@powerhousedao/connect 1.0.0-dev.134 → 1.0.0-dev.135
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.
- package/dist/assets/{browser-BEEirMuO.js → browser-Bl9M96KQ.js} +4 -4
- package/dist/assets/{content-BA89BGTU.js.map → browser-Bl9M96KQ.js.map} +1 -1
- package/dist/assets/{ccip-6rlDGLkL-DLquEPm3-DsHnVs3R.js → ccip-6rlDGLkL-DLquEPm3-BAx7HjfJ.js} +2 -2
- package/dist/assets/ccip-6rlDGLkL-DLquEPm3-BAx7HjfJ.js.map +1 -0
- package/dist/assets/{ccip-D7jGecEM-BZhoTqQe.js → ccip-D7jGecEM-DVDlOqoI.js} +2 -2
- package/dist/assets/ccip-D7jGecEM-DVDlOqoI.js.map +1 -0
- package/dist/assets/{ccip-C90evIJH.js → ccip-bk1IJr0a.js} +2 -2
- package/dist/assets/ccip-bk1IJr0a.js.map +1 -0
- package/dist/assets/{content-BA89BGTU.js → content-TdogUNEo.js} +3 -3
- package/dist/assets/{browser-BEEirMuO.js.map → content-TdogUNEo.js.map} +1 -1
- package/dist/assets/{cssMode-DVq3LtHT-T-7Kj20A.js → cssMode-DVq3LtHT-CoUgr_4L.js} +2 -2
- package/dist/assets/cssMode-DVq3LtHT-CoUgr_4L.js.map +1 -0
- package/dist/assets/{editor-B8aF84QX.js → editor-Bat08LEU.js} +2 -2
- package/dist/assets/editor-Bat08LEU.js.map +1 -0
- package/dist/assets/{editor-D1liwP8t.js → editor-CIbZp8-c.js} +4 -4
- package/dist/assets/{editor-D1liwP8t.js.map → editor-CIbZp8-c.js.map} +1 -1
- package/dist/assets/{editor-C6Um7TKF.js → editor-Cxi1Bi4m.js} +2 -2
- package/dist/assets/editor-Cxi1Bi4m.js.map +1 -0
- package/dist/assets/{editor-ZZR7pxvt.js → editor-NPbexOjM.js} +2 -2
- package/dist/assets/editor-NPbexOjM.js.map +1 -0
- package/dist/assets/{editors-BvDPqtae.js → editors-DVrDEp-F.js} +7 -7
- package/dist/assets/{editors-BvDPqtae.js.map → editors-DVrDEp-F.js.map} +1 -1
- package/dist/assets/{freemarker2-B12auKfc-CV2bI2LT.js → freemarker2-B12auKfc-CY1f5BH_.js} +2 -2
- package/dist/assets/freemarker2-B12auKfc-CY1f5BH_.js.map +1 -0
- package/dist/assets/{handlebars-fup3rJ3C-CxSp7nNU.js → handlebars-fup3rJ3C-DIrFum2b.js} +2 -2
- package/dist/assets/handlebars-fup3rJ3C-DIrFum2b.js.map +1 -0
- package/dist/assets/{html-Bd7p9h1P-VHQCRfyo.js → html-Bd7p9h1P-DH0yLc_S.js} +2 -2
- package/dist/assets/html-Bd7p9h1P-DH0yLc_S.js.map +1 -0
- package/dist/assets/{htmlMode-D_EcT_ua-DeobOP5l.js → htmlMode-D_EcT_ua-BUl6Pr_e.js} +2 -2
- package/dist/assets/htmlMode-D_EcT_ua-BUl6Pr_e.js.map +1 -0
- package/dist/assets/{index-8PbnK2go-D-EdohcU.js → index-8PbnK2go-BoR1WEku.js} +2 -2
- package/dist/assets/index-8PbnK2go-BoR1WEku.js.map +1 -0
- package/dist/assets/{index-Dsh5c9Wv.js → index-CMnBdWsa.js} +2 -2
- package/dist/assets/{index-Dsh5c9Wv.js.map → index-CMnBdWsa.js.map} +1 -1
- package/dist/assets/{index-CnxM4IIa-CvFEW5IC.js → index-CnxM4IIa-CoekJPsT.js} +18 -18
- package/dist/assets/index-CnxM4IIa-CoekJPsT.js.map +1 -0
- package/dist/assets/{index-Dc3srWFp-Dj58lFaD.js → index-Dc3srWFp-DVPU56zP.js} +2 -2
- package/dist/assets/index-Dc3srWFp-DVPU56zP.js.map +1 -0
- package/dist/assets/{index-T6Et30Eh-Bk15VVSB.js → index-T6Et30Eh-B1ytNt1O.js} +2 -2
- package/dist/assets/index-T6Et30Eh-B1ytNt1O.js.map +1 -0
- package/dist/assets/{javascript-egJvx3xR-D5qg5jV7.js → javascript-egJvx3xR-CXu0MlTd.js} +2 -2
- package/dist/assets/javascript-egJvx3xR-CXu0MlTd.js.map +1 -0
- package/dist/assets/{jsonMode-CmFhZ-nO-Ct78-OTz.js → jsonMode-CmFhZ-nO-BJHj7Aq3.js} +2 -2
- package/dist/assets/jsonMode-CmFhZ-nO-BJHj7Aq3.js.map +1 -0
- package/dist/assets/{liquid-Bn94NRXM-D3xTeo2T.js → liquid-Bn94NRXM-DXR9Xdil.js} +2 -2
- package/dist/assets/liquid-Bn94NRXM-DXR9Xdil.js.map +1 -0
- package/dist/assets/{main.DHxrtmJK.js → main.9ezbfd1a.js} +5 -5
- package/dist/assets/{main.DHxrtmJK.js.map → main.9ezbfd1a.js.map} +1 -1
- package/dist/assets/{mdx-CUs5ly0Y-DxijAFif.js → mdx-CUs5ly0Y-PFSuKGqp.js} +2 -2
- package/dist/assets/mdx-CUs5ly0Y-PFSuKGqp.js.map +1 -0
- package/dist/assets/{python-CvQNUgbY-DBYmw6_9.js → python-CvQNUgbY-DKU7Nn90.js} +2 -2
- package/dist/assets/python-CvQNUgbY-DKU7Nn90.js.map +1 -0
- package/dist/assets/{razor-COKLAES4-BPYm69MZ.js → razor-COKLAES4-DVH5NG6J.js} +2 -2
- package/dist/assets/razor-COKLAES4-DVH5NG6J.js.map +1 -0
- package/dist/assets/{root-0NIp6wBQ.js → root-D5vIE4mi.js} +2 -2
- package/dist/assets/root-D5vIE4mi.js.map +1 -0
- package/dist/assets/{router-j5rEsdZ1.js → router-BLZPRKeS.js} +4 -4
- package/dist/assets/{router-j5rEsdZ1.js.map → router-BLZPRKeS.js.map} +1 -1
- package/dist/assets/{tsMode-Dj44YKby-CWl_rxwS.js → tsMode-Dj44YKby-BecbNaDB.js} +2 -2
- package/dist/assets/tsMode-Dj44YKby-BecbNaDB.js.map +1 -0
- package/dist/assets/{typescript-BGB8OuQj-CojMjzn1.js → typescript-BGB8OuQj-q21L76s7.js} +2 -2
- package/dist/assets/typescript-BGB8OuQj-q21L76s7.js.map +1 -0
- package/dist/assets/{typescript-e2Impz-Y-ZFE3ath_.js → typescript-e2Impz-Y-eyfqYqVi.js} +2 -2
- package/dist/assets/{typescript-e2Impz-Y-ZFE3ath_.js.map → typescript-e2Impz-Y-eyfqYqVi.js.map} +1 -1
- package/dist/assets/{useUiNodes-CFkBr3IB.js → useUiNodes-BpMMwQ0y.js} +2 -2
- package/dist/assets/{useUiNodes-CFkBr3IB.js.map → useUiNodes-BpMMwQ0y.js.map} +1 -1
- package/dist/assets/{visitor-jgO2GXVr-CpK_hqN0.js → visitor-jgO2GXVr-DtE61rfq.js} +2 -2
- package/dist/assets/visitor-jgO2GXVr-DtE61rfq.js.map +1 -0
- package/dist/assets/{xml-C95L75A3-DKw4cO1a.js → xml-C95L75A3-CktYugFs.js} +2 -2
- package/dist/assets/xml-C95L75A3-CktYugFs.js.map +1 -0
- package/dist/assets/{yaml-CBgf5N3D-Chtc7gtl.js → yaml-CBgf5N3D-DNYfpm9a.js} +2 -2
- package/dist/assets/yaml-CBgf5N3D-DNYfpm9a.js.map +1 -0
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/dist/swEnv.js +2 -2
- package/dist/vite-envs.sh +5 -5
- package/package/index.js +46 -8
- package/package.json +1 -1
- package/dist/assets/ccip-6rlDGLkL-DLquEPm3-DsHnVs3R.js.map +0 -1
- package/dist/assets/ccip-C90evIJH.js.map +0 -1
- package/dist/assets/ccip-D7jGecEM-BZhoTqQe.js.map +0 -1
- package/dist/assets/cssMode-DVq3LtHT-T-7Kj20A.js.map +0 -1
- package/dist/assets/editor-B8aF84QX.js.map +0 -1
- package/dist/assets/editor-C6Um7TKF.js.map +0 -1
- package/dist/assets/editor-ZZR7pxvt.js.map +0 -1
- package/dist/assets/freemarker2-B12auKfc-CV2bI2LT.js.map +0 -1
- package/dist/assets/handlebars-fup3rJ3C-CxSp7nNU.js.map +0 -1
- package/dist/assets/html-Bd7p9h1P-VHQCRfyo.js.map +0 -1
- package/dist/assets/htmlMode-D_EcT_ua-DeobOP5l.js.map +0 -1
- package/dist/assets/index-8PbnK2go-D-EdohcU.js.map +0 -1
- package/dist/assets/index-CnxM4IIa-CvFEW5IC.js.map +0 -1
- package/dist/assets/index-Dc3srWFp-Dj58lFaD.js.map +0 -1
- package/dist/assets/index-T6Et30Eh-Bk15VVSB.js.map +0 -1
- package/dist/assets/javascript-egJvx3xR-D5qg5jV7.js.map +0 -1
- package/dist/assets/jsonMode-CmFhZ-nO-Ct78-OTz.js.map +0 -1
- package/dist/assets/liquid-Bn94NRXM-D3xTeo2T.js.map +0 -1
- package/dist/assets/mdx-CUs5ly0Y-DxijAFif.js.map +0 -1
- package/dist/assets/python-CvQNUgbY-DBYmw6_9.js.map +0 -1
- package/dist/assets/razor-COKLAES4-BPYm69MZ.js.map +0 -1
- package/dist/assets/root-0NIp6wBQ.js.map +0 -1
- package/dist/assets/tsMode-Dj44YKby-CWl_rxwS.js.map +0 -1
- package/dist/assets/typescript-BGB8OuQj-CojMjzn1.js.map +0 -1
- package/dist/assets/visitor-jgO2GXVr-CpK_hqN0.js.map +0 -1
- package/dist/assets/xml-C95L75A3-DKw4cO1a.js.map +0 -1
- package/dist/assets/yaml-CBgf5N3D-Chtc7gtl.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-B12auKfc-
|
|
2
|
-
import{r as Eo,_ as Ce,d as HK}from"./main.DHxrtmJK.js";import{K as eo,G as zK,d as m7,p as wT,e as UK,f as KK,v as f7,g as jK,h as Ap,i as ad,j as Vx,S as Hx,k as zx,l as _7,m as xf,n as $K,o as qK,q as GK,r as ZK,s as YK,t as Yn,u as QK,w as XK,x as v7,y as hC,z as b7,N as JK,A as oO,B as ej,C as tj,F as ij,H as nj}from"./editors-BvDPqtae.js";import oj from"./index-T6Et30Eh-Bk15VVSB.js";var sO={},sj=Object.defineProperty,rj=(i,e,t)=>e in i?sj(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Si=(i,e,t)=>rj(i,typeof e!="symbol"?e+"":e,t),aj=function(i,e,t,n){function o(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(h){try{d(n.next(h))}catch(c){r(c)}}function l(h){try{d(n.throw(h))}catch(c){r(c)}}function d(h){h.done?s(h.value):o(h.value).then(a,l)}d((n=n.apply(i,[])).next())})};const lj=i=>aj(void 0,void 0,void 0,function*(){var e;const{requestOpts:t,uri:n,introspectionOptions:o}=i;if(!n)return null;const s=yield(yield fetch(n,Object.assign({method:(e=t==null?void 0:t.method)!==null&&e!==void 0?e:"post",body:JSON.stringify({query:jK(o),operationName:"IntrospectionQuery"}),credentials:"omit",headers:(t==null?void 0:t.headers)||{"Content-Type":"application/json"}},t))).json();return s==null?void 0:s.data});function dj(i,e){if(!i)throw Error("Empty schema response");return"__schema"in i?UK(i,e):KK(i,e)}function hj(i){let e;return C7(i,t=>{switch(t.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":e=t;break}}),e}function rO(i,e,t){return t===Hx.name&&i.getQueryType()===e?Hx:t===zx.name&&i.getQueryType()===e?zx:t===Vx.name&&ad(e)?Vx:"getFields"in e?e.getFields()[t]:null}function C7(i,e){const t=[];let n=i;for(;n&&n.kind;)t.push(n),n=n.prevState;for(let o=t.length-1;o>=0;o--)e(t[o])}function Tu(i){const e=Object.keys(i),t=e.length,n=new Array(t);for(let o=0;o<t;++o)n[o]=i[e[o]];return n}function _r(i,e){return cj(e,w7(i.string))}function cj(i,e){if(!e)return Rk(i,n=>!n.isDeprecated);const t=i.map(n=>({proximity:uj(w7(n.label),e),entry:n}));return Rk(Rk(t,n=>n.proximity<=2),n=>!n.entry.isDeprecated).sort((n,o)=>(n.entry.isDeprecated?1:0)-(o.entry.isDeprecated?1:0)||n.proximity-o.proximity||n.entry.label.length-o.entry.label.length).map(n=>n.entry)}function Rk(i,e){const t=i.filter(e);return t.length===0?i:t}function w7(i){return i.toLowerCase().replace(/\W/g,"")}function uj(i,e){let t=gj(e,i);return i.length>e.length&&(t-=i.length-e.length-1,t+=i.indexOf(e)===0?0:.5),t}function gj(i,e){let t,n;const o=[],s=i.length,r=e.length;for(t=0;t<=s;t++)o[t]=[t];for(n=1;n<=r;n++)o[0][n]=n;for(t=1;t<=s;t++)for(n=1;n<=r;n++){const a=i[t-1]===e[n-1]?0:1;o[t][n]=Math.min(o[t-1][n]+1,o[t][n-1]+1,o[t-1][n-1]+a),t>1&&n>1&&i[t-1]===e[n-2]&&i[t-2]===e[n-1]&&(o[t][n]=Math.min(o[t][n],o[t-2][n-2]+a))}return o[s][r]}var aO;(function(i){function e(t){return typeof t=="string"}i.is=e})(aO||(aO={}));var Ux;(function(i){function e(t){return typeof t=="string"}i.is=e})(Ux||(Ux={}));var lO;(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(lO||(lO={}));var QC;(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(QC||(QC={}));var Xr;(function(i){function e(n,o){return n===Number.MAX_VALUE&&(n=QC.MAX_VALUE),o===Number.MAX_VALUE&&(o=QC.MAX_VALUE),{line:n,character:o}}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&X.uinteger(o.line)&&X.uinteger(o.character)}i.is=t})(Xr||(Xr={}));var Sn;(function(i){function e(n,o,s,r){if(X.uinteger(n)&&X.uinteger(o)&&X.uinteger(s)&&X.uinteger(r))return{start:Xr.create(n,o),end:Xr.create(s,r)};if(Xr.is(n)&&Xr.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${s}, ${r}]`)}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&Xr.is(o.start)&&Xr.is(o.end)}i.is=t})(Sn||(Sn={}));var XC;(function(i){function e(n,o){return{uri:n,range:o}}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&Sn.is(o.range)&&(X.string(o.uri)||X.undefined(o.uri))}i.is=t})(XC||(XC={}));var dO;(function(i){function e(n,o,s,r){return{targetUri:n,targetRange:o,targetSelectionRange:s,originSelectionRange:r}}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&Sn.is(o.targetRange)&&X.string(o.targetUri)&&Sn.is(o.targetSelectionRange)&&(Sn.is(o.originSelectionRange)||X.undefined(o.originSelectionRange))}i.is=t})(dO||(dO={}));var Kx;(function(i){function e(n,o,s,r){return{red:n,green:o,blue:s,alpha:r}}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&X.numberRange(o.red,0,1)&&X.numberRange(o.green,0,1)&&X.numberRange(o.blue,0,1)&&X.numberRange(o.alpha,0,1)}i.is=t})(Kx||(Kx={}));var hO;(function(i){function e(n,o){return{range:n,color:o}}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&Sn.is(o.range)&&Kx.is(o.color)}i.is=t})(hO||(hO={}));var cO;(function(i){function e(n,o,s){return{label:n,textEdit:o,additionalTextEdits:s}}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&X.string(o.label)&&(X.undefined(o.textEdit)||lm.is(o))&&(X.undefined(o.additionalTextEdits)||X.typedArray(o.additionalTextEdits,lm.is))}i.is=t})(cO||(cO={}));var uO;(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(uO||(uO={}));var gO;(function(i){function e(n,o,s,r,a,l){const d={startLine:n,endLine:o};return X.defined(s)&&(d.startCharacter=s),X.defined(r)&&(d.endCharacter=r),X.defined(a)&&(d.kind=a),X.defined(l)&&(d.collapsedText=l),d}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&X.uinteger(o.startLine)&&X.uinteger(o.startLine)&&(X.undefined(o.startCharacter)||X.uinteger(o.startCharacter))&&(X.undefined(o.endCharacter)||X.uinteger(o.endCharacter))&&(X.undefined(o.kind)||X.string(o.kind))}i.is=t})(gO||(gO={}));var jx;(function(i){function e(n,o){return{location:n,message:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&XC.is(o.location)&&X.string(o.message)}i.is=t})(jx||(jx={}));var pO;(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(pO||(pO={}));var mO;(function(i){i.Unnecessary=1,i.Deprecated=2})(mO||(mO={}));var fO;(function(i){function e(t){const n=t;return X.objectLiteral(n)&&X.string(n.href)}i.is=e})(fO||(fO={}));var JC;(function(i){function e(n,o,s,r,a,l){let d={range:n,message:o};return X.defined(s)&&(d.severity=s),X.defined(r)&&(d.code=r),X.defined(a)&&(d.source=a),X.defined(l)&&(d.relatedInformation=l),d}i.create=e;function t(n){var o;let s=n;return X.defined(s)&&Sn.is(s.range)&&X.string(s.message)&&(X.number(s.severity)||X.undefined(s.severity))&&(X.integer(s.code)||X.string(s.code)||X.undefined(s.code))&&(X.undefined(s.codeDescription)||X.string((o=s.codeDescription)===null||o===void 0?void 0:o.href))&&(X.string(s.source)||X.undefined(s.source))&&(X.undefined(s.relatedInformation)||X.typedArray(s.relatedInformation,jx.is))}i.is=t})(JC||(JC={}));var am;(function(i){function e(n,o,...s){let r={title:n,command:o};return X.defined(s)&&s.length>0&&(r.arguments=s),r}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.title)&&X.string(o.command)}i.is=t})(am||(am={}));var lm;(function(i){function e(s,r){return{range:s,newText:r}}i.replace=e;function t(s,r){return{range:{start:s,end:s},newText:r}}i.insert=t;function n(s){return{range:s,newText:""}}i.del=n;function o(s){const r=s;return X.objectLiteral(r)&&X.string(r.newText)&&Sn.is(r.range)}i.is=o})(lm||(lm={}));var $x;(function(i){function e(n,o,s){const r={label:n};return o!==void 0&&(r.needsConfirmation=o),s!==void 0&&(r.description=s),r}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&X.string(o.label)&&(X.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(X.string(o.description)||o.description===void 0)}i.is=t})($x||($x={}));var dm;(function(i){function e(t){const n=t;return X.string(n)}i.is=e})(dm||(dm={}));var _O;(function(i){function e(s,r,a){return{range:s,newText:r,annotationId:a}}i.replace=e;function t(s,r,a){return{range:{start:s,end:s},newText:r,annotationId:a}}i.insert=t;function n(s,r){return{range:s,newText:"",annotationId:r}}i.del=n;function o(s){const r=s;return lm.is(r)&&($x.is(r.annotationId)||dm.is(r.annotationId))}i.is=o})(_O||(_O={}));var qx;(function(i){function e(n,o){return{textDocument:n,edits:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&Xx.is(o.textDocument)&&Array.isArray(o.edits)}i.is=t})(qx||(qx={}));var Gx;(function(i){function e(n,o,s){let r={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(r.options=o),s!==void 0&&(r.annotationId=s),r}i.create=e;function t(n){let o=n;return o&&o.kind==="create"&&X.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||X.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||X.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||dm.is(o.annotationId))}i.is=t})(Gx||(Gx={}));var Zx;(function(i){function e(n,o,s,r){let a={kind:"rename",oldUri:n,newUri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),r!==void 0&&(a.annotationId=r),a}i.create=e;function t(n){let o=n;return o&&o.kind==="rename"&&X.string(o.oldUri)&&X.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||X.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||X.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||dm.is(o.annotationId))}i.is=t})(Zx||(Zx={}));var Yx;(function(i){function e(n,o,s){let r={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(r.options=o),s!==void 0&&(r.annotationId=s),r}i.create=e;function t(n){let o=n;return o&&o.kind==="delete"&&X.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||X.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||X.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||dm.is(o.annotationId))}i.is=t})(Yx||(Yx={}));var Qx;(function(i){function e(t){let n=t;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>X.string(o.kind)?Gx.is(o)||Zx.is(o)||Yx.is(o):qx.is(o)))}i.is=e})(Qx||(Qx={}));var vO;(function(i){function e(n){return{uri:n}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.uri)}i.is=t})(vO||(vO={}));var bO;(function(i){function e(n,o){return{uri:n,version:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.uri)&&X.integer(o.version)}i.is=t})(bO||(bO={}));var Xx;(function(i){function e(n,o){return{uri:n,version:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.uri)&&(o.version===null||X.integer(o.version))}i.is=t})(Xx||(Xx={}));var CO;(function(i){function e(n,o,s,r){return{uri:n,languageId:o,version:s,text:r}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.uri)&&X.string(o.languageId)&&X.integer(o.version)&&X.string(o.text)}i.is=t})(CO||(CO={}));var Jx;(function(i){i.PlainText="plaintext",i.Markdown="markdown";function e(t){const n=t;return n===i.PlainText||n===i.Markdown}i.is=e})(Jx||(Jx={}));var hv;(function(i){function e(t){const n=t;return X.objectLiteral(t)&&Jx.is(n.kind)&&X.string(n.value)}i.is=e})(hv||(hv={}));var In;(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(In||(In={}));var eE;(function(i){i.PlainText=1,i.Snippet=2})(eE||(eE={}));var wO;(function(i){i.Deprecated=1})(wO||(wO={}));var yO;(function(i){function e(n,o,s){return{newText:n,insert:o,replace:s}}i.create=e;function t(n){const o=n;return o&&X.string(o.newText)&&Sn.is(o.insert)&&Sn.is(o.replace)}i.is=t})(yO||(yO={}));var SO;(function(i){i.asIs=1,i.adjustIndentation=2})(SO||(SO={}));var LO;(function(i){function e(t){const n=t;return n&&(X.string(n.detail)||n.detail===void 0)&&(X.string(n.description)||n.description===void 0)}i.is=e})(LO||(LO={}));var kO;(function(i){function e(t){return{label:t}}i.create=e})(kO||(kO={}));var DO;(function(i){function e(t,n){return{items:t||[],isIncomplete:!!n}}i.create=e})(DO||(DO={}));var ew;(function(i){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i.fromPlainText=e;function t(n){const o=n;return X.string(o)||X.objectLiteral(o)&&X.string(o.language)&&X.string(o.value)}i.is=t})(ew||(ew={}));var xO;(function(i){function e(t){let n=t;return!!n&&X.objectLiteral(n)&&(hv.is(n.contents)||ew.is(n.contents)||X.typedArray(n.contents,ew.is))&&(t.range===void 0||Sn.is(t.range))}i.is=e})(xO||(xO={}));var EO;(function(i){function e(t,n){return n?{label:t,documentation:n}:{label:t}}i.create=e})(EO||(EO={}));var NO;(function(i){function e(t,n,...o){let s={label:t};return X.defined(n)&&(s.documentation=n),X.defined(o)?s.parameters=o:s.parameters=[],s}i.create=e})(NO||(NO={}));var IO;(function(i){i.Text=1,i.Read=2,i.Write=3})(IO||(IO={}));var MO;(function(i){function e(t,n){let o={range:t};return X.number(n)&&(o.kind=n),o}i.create=e})(MO||(MO={}));var Vo;(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(Vo||(Vo={}));var TO;(function(i){i.Deprecated=1})(TO||(TO={}));var RO;(function(i){function e(t,n,o,s,r){let a={name:t,kind:n,location:{uri:s,range:o}};return r&&(a.containerName=r),a}i.create=e})(RO||(RO={}));var AO;(function(i){function e(t,n,o,s){return s!==void 0?{name:t,kind:n,location:{uri:o,range:s}}:{name:t,kind:n,location:{uri:o}}}i.create=e})(AO||(AO={}));var PO;(function(i){function e(n,o,s,r,a,l){let d={name:n,detail:o,kind:s,range:r,selectionRange:a};return l!==void 0&&(d.children=l),d}i.create=e;function t(n){let o=n;return o&&X.string(o.name)&&X.number(o.kind)&&Sn.is(o.range)&&Sn.is(o.selectionRange)&&(o.detail===void 0||X.string(o.detail))&&(o.deprecated===void 0||X.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}i.is=t})(PO||(PO={}));var OO;(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(OO||(OO={}));var tw;(function(i){i.Invoked=1,i.Automatic=2})(tw||(tw={}));var FO;(function(i){function e(n,o,s){let r={diagnostics:n};return o!=null&&(r.only=o),s!=null&&(r.triggerKind=s),r}i.create=e;function t(n){let o=n;return X.defined(o)&&X.typedArray(o.diagnostics,JC.is)&&(o.only===void 0||X.typedArray(o.only,X.string))&&(o.triggerKind===void 0||o.triggerKind===tw.Invoked||o.triggerKind===tw.Automatic)}i.is=t})(FO||(FO={}));var BO;(function(i){function e(n,o,s){let r={title:n},a=!0;return typeof o=="string"?(a=!1,r.kind=o):am.is(o)?r.command=o:r.edit=o,a&&s!==void 0&&(r.kind=s),r}i.create=e;function t(n){let o=n;return o&&X.string(o.title)&&(o.diagnostics===void 0||X.typedArray(o.diagnostics,JC.is))&&(o.kind===void 0||X.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||am.is(o.command))&&(o.isPreferred===void 0||X.boolean(o.isPreferred))&&(o.edit===void 0||Qx.is(o.edit))}i.is=t})(BO||(BO={}));var WO;(function(i){function e(n,o){let s={range:n};return X.defined(o)&&(s.data=o),s}i.create=e;function t(n){let o=n;return X.defined(o)&&Sn.is(o.range)&&(X.undefined(o.command)||am.is(o.command))}i.is=t})(WO||(WO={}));var VO;(function(i){function e(n,o){return{tabSize:n,insertSpaces:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.uinteger(o.tabSize)&&X.boolean(o.insertSpaces)}i.is=t})(VO||(VO={}));var HO;(function(i){function e(n,o,s){return{range:n,target:o,data:s}}i.create=e;function t(n){let o=n;return X.defined(o)&&Sn.is(o.range)&&(X.undefined(o.target)||X.string(o.target))}i.is=t})(HO||(HO={}));var zO;(function(i){function e(n,o){return{range:n,parent:o}}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&Sn.is(o.range)&&(o.parent===void 0||i.is(o.parent))}i.is=t})(zO||(zO={}));var UO;(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(UO||(UO={}));var KO;(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(KO||(KO={}));var jO;(function(i){function e(t){const n=t;return X.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i.is=e})(jO||(jO={}));var $O;(function(i){function e(n,o){return{range:n,text:o}}i.create=e;function t(n){const o=n;return o!=null&&Sn.is(o.range)&&X.string(o.text)}i.is=t})($O||($O={}));var qO;(function(i){function e(n,o,s){return{range:n,variableName:o,caseSensitiveLookup:s}}i.create=e;function t(n){const o=n;return o!=null&&Sn.is(o.range)&&X.boolean(o.caseSensitiveLookup)&&(X.string(o.variableName)||o.variableName===void 0)}i.is=t})(qO||(qO={}));var GO;(function(i){function e(n,o){return{range:n,expression:o}}i.create=e;function t(n){const o=n;return o!=null&&Sn.is(o.range)&&(X.string(o.expression)||o.expression===void 0)}i.is=t})(GO||(GO={}));var ZO;(function(i){function e(n,o){return{frameId:n,stoppedLocation:o}}i.create=e;function t(n){const o=n;return X.defined(o)&&Sn.is(n.stoppedLocation)}i.is=t})(ZO||(ZO={}));var tE;(function(i){i.Type=1,i.Parameter=2;function e(t){return t===1||t===2}i.is=e})(tE||(tE={}));var iE;(function(i){function e(n){return{value:n}}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&(o.tooltip===void 0||X.string(o.tooltip)||hv.is(o.tooltip))&&(o.location===void 0||XC.is(o.location))&&(o.command===void 0||am.is(o.command))}i.is=t})(iE||(iE={}));var YO;(function(i){function e(n,o,s){const r={position:n,label:o};return s!==void 0&&(r.kind=s),r}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&Xr.is(o.position)&&(X.string(o.label)||X.typedArray(o.label,iE.is))&&(o.kind===void 0||tE.is(o.kind))&&o.textEdits===void 0||X.typedArray(o.textEdits,lm.is)&&(o.tooltip===void 0||X.string(o.tooltip)||hv.is(o.tooltip))&&(o.paddingLeft===void 0||X.boolean(o.paddingLeft))&&(o.paddingRight===void 0||X.boolean(o.paddingRight))}i.is=t})(YO||(YO={}));var QO;(function(i){function e(t){return{kind:"snippet",value:t}}i.createSnippet=e})(QO||(QO={}));var XO;(function(i){function e(t,n,o,s){return{insertText:t,filterText:n,range:o,command:s}}i.create=e})(XO||(XO={}));var JO;(function(i){function e(t){return{items:t}}i.create=e})(JO||(JO={}));var e4;(function(i){i.Invoked=0,i.Automatic=1})(e4||(e4={}));var t4;(function(i){function e(t,n){return{range:t,text:n}}i.create=e})(t4||(t4={}));var i4;(function(i){function e(t,n){return{triggerKind:t,selectedCompletionInfo:n}}i.create=e})(i4||(i4={}));var n4;(function(i){function e(t){const n=t;return X.objectLiteral(n)&&Ux.is(n.uri)&&X.string(n.name)}i.is=e})(n4||(n4={}));var o4;(function(i){function e(s,r,a,l){return new pj(s,r,a,l)}i.create=e;function t(s){let r=s;return!!(X.defined(r)&&X.string(r.uri)&&(X.undefined(r.languageId)||X.string(r.languageId))&&X.uinteger(r.lineCount)&&X.func(r.getText)&&X.func(r.positionAt)&&X.func(r.offsetAt))}i.is=t;function n(s,r){let a=s.getText(),l=o(r,(h,c)=>{let u=h.range.start.line-c.range.start.line;return u===0?h.range.start.character-c.range.start.character:u}),d=a.length;for(let h=l.length-1;h>=0;h--){let c=l[h],u=s.offsetAt(c.range.start),g=s.offsetAt(c.range.end);if(g<=d)a=a.substring(0,u)+c.newText+a.substring(g,a.length);else throw new Error("Overlapping edit");d=u}return a}i.applyEdits=n;function o(s,r){if(s.length<=1)return s;const a=s.length/2|0,l=s.slice(0,a),d=s.slice(a);o(l,r),o(d,r);let h=0,c=0,u=0;for(;h<l.length&&c<d.length;)r(l[h],d[c])<=0?s[u++]=l[h++]:s[u++]=d[c++];for(;h<l.length;)s[u++]=l[h++];for(;c<d.length;)s[u++]=d[c++];return s}})(o4||(o4={}));class pj{constructor(e,t,n,o){this._uri=e,this._languageId=t,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let o=0;o<t.length;o++){n&&(e.push(o),n=!1);let s=t.charAt(o);n=s==="\r"||s===`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-B12auKfc-CY1f5BH_.js","assets/main.9ezbfd1a.js","assets/main-Bfrdc6YH.css","assets/editors-DVrDEp-F.js","assets/index-T6Et30Eh-B1ytNt1O.js","assets/handlebars-fup3rJ3C-DIrFum2b.js","assets/html-Bd7p9h1P-DH0yLc_S.js","assets/javascript-egJvx3xR-CXu0MlTd.js","assets/typescript-BGB8OuQj-q21L76s7.js","assets/liquid-Bn94NRXM-DXR9Xdil.js","assets/mdx-CUs5ly0Y-PFSuKGqp.js","assets/python-CvQNUgbY-DKU7Nn90.js","assets/razor-COKLAES4-DVH5NG6J.js","assets/xml-C95L75A3-CktYugFs.js","assets/yaml-CBgf5N3D-DNYfpm9a.js","assets/cssMode-DVq3LtHT-CoUgr_4L.js","assets/htmlMode-D_EcT_ua-BUl6Pr_e.js","assets/jsonMode-CmFhZ-nO-BJHj7Aq3.js","assets/tsMode-Dj44YKby-BecbNaDB.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as Eo,_ as Ce,d as HK}from"./main.9ezbfd1a.js";import{K as eo,G as zK,d as m7,p as wT,e as UK,f as KK,v as f7,g as jK,h as Ap,i as ad,j as Vx,S as Hx,k as zx,l as _7,m as xf,n as $K,o as qK,q as GK,r as ZK,s as YK,t as Yn,u as QK,w as XK,x as v7,y as hC,z as b7,N as JK,A as oO,B as ej,C as tj,F as ij,H as nj}from"./editors-DVrDEp-F.js";import oj from"./index-T6Et30Eh-B1ytNt1O.js";var sO={},sj=Object.defineProperty,rj=(i,e,t)=>e in i?sj(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Si=(i,e,t)=>rj(i,typeof e!="symbol"?e+"":e,t),aj=function(i,e,t,n){function o(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(h){try{d(n.next(h))}catch(c){r(c)}}function l(h){try{d(n.throw(h))}catch(c){r(c)}}function d(h){h.done?s(h.value):o(h.value).then(a,l)}d((n=n.apply(i,[])).next())})};const lj=i=>aj(void 0,void 0,void 0,function*(){var e;const{requestOpts:t,uri:n,introspectionOptions:o}=i;if(!n)return null;const s=yield(yield fetch(n,Object.assign({method:(e=t==null?void 0:t.method)!==null&&e!==void 0?e:"post",body:JSON.stringify({query:jK(o),operationName:"IntrospectionQuery"}),credentials:"omit",headers:(t==null?void 0:t.headers)||{"Content-Type":"application/json"}},t))).json();return s==null?void 0:s.data});function dj(i,e){if(!i)throw Error("Empty schema response");return"__schema"in i?UK(i,e):KK(i,e)}function hj(i){let e;return C7(i,t=>{switch(t.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":e=t;break}}),e}function rO(i,e,t){return t===Hx.name&&i.getQueryType()===e?Hx:t===zx.name&&i.getQueryType()===e?zx:t===Vx.name&&ad(e)?Vx:"getFields"in e?e.getFields()[t]:null}function C7(i,e){const t=[];let n=i;for(;n&&n.kind;)t.push(n),n=n.prevState;for(let o=t.length-1;o>=0;o--)e(t[o])}function Tu(i){const e=Object.keys(i),t=e.length,n=new Array(t);for(let o=0;o<t;++o)n[o]=i[e[o]];return n}function _r(i,e){return cj(e,w7(i.string))}function cj(i,e){if(!e)return Rk(i,n=>!n.isDeprecated);const t=i.map(n=>({proximity:uj(w7(n.label),e),entry:n}));return Rk(Rk(t,n=>n.proximity<=2),n=>!n.entry.isDeprecated).sort((n,o)=>(n.entry.isDeprecated?1:0)-(o.entry.isDeprecated?1:0)||n.proximity-o.proximity||n.entry.label.length-o.entry.label.length).map(n=>n.entry)}function Rk(i,e){const t=i.filter(e);return t.length===0?i:t}function w7(i){return i.toLowerCase().replace(/\W/g,"")}function uj(i,e){let t=gj(e,i);return i.length>e.length&&(t-=i.length-e.length-1,t+=i.indexOf(e)===0?0:.5),t}function gj(i,e){let t,n;const o=[],s=i.length,r=e.length;for(t=0;t<=s;t++)o[t]=[t];for(n=1;n<=r;n++)o[0][n]=n;for(t=1;t<=s;t++)for(n=1;n<=r;n++){const a=i[t-1]===e[n-1]?0:1;o[t][n]=Math.min(o[t-1][n]+1,o[t][n-1]+1,o[t-1][n-1]+a),t>1&&n>1&&i[t-1]===e[n-2]&&i[t-2]===e[n-1]&&(o[t][n]=Math.min(o[t][n],o[t-2][n-2]+a))}return o[s][r]}var aO;(function(i){function e(t){return typeof t=="string"}i.is=e})(aO||(aO={}));var Ux;(function(i){function e(t){return typeof t=="string"}i.is=e})(Ux||(Ux={}));var lO;(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(lO||(lO={}));var QC;(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(QC||(QC={}));var Xr;(function(i){function e(n,o){return n===Number.MAX_VALUE&&(n=QC.MAX_VALUE),o===Number.MAX_VALUE&&(o=QC.MAX_VALUE),{line:n,character:o}}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&X.uinteger(o.line)&&X.uinteger(o.character)}i.is=t})(Xr||(Xr={}));var Sn;(function(i){function e(n,o,s,r){if(X.uinteger(n)&&X.uinteger(o)&&X.uinteger(s)&&X.uinteger(r))return{start:Xr.create(n,o),end:Xr.create(s,r)};if(Xr.is(n)&&Xr.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${s}, ${r}]`)}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&Xr.is(o.start)&&Xr.is(o.end)}i.is=t})(Sn||(Sn={}));var XC;(function(i){function e(n,o){return{uri:n,range:o}}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&Sn.is(o.range)&&(X.string(o.uri)||X.undefined(o.uri))}i.is=t})(XC||(XC={}));var dO;(function(i){function e(n,o,s,r){return{targetUri:n,targetRange:o,targetSelectionRange:s,originSelectionRange:r}}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&Sn.is(o.targetRange)&&X.string(o.targetUri)&&Sn.is(o.targetSelectionRange)&&(Sn.is(o.originSelectionRange)||X.undefined(o.originSelectionRange))}i.is=t})(dO||(dO={}));var Kx;(function(i){function e(n,o,s,r){return{red:n,green:o,blue:s,alpha:r}}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&X.numberRange(o.red,0,1)&&X.numberRange(o.green,0,1)&&X.numberRange(o.blue,0,1)&&X.numberRange(o.alpha,0,1)}i.is=t})(Kx||(Kx={}));var hO;(function(i){function e(n,o){return{range:n,color:o}}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&Sn.is(o.range)&&Kx.is(o.color)}i.is=t})(hO||(hO={}));var cO;(function(i){function e(n,o,s){return{label:n,textEdit:o,additionalTextEdits:s}}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&X.string(o.label)&&(X.undefined(o.textEdit)||lm.is(o))&&(X.undefined(o.additionalTextEdits)||X.typedArray(o.additionalTextEdits,lm.is))}i.is=t})(cO||(cO={}));var uO;(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(uO||(uO={}));var gO;(function(i){function e(n,o,s,r,a,l){const d={startLine:n,endLine:o};return X.defined(s)&&(d.startCharacter=s),X.defined(r)&&(d.endCharacter=r),X.defined(a)&&(d.kind=a),X.defined(l)&&(d.collapsedText=l),d}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&X.uinteger(o.startLine)&&X.uinteger(o.startLine)&&(X.undefined(o.startCharacter)||X.uinteger(o.startCharacter))&&(X.undefined(o.endCharacter)||X.uinteger(o.endCharacter))&&(X.undefined(o.kind)||X.string(o.kind))}i.is=t})(gO||(gO={}));var jx;(function(i){function e(n,o){return{location:n,message:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&XC.is(o.location)&&X.string(o.message)}i.is=t})(jx||(jx={}));var pO;(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(pO||(pO={}));var mO;(function(i){i.Unnecessary=1,i.Deprecated=2})(mO||(mO={}));var fO;(function(i){function e(t){const n=t;return X.objectLiteral(n)&&X.string(n.href)}i.is=e})(fO||(fO={}));var JC;(function(i){function e(n,o,s,r,a,l){let d={range:n,message:o};return X.defined(s)&&(d.severity=s),X.defined(r)&&(d.code=r),X.defined(a)&&(d.source=a),X.defined(l)&&(d.relatedInformation=l),d}i.create=e;function t(n){var o;let s=n;return X.defined(s)&&Sn.is(s.range)&&X.string(s.message)&&(X.number(s.severity)||X.undefined(s.severity))&&(X.integer(s.code)||X.string(s.code)||X.undefined(s.code))&&(X.undefined(s.codeDescription)||X.string((o=s.codeDescription)===null||o===void 0?void 0:o.href))&&(X.string(s.source)||X.undefined(s.source))&&(X.undefined(s.relatedInformation)||X.typedArray(s.relatedInformation,jx.is))}i.is=t})(JC||(JC={}));var am;(function(i){function e(n,o,...s){let r={title:n,command:o};return X.defined(s)&&s.length>0&&(r.arguments=s),r}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.title)&&X.string(o.command)}i.is=t})(am||(am={}));var lm;(function(i){function e(s,r){return{range:s,newText:r}}i.replace=e;function t(s,r){return{range:{start:s,end:s},newText:r}}i.insert=t;function n(s){return{range:s,newText:""}}i.del=n;function o(s){const r=s;return X.objectLiteral(r)&&X.string(r.newText)&&Sn.is(r.range)}i.is=o})(lm||(lm={}));var $x;(function(i){function e(n,o,s){const r={label:n};return o!==void 0&&(r.needsConfirmation=o),s!==void 0&&(r.description=s),r}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&X.string(o.label)&&(X.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(X.string(o.description)||o.description===void 0)}i.is=t})($x||($x={}));var dm;(function(i){function e(t){const n=t;return X.string(n)}i.is=e})(dm||(dm={}));var _O;(function(i){function e(s,r,a){return{range:s,newText:r,annotationId:a}}i.replace=e;function t(s,r,a){return{range:{start:s,end:s},newText:r,annotationId:a}}i.insert=t;function n(s,r){return{range:s,newText:"",annotationId:r}}i.del=n;function o(s){const r=s;return lm.is(r)&&($x.is(r.annotationId)||dm.is(r.annotationId))}i.is=o})(_O||(_O={}));var qx;(function(i){function e(n,o){return{textDocument:n,edits:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&Xx.is(o.textDocument)&&Array.isArray(o.edits)}i.is=t})(qx||(qx={}));var Gx;(function(i){function e(n,o,s){let r={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(r.options=o),s!==void 0&&(r.annotationId=s),r}i.create=e;function t(n){let o=n;return o&&o.kind==="create"&&X.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||X.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||X.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||dm.is(o.annotationId))}i.is=t})(Gx||(Gx={}));var Zx;(function(i){function e(n,o,s,r){let a={kind:"rename",oldUri:n,newUri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),r!==void 0&&(a.annotationId=r),a}i.create=e;function t(n){let o=n;return o&&o.kind==="rename"&&X.string(o.oldUri)&&X.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||X.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||X.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||dm.is(o.annotationId))}i.is=t})(Zx||(Zx={}));var Yx;(function(i){function e(n,o,s){let r={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(r.options=o),s!==void 0&&(r.annotationId=s),r}i.create=e;function t(n){let o=n;return o&&o.kind==="delete"&&X.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||X.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||X.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||dm.is(o.annotationId))}i.is=t})(Yx||(Yx={}));var Qx;(function(i){function e(t){let n=t;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>X.string(o.kind)?Gx.is(o)||Zx.is(o)||Yx.is(o):qx.is(o)))}i.is=e})(Qx||(Qx={}));var vO;(function(i){function e(n){return{uri:n}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.uri)}i.is=t})(vO||(vO={}));var bO;(function(i){function e(n,o){return{uri:n,version:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.uri)&&X.integer(o.version)}i.is=t})(bO||(bO={}));var Xx;(function(i){function e(n,o){return{uri:n,version:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.uri)&&(o.version===null||X.integer(o.version))}i.is=t})(Xx||(Xx={}));var CO;(function(i){function e(n,o,s,r){return{uri:n,languageId:o,version:s,text:r}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.string(o.uri)&&X.string(o.languageId)&&X.integer(o.version)&&X.string(o.text)}i.is=t})(CO||(CO={}));var Jx;(function(i){i.PlainText="plaintext",i.Markdown="markdown";function e(t){const n=t;return n===i.PlainText||n===i.Markdown}i.is=e})(Jx||(Jx={}));var hv;(function(i){function e(t){const n=t;return X.objectLiteral(t)&&Jx.is(n.kind)&&X.string(n.value)}i.is=e})(hv||(hv={}));var In;(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(In||(In={}));var eE;(function(i){i.PlainText=1,i.Snippet=2})(eE||(eE={}));var wO;(function(i){i.Deprecated=1})(wO||(wO={}));var yO;(function(i){function e(n,o,s){return{newText:n,insert:o,replace:s}}i.create=e;function t(n){const o=n;return o&&X.string(o.newText)&&Sn.is(o.insert)&&Sn.is(o.replace)}i.is=t})(yO||(yO={}));var SO;(function(i){i.asIs=1,i.adjustIndentation=2})(SO||(SO={}));var LO;(function(i){function e(t){const n=t;return n&&(X.string(n.detail)||n.detail===void 0)&&(X.string(n.description)||n.description===void 0)}i.is=e})(LO||(LO={}));var kO;(function(i){function e(t){return{label:t}}i.create=e})(kO||(kO={}));var DO;(function(i){function e(t,n){return{items:t||[],isIncomplete:!!n}}i.create=e})(DO||(DO={}));var ew;(function(i){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i.fromPlainText=e;function t(n){const o=n;return X.string(o)||X.objectLiteral(o)&&X.string(o.language)&&X.string(o.value)}i.is=t})(ew||(ew={}));var xO;(function(i){function e(t){let n=t;return!!n&&X.objectLiteral(n)&&(hv.is(n.contents)||ew.is(n.contents)||X.typedArray(n.contents,ew.is))&&(t.range===void 0||Sn.is(t.range))}i.is=e})(xO||(xO={}));var EO;(function(i){function e(t,n){return n?{label:t,documentation:n}:{label:t}}i.create=e})(EO||(EO={}));var NO;(function(i){function e(t,n,...o){let s={label:t};return X.defined(n)&&(s.documentation=n),X.defined(o)?s.parameters=o:s.parameters=[],s}i.create=e})(NO||(NO={}));var IO;(function(i){i.Text=1,i.Read=2,i.Write=3})(IO||(IO={}));var MO;(function(i){function e(t,n){let o={range:t};return X.number(n)&&(o.kind=n),o}i.create=e})(MO||(MO={}));var Vo;(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(Vo||(Vo={}));var TO;(function(i){i.Deprecated=1})(TO||(TO={}));var RO;(function(i){function e(t,n,o,s,r){let a={name:t,kind:n,location:{uri:s,range:o}};return r&&(a.containerName=r),a}i.create=e})(RO||(RO={}));var AO;(function(i){function e(t,n,o,s){return s!==void 0?{name:t,kind:n,location:{uri:o,range:s}}:{name:t,kind:n,location:{uri:o}}}i.create=e})(AO||(AO={}));var PO;(function(i){function e(n,o,s,r,a,l){let d={name:n,detail:o,kind:s,range:r,selectionRange:a};return l!==void 0&&(d.children=l),d}i.create=e;function t(n){let o=n;return o&&X.string(o.name)&&X.number(o.kind)&&Sn.is(o.range)&&Sn.is(o.selectionRange)&&(o.detail===void 0||X.string(o.detail))&&(o.deprecated===void 0||X.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}i.is=t})(PO||(PO={}));var OO;(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(OO||(OO={}));var tw;(function(i){i.Invoked=1,i.Automatic=2})(tw||(tw={}));var FO;(function(i){function e(n,o,s){let r={diagnostics:n};return o!=null&&(r.only=o),s!=null&&(r.triggerKind=s),r}i.create=e;function t(n){let o=n;return X.defined(o)&&X.typedArray(o.diagnostics,JC.is)&&(o.only===void 0||X.typedArray(o.only,X.string))&&(o.triggerKind===void 0||o.triggerKind===tw.Invoked||o.triggerKind===tw.Automatic)}i.is=t})(FO||(FO={}));var BO;(function(i){function e(n,o,s){let r={title:n},a=!0;return typeof o=="string"?(a=!1,r.kind=o):am.is(o)?r.command=o:r.edit=o,a&&s!==void 0&&(r.kind=s),r}i.create=e;function t(n){let o=n;return o&&X.string(o.title)&&(o.diagnostics===void 0||X.typedArray(o.diagnostics,JC.is))&&(o.kind===void 0||X.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||am.is(o.command))&&(o.isPreferred===void 0||X.boolean(o.isPreferred))&&(o.edit===void 0||Qx.is(o.edit))}i.is=t})(BO||(BO={}));var WO;(function(i){function e(n,o){let s={range:n};return X.defined(o)&&(s.data=o),s}i.create=e;function t(n){let o=n;return X.defined(o)&&Sn.is(o.range)&&(X.undefined(o.command)||am.is(o.command))}i.is=t})(WO||(WO={}));var VO;(function(i){function e(n,o){return{tabSize:n,insertSpaces:o}}i.create=e;function t(n){let o=n;return X.defined(o)&&X.uinteger(o.tabSize)&&X.boolean(o.insertSpaces)}i.is=t})(VO||(VO={}));var HO;(function(i){function e(n,o,s){return{range:n,target:o,data:s}}i.create=e;function t(n){let o=n;return X.defined(o)&&Sn.is(o.range)&&(X.undefined(o.target)||X.string(o.target))}i.is=t})(HO||(HO={}));var zO;(function(i){function e(n,o){return{range:n,parent:o}}i.create=e;function t(n){let o=n;return X.objectLiteral(o)&&Sn.is(o.range)&&(o.parent===void 0||i.is(o.parent))}i.is=t})(zO||(zO={}));var UO;(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(UO||(UO={}));var KO;(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(KO||(KO={}));var jO;(function(i){function e(t){const n=t;return X.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i.is=e})(jO||(jO={}));var $O;(function(i){function e(n,o){return{range:n,text:o}}i.create=e;function t(n){const o=n;return o!=null&&Sn.is(o.range)&&X.string(o.text)}i.is=t})($O||($O={}));var qO;(function(i){function e(n,o,s){return{range:n,variableName:o,caseSensitiveLookup:s}}i.create=e;function t(n){const o=n;return o!=null&&Sn.is(o.range)&&X.boolean(o.caseSensitiveLookup)&&(X.string(o.variableName)||o.variableName===void 0)}i.is=t})(qO||(qO={}));var GO;(function(i){function e(n,o){return{range:n,expression:o}}i.create=e;function t(n){const o=n;return o!=null&&Sn.is(o.range)&&(X.string(o.expression)||o.expression===void 0)}i.is=t})(GO||(GO={}));var ZO;(function(i){function e(n,o){return{frameId:n,stoppedLocation:o}}i.create=e;function t(n){const o=n;return X.defined(o)&&Sn.is(n.stoppedLocation)}i.is=t})(ZO||(ZO={}));var tE;(function(i){i.Type=1,i.Parameter=2;function e(t){return t===1||t===2}i.is=e})(tE||(tE={}));var iE;(function(i){function e(n){return{value:n}}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&(o.tooltip===void 0||X.string(o.tooltip)||hv.is(o.tooltip))&&(o.location===void 0||XC.is(o.location))&&(o.command===void 0||am.is(o.command))}i.is=t})(iE||(iE={}));var YO;(function(i){function e(n,o,s){const r={position:n,label:o};return s!==void 0&&(r.kind=s),r}i.create=e;function t(n){const o=n;return X.objectLiteral(o)&&Xr.is(o.position)&&(X.string(o.label)||X.typedArray(o.label,iE.is))&&(o.kind===void 0||tE.is(o.kind))&&o.textEdits===void 0||X.typedArray(o.textEdits,lm.is)&&(o.tooltip===void 0||X.string(o.tooltip)||hv.is(o.tooltip))&&(o.paddingLeft===void 0||X.boolean(o.paddingLeft))&&(o.paddingRight===void 0||X.boolean(o.paddingRight))}i.is=t})(YO||(YO={}));var QO;(function(i){function e(t){return{kind:"snippet",value:t}}i.createSnippet=e})(QO||(QO={}));var XO;(function(i){function e(t,n,o,s){return{insertText:t,filterText:n,range:o,command:s}}i.create=e})(XO||(XO={}));var JO;(function(i){function e(t){return{items:t}}i.create=e})(JO||(JO={}));var e4;(function(i){i.Invoked=0,i.Automatic=1})(e4||(e4={}));var t4;(function(i){function e(t,n){return{range:t,text:n}}i.create=e})(t4||(t4={}));var i4;(function(i){function e(t,n){return{triggerKind:t,selectedCompletionInfo:n}}i.create=e})(i4||(i4={}));var n4;(function(i){function e(t){const n=t;return X.objectLiteral(n)&&Ux.is(n.uri)&&X.string(n.name)}i.is=e})(n4||(n4={}));var o4;(function(i){function e(s,r,a,l){return new pj(s,r,a,l)}i.create=e;function t(s){let r=s;return!!(X.defined(r)&&X.string(r.uri)&&(X.undefined(r.languageId)||X.string(r.languageId))&&X.uinteger(r.lineCount)&&X.func(r.getText)&&X.func(r.positionAt)&&X.func(r.offsetAt))}i.is=t;function n(s,r){let a=s.getText(),l=o(r,(h,c)=>{let u=h.range.start.line-c.range.start.line;return u===0?h.range.start.character-c.range.start.character:u}),d=a.length;for(let h=l.length-1;h>=0;h--){let c=l[h],u=s.offsetAt(c.range.start),g=s.offsetAt(c.range.end);if(g<=d)a=a.substring(0,u)+c.newText+a.substring(g,a.length);else throw new Error("Overlapping edit");d=u}return a}i.applyEdits=n;function o(s,r){if(s.length<=1)return s;const a=s.length/2|0,l=s.slice(0,a),d=s.slice(a);o(l,r),o(d,r);let h=0,c=0,u=0;for(;h<l.length&&c<d.length;)r(l[h],d[c])<=0?s[u++]=l[h++]:s[u++]=d[c++];for(;h<l.length;)s[u++]=l[h++];for(;c<d.length;)s[u++]=d[c++];return s}})(o4||(o4={}));class pj{constructor(e,t,n,o){this._uri=e,this._languageId=t,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let o=0;o<t.length;o++){n&&(e.push(o),n=!1);let s=t.charAt(o);n=s==="\r"||s===`
|
|
3
3
|
`,s==="\r"&&o+1<t.length&&t.charAt(o+1)===`
|
|
4
4
|
`&&o++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,o=t.length;if(o===0)return Xr.create(0,e);for(;n<o;){let r=Math.floor((n+o)/2);t[r]>e?o=r:n=r+1}let s=n-1;return Xr.create(s,e-t[s])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],o=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,o),n)}get lineCount(){return this.getLineOffsets().length}}var X;(function(i){const e=Object.prototype.toString;function t(g){return typeof g<"u"}i.defined=t;function n(g){return typeof g>"u"}i.undefined=n;function o(g){return g===!0||g===!1}i.boolean=o;function s(g){return e.call(g)==="[object String]"}i.string=s;function r(g){return e.call(g)==="[object Number]"}i.number=r;function a(g,m,f){return e.call(g)==="[object Number]"&&m<=g&&g<=f}i.numberRange=a;function l(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}i.integer=l;function d(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}i.uinteger=d;function h(g){return e.call(g)==="[object Function]"}i.func=h;function c(g){return g!==null&&typeof g=="object"}i.objectLiteral=c;function u(g,m){return Array.isArray(g)&&g.every(m)}i.typedArray=u})(X||(X={}));class nE{constructor(e){this.getStartOfToken=()=>this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>this._pos===0,this.peek=()=>this._sourceText.charAt(this._pos)?this._sourceText.charAt(this._pos):null,this.next=()=>{const t=this._sourceText.charAt(this._pos);return this._pos++,t},this.eat=t=>{if(this._testNextCharacter(t))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=t=>{let n=this._testNextCharacter(t),o=!1;for(n&&(o=n,this._start=this._pos);n;)this._pos++,n=this._testNextCharacter(t),o=!0;return o},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=t=>{this._pos=t},this.match=(t,n=!0,o=!1)=>{let s=null,r=null;return typeof t=="string"?(r=new RegExp(t,o?"i":"g").test(this._sourceText.substr(this._pos,t.length)),s=t):t instanceof RegExp&&(r=this._sourceText.slice(this._pos).match(t),s=r&&r[0]),r!=null&&(typeof t=="string"||r instanceof Array&&this._sourceText.startsWith(r[0],this._pos))?(n&&(this._start=this._pos,s&&s.length&&(this._pos+=s.length)),r):!1},this.backUp=t=>{this._pos-=t},this.column=()=>this._pos,this.indentation=()=>{const t=this._sourceText.match(/\s*/);let n=0;if(t&&t.length!==0){const o=t[0];let s=0;for(;o.length>s;)o.charCodeAt(s)===9?n+=2:n++,s++}return n},this.current=()=>this._sourceText.slice(this._start,this._pos),this._start=0,this._pos=0,this._sourceText=e}_testNextCharacter(e){const t=this._sourceText.charAt(this._pos);let n=!1;return typeof e=="string"?n=t===e:n=e instanceof RegExp?e.test(t):e(t),n}}function pn(i){return{ofRule:i}}function Zt(i,e){return{ofRule:i,isList:!0,separator:e}}function mj(i,e){const t=i.match;return i.match=n=>{let o=!1;return t&&(o=t(n)),o&&e.every(s=>s.match&&!s.match(n))},i}function Ak(i,e){return{style:e,match:t=>t.kind===i}}function St(i,e){return{style:e||"punctuation",match:t=>t.kind==="Punctuation"&&t.value===i}}const fj=i=>i===" "||i===" "||i===","||i===`
|
|
5
5
|
`||i==="\r"||i==="\uFEFF"||i===" ",_j={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},vj={Document:[Zt("Definition")],Definition(i){switch(i.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return eo.FRAGMENT_DEFINITION;case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[ao("query"),pn(Oi("def")),pn("VariableDefinitions"),Zt("Directive"),"SelectionSet"],Mutation:[ao("mutation"),pn(Oi("def")),pn("VariableDefinitions"),Zt("Directive"),"SelectionSet"],Subscription:[ao("subscription"),pn(Oi("def")),pn("VariableDefinitions"),Zt("Directive"),"SelectionSet"],VariableDefinitions:[St("("),Zt("VariableDefinition"),St(")")],VariableDefinition:["Variable",St(":"),"Type",pn("DefaultValue")],Variable:[St("$","variable"),Oi("variable")],DefaultValue:[St("="),"Value"],SelectionSet:[St("{"),Zt("Selection"),St("}")],Selection(i,e){return i.value==="..."?e.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":e.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[Oi("property"),St(":"),Oi("qualifier"),pn("Arguments"),Zt("Directive"),pn("SelectionSet")],Field:[Oi("property"),pn("Arguments"),Zt("Directive"),pn("SelectionSet")],Arguments:[St("("),Zt("Argument"),St(")")],Argument:[Oi("attribute"),St(":"),"Value"],FragmentSpread:[St("..."),Oi("def"),Zt("Directive")],InlineFragment:[St("..."),pn("TypeCondition"),Zt("Directive"),"SelectionSet"],FragmentDefinition:[ao("fragment"),pn(mj(Oi("def"),[ao("on")])),"TypeCondition",Zt("Directive"),"SelectionSet"],TypeCondition:[ao("on"),"NamedType"],Value(i){switch(i.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(i.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable";case"&":return"NamedType"}return null;case"Name":switch(i.value){case"true":case"false":return"BooleanValue"}return i.value==="null"?"NullValue":"EnumValue"}},NumberValue:[Ak("Number","number")],StringValue:[{style:"string",match:i=>i.kind==="String",update(i,e){e.value.startsWith('"""')&&(i.inBlockstring=!e.value.slice(3).endsWith('"""'))}}],BooleanValue:[Ak("Name","builtin")],NullValue:[Ak("Name","keyword")],EnumValue:[Oi("string-2")],ListValue:[St("["),Zt("Value"),St("]")],ObjectValue:[St("{"),Zt("ObjectField"),St("}")],ObjectField:[Oi("attribute"),St(":"),"Value"],Type(i){return i.value==="["?"ListType":"NonNullType"},ListType:[St("["),"Type",St("]"),pn(St("!"))],NonNullType:["NamedType",pn(St("!"))],NamedType:[bj("atom")],Directive:[St("@","meta"),Oi("meta"),pn("Arguments")],DirectiveDef:[ao("directive"),St("@","meta"),Oi("meta"),pn("ArgumentsDef"),ao("on"),Zt("DirectiveLocation",St("|"))],InterfaceDef:[ao("interface"),Oi("atom"),pn("Implements"),Zt("Directive"),St("{"),Zt("FieldDef"),St("}")],Implements:[ao("implements"),Zt("NamedType",St("&"))],DirectiveLocation:[Oi("string-2")],SchemaDef:[ao("schema"),Zt("Directive"),St("{"),Zt("OperationTypeDef"),St("}")],OperationTypeDef:[Oi("keyword"),St(":"),Oi("atom")],ScalarDef:[ao("scalar"),Oi("atom"),Zt("Directive")],ObjectTypeDef:[ao("type"),Oi("atom"),pn("Implements"),Zt("Directive"),St("{"),Zt("FieldDef"),St("}")],FieldDef:[Oi("property"),pn("ArgumentsDef"),St(":"),"Type",Zt("Directive")],ArgumentsDef:[St("("),Zt("InputValueDef"),St(")")],InputValueDef:[Oi("attribute"),St(":"),"Type",pn("DefaultValue"),Zt("Directive")],UnionDef:[ao("union"),Oi("atom"),Zt("Directive"),St("="),Zt("UnionMember",St("|"))],UnionMember:["NamedType"],EnumDef:[ao("enum"),Oi("atom"),Zt("Directive"),St("{"),Zt("EnumValueDef"),St("}")],EnumValueDef:[Oi("string-2"),Zt("Directive")],InputDef:[ao("input"),Oi("atom"),Zt("Directive"),St("{"),Zt("InputValueDef"),St("}")],ExtendDef:[ao("extend"),"ObjectTypeDef"]};function ao(i){return{style:"keyword",match:e=>e.kind==="Name"&&e.value===i}}function Oi(i){return{style:i,match:e=>e.kind==="Name",update(e,t){e.name=t.value}}}function bj(i){return{style:i,match:e=>e.kind==="Name",update(e,t){e.prevState&&e.prevState.prevState&&(e.name=t.value,e.prevState.prevState.type=t.value)}}}function y7(i={eatWhitespace:e=>e.eatWhile(fj),lexRules:_j,parseRules:vj,editorConfig:{}}){return{startState(){const e={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeperator:!1,prevState:null};return o_(i.parseRules,e,eo.DOCUMENT),e},token(e,t){return Cj(e,t,i)}}}function Cj(i,e,t){if(e.inBlockstring)return i.match(/.*"""/)?(e.inBlockstring=!1,"string"):(i.skipToEnd(),"string");const{lexRules:n,parseRules:o,eatWhitespace:s,editorConfig:r}=t;if(e.rule&&e.rule.length===0?yT(e):e.needsAdvance&&(e.needsAdvance=!1,oE(e,!0)),i.sol()){const d=r&&r.tabSize||2;e.indentLevel=Math.floor(i.indentation()/d)}if(s(i))return"ws";const a=yj(n,i);if(!a)return i.match(/\S+/)||i.match(/\s/),o_(Pk,e,"Invalid"),"invalidchar";if(a.kind==="Comment")return o_(Pk,e,"Comment"),"comment";const l=s4({},e);if(a.kind==="Punctuation"){if(/^[{([]/.test(a.value))e.indentLevel!==void 0&&(e.levels=(e.levels||[]).concat(e.indentLevel+1));else if(/^[})\]]/.test(a.value)){const d=e.levels=(e.levels||[]).slice(0,-1);e.indentLevel&&d.length>0&&d[d.length-1]<e.indentLevel&&(e.indentLevel=d[d.length-1])}}for(;e.rule;){let d=typeof e.rule=="function"?e.step===0?e.rule(a,i):null:e.rule[e.step];if(e.needsSeperator&&(d=d&&(d==null?void 0:d.separator)),d){if(d.ofRule&&(d=d.ofRule),typeof d=="string"){o_(o,e,d);continue}if(d.match&&d.match(a))return d.update&&d.update(e,a),a.kind==="Punctuation"?oE(e,!0):e.needsAdvance=!0,d.style}wj(e)}return s4(e,l),o_(Pk,e,"Invalid"),"invalidchar"}function s4(i,e){const t=Object.keys(e);for(let n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}const Pk={Invalid:[],Comment:[]};function o_(i,e,t){if(!i[t])throw new TypeError("Unknown rule: "+t);e.prevState=Object.assign({},e),e.kind=t,e.name=null,e.type=null,e.rule=i[t],e.step=0,e.needsSeperator=!1}function yT(i){i.prevState&&(i.kind=i.prevState.kind,i.name=i.prevState.name,i.type=i.prevState.type,i.rule=i.prevState.rule,i.step=i.prevState.step,i.needsSeperator=i.prevState.needsSeperator,i.prevState=i.prevState.prevState)}function oE(i,e){if(r4(i)&&i.rule){const t=i.rule[i.step];if(t.separator){const n=t.separator;if(i.needsSeperator=!i.needsSeperator,!i.needsSeperator&&n.ofRule)return}if(e)return}for(i.needsSeperator=!1,i.step++;i.rule&&!(Array.isArray(i.rule)&&i.step<i.rule.length);)yT(i),i.rule&&(r4(i)?i.rule&&i.rule[i.step].separator&&(i.needsSeperator=!i.needsSeperator):(i.needsSeperator=!1,i.step++))}function r4(i){const e=Array.isArray(i.rule)&&typeof i.rule[i.step]!="string"&&i.rule[i.step];return e&&e.isList}function wj(i){for(;i.rule&&!(Array.isArray(i.rule)&&i.rule[i.step].ofRule);)yT(i);i.rule&&oE(i,!1)}function yj(i,e){const t=Object.keys(i);for(let n=0;n<t.length;n++){const o=e.match(i[t[n]]);if(o&&o instanceof Array)return{kind:t[n],value:o[0]}}}const Sj={ALIASED_FIELD:"AliasedField",ARGUMENTS:"Arguments",SHORT_QUERY:"ShortQuery",QUERY:"Query",MUTATION:"Mutation",SUBSCRIPTION:"Subscription",TYPE_CONDITION:"TypeCondition",INVALID:"Invalid",COMMENT:"Comment",SCHEMA_DEF:"SchemaDef",SCALAR_DEF:"ScalarDef",OBJECT_TYPE_DEF:"ObjectTypeDef",OBJECT_VALUE:"ObjectValue",LIST_VALUE:"ListValue",INTERFACE_DEF:"InterfaceDef",UNION_DEF:"UnionDef",ENUM_DEF:"EnumDef",ENUM_VALUE:"EnumValue",FIELD_DEF:"FieldDef",INPUT_DEF:"InputDef",INPUT_VALUE_DEF:"InputValueDef",ARGUMENTS_DEF:"ArgumentsDef",EXTEND_DEF:"ExtendDef",DIRECTIVE_DEF:"DirectiveDef",IMPLEMENTS:"Implements",VARIABLE_DEFINITIONS:"VariableDefinitions",TYPE:"Type"},Ie=Object.assign(Object.assign({},eo),Sj),S7={command:"editor.action.triggerSuggest",title:"Suggestions"},Lj=i=>{const e=[];return i&&f7(wT(i),{FragmentDefinition(t){e.push(t)}}),e};function kj(i,e,t,n,o,s){var r;const a=Object.assign(Object.assign({},s),{schema:i}),l=ST(e,t),d=l.state.kind==="Invalid"?l.state.prevState:l.state;if(!d)return[];const h=d.kind,c=d.step,u=k7(i,l.state);if(h===Ie.DOCUMENT)return _r(l,[{label:"query",kind:In.Function},{label:"mutation",kind:In.Function},{label:"subscription",kind:In.Function},{label:"fragment",kind:In.Function},{label:"{",kind:In.Constructor}]);if(h===Ie.IMPLEMENTS||h===Ie.NAMED_TYPE&&((r=d.prevState)===null||r===void 0?void 0:r.kind)===Ie.IMPLEMENTS)return Ij(l,d,i,e,u);if(h===Ie.SELECTION_SET||h===Ie.FIELD||h===Ie.ALIASED_FIELD)return Ej(l,u,a);if(h===Ie.ARGUMENTS||h===Ie.ARGUMENT&&c===0){const g=u.argDefs;if(g)return _r(l,g.map(m=>{var f;return{label:m.name,insertText:m.name+": ",command:S7,detail:String(m.type),documentation:(f=m.description)!==null&&f!==void 0?f:void 0,kind:In.Variable,type:m.type}}))}if((h===Ie.OBJECT_VALUE||h===Ie.OBJECT_FIELD&&c===0)&&u.objectFieldDefs){const g=Tu(u.objectFieldDefs),m=h===Ie.OBJECT_VALUE?In.Value:In.Field;return _r(l,g.map(f=>{var _;return{label:f.name,detail:String(f.type),documentation:(_=f.description)!==null&&_!==void 0?_:void 0,kind:m,type:f.type}}))}if(h===Ie.ENUM_VALUE||h===Ie.LIST_VALUE&&c===1||h===Ie.OBJECT_FIELD&&c===2||h===Ie.ARGUMENT&&c===2)return Nj(l,u,e,i);if(h===Ie.VARIABLE&&c===1){const g=Ap(u.inputType),m=L7(e,i,l);return _r(l,m.filter(f=>f.detail===(g==null?void 0:g.name)))}return h===Ie.TYPE_CONDITION&&c===1||h===Ie.NAMED_TYPE&&d.prevState!=null&&d.prevState.kind===Ie.TYPE_CONDITION?Mj(l,u,i):h===Ie.FRAGMENT_SPREAD&&c===1?Tj(l,u,i,e,Array.isArray(o)?o:Lj(o)):h===Ie.VARIABLE_DEFINITION&&c===2||h===Ie.LIST_TYPE&&c===1||h===Ie.NAMED_TYPE&&d.prevState&&(d.prevState.kind===Ie.VARIABLE_DEFINITION||d.prevState.kind===Ie.LIST_TYPE||d.prevState.kind===Ie.NON_NULL_TYPE)?Pj(l,i):h===Ie.DIRECTIVE?Oj(l,d,i):[]}const Dj=` {
|
|
@@ -750,7 +750,7 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
750
750
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
751
751
|
* Released under the MIT license
|
|
752
752
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
753
|
-
*-----------------------------------------------------------------------------*/Le({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Ce(()=>import("./freemarker2-B12auKfc-
|
|
753
|
+
*-----------------------------------------------------------------------------*/Le({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Ce(()=>import("./freemarker2-B12auKfc-CY1f5BH_.js"),__vite__mapDeps([0,1,2,3,4])).then(i=>i.TagAutoInterpolationDollar)});Le({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Ce(()=>import("./freemarker2-B12auKfc-CY1f5BH_.js"),__vite__mapDeps([0,1,2,3,4])).then(i=>i.TagAngleInterpolationDollar)});Le({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Ce(()=>import("./freemarker2-B12auKfc-CY1f5BH_.js"),__vite__mapDeps([0,1,2,3,4])).then(i=>i.TagBracketInterpolationDollar)});Le({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Ce(()=>import("./freemarker2-B12auKfc-CY1f5BH_.js"),__vite__mapDeps([0,1,2,3,4])).then(i=>i.TagAngleInterpolationBracket)});Le({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Ce(()=>import("./freemarker2-B12auKfc-CY1f5BH_.js"),__vite__mapDeps([0,1,2,3,4])).then(i=>i.TagBracketInterpolationBracket)});Le({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Ce(()=>import("./freemarker2-B12auKfc-CY1f5BH_.js"),__vite__mapDeps([0,1,2,3,4])).then(i=>i.TagAutoInterpolationDollar)});Le({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Ce(()=>import("./freemarker2-B12auKfc-CY1f5BH_.js"),__vite__mapDeps([0,1,2,3,4])).then(i=>i.TagAutoInterpolationBracket)});/*!-----------------------------------------------------------------------------
|
|
754
754
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
755
755
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
756
756
|
* Released under the MIT license
|
|
@@ -765,7 +765,7 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
765
765
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
766
766
|
* Released under the MIT license
|
|
767
767
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
768
|
-
*-----------------------------------------------------------------------------*/Le({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Ce(()=>import("./handlebars-fup3rJ3C-
|
|
768
|
+
*-----------------------------------------------------------------------------*/Le({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Ce(()=>import("./handlebars-fup3rJ3C-DIrFum2b.js"),__vite__mapDeps([5,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
769
769
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
770
770
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
771
771
|
* Released under the MIT license
|
|
@@ -775,7 +775,7 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
775
775
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
776
776
|
* Released under the MIT license
|
|
777
777
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
778
|
-
*-----------------------------------------------------------------------------*/Le({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Ce(()=>import("./html-Bd7p9h1P-
|
|
778
|
+
*-----------------------------------------------------------------------------*/Le({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Ce(()=>import("./html-Bd7p9h1P-DH0yLc_S.js"),__vite__mapDeps([6,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
779
779
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
780
780
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
781
781
|
* Released under the MIT license
|
|
@@ -790,7 +790,7 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
790
790
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
791
791
|
* Released under the MIT license
|
|
792
792
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
793
|
-
*-----------------------------------------------------------------------------*/Le({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Ce(()=>import("./javascript-egJvx3xR-
|
|
793
|
+
*-----------------------------------------------------------------------------*/Le({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Ce(()=>import("./javascript-egJvx3xR-CXu0MlTd.js"),__vite__mapDeps([7,8,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
794
794
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
795
795
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
796
796
|
* Released under the MIT license
|
|
@@ -820,7 +820,7 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
820
820
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
821
821
|
* Released under the MIT license
|
|
822
822
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
823
|
-
*-----------------------------------------------------------------------------*/Le({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Ce(()=>import("./liquid-Bn94NRXM-
|
|
823
|
+
*-----------------------------------------------------------------------------*/Le({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Ce(()=>import("./liquid-Bn94NRXM-DXR9Xdil.js"),__vite__mapDeps([9,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
824
824
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
825
825
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
826
826
|
* Released under the MIT license
|
|
@@ -835,7 +835,7 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
835
835
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
836
836
|
* Released under the MIT license
|
|
837
837
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
838
|
-
*-----------------------------------------------------------------------------*/Le({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Ce(()=>import("./mdx-CUs5ly0Y-
|
|
838
|
+
*-----------------------------------------------------------------------------*/Le({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Ce(()=>import("./mdx-CUs5ly0Y-PFSuKGqp.js"),__vite__mapDeps([10,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
839
839
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
840
840
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
841
841
|
* Released under the MIT license
|
|
@@ -915,7 +915,7 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
915
915
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
916
916
|
* Released under the MIT license
|
|
917
917
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
918
|
-
*-----------------------------------------------------------------------------*/Le({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Ce(()=>import("./python-CvQNUgbY-
|
|
918
|
+
*-----------------------------------------------------------------------------*/Le({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Ce(()=>import("./python-CvQNUgbY-DKU7Nn90.js"),__vite__mapDeps([11,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
919
919
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
920
920
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
921
921
|
* Released under the MIT license
|
|
@@ -930,7 +930,7 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
930
930
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
931
931
|
* Released under the MIT license
|
|
932
932
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
933
|
-
*-----------------------------------------------------------------------------*/Le({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Ce(()=>import("./razor-COKLAES4-
|
|
933
|
+
*-----------------------------------------------------------------------------*/Le({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Ce(()=>import("./razor-COKLAES4-DVH5NG6J.js"),__vite__mapDeps([12,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
934
934
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
935
935
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
936
936
|
* Released under the MIT license
|
|
@@ -1030,7 +1030,7 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
1030
1030
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
1031
1031
|
* Released under the MIT license
|
|
1032
1032
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
1033
|
-
*-----------------------------------------------------------------------------*/Le({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Ce(()=>import("./typescript-BGB8OuQj-
|
|
1033
|
+
*-----------------------------------------------------------------------------*/Le({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Ce(()=>import("./typescript-BGB8OuQj-q21L76s7.js"),__vite__mapDeps([8,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
1034
1034
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1035
1035
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
1036
1036
|
* Released under the MIT license
|
|
@@ -1045,32 +1045,32 @@ ${e.toString()}`}}class Ly{constructor(e=new ab,t=!1,n,o=dce){var s;this._servic
|
|
|
1045
1045
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
1046
1046
|
* Released under the MIT license
|
|
1047
1047
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
1048
|
-
*-----------------------------------------------------------------------------*/Le({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>Ce(()=>import("./xml-C95L75A3-
|
|
1048
|
+
*-----------------------------------------------------------------------------*/Le({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>Ce(()=>import("./xml-C95L75A3-CktYugFs.js"),__vite__mapDeps([13,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
1049
1049
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1050
1050
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
1051
1051
|
* Released under the MIT license
|
|
1052
1052
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
1053
|
-
*-----------------------------------------------------------------------------*/Le({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Ce(()=>import("./yaml-CBgf5N3D-
|
|
1053
|
+
*-----------------------------------------------------------------------------*/Le({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Ce(()=>import("./yaml-CBgf5N3D-DNYfpm9a.js"),__vite__mapDeps([14,1,2,3,4]))});/*!-----------------------------------------------------------------------------
|
|
1054
1054
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1055
1055
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
1056
1056
|
* Released under the MIT license
|
|
1057
1057
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
1058
|
-
*-----------------------------------------------------------------------------*/var Wpe=Object.defineProperty,Vpe=Object.getOwnPropertyDescriptor,Hpe=Object.getOwnPropertyNames,zpe=Object.prototype.hasOwnProperty,Upe=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Hpe(e))!zpe.call(i,o)&&o!==t&&Wpe(i,o,{get:()=>e[o],enumerable:!(n=Vpe(e,o))||n.enumerable});return i},Kpe=(i,e,t)=>(Upe(i,e,"default"),t),ff={};Kpe(ff,yb);var tP=class{constructor(i,e,t){Si(this,"_onDidChange",new ff.Emitter),Si(this,"_options"),Si(this,"_modeConfiguration"),Si(this,"_languageId"),this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(i){this.setOptions(i)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},iP={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},nP={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},TH=new tP("css",iP,nP),RH=new tP("scss",iP,nP),AH=new tP("less",iP,nP);ff.languages.css={cssDefaults:TH,lessDefaults:AH,scssDefaults:RH};function oP(){return Ce(()=>import("./cssMode-DVq3LtHT-
|
|
1058
|
+
*-----------------------------------------------------------------------------*/var Wpe=Object.defineProperty,Vpe=Object.getOwnPropertyDescriptor,Hpe=Object.getOwnPropertyNames,zpe=Object.prototype.hasOwnProperty,Upe=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Hpe(e))!zpe.call(i,o)&&o!==t&&Wpe(i,o,{get:()=>e[o],enumerable:!(n=Vpe(e,o))||n.enumerable});return i},Kpe=(i,e,t)=>(Upe(i,e,"default"),t),ff={};Kpe(ff,yb);var tP=class{constructor(i,e,t){Si(this,"_onDidChange",new ff.Emitter),Si(this,"_options"),Si(this,"_modeConfiguration"),Si(this,"_languageId"),this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(i){this.setOptions(i)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},iP={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},nP={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},TH=new tP("css",iP,nP),RH=new tP("scss",iP,nP),AH=new tP("less",iP,nP);ff.languages.css={cssDefaults:TH,lessDefaults:AH,scssDefaults:RH};function oP(){return Ce(()=>import("./cssMode-DVq3LtHT-CoUgr_4L.js"),__vite__mapDeps([15,1,2,3,4]))}ff.languages.onLanguage("less",()=>{oP().then(i=>i.setupMode(AH))});ff.languages.onLanguage("scss",()=>{oP().then(i=>i.setupMode(RH))});ff.languages.onLanguage("css",()=>{oP().then(i=>i.setupMode(TH))});/*!-----------------------------------------------------------------------------
|
|
1059
1059
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1060
1060
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
1061
1061
|
* Released under the MIT license
|
|
1062
1062
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
1063
|
-
*-----------------------------------------------------------------------------*/var jpe=Object.defineProperty,$pe=Object.getOwnPropertyDescriptor,qpe=Object.getOwnPropertyNames,Gpe=Object.prototype.hasOwnProperty,Zpe=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of qpe(e))!Gpe.call(i,o)&&o!==t&&jpe(i,o,{get:()=>e[o],enumerable:!(n=$pe(e,o))||n.enumerable});return i},Ype=(i,e,t)=>(Zpe(i,e,"default"),t),EL={};Ype(EL,yb);var Qpe=class{constructor(i,e,t){Si(this,"_onDidChange",new EL.Emitter),Si(this,"_options"),Si(this,"_modeConfiguration"),Si(this,"_languageId"),this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},Xpe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},NL={format:Xpe,suggest:{},data:{useDefaultDataProvider:!0}};function IL(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===X_,documentFormattingEdits:i===X_,documentRangeFormattingEdits:i===X_}}var X_="html",B6="handlebars",W6="razor",PH=ML(X_,NL,IL(X_)),Jpe=PH.defaults,OH=ML(B6,NL,IL(B6)),eme=OH.defaults,FH=ML(W6,NL,IL(W6)),tme=FH.defaults;EL.languages.html={htmlDefaults:Jpe,razorDefaults:tme,handlebarDefaults:eme,htmlLanguageService:PH,handlebarLanguageService:OH,razorLanguageService:FH,registerHTMLLanguageService:ML};function ime(){return Ce(()=>import("./htmlMode-D_EcT_ua-
|
|
1063
|
+
*-----------------------------------------------------------------------------*/var jpe=Object.defineProperty,$pe=Object.getOwnPropertyDescriptor,qpe=Object.getOwnPropertyNames,Gpe=Object.prototype.hasOwnProperty,Zpe=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of qpe(e))!Gpe.call(i,o)&&o!==t&&jpe(i,o,{get:()=>e[o],enumerable:!(n=$pe(e,o))||n.enumerable});return i},Ype=(i,e,t)=>(Zpe(i,e,"default"),t),EL={};Ype(EL,yb);var Qpe=class{constructor(i,e,t){Si(this,"_onDidChange",new EL.Emitter),Si(this,"_options"),Si(this,"_modeConfiguration"),Si(this,"_languageId"),this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},Xpe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},NL={format:Xpe,suggest:{},data:{useDefaultDataProvider:!0}};function IL(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===X_,documentFormattingEdits:i===X_,documentRangeFormattingEdits:i===X_}}var X_="html",B6="handlebars",W6="razor",PH=ML(X_,NL,IL(X_)),Jpe=PH.defaults,OH=ML(B6,NL,IL(B6)),eme=OH.defaults,FH=ML(W6,NL,IL(W6)),tme=FH.defaults;EL.languages.html={htmlDefaults:Jpe,razorDefaults:tme,handlebarDefaults:eme,htmlLanguageService:PH,handlebarLanguageService:OH,razorLanguageService:FH,registerHTMLLanguageService:ML};function ime(){return Ce(()=>import("./htmlMode-D_EcT_ua-BUl6Pr_e.js"),__vite__mapDeps([16,1,2,3,4]))}function ML(i,e=NL,t=IL(i)){const n=new Qpe(i,e,t);let o;const s=EL.languages.onLanguage(i,async()=>{o=(await ime()).setupMode(n)});return{defaults:n,dispose(){s.dispose(),o==null||o.dispose(),o=void 0}}}/*!-----------------------------------------------------------------------------
|
|
1064
1064
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1065
1065
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
1066
1066
|
* Released under the MIT license
|
|
1067
1067
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
1068
|
-
*-----------------------------------------------------------------------------*/var nme=Object.defineProperty,ome=Object.getOwnPropertyDescriptor,sme=Object.getOwnPropertyNames,rme=Object.prototype.hasOwnProperty,ame=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of sme(e))!rme.call(i,o)&&o!==t&&nme(i,o,{get:()=>e[o],enumerable:!(n=ome(e,o))||n.enumerable});return i},lme=(i,e,t)=>(ame(i,e,"default"),t),Sb={};lme(Sb,yb);var dme=class{constructor(i,e,t){Si(this,"_onDidChange",new Sb.Emitter),Si(this,"_diagnosticsOptions"),Si(this,"_modeConfiguration"),Si(this,"_languageId"),this._languageId=i,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},hme={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},cme={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},BH=new dme("json",hme,cme);Sb.languages.json={jsonDefaults:BH};function ume(){return Ce(()=>import("./jsonMode-CmFhZ-nO-
|
|
1068
|
+
*-----------------------------------------------------------------------------*/var nme=Object.defineProperty,ome=Object.getOwnPropertyDescriptor,sme=Object.getOwnPropertyNames,rme=Object.prototype.hasOwnProperty,ame=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of sme(e))!rme.call(i,o)&&o!==t&&nme(i,o,{get:()=>e[o],enumerable:!(n=ome(e,o))||n.enumerable});return i},lme=(i,e,t)=>(ame(i,e,"default"),t),Sb={};lme(Sb,yb);var dme=class{constructor(i,e,t){Si(this,"_onDidChange",new Sb.Emitter),Si(this,"_diagnosticsOptions"),Si(this,"_modeConfiguration"),Si(this,"_languageId"),this._languageId=i,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},hme={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},cme={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},BH=new dme("json",hme,cme);Sb.languages.json={jsonDefaults:BH};function ume(){return Ce(()=>import("./jsonMode-CmFhZ-nO-BJHj7Aq3.js"),__vite__mapDeps([17,1,2,3,4]))}Sb.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Sb.languages.onLanguage("json",()=>{ume().then(i=>i.setupMode(BH))});/*!-----------------------------------------------------------------------------
|
|
1069
1069
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1070
1070
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
1071
1071
|
* Released under the MIT license
|
|
1072
1072
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
1073
|
-
*-----------------------------------------------------------------------------*/var gme=Object.defineProperty,pme=Object.getOwnPropertyDescriptor,mme=Object.getOwnPropertyNames,fme=Object.prototype.hasOwnProperty,_me=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of mme(e))!fme.call(i,o)&&o!==t&&gme(i,o,{get:()=>e[o],enumerable:!(n=pme(e,o))||n.enumerable});return i},vme=(i,e,t)=>(_me(i,e,"default"),t),bme="5.0.2",Hm={};vme(Hm,yb);var WH=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(WH||{}),VH=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(VH||{}),HH=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(HH||{}),zH=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(zH||{}),UH=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(UH||{}),KH=class{constructor(i,e,t,n,o){Si(this,"_onDidChange",new Hm.Emitter),Si(this,"_onDidExtraLibsChange",new Hm.Emitter),Si(this,"_extraLibs"),Si(this,"_removedExtraLibs"),Si(this,"_eagerModelSync"),Si(this,"_compilerOptions"),Si(this,"_diagnosticsOptions"),Si(this,"_workerOptions"),Si(this,"_onDidExtraLibsChangeTimeout"),Si(this,"_inlayHintsOptions"),Si(this,"_modeConfiguration"),this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(o),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(i,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let o=this._extraLibs[t];o&&o.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let o=1;this._removedExtraLibs[t]&&(o=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:o}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},Cme=bme,jH={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},$H=new KH({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},jH),qH=new KH({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},jH),wme=()=>TL().then(i=>i.getTypeScriptWorker()),yme=()=>TL().then(i=>i.getJavaScriptWorker());Hm.languages.typescript={ModuleKind:WH,JsxEmit:VH,NewLineKind:HH,ScriptTarget:zH,ModuleResolutionKind:UH,typescriptVersion:Cme,typescriptDefaults:$H,javascriptDefaults:qH,getTypeScriptWorker:wme,getJavaScriptWorker:yme};function TL(){return Ce(()=>import("./tsMode-Dj44YKby-CWl_rxwS.js"),__vite__mapDeps([18,1,2,3,4]))}Hm.languages.onLanguage("typescript",()=>TL().then(i=>i.setupTypeScript($H)));Hm.languages.onLanguage("javascript",()=>TL().then(i=>i.setupJavaScript(qH)));class Sme extends Os{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:p("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:oe.map,toggled:G.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:G.has("isInDiffEditor"),menu:{when:G.has("isInDiffEditor"),id:x.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(at),o=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}}Gt(Sme);class GH extends Os{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:p("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:G.has("isInDiffEditor")})}run(e,...t){const n=e.get(at),o=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",o)}}Gt(GH);class ZH extends Os{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:G.has("isInDiffEditor")})}run(e,...t){const n=e.get(at),o=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}}Gt(ZH);yn.appendMenuItem(x.EditorTitle,{command:{id:new ZH().desc.id,title:p("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:G.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:G.has("isInDiffEditor")},order:11,group:"1_diff",when:G.and(E.diffEditorRenderSideBySideInlineBreakpointReached,G.has("isInDiffEditor"))});yn.appendMenuItem(x.EditorTitle,{command:{id:new GH().desc.id,title:p("showMoves","Show Moved Code Blocks"),icon:oe.move,toggled:nf.create("config.diffEditor.experimental.showMoves",!0),precondition:G.has("isInDiffEditor")},order:10,group:"1_diff",when:G.has("isInDiffEditor")});const RL={value:p("diffEditor","Diff Editor"),original:"Diff Editor"};class Lme extends La{constructor(){super({id:"diffEditor.switchSide",title:{value:p("switchSide","Switch Side"),original:"Switch Side"},icon:oe.arrowSwap,precondition:G.has("isInDiffEditor"),f1:!0,category:RL})}runEditorCommand(e,t,n){const o=vf(e);if(o instanceof nc){if(n&&n.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}}Gt(Lme);class kme extends La{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:p("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:oe.close,precondition:E.comparingMovedCode,f1:!1,category:RL,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const o=vf(e);o instanceof nc&&o.exitCompareMove()}}Gt(kme);class Dme extends La{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:p("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:oe.fold,precondition:G.has("isInDiffEditor"),f1:!0,category:RL})}runEditorCommand(e,t,...n){const o=vf(e);o instanceof nc&&o.collapseAllUnchangedRegions()}}Gt(Dme);class xme extends La{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:p("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:oe.unfold,precondition:G.has("isInDiffEditor"),f1:!0,category:RL})}runEditorCommand(e,t,...n){const o=vf(e);o instanceof nc&&o.showAllUnchangedRegions()}}Gt(xme);const YH={value:p("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class _f extends Os{constructor(){super({id:_f.id,title:{value:p("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:YH,precondition:G.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=vf(e);t==null||t.accessibleDiffViewerNext()}}_f.id="editor.action.accessibleDiffViewer.next";yn.appendMenuItem(x.EditorTitle,{command:{id:_f.id,title:p("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:G.has("isInDiffEditor")},order:10,group:"2_diff",when:G.and(E.accessibleDiffViewerVisible.negate(),G.has("isInDiffEditor"))});class Lb extends Os{constructor(){super({id:Lb.id,title:{value:p("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:YH,precondition:G.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=vf(e);t==null||t.accessibleDiffViewerPrev()}}Lb.id="editor.action.accessibleDiffViewer.prev";function vf(i){var e;const t=i.get(vt),n=t.listDiffEditors(),o=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!o)return null;for(let r=0,a=n.length;r<a;r++){const l=n[r];if(l.getModifiedEditor().getId()===o.getId()||l.getOriginalEditor().getId()===o.getId())return l}const s=Ns();if(s)for(const r of n){const a=r.getContainerDomNode();if(Eme(a,s))return r}return null}function Eme(i,e){let t=e;for(;t;){if(t===i)return!0;t=t.parentElement}return!1}ct.registerCommandAlias("editor.action.diffReview.next",_f.id);Gt(_f);ct.registerCommandAlias("editor.action.diffReview.prev",Lb.id);Gt(Lb);var Nme=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Ime=function(i,e){return function(t,n){e(t,n,i)}},I2;const AL=new de("selectionAnchorSet",!1);let Nd=I2=class{static get(i){return i.getContribution(I2.ID)}constructor(i,e){this.editor=i,this.selectionAnchorSetContextKey=AL.bindTo(e),this.modelChangeListener=i.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const i=this.editor.getPosition();this.editor.changeDecorations(e=>{this.decorationId&&e.removeDecoration(this.decorationId),this.decorationId=e.addDecoration(ve.fromPositions(i,i),{description:"selection-anchor",stickiness:1,hoverMessage:new Kn().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ir(p("anchorSet","Anchor set at {0}:{1}",i.lineNumber,i.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const i=this.editor.getModel().getDecorationRange(this.decorationId);i&&this.editor.setPosition(i.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const i=this.editor.getModel().getDecorationRange(this.decorationId);if(i){const e=this.editor.getPosition();this.editor.setSelection(ve.fromPositions(i.getStartPosition(),e)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const i=this.decorationId;this.editor.changeDecorations(e=>{e.removeDecoration(i),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Nd.ID="editor.contrib.selectionAnchorController";Nd=I2=Nme([Ime(1,Ae)],Nd);class Mme extends ce{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:$i(2089,2080),weight:100}})}async run(e,t){var n;(n=Nd.get(t))===null||n===void 0||n.setSelectionAnchor()}}class Tme extends ce{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:AL})}async run(e,t){var n;(n=Nd.get(t))===null||n===void 0||n.goToSelectionAnchor()}}class Rme extends ce{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:AL,kbOpts:{kbExpr:E.editorTextFocus,primary:$i(2089,2089),weight:100}})}async run(e,t){var n;(n=Nd.get(t))===null||n===void 0||n.selectFromAnchorToCursor()}}class Ame extends ce{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:AL,kbOpts:{kbExpr:E.editorTextFocus,primary:9,weight:100}})}async run(e,t){var n;(n=Nd.get(t))===null||n===void 0||n.cancelSelectionAnchor()}}pt(Nd.ID,Nd,4);ie(Mme);ie(Tme);ie(Rme);ie(Ame);const Pme=M("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class Ome extends ce{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=xr.get(t))===null||n===void 0||n.jumpToBracket()}}class Fme extends ce{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:a$("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,n){var o;let s=!0;n&&n.selectBrackets===!1&&(s=!1),(o=xr.get(t))===null||o===void 0||o.selectToBracket(s)}}class Bme extends ce{constructor(){super({id:"editor.action.removeBrackets",label:p("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=xr.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class Wme{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class xr extends B{static get(e){return e.getContribution(xr.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Mt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(n=>{const o=n.getStartPosition(),s=e.bracketPairs.matchBracket(o);let r=null;if(s)s[0].containsPosition(o)&&!s[1].containsPosition(o)?r=s[1].getStartPosition():s[1].containsPosition(o)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(o);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(o);l&&l.range&&(r=l.range.getStartPosition())}}return r?new ve(r.lineNumber,r.column,r.lineNumber,r.column):new ve(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(o=>{const s=o.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(L.compareRangesUsingStarts);const[d,h]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?h.getEndPosition():h.getStartPosition(),h.containsPosition(s)){const c=a;a=l,l=c}}a&&l&&n.push(new ve(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const o=n.getPosition();let s=t.bracketPairs.matchBracket(o);s||(s=t.bracketPairs.findEnclosingBrackets(o)),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 n of this._lastBracketsData){const o=n.brackets;o&&(e[t++]={range:o[0],options:n.options},e[t++]={range:o[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),n=t.getVersionId();let o=[];this._lastVersionId===n&&(o=this._lastBracketsData);const s=[];let r=0;for(let c=0,u=e.length;c<u;c++){const g=e[c];g.isEmpty()&&(s[r++]=g.getStartPosition())}s.length>1&&s.sort(P.compare);const a=[];let l=0,d=0;const h=o.length;for(let c=0,u=s.length;c<u;c++){const g=s[c];for(;d<h&&o[d].position.isBefore(g);)d++;if(d<h&&o[d].position.equals(g))a[l++]=o[d];else{let m=t.bracketPairs.matchBracket(g,20),f=xr._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(g,20),f=xr._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new Wme(g,m,f)}}this._lastBracketsData=a,this._lastVersionId=n}}xr.ID="editor.contrib.bracketMatchingController";xr._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=je.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ci(Pme),position:Ts.Center}});xr._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=je.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});pt(xr.ID,xr,1);ie(Fme);ie(Ome);ie(Bme);yn.appendMenuItem(x.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:p({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class Vme{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const n=this._selection.startLineNumber,o=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&o===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(n)))if(this._isMovingLeft){const r=new L(n,o-1,n,o),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(n,s,n,s),a)}else{const r=new L(n,s,n,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(n,o,n,o),a)}}computeCursorState(e,t){return this._isMovingLeft?new ve(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ve(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class QH extends ce{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const n=[],o=t.getSelections();for(const s of o)n.push(new Vme(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class Hme extends QH{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:p("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:E.writable})}}class zme extends QH{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:p("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:E.writable})}}ie(Hme);ie(zme);class Ume extends ce{constructor(){super({id:"editor.action.transposeLetters",label:p("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const n=t.getModel(),o=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,d=n.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const h=l===d?r.getPosition():Lt.rightPosition(n,r.getPosition().lineNumber,r.getPosition().column),c=Lt.leftPosition(n,h),u=Lt.leftPosition(n,c),g=n.getValueInRange(L.fromPositions(u,c)),m=n.getValueInRange(L.fromPositions(c,h)),f=L.fromPositions(u,h);o.push(new En(f,m+g))}o.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}}ie(Ume);const Ju="9_cutcopypaste",Kme=da||document.queryCommandSupported("cut"),XH=da||document.queryCommandSupported("copy"),jme=typeof navigator.clipboard>"u"||Xs?document.queryCommandSupported("paste"):!0;function sP(i){return i.register(),i}const $me=Kme?sP(new sf({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:da?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:x.MenubarEditMenu,group:"2_ccp",title:p({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:x.EditorContext,group:Ju,title:p("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1},{menuId:x.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:x.SimpleEditorContext,group:Ju,title:p("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1}]})):void 0,qme=XH?sP(new sf({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:da?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:x.MenubarEditMenu,group:"2_ccp",title:p({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:x.EditorContext,group:Ju,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:x.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:x.SimpleEditorContext,group:Ju,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;yn.appendMenuItem(x.MenubarEditMenu,{submenu:x.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});yn.appendMenuItem(x.EditorContext,{submenu:x.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:Ju,order:3});yn.appendMenuItem(x.EditorContext,{submenu:x.EditorContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1,when:G.and(G.notEquals("resourceScheme","output"),E.editorTextFocus)});yn.appendMenuItem(x.EditorTitleContext,{submenu:x.EditorTitleContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});yn.appendMenuItem(x.ExplorerContext,{submenu:x.ExplorerContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});const dx=jme?sP(new sf({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:da?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:x.MenubarEditMenu,group:"2_ccp",title:p({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:x.EditorContext,group:Ju,title:p("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4},{menuId:x.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:x.SimpleEditorContext,group:Ju,title:p("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4}]})):void 0;class Gme extends ce{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:E.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(RN.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),RN.forceCopyWithSyntaxHighlighting=!1)}}function JH(i,e){i&&(i.addImplementation(1e4,"code-editor",(t,n)=>{const o=t.get(vt).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const s=o.getOption(37),r=o.getSelection();return r&&r.isEmpty()&&!s||o.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(of().execCommand(e),!0)))}JH($me,"cut");JH(qme,"copy");dx&&(dx.addImplementation(1e4,"code-editor",(i,e)=>{const t=i.get(vt),n=i.get(Od),o=t.getFocusedCodeEditor();return o&&o.hasTextFocus()?!o.getContainerDomNode().ownerDocument.execCommand("paste")&&fc?(async()=>{const s=await n.readText();if(s!==""){const r=Vv.INSTANCE.get(s);let a=!1,l=null,d=null;r&&(a=o.getOption(37)&&!!r.isFromEmptySelection,l=typeof r.multicursorText<"u"?r.multicursorText:null,d=r.mode),o.trigger("keyboard","paste",{text:s,pasteOnNewLine:a,multicursorText:l,mode:d})}})():!0:!1}),dx.addImplementation(0,"generic-dom",(i,e)=>(of().execCommand("paste"),!0)));XH&&ie(Gme);class Re{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+Re.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Re(this.value+Re.sep+e)}}Re.sep=".";Re.None=new Re("@@none@@");Re.Empty=new Re("");Re.QuickFix=new Re("quickfix");Re.Refactor=new Re("refactor");Re.RefactorExtract=Re.Refactor.append("extract");Re.RefactorInline=Re.Refactor.append("inline");Re.RefactorMove=Re.Refactor.append("move");Re.RefactorRewrite=Re.Refactor.append("rewrite");Re.Notebook=new Re("notebook");Re.Source=new Re("source");Re.SourceOrganizeImports=Re.Source.append("organizeImports");Re.SourceFixAll=Re.Source.append("fixAll");Re.SurroundWith=Re.Refactor.append("surround");var is;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(is||(is={}));function Zme(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>ez(e,t,i.include))||!i.includeSourceActions&&Re.Source.contains(e))}function Yme(i,e){const t=e.kind?new Re(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>ez(t,n,i.include))||!i.includeSourceActions&&t&&Re.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function ez(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class Qa{static fromUser(e,t){return!e||typeof e!="object"?new Qa(t.kind,t.apply,!1):new Qa(Qa.getKindFromUser(e,t.kind),Qa.getApplyFromUser(e,t.apply),Qa.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 Re(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class Qme{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let n;try{n=await this.provider.resolveCodeAction(this.action,e)}catch(o){Ti(o)}n&&(this.action.edit=n.edit)}return this}}const tz="editor.action.codeAction",rP="editor.action.quickFix",iz="editor.action.autoFix",nz="editor.action.refactor",oz="editor.action.sourceAction",aP="editor.action.organizeImports",lP="editor.action.fixAll";class J_ extends B{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:jn(e.diagnostics)?jn(t.diagnostics)?J_.codeActionsPreferredComparator(e,t):-1:jn(t.diagnostics)?1:J_.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(J_.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Re.QuickFix.contains(new Re(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 V6={actions:[],documentation:void 0};async function ev(i,e,t,n,o,s){var r;const a=n.filter||{},l={...a,excludes:[...a.excludes||[],Re.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:n.type},h=new JA(e,s),c=n.type===2,u=Xme(i,e,c?l:a),g=new Y,m=u.map(async _=>{try{o.report(_);const b=await _.provideCodeActions(e,t,d,h.token);if(b&&g.add(b),h.token.isCancellationRequested)return V6;const v=((b==null?void 0:b.actions)||[]).filter(w=>w&&Yme(a,w)),C=efe(_,v,a.include);return{actions:v.map(w=>new Qme(w,_)),documentation:C}}catch(b){if(ya(b))throw b;return Ti(b),V6}}),f=i.onDidChange(()=>{const _=i.all(e);vi(_,u)||h.cancel()});try{const _=await Promise.all(m),b=_.map(C=>C.actions).flat(),v=[...pa(_.map(C=>C.documentation)),...Jme(i,e,n,b)];return new J_(b,v,g)}finally{f.dispose(),h.dispose()}}function Xme(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(o=>Zme(t,new Re(o))):!0)}function*Jme(i,e,t,n){var o,s,r;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)===null||o===void 0?void 0:o.call(a,{trigger:t.type,only:(r=(s=t.filter)===null||s===void 0?void 0:s.include)===null||r===void 0?void 0:r.value},n.map(l=>l.action)))}function efe(i,e,t){if(!i.documentation)return;const n=i.documentation.map(o=>({kind:new Re(o.kind),command:o.command}));if(t){let o;for(const s of n)s.kind.contains(t)&&(o?o.kind.contains(s.kind)&&(o=s):o=s);if(o)return o==null?void 0:o.command}for(const o of e)if(o.kind){for(const s of n)if(s.kind.contains(new Re(o.kind)))return s.command}}var Oy;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions"})(Oy||(Oy={}));async function tfe(i,e,t,n,o=et.None){var s;const r=i.get(db),a=i.get(pi),l=i.get(ns),d=i.get(Pi);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(o),!o.isCancellationRequested&&!(!((s=e.action.edit)===null||s===void 0)&&s.edits.length&&!(await r.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Oy.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(h){const c=ife(h);d.error(typeof c=="string"?c:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function ife(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}ct.registerCommand("_executeCodeActionProvider",async function(i,e,t,n,o){if(!(e instanceof xe))throw Zs();const{codeActionProvider:s}=i.get(pe),r=i.get(ti).getModel(e);if(!r)throw Zs();const a=ve.isISelection(t)?ve.liftSelection(t):L.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Zs();const l=typeof n=="string"?new Re(n):void 0,d=await ev(s,r,a,{type:1,triggerAction:is.Default,filter:{includeSourceActions:!0,include:l}},Sd.None,et.None),h=[],c=Math.min(d.validActions.length,typeof o=="number"?o:0);for(let u=0;u<c;u++)h.push(d.validActions[u].resolve(et.None));try{return await Promise.all(h),d.validActions.map(u=>u.action)}finally{setTimeout(()=>d.dispose(),100)}});var nfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},ofe=function(i,e){return function(t,n){e(t,n,i)}},M2;let Fy=M2=class{constructor(i){this.keybindingService=i}getResolver(){const i=new bc(()=>this.keybindingService.getKeybindings().filter(e=>M2.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return e.command===aP?t={kind:Re.SourceOrganizeImports.value}:e.command===lP&&(t={kind:Re.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...Qa.fromUser(t,{kind:Re.None,apply:"never"})}}));return e=>{if(e.kind){const t=this.bestKeybindingForCodeAction(e,i.value);return t==null?void 0:t.resolvedKeybinding}}}bestKeybindingForCodeAction(i,e){if(!i.kind)return;const t=new Re(i.kind);return e.filter(n=>n.kind.contains(t)).filter(n=>n.preferred?i.isPreferred:!0).reduceRight((n,o)=>n?n.kind.contains(o.kind)?o:n:o,void 0)}};Fy.codeActionCommands=[nz,tz,oz,aP,lP];Fy=M2=nfe([ofe(0,Tt)],Fy);M("symbolIcon.arrayForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.booleanForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("symbolIcon.colorForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.constantForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("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."));M("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."));M("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."));M("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."));M("symbolIcon.fileForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.folderForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("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."));M("symbolIcon.keyForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.keywordForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("symbolIcon.moduleForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.namespaceForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.nullForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.numberForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.objectForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.operatorForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.packageForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.propertyForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.referenceForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.snippetForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.stringForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.structForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.textForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.typeParameterForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.unitForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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 sz=Object.freeze({kind:Re.Empty,title:p("codeAction.widget.id.more","More Actions...")}),sfe=Object.freeze([{kind:Re.QuickFix,title:p("codeAction.widget.id.quickfix","Quick Fix")},{kind:Re.RefactorExtract,title:p("codeAction.widget.id.extract","Extract"),icon:oe.wrench},{kind:Re.RefactorInline,title:p("codeAction.widget.id.inline","Inline"),icon:oe.wrench},{kind:Re.RefactorRewrite,title:p("codeAction.widget.id.convert","Rewrite"),icon:oe.wrench},{kind:Re.RefactorMove,title:p("codeAction.widget.id.move","Move"),icon:oe.wrench},{kind:Re.SurroundWith,title:p("codeAction.widget.id.surround","Surround With"),icon:oe.symbolSnippet},{kind:Re.Source,title:p("codeAction.widget.id.source","Source Action"),icon:oe.symbolFile},sz]);function rfe(i,e,t){if(!e)return i.map(s=>{var r;return{kind:"action",item:s,group:sz,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!(!((r=s.action.edit)===null||r===void 0)&&r.edits.length)}});const n=sfe.map(s=>({group:s,actions:[]}));for(const s of i){const r=s.action.kind?new Re(s.action.kind):Re.None;for(const a of n)if(a.group.kind.contains(r)){a.actions.push(s);break}}const o=[];for(const s of n)if(s.actions.length){o.push({kind:"header",group:s.group});for(const r of s.actions){const a=s.group;o.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:oe.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return o}var afe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},H6=function(i,e){return function(t,n){e(t,n,i)}},T2,Ip;(function(i){i.Hidden={type:0};class e{constructor(n,o,s,r){this.actions=n,this.trigger=o,this.editorPosition=s,this.widgetPosition=r,this.type=1}}i.Showing=e})(Ip||(Ip={}));let eg=T2=class extends B{constructor(i,e,t){super(),this._editor=i,this._keybindingService=e,this._onClick=this._register(new A),this.onClick=this._onClick.event,this._state=Ip.Hidden,this._iconClasses=[],this._domNode=ee("div.lightBulbWidget"),this._register(Pt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(AZ(this._domNode,n=>{var o;if(this.state.type!==1)return;const s=this._editor.getOption(64).experimental.showAiIcon;if((s===jo.On||s===jo.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){const h=this.state.actions.validActions[0].action;if(!((o=h.command)===null||o===void 0)&&o.id){t.executeCommand(h.command.id,...h.command.arguments||[]),n.preventDefault();return}}this._editor.focus(),n.preventDefault();const{top:r,height:a}=ji(this._domNode),l=this._editor.getOption(66);let d=Math.floor(l/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(d+=l),this._onClick.fire({x:n.posx,y:r+a+d,actions:this.state.actions,trigger:this.state.trigger})})),this._register($(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(le.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var n,o,s,r;this._preferredKbLabel=(o=(n=this._keybindingService.lookupKeybinding(iz))===null||n===void 0?void 0:n.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(r=(s=this._keybindingService.lookupKeybinding(rP))===null||s===void 0?void 0:s.getLabel())!==null&&r!==void 0?r:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(i,e,t){if(i.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:r}=o.validatePosition(t),a=o.getOptions().tabSize,l=n.get(50),d=o.getLineContent(s),h=ZS(d,a),c=l.spaceWidth*h>22,u=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let g=s;if(!c){if(s>1&&!u(s-1))g-=1;else if(!u(s+1))g+=1;else if(r*l.spaceWidth<22)return this.hide()}this.state=new Ip.Showing(i,e,t,{position:{lineNumber:g,column:o.getLineContent(g).match(/^\S\s*$/)?2:1},preference:T2._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==Ip.Hidden&&(this.state=Ip.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(i){this._state=i,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){var i,e,t;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))},o=()=>{this._quickFixKbLabel?this.title=p("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=p("codeAction","Show Code Actions")};let s;const r=this._editor.getOption(64).experimental.showAiIcon;if(r===jo.On||r===jo.OnCode)if(r===jo.On&&this.state.actions.allAIFixes)if(s=oe.sparkleFilled,this.state.actions.allAIFixes&&this.state.actions.validActions.length===1)if(((i=this.state.actions.validActions[0].action.command)===null||i===void 0?void 0:i.id)==="inlineChat.start"){const a=(t=(e=this._keybindingService.lookupKeybinding("inlineChat.start"))===null||e===void 0?void 0:e.getLabel())!==null&&t!==void 0?t:void 0;this.title=a?p("codeActionStartInlineChatWithKb","Start Inline Chat ({0})",a):p("codeActionStartInlineChat","Start Inline Chat")}else this.title=p("codeActionTriggerAiAction","Trigger AI Action");else o();else this.state.actions.hasAutoFix?(this.state.actions.hasAIFix?s=oe.lightbulbSparkleAutofix:s=oe.lightbulbAutofix,n()):this.state.actions.hasAIFix?(s=oe.lightbulbSparkle,o()):(s=oe.lightBulb,o());else this.state.actions.hasAutoFix?(s=oe.lightbulbAutofix,n()):(s=oe.lightBulb,o());this._iconClasses=Ee.asClassNameArray(s),this._domNode.classList.add(...this._iconClasses)}set title(i){this._domNode.title=i}};eg.ID="editor.contrib.lightbulbWidget";eg._posPref=[0];eg=T2=afe([H6(1,Tt),H6(2,pi)],eg);var lfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},z6=function(i,e){return function(t,n){e(t,n,i)}},R2;let Id=R2=class{constructor(i,e,t){this._options=i,this._languageService=e,this._openerService=t,this._onDidRenderAsync=new A,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(i,e,t){if(!i)return{element:document.createElement("span"),dispose:()=>{}};const n=new Y,o=n.add(rL(i,{...this._getRenderOptions(i,n),...e},t));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>n.dispose()}}_getRenderOptions(i,e){return{codeBlockRenderer:async(t,n)=>{var o,s,r;let a;t?a=this._languageService.getLanguageIdByLanguageName(t):this._options.editor&&(a=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),a||(a=Is);const l=await ise(this._languageService,n,a),d=document.createElement("span");if(d.innerHTML=(r=(s=R2._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(l))!==null&&r!==void 0?r:l,this._options.editor){const h=this._options.editor.getOption(50);Pn(d,h)}else this._options.codeBlockFontFamily&&(d.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(d.style.fontSize=this._options.codeBlockFontSize),d},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:t=>rz(this._openerService,t,i.isTrusted),disposables:e}}}};Id._ttpTokenizer=Td("tokenizeToString",{createHTML(i){return i}});Id=R2=lfe([z6(1,Xt),z6(2,as)],Id);async function rz(i,e,t){try{return await i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:dfe(t)})}catch(n){return Ke(n),!1}}function dfe(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var hfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},U6=function(i,e){return function(t,n){e(t,n,i)}},WC;let Xo=WC=class{static get(i){return i.getContribution(WC.ID)}constructor(i,e,t){this._openerService=t,this._messageWidget=new un,this._messageListeners=new Y,this._mouseOverMessage=!1,this._editor=i,this._visible=WC.MESSAGE_VISIBLE.bindTo(e)}dispose(){var i;(i=this._message)===null||i===void 0||i.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(i,e){ir(Mh(i)?i.value:i),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Mh(i)?rL(i,{actionHandler:{callback:n=>rz(this._openerService,n,Mh(i)?i.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new K6(this._editor,e,typeof i=="string"?i:this._message.element),this._messageListeners.add(le.debounce(this._editor.onDidBlurEditorText,(n,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&An(Ns(),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($(this._messageWidget.value.getDomNode(),ae.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add($(this._messageWidget.value.getDomNode(),ae.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let t;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(t?t.containsPosition(n.target.position)||this.closeMessage():t=new L(e.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(K6.fadeOut(this._messageWidget.value))}};Xo.ID="editor.contrib.messageController";Xo.MESSAGE_VISIBLE=new de("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));Xo=WC=hfe([U6(1,Ae),U6(2,as)],Xo);const cfe=gn.bindToContribution(Xo.get);re(new cfe({id:"leaveEditorMessage",precondition:Xo.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:130,primary:9}}));let K6=class{static fadeOut(i){const e=()=>{i.dispose(),clearTimeout(t),i.getDomNode().removeEventListener("animationend",e)},t=setTimeout(e,110);return i.getDomNode().addEventListener("animationend",e),i.getDomNode().classList.add("fadeOut"),{dispose:e}}constructor(i,{lineNumber:e,column:t},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=i,this._editor.revealLinesInCenterIfOutsideViewport(e,e,0),this._position={lineNumber:e,column:t},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");typeof n=="string"?(s.classList.add("message"),s.textContent=n):(n.classList.add("message"),s.appendChild(n)),this._domNode.appendChild(s);const r=document.createElement("div");r.classList.add("anchor","below"),this._domNode.appendChild(r),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(i){this._domNode.classList.toggle("below",i===2)}};pt(Xo.ID,Xo,4);var az=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},A2=function(i,e){return function(t,n){e(t,n,i)}};const lz="acceptSelectedCodeAction",dz="previewSelectedCodeAction";class ufe{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,n){var o,s;n.text.textContent=(s=(o=e.group)===null||o===void 0?void 0:o.title)!==null&&s!==void 0?s:""}disposeTemplate(e){}}let P2=class{get templateId(){return"action"}constructor(i,e){this._supportsPreview=i,this._keybindingService=e}renderTemplate(i){i.classList.add(this.templateId);const e=document.createElement("div");e.className="icon",i.append(e);const t=document.createElement("span");t.className="title",i.append(t);const n=new mb(i,Ls);return{container:i,icon:e,text:t,keybinding:n}}renderElement(i,e,t){var n,o,s;if(!((n=i.group)===null||n===void 0)&&n.icon?(t.icon.className=Ee.asClassName(i.group.icon),i.group.icon.color&&(t.icon.style.color=he(i.group.icon.color.id))):(t.icon.className=Ee.asClassName(oe.lightBulb),t.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!i.item||!i.label)return;t.text.textContent=hz(i.label),t.keybinding.set(i.keybinding),YZ(!!i.keybinding,t.keybinding.element);const r=(o=this._keybindingService.lookupKeybinding(lz))===null||o===void 0?void 0:o.getLabel(),a=(s=this._keybindingService.lookupKeybinding(dz))===null||s===void 0?void 0:s.getLabel();t.container.classList.toggle("option-disabled",i.disabled),i.disabled?t.container.title=i.label:r&&a?this._supportsPreview&&i.canPreview?t.container.title=p({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",r,a):t.container.title=p({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",r):t.container.title=""}disposeTemplate(i){}};P2=az([A2(1,Tt)],P2);class gfe extends UIEvent{constructor(){super("acceptSelectedAction")}}class j6 extends UIEvent{constructor(){super("previewSelectedAction")}}function pfe(i){if(i.kind==="action")return i.label}let O2=class extends B{constructor(i,e,t,n,o,s){super(),this._delegate=n,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Ri),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const r={getHeight:a=>a.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:a=>a.kind};this._list=this._register(new Ar(i,this.domNode,r,[new P2(e,this._keybindingService),new ufe],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:pfe},accessibilityProvider:{getAriaLabel:a=>{if(a.kind==="action"){let l=a.label?hz(a==null?void 0:a.label):"";return a.disabled&&(l=p({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",l,a.disabled)),l}return null},getWidgetAriaLabel:()=>p({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:a=>a.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(wg),this._register(this._list.onMouseClick(a=>this.onListClick(a))),this._register(this._list.onMouseOver(a=>this.onListHover(a))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(a=>this.onListSelection(a))),this._allMenuItems=t,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(i){return!i.disabled&&i.kind==="action"}hide(i){this._delegate.onHide(i),this.cts.cancel(),this._contextViewService.hideContextView()}layout(i){const e=this._allMenuItems.filter(s=>s.kind==="header").length,t=this._allMenuItems.length*this._actionLineHeight+e*this._headerLineHeight-e*this._actionLineHeight;this._list.layout(t);let n=i;if(this._allMenuItems.length>=50)n=380;else{const s=this._allMenuItems.map((r,a)=>{const l=this.domNode.ownerDocument.getElementById(this._list.getElementID(a));if(l){l.style.width="auto";const d=l.getBoundingClientRect().width;return l.style.width="",d}return 0});n=Math.max(...s,i)}const o=Math.min(t,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(o,n),this.domNode.style.height=`${o}px`,this._list.domFocus(),n}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(i){const e=this._list.getFocus();if(e.length===0)return;const t=e[0],n=this._list.element(t);if(!this.focusCondition(n))return;const o=i?new j6:new gfe;this._list.setSelection([t],o)}onListSelection(i){if(!i.elements.length)return;const e=i.elements[0];e.item&&this.focusCondition(e)?this._delegate.onSelect(e.item,i.browserEvent instanceof j6):this._list.setSelection([])}onFocus(){var i,e;this._list.domFocus();const t=this._list.getFocus();if(t.length===0)return;const n=t[0],o=this._list.element(n);(e=(i=this._delegate).onFocus)===null||e===void 0||e.call(i,o.item)}async onListHover(i){const e=i.element;if(e&&e.item&&this.focusCondition(e)){if(this._delegate.onHover&&!e.disabled&&e.kind==="action"){const t=await this._delegate.onHover(e.item,this.cts.token);e.canPreview=t?t.canPreview:void 0}i.index&&this._list.splice(i.index,1,[e])}this._list.setFocus(typeof i.index=="number"?[i.index]:[])}onListClick(i){i.element&&this.focusCondition(i.element)&&this._list.setFocus([])}};O2=az([A2(4,Rd),A2(5,Tt)],O2);function hz(i){return i.replace(/\r\n|\r|\n/g," ")}var mfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},hx=function(i,e){return function(t,n){e(t,n,i)}};M("actionBar.toggledBackground",{dark:du,light:du,hcDark:du,hcLight:du},p("actionBar.toggledBackground","Background color for toggled action items in action bar."));const tg={Visible:new de("codeActionMenuVisible",!1,p("codeActionMenuVisible","Whether the action widget list is visible"))},kg=tt("actionWidgetService");let ig=class extends B{get isVisible(){return tg.Visible.getValue(this._contextKeyService)||!1}constructor(i,e,t){super(),this._contextViewService=i,this._contextKeyService=e,this._instantiationService=t,this._list=this._register(new un)}show(i,e,t,n,o,s,r){const a=tg.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(O2,i,e,t,n);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(a.set(!0),this._renderWidget(d,l,r??[])),onHide:d=>{a.reset(),this._onWidgetClosed(d)}},s,!1)}acceptSelected(i){var e;(e=this._list.value)===null||e===void 0||e.acceptSelected(i)}focusPrevious(){var i,e;(e=(i=this._list)===null||i===void 0?void 0:i.value)===null||e===void 0||e.focusPrevious()}focusNext(){var i,e;(e=(i=this._list)===null||i===void 0?void 0:i.value)===null||e===void 0||e.focusNext()}hide(){var i;(i=this._list.value)===null||i===void 0||i.hide(),this._list.clear()}_renderWidget(i,e,t){var n;const o=document.createElement("div");if(o.classList.add("action-widget"),i.appendChild(o),this._list.value=e,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Y,r=document.createElement("div"),a=i.appendChild(r);a.classList.add("context-view-block"),s.add($(a,ae.MOUSE_DOWN,g=>g.stopPropagation()));const l=document.createElement("div"),d=i.appendChild(l);d.classList.add("context-view-pointerBlock"),s.add($(d,ae.POINTER_MOVE,()=>d.remove())),s.add($(d,ae.MOUSE_DOWN,()=>d.remove()));let h=0;if(t.length){const g=this._createActionBar(".action-widget-action-bar",t);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),h=g.getContainer().offsetWidth)}const c=(n=this._list.value)===null||n===void 0?void 0:n.layout(h);o.style.width=`${c}px`;const u=s.add(bl(i));return s.add(u.onDidBlur(()=>this.hide())),s}_createActionBar(i,e){if(!e.length)return;const t=ee(i),n=new or(t);return n.push(e,{icon:!1,label:!0}),n}_onWidgetClosed(i){var e;(e=this._list.value)===null||e===void 0||e.hide(i)}};ig=mfe([hx(0,Rd),hx(1,Ae),hx(2,Me)],ig);lt(kg,ig,1);const kb=1100;Gt(class extends Os{constructor(){super({id:"hideCodeActionWidget",title:{value:p("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:tg.Visible,keybinding:{weight:kb,primary:9,secondary:[1033]}})}run(i){i.get(kg).hide()}});Gt(class extends Os{constructor(){super({id:"selectPrevCodeAction",title:{value:p("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:tg.Visible,keybinding:{weight:kb,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(kg);e instanceof ig&&e.focusPrevious()}});Gt(class extends Os{constructor(){super({id:"selectNextCodeAction",title:{value:p("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:tg.Visible,keybinding:{weight:kb,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(kg);e instanceof ig&&e.focusNext()}});Gt(class extends Os{constructor(){super({id:lz,title:{value:p("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:tg.Visible,keybinding:{weight:kb,primary:3,secondary:[2137]}})}run(i){const e=i.get(kg);e instanceof ig&&e.acceptSelected()}});Gt(class extends Os{constructor(){super({id:dz,title:{value:p("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:tg.Visible,keybinding:{weight:kb,primary:2051}})}run(i){const e=i.get(kg);e instanceof ig&&e.acceptSelected(!0)}});const cz=new de("supportedCodeAction","");class ffe extends B{constructor(e,t,n,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=o,this._autoTriggerTimer=this._register(new Mr),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(n=>VR(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:is.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){var t;if(!this._editor.hasModel())return;const n=this._editor.getModel(),o=this._editor.getSelection();if(o.isEmpty()&&e.type===2){const{lineNumber:s,column:r}=o.getPosition(),a=n.getLineContent(s);if(a.length===0){if(((t=this._editor.getOption(64).experimental)===null||t===void 0?void 0:t.showAiIcon)!==jo.On)return}else if(r===1){if(/\s/.test(a[0]))return}else if(r===n.getLineMaxColumn(s)){if(/\s/.test(a[a.length-1]))return}else if(/\s/.test(a[r-2])&&/\s/.test(a[r-1]))return}return o}}var su;(function(i){i.Empty={type:0};class e{constructor(n,o,s){this.trigger=n,this.position=o,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(ya(r))return uz;throw r})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(su||(su={}));const uz=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class _fe extends B{constructor(e,t,n,o,s,r){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new un),this._state=su.Empty,this._onDidChangeState=this._register(new A),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=cz.bindTo(o),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(su.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(su.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(n=>{var o;return(o=n.providedCodeActionKinds)!==null&&o!==void 0?o:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new ffe(this._editor,this._markerService,n=>{var o;if(!n){this.setState(su.Empty);return}const s=n.selection.getStartPosition(),r=Yi(async a=>{var l,d,h,c,u,g;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===is.QuickFix||!((d=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Re.QuickFix))){const m=await ev(this._registry,e,n.selection,n.trigger,Sd.None,a),f=[...m.allActions];if(a.isCancellationRequested)return uz;if(!(!((h=m.validActions)===null||h===void 0)&&h.some(_=>_.action.kind?Re.QuickFix.contains(new Re(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const b=n.selection.getPosition();let v=b,C=Number.MAX_VALUE;const w=[...m.validActions];for(const k of _){const D=k.endColumn,N=k.endLineNumber,R=k.startLineNumber;if(N===b.lineNumber||R===b.lineNumber){v=new P(N,D);const z={type:n.trigger.type,triggerAction:n.trigger.triggerAction,filter:{include:!((c=n.trigger.filter)===null||c===void 0)&&c.include?(u=n.trigger.filter)===null||u===void 0?void 0:u.include:Re.QuickFix},autoApply:n.trigger.autoApply,context:{notAvailableMessage:((g=n.trigger.context)===null||g===void 0?void 0:g.notAvailableMessage)||"",position:v}},H=new ve(v.lineNumber,v.column,v.lineNumber,v.column),W=await ev(this._registry,e,H,z,Sd.None,a);if(W.validActions.length!==0){for(const j of W.validActions)j.highlightRange=j.action.isPreferred;m.allActions.length===0&&f.push(...W.allActions),Math.abs(b.column-D)<C?w.unshift(...W.validActions):w.push(...W.validActions)}C=Math.abs(b.column-D)}}const y=w.filter((k,D,N)=>N.findIndex(R=>R.action.title===k.action.title)===D);return y.sort((k,D)=>k.action.isPreferred&&!D.action.isPreferred?-1:!k.action.isPreferred&&D.action.isPreferred||k.action.isAI&&!D.action.isAI?1:!k.action.isAI&&D.action.isAI?-1:0),{validActions:y,allActions:f,documentation:m.documentation,hasAutoFix:m.hasAutoFix,hasAIFix:m.hasAIFix,allAIFixes:m.allAIFixes,dispose:()=>{m.dispose()}}}}}return ev(this._registry,e,n.selection,n.trigger,Sd.None,a)});n.trigger.type===1&&((o=this._progressService)===null||o===void 0||o.showWhile(r,250)),this.setState(new su.Triggered(n.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:is.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 vfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Hl=function(i,e){return function(t,n){e(t,n,i)}},VC;const bfe="quickfix-edit-highlight";let sc=VC=class extends B{static get(i){return i.getContribution(VC.ID)}constructor(i,e,t,n,o,s,r,a,l,d){super(),this._commandService=r,this._configurationService=a,this._actionWidgetService=l,this._instantiationService=d,this._activeCodeActions=this._register(new un),this._showDisabled=!1,this._disposed=!1,this._editor=i,this._model=this._register(new _fe(this._editor,o.codeActionProvider,e,t,s,a)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new bc(()=>{const h=this._editor.getContribution(eg.ID);return h&&this._register(h.onClick(c=>this.showCodeActionList(c.actions,c,{includeDisabledActions:!1,fromLightbulb:!0}))),h}),this._resolver=n.createInstance(Fy),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(i,e,t){return this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(i,e,t,n){var o;if(!this._editor.hasModel())return;(o=Xo.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:e,filter:t,autoApply:n,context:{notAvailableMessage:i,position:s}})}_trigger(i){return this._model.trigger(i)}async _applyCodeAction(i,e,t){try{await this._instantiationService.invokeFunction(tfe,i,Oy.FromCodeActions,{preview:t,editor:this._editor})}finally{e&&this._trigger({type:2,triggerAction:is.QuickFix,filter:{}})}}async update(i){var e,t,n,o,s,r,a;if(i.type!==1){(e=this._lightBulbWidget.rawValue)===null||e===void 0||e.hide();return}let l;try{l=await i.actions}catch(d){Ke(d);return}if(!this._disposed)if((t=this._lightBulbWidget.value)===null||t===void 0||t.update(l,i.trigger,i.position),i.trigger.type===1){if(!((n=i.trigger.filter)===null||n===void 0)&&n.include){const h=this.tryGetValidActionToApply(i.trigger,l);if(h){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),await this._applyCodeAction(h,!1,!1)}finally{l.dispose()}return}if(i.trigger.context){const c=this.getInvalidActionThatWouldHaveBeenApplied(i.trigger,l);if(c&&c.action.disabled){(s=Xo.get(this._editor))===null||s===void 0||s.showMessage(c.action.disabled,i.trigger.context.position),l.dispose();return}}}const d=!!(!((r=i.trigger.filter)===null||r===void 0)&&r.include);if(i.trigger.context&&(!l.allActions.length||!d&&!l.validActions.length)){(a=Xo.get(this._editor))===null||a===void 0||a.showMessage(i.trigger.context.notAvailableMessage,i.trigger.context.position),this._activeCodeActions.value=l,l.dispose();return}this._activeCodeActions.value=l,this.showCodeActionList(l,this.toCoords(i.position),{includeDisabledActions:d,fromLightbulb:!1})}else this._actionWidgetService.isVisible?l.dispose():this._activeCodeActions.value=l}getInvalidActionThatWouldHaveBeenApplied(i,e){if(e.allActions.length&&(i.autoApply==="first"&&e.validActions.length===0||i.autoApply==="ifSingle"&&e.allActions.length===1))return e.allActions.find(({action:t})=>t.disabled)}tryGetValidActionToApply(i,e){if(e.validActions.length&&(i.autoApply==="first"&&e.validActions.length>0||i.autoApply==="ifSingle"&&e.validActions.length===1))return e.validActions[0]}async showCodeActionList(i,e,t){const n=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=t.includeDisabledActions&&(this._showDisabled||i.validActions.length===0)?i.allActions:i.validActions;if(!s.length)return;const r=P.isIPosition(e)?this.toCoords(e):e,a={onSelect:async(l,d)=>{this._applyCodeAction(l,!0,!!d),this._actionWidgetService.hide(),n.clear()},onHide:()=>{var l;(l=this._editor)===null||l===void 0||l.focus(),n.clear()},onHover:async(l,d)=>{var h;if(await l.resolve(d),!d.isCancellationRequested)return{canPreview:!!(!((h=l.action.edit)===null||h===void 0)&&h.edits.length)}},onFocus:l=>{var d,h;if(l&&l.highlightRange&&l.action.diagnostics){const c=[{range:l.action.diagnostics[0],options:VC.DECORATION}];n.set(c);const u=l.action.diagnostics[0],g=(h=(d=this._editor.getModel())===null||d===void 0?void 0:d.getWordAtPosition({lineNumber:u.startLineNumber,column:u.startColumn}))===null||h===void 0?void 0:h.word;Qh(p("editingNewSelection","Context: {0} at line {1} and column {2}.",g,u.startLineNumber,u.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,rfe(s,this._shouldShowHeaders(),this._resolver.getResolver()),a,r,o,this._getActionBarActions(i,e,t))}toCoords(i){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(i,1),this._editor.render();const e=this._editor.getScrolledVisiblePosition(i),t=ji(this._editor.getDomNode()),n=t.left+e.left,o=t.top+e.top+e.height;return{x:n,y:o}}_shouldShowHeaders(){var i;const e=(i=this._editor)===null||i===void 0?void 0:i.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e==null?void 0:e.uri})}_getActionBarActions(i,e,t){if(t.fromLightbulb)return[];const n=i.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var r;return this._commandService.executeCommand(o.id,...(r=o.arguments)!==null&&r!==void 0?r:[])}}});return t.includeDisabledActions&&i.validActions.length>0&&i.allActions.length!==i.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(i,e,t))}:{id:"showMoreActions",label:p("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(i,e,t))}),n}};sc.ID="editor.contrib.codeActionController";sc.DECORATION=je.register({description:"quickfix-highlight",className:bfe});sc=VC=vfe([Hl(1,Al),Hl(2,Ae),Hl(3,Me),Hl(4,pe),Hl(5,Sc),Hl(6,pi),Hl(7,at),Hl(8,kg),Hl(9,Me)],sc);Rr((i,e)=>{((n,o)=>{o&&e.addRule(`.monaco-editor ${n} { background-color: ${o}; }`)})(".quickfix-edit-highlight",i.getColor(rl));const t=i.getColor(ph);t&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${ua(i.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`)});function Db(i){return G.regex(cz.keys()[0],new RegExp("(\\s|^)"+Ms(i.value)+"\\b"))}const dP={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 Dg(i,e,t,n,o=is.Default){if(i.hasModel()){const s=sc.get(i);s==null||s.manualTriggerAtCurrentPosition(e,o,t,n)}}class Cfe extends ce{constructor(){super({id:rP,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:G.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:2137,weight:100}})}run(e,t){return Dg(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,is.QuickFix)}}class wfe extends gn{constructor(){super({id:tz,precondition:G.and(E.writable,E.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:dP}]}})}runEditorCommand(e,t,n){const o=Qa.fromUser(n,{kind:Re.Empty,apply:"ifSingle"});return Dg(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?p("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):p("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):o.preferred?p("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):p("editor.action.codeAction.noneMessage","No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}}class yfe extends ce{constructor(){super({id:nz,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:G.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:G.and(E.writable,Db(Re.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:dP}]}})}run(e,t,n){const o=Qa.fromUser(n,{kind:Re.Refactor,apply:"never"});return Dg(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?p("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):p("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):o.preferred?p("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):p("editor.action.refactor.noneMessage","No refactorings available"),{include:Re.Refactor.contains(o.kind)?o.kind:Re.None,onlyIncludePreferredActions:o.preferred},o.apply,is.Refactor)}}class Sfe extends ce{constructor(){super({id:oz,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:G.and(E.writable,E.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:G.and(E.writable,Db(Re.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:dP}]}})}run(e,t,n){const o=Qa.fromUser(n,{kind:Re.Source,apply:"never"});return Dg(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?p("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):p("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):o.preferred?p("editor.action.source.noneMessage.preferred","No preferred source actions available"):p("editor.action.source.noneMessage","No source actions available"),{include:Re.Source.contains(o.kind)?o.kind:Re.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,is.SourceAction)}}class Lfe extends ce{constructor(){super({id:aP,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:G.and(E.writable,Db(Re.SourceOrganizeImports)),kbOpts:{kbExpr:E.textInputFocus,primary:1581,weight:100}})}run(e,t){return Dg(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:Re.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",is.OrganizeImports)}}class kfe extends ce{constructor(){super({id:lP,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:G.and(E.writable,Db(Re.SourceFixAll))})}run(e,t){return Dg(t,p("fixAll.noneMessage","No fix all action available"),{include:Re.SourceFixAll,includeSourceActions:!0},"ifSingle",is.FixAll)}}class Dfe extends ce{constructor(){super({id:iz,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:G.and(E.writable,Db(Re.QuickFix)),kbOpts:{kbExpr:E.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Dg(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Re.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",is.AutoFix)}}pt(sc.ID,sc,3);pt(eg.ID,eg,4);ie(Cfe);ie(yfe);ie(Sfe);ie(Lfe);ie(Dfe);ie(kfe);re(new wfe);ai.as(ka.Configuration).registerConfiguration({...tL,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:p("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});ai.as(ka.Configuration).registerConfiguration({...tL,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 F2{constructor(){this.lenses=[],this._disposables=new Y}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}async function gz(i,e,t){const n=i.ordered(e),o=new Map,s=new F2,r=n.map(async(a,l)=>{o.set(a,l);try{const d=await Promise.resolve(a.provideCodeLenses(e,t));d&&s.add(d,a)}catch(d){Ti(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:o.get(a.provider)<o.get(l.provider)?-1:o.get(a.provider)>o.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),s}ct.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;Et(xe.isUri(t)),Et(typeof n=="number"||!n);const{codeLensProvider:o}=i.get(pe),s=i.get(ti).getModel(t);if(!s)throw Zs();const r=[],a=new Y;return gz(o,s,et.None).then(l=>{a.add(l);const d=[];for(const h of l.lenses)n==null||h.symbol.command?r.push(h.symbol):n-- >0&&h.provider.resolveCodeLens&&d.push(Promise.resolve(h.provider.resolveCodeLens(s,h.symbol,et.None)).then(c=>r.push(c||h.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var xfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Efe=function(i,e){return function(t,n){e(t,n,i)}};const pz=tt("ICodeLensCache");class $6{constructor(e,t){this.lineCount=e,this.data=t}}let B2=class{constructor(i){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Cc(20,.75);const e="codelens/cache";r_(si,()=>i.remove(e,1));const t="codelens/cache2",n=i.get(t,1,"{}");this._deserialize(n),le.once(i.onWillSaveState)(o=>{o.reason===n0.SHUTDOWN&&i.store(t,this._serialize(),1,1)})}put(i,e){const t=e.lenses.map(s=>{var r;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(r=s.symbol.command)===null||r===void 0?void 0:r.title}}}),n=new F2;n.add({lenses:t,dispose:()=>{}},this._fakeProvider);const o=new $6(i.getLineCount(),n);this._cache.set(i.uri.toString(),o)}get(i){const e=this._cache.get(i.uri.toString());return e&&e.lineCount===i.getLineCount()?e.data:void 0}delete(i){this._cache.delete(i.uri.toString())}_serialize(){const i=Object.create(null);for(const[e,t]of this._cache){const n=new Set;for(const o of t.data.lenses)n.add(o.symbol.range.startLineNumber);i[e]={lineCount:t.lineCount,lines:[...n.values()]}}return JSON.stringify(i)}_deserialize(i){try{const e=JSON.parse(i);for(const t in e){const n=e[t],o=[];for(const r of n.lines)o.push({range:new L(r,1,r,11)});const s=new F2;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(t,new $6(n.lineCount,s))}}catch{}}};B2=xfe([Efe(0,Pr)],B2);lt(pz,B2,1);class Nfe{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class PL{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${PL._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let o=!1;for(let s=0;s<e.length;s++){const r=e[s];if(r&&(o=!0,r.command)){const a=Th(r.command.title.trim());r.command.id?(n.push(ee("a",{id:String(s),title:r.command.tooltip,role:"button"},...a)),this._commands.set(String(s),r.command)):n.push(ee("span",{title:r.command.tooltip},...a)),s+1<e.length&&n.push(ee("span",void 0," | "))}}o?(On(this._domNode,...n),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):On(this._domNode,ee("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}}PL._idPool=0;class cx{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 n=0,o=t.length;n<o;n++)this._addDecorationsCallbacks[n](t[n])}}const q6=je.register({collapseOnReplaceEdit:!0,description:"codelens"});class G6{constructor(e,t,n,o,s,r){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a;const l=[];this._data.forEach((d,h)=>{d.symbol.command&&l.push(d.symbol),n.addDecoration({range:d.symbol.range,options:q6},c=>this._decorationIds[h]=c),a?a=L.plusRange(a,d.symbol.range):a=L.lift(d.symbol.range)}),this._viewZone=new Nfe(a.startLineNumber-1,s,r),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new PL(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const n=this._editor.getModel().getDecorationRange(e),o=this._data[t].symbol;return!!(n&&L.isEmpty(o.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,o)=>{t.addDecoration({range:n.symbol.range,options:q6},s=>this._decorationIds[o]=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 n=e.getDecorationRange(this._decorationIds[t]);n&&(this._data[t].symbol.range=n)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const n=e[t];if(n){const{symbol:o}=this._data[t];o.command=n.command||o.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 Ife=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Zf=function(i,e){return function(t,n){e(t,n,i)}};let zm=class{constructor(i,e,t,n,o,s){this._editor=i,this._languageFeaturesService=e,this._commandService=n,this._notificationService=o,this._codeLensCache=s,this._disposables=new Y,this._localToDispose=new Y,this._lenses=[],this._oldCodeLensModels=new Y,this._provideCodeLensDebounce=t.for(e.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=t.for(e.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Mt(()=>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(r=>{(r.hasChanged(50)||r.hasChanged(19)||r.hasChanged(18))&&this._updateLensStyle(),r.hasChanged(17)&&this._onModelChange()})),this._disposables.add(e.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var i;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_getLayoutInfo(){const i=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let e=this._editor.getOption(19);return(!e||e<5)&&(e=this._editor.getOption(52)*.9|0),{fontSize:e,codeLensHeight:e*i|0}}_updateLensStyle(){const{codeLensHeight:i,fontSize:e}=this._getLayoutInfo(),t=this._editor.getOption(18),n=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${i}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),t&&(o.setProperty("--vscode-editorCodeLens-fontFamily",t),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Yo.fontFamily)),this._editor.changeViewZones(s=>{for(const r of this._lenses)r.updateHeight(i,s)})}_localDispose(){var i,e,t;(i=this._getCodeLensModelPromise)===null||i===void 0||i.cancel(),this._getCodeLensModelPromise=void 0,(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(t=this._currentCodeLensModel)===null||t===void 0||t.dispose()}_onModelChange(){this._localDispose();const i=this._editor.getModel();if(!i||!this._editor.getOption(17)||i.isTooLargeForTokenization())return;const e=this._codeLensCache.get(i);if(e&&this._renderCodeLensSymbols(e),!this._languageFeaturesService.codeLensProvider.has(i)){e&&qh(()=>{const n=this._codeLensCache.get(i);e===n&&(this._codeLensCache.delete(i),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(i))if(typeof n.onDidChange=="function"){const o=n.onDidChange(()=>t.schedule());this._localToDispose.add(o)}const t=new Mt(()=>{var n;const o=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=Yi(s=>gz(this._languageFeaturesService.codeLensProvider,i,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(i,s);const r=this._provideCodeLensDebounce.update(i,Date.now()-o);t.delay=r,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},Ke)},this._provideCodeLensDebounce.get(i));this._localToDispose.add(t),this._localToDispose.add(Ne(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var n;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const r=[];let a=-1;this._lenses.forEach(d=>{!d.isValid()||a===d.getLineNumber()?r.push(d):(d.update(s),a=d.getLineNumber())});const l=new cx;r.forEach(d=>{d.dispose(l,s),this._lenses.splice(this._lenses.indexOf(d),1)}),l.commit(o)})}),t.schedule(),this._resolveCodeLensesScheduler.cancel(),(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{t.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{t.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(Ne(()=>{if(this._editor.getModel()){const n=Ca.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),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 o=n.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const r=s.getCommand(o);if(r){this._commandService.executeCommand(r.id,...r.arguments||[]).catch(a=>this._notificationService.error(a));break}}})),t.schedule()}_disposeAllLenses(i,e){const t=new cx;for(const n of this._lenses)n.dispose(t,e);i&&t.commit(i),this._lenses.length=0}_renderCodeLensSymbols(i){if(!this._editor.hasModel())return;const e=this._editor.getModel().getLineCount(),t=[];let n;for(const r of i.lenses){const a=r.symbol.range.startLineNumber;a<1||a>e||(n&&n[n.length-1].symbol.range.startLineNumber===a?n.push(r):(n=[r],t.push(n)))}if(!t.length&&!this._lenses.length)return;const o=Ca.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(r=>{this._editor.changeViewZones(a=>{const l=new cx;let d=0,h=0;for(;h<t.length&&d<this._lenses.length;){const c=t[h][0].symbol.range.startLineNumber,u=this._lenses[d].getLineNumber();u<c?(this._lenses[d].dispose(l,a),this._lenses.splice(d,1)):u===c?(this._lenses[d].updateCodeLensSymbols(t[h],l),h++,d++):(this._lenses.splice(d,0,new G6(t[h],this._editor,l,a,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),d++,h++)}for(;d<this._lenses.length;)this._lenses[d].dispose(l,a),this._lenses.splice(d,1);for(;h<t.length;)this._lenses.push(new G6(t[h],this._editor,l,a,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;l.commit(r)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var i;(i=this._resolveCodeLensesPromise)===null||i===void 0||i.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],n=[];if(this._lenses.forEach(r=>{const a=r.computeIfNecessary(e);a&&(t.push(a),n.push(r))}),t.length===0)return;const o=Date.now(),s=Yi(r=>{const a=t.map((l,d)=>{const h=new Array(l.length),c=l.map((u,g)=>!u.symbol.command&&typeof u.provider.resolveCodeLens=="function"?Promise.resolve(u.provider.resolveCodeLens(e,u.symbol,r)).then(m=>{h[g]=m},Ti):(h[g]=u.symbol,Promise.resolve(void 0)));return Promise.all(c).then(()=>{!r.isCancellationRequested&&!n[d].isDisposed()&&n[d].updateCommands(h)})});return Promise.all(a)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const r=this._resolveCodeLensesDebounce.update(e,Date.now()-o);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{Ke(r),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var i;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((i=this._currentCodeLensModel)===null||i===void 0)&&i.isDisposed?void 0:this._currentCodeLensModel}};zm.ID="css.editor.codeLens";zm=Ife([Zf(1,pe),Zf(2,sr),Zf(3,pi),Zf(4,Pi),Zf(5,pz)],zm);pt(zm.ID,zm,1);ie(class extends ce{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:E.hasCodeLensProvider,label:p("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(i,e){if(!e.hasModel())return;const t=i.get(Da),n=i.get(pi),o=i.get(Pi),s=e.getSelection().positionLineNumber,r=e.getContribution(zm.ID);if(!r)return;const a=await r.getModel();if(!a)return;const l=[];for(const c of a.lenses)c.symbol.command&&c.symbol.range.startLineNumber===s&&l.push({label:c.symbol.command.title,command:c.symbol.command});if(l.length===0)return;const d=await t.pick(l,{canPickMany:!1,placeHolder:p("placeHolder","Select a command")});if(!d)return;let h=d.command;if(a.isDisposed){const c=await r.getModel(),u=c==null?void 0:c.lenses.find(g=>{var m;return g.symbol.range.startLineNumber===s&&((m=g.symbol.command)===null||m===void 0?void 0:m.title)===h.title});if(!u||!u.symbol.command)return;h=u.symbol.command}try{await n.executeCommand(h.id,...h.arguments||[])}catch(c){o.error(c)}}});var Mfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},ux=function(i,e){return function(t,n){e(t,n,i)}};class hP{constructor(e,t){this._editorWorkerClient=new mR(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){const o=t.range,s=t.color,r=s.alpha,a=new V(new dt(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?V.Format.CSS.formatRGB(a):V.Format.CSS.formatRGBA(a),d=r?V.Format.CSS.formatHSL(a):V.Format.CSS.formatHSLA(a),h=r?V.Format.CSS.formatHex(a):V.Format.CSS.formatHexA(a),c=[];return c.push({label:l,textEdit:{range:o,text:l}}),c.push({label:d,textEdit:{range:o,text:d}}),c.push({label:h,textEdit:{range:o,text:h}}),c}}let W2=class extends B{constructor(i,e,t){super(),this._register(t.colorProvider.register("*",new hP(i,e)))}};W2=Mfe([ux(0,ti),ux(1,Bt),ux(2,pe)],W2);wL(W2);async function mz(i,e,t,n=!0){return cP(new Tfe,i,e,t,n)}function fz(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class Tfe{constructor(){}async compute(e,t,n,o){const s=await e.provideDocumentColors(t,n);if(Array.isArray(s))for(const r of s)o.push({colorInfo:r,provider:e});return Array.isArray(s)}}class Rfe{constructor(){}async compute(e,t,n,o){const s=await e.provideDocumentColors(t,n);if(Array.isArray(s))for(const r of s)o.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)}}class Afe{constructor(e){this.colorInfo=e}async compute(e,t,n,o){const s=await e.provideColorPresentations(t,this.colorInfo,et.None);return Array.isArray(s)&&o.push(...s),Array.isArray(s)}}async function cP(i,e,t,n,o){let s=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const h=l[d];if(h instanceof hP)r=h;else try{await i.compute(h,t,n,a)&&(s=!0)}catch(c){Ti(c)}}return s?a:r&&o?(await i.compute(r,t,n,a),a):[]}function _z(i,e){const{colorProvider:t}=i.get(pe),n=i.get(ti).getModel(e);if(!n)throw Zs();const o=i.get(at).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:o}}ct.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof xe))throw Zs();const{model:n,colorProviderRegistry:o,isDefaultColorDecoratorsEnabled:s}=_z(i,t);return cP(new Rfe,o,n,et.None,s)});ct.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:o,range:s}=n;if(!(o instanceof xe)||!Array.isArray(t)||t.length!==4||!L.isIRange(s))throw Zs();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=_z(i,o),[d,h,c,u]=t;return cP(new Afe({range:s,color:{red:d,green:h,blue:c,alpha:u}}),a,r,et.None,l)});var Pfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},gx=function(i,e){return function(t,n){e(t,n,i)}},V2;const vz=Object.create({});let rc=V2=class extends B{constructor(i,e,t,n){super(),this._editor=i,this._configurationService=e,this._languageFeaturesService=t,this._localToDispose=this._register(new Y),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new eb(this._editor),this._decoratorLimitReporter=new Ofe,this._colorDecorationClassRefs=this._register(new Y),this._debounceInformation=n.for(t.colorProvider,"Document Colors",{min:V2.RECOMPUTE_TIME}),this._register(i.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(i.onDidChangeModelLanguage(()=>this.updateColors())),this._register(t.colorProvider.onDidChange(()=>this.updateColors())),this._register(i.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const r=s!==this._isColorDecoratorsEnabled||o.hasChanged(21),a=o.hasChanged(145);(r||a)&&(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 i=this._editor.getModel();if(!i)return!1;const e=i.getLanguageId(),t=this._configurationService.getValue(e);if(t&&typeof t=="object"){const n=t.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(20)}static get(i){return i.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const i=this._editor.getModel();!i||!this._languageFeaturesService.colorProvider.has(i)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Mr,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(i)))})),this.beginCompute())}async beginCompute(){this._computePromise=Yi(async i=>{const e=this._editor.getModel();if(!e)return[];const t=new $n(!1),n=await mz(this._languageFeaturesService.colorProvider,e,i,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(e,t.elapsed()),n});try{const i=await this._computePromise;this.updateDecorations(i),this.updateColorDecorators(i),this._computePromise=null}catch(i){Ke(i)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(i){const e=i.map(t=>({range:{startLineNumber:t.colorInfo.range.startLineNumber,startColumn:t.colorInfo.range.startColumn,endLineNumber:t.colorInfo.range.endLineNumber,endColumn:t.colorInfo.range.endColumn},options:je.EMPTY}));this._editor.changeDecorations(t=>{this._decorationsIds=t.deltaDecorations(this._decorationsIds,e),this._colorDatas=new Map,this._decorationsIds.forEach((n,o)=>this._colorDatas.set(n,i[o]))})}updateColorDecorators(i){this._colorDecorationClassRefs.clear();const e=[],t=this._editor.getOption(21);for(let o=0;o<i.length&&e.length<t;o++){const{red:s,green:r,blue:a,alpha:l}=i[o].colorInfo.color,d=new dt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),h=`rgba(${d.r}, ${d.g}, ${d.b}, ${d.a})`,c=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:h}));e.push({range:{startLineNumber:i[o].colorInfo.range.startLineNumber,startColumn:i[o].colorInfo.range.startColumn,endLineNumber:i[o].colorInfo.range.endLineNumber,endColumn:i[o].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:v8,inlineClassName:`${c.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:vz}}})}const n=t<i.length?t:!1;this._decoratorLimitReporter.update(i.length,n),this._colorDecoratorIds.set(e)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(i){const e=this._editor.getModel();if(!e)return null;const t=e.getDecorationsInRange(L.fromPositions(i,i)).filter(n=>this._colorDatas.has(n.id));return t.length===0?null:this._colorDatas.get(t[0].id)}isColorDecoration(i){return this._colorDecoratorIds.has(i)}};rc.ID="editor.contrib.colorDetector";rc.RECOMPUTE_TIME=1e3;rc=V2=Pfe([gx(1,at),gx(2,pe),gx(3,sr)],rc);class Ofe{constructor(){this._onDidChange=new A,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}pt(rc.ID,rc,1);class Ffe{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,n){this.presentationIndex=n,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new A,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new A,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let n=-1;for(let o=0;o<this.colorPresentations.length;o++)if(t.toLowerCase()===this.colorPresentations[o].label){n=o;break}if(n===-1){const o=t.split("(")[0].toLowerCase();for(let s=0;s<this.colorPresentations.length;s++)if(this.colorPresentations[s].label.toLowerCase().startsWith(o)){n=s;break}}n!==-1&&n!==this.presentationIndex&&(this.presentationIndex=n,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const Ss=ee;class Bfe extends B{constructor(e,t,n,o=!1){super(),this.model=t,this.showingStandaloneColorPicker=o,this._closeButton=null,this._domNode=Ss(".colorpicker-header"),Z(e,this._domNode),this._pickedColorNode=Z(this._domNode,Ss(".picked-color")),Z(this._pickedColorNode,Ss("span.codicon.codicon-color-mode")),this._pickedColorPresentation=Z(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=Z(this._domNode,Ss(".original-color")),this._originalColorNode.style.backgroundColor=V.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=n.getColorTheme().getColor(Mw)||V.white,this._register(n.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor(Mw)||V.white})),this._register($(this._pickedColorNode,ae.CLICK,()=>this.model.selectNextColorPresentation())),this._register($(this._originalColorNode,ae.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=V.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 Wfe(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=V.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 Wfe extends B{constructor(e){super(),this._onClicked=this._register(new A),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Z(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Z(this._button,t),Z(t,Ss(".button"+Ee.asCSSSelector(Ei("color-picker-close",oe.close,p("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class Vfe extends B{constructor(e,t,n,o=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=Ss(".colorpicker-body"),Z(e,this._domNode),this._saturationBox=new Hfe(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 zfe(this._domNode,this.model,o),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Ufe(this._domNode,this.model,o),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),o&&(this._insertButton=this._register(new Kfe(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new V(new el(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new V(new el(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new V(new el(n===360?0:n,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class Hfe extends B{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Ss(".saturation-wrap"),Z(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Z(this._domNode,this._canvas),this.selection=Ss(".saturation-selection"),Z(this._domNode,this.selection),this.layout(),this._register($(this._domNode,ae.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new lf);const t=ji(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangePosition(o.pageX-t.left,o.pageY-t.top),()=>null);const n=$(e.target.ownerDocument,ae.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),o=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,o),this._onDidChange.fire({s:n,v:o})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new V(new el(e.h,1,1,1)),n=this._canvas.getContext("2d"),o=n.createLinearGradient(0,0,this._canvas.width,0);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)");const s=n.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=V.Format.CSS.format(t),n.fill(),n.fillStyle=o,n.fill(),n.fillStyle=s,n.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class bz extends B{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=Z(e,Ss(".standalone-strip")),this.overlay=Z(this.domNode,Ss(".standalone-overlay"))):(this.domNode=Z(e,Ss(".strip")),this.overlay=Z(this.domNode,Ss(".overlay"))),this.slider=Z(this.domNode,Ss(".slider")),this.slider.style.top="0px",this._register($(this.domNode,ae.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new lf),n=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-n.top),()=>null);const o=$(e.target.ownerDocument,ae.POINTER_UP,()=>{this._onColorFlushed.fire(),o.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class zfe extends bz{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:o}=e.rgba,s=new V(new dt(t,n,o,1)),r=new V(new dt(t,n,o,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Ufe extends bz{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Kfe extends B{constructor(e){super(),this._onClicked=this._register(new A),this.onClicked=this._onClicked.event,this._button=Z(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 jfe extends Tr{constructor(e,t,n,o,s=!1){super(),this.model=t,this.pixelRatio=n,this._register(Cv.onDidChange(()=>this.layout()));const r=Ss(".colorpicker-widget");e.appendChild(r),this.header=this._register(new Bfe(r,this.model,o,s)),this.body=this._register(new Vfe(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var Cz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},wz=function(i,e){return function(t,n){e(t,n,i)}};class $fe{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let By=class{constructor(i,e){this._editor=i,this._themeService=e,this.hoverOrdinal=2}computeSync(i,e){return[]}computeAsync(i,e,t){return Bi.fromPromise(this._computeAsync(i,e,t))}async _computeAsync(i,e,t){if(!this._editor.hasModel())return[];const n=rc.get(this._editor);if(!n)return[];for(const o of e){if(!n.isColorDecoration(o))continue;const s=n.getColorData(o.range.getStartPosition());if(s)return[await yz(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]}renderHoverParts(i,e){return Sz(this,this._editor,this._themeService,e,i)}};By=Cz([wz(1,nn)],By);class qfe{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o}}let v0=class{constructor(i,e){this._editor=i,this._themeService=e,this._color=null}async createColorHover(i,e,t){if(!this._editor.hasModel()||!rc.get(this._editor))return null;const n=await mz(t,this._editor.getModel(),et.None);let o=null,s=null;for(const d of n){const h=d.colorInfo;L.containsRange(h.range,i.range)&&(o=h,s=d.provider)}const r=o??i,a=s??e,l=!!o;return{colorHover:await yz(this,this._editor.getModel(),r,a),foundInEditor:l}}async updateEditorModel(i){if(!this._editor.hasModel())return;const e=i.model;let t=new L(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn);this._color&&(await HC(this._editor.getModel(),e,this._color,t,i),t=Lz(this._editor,t,e))}renderHoverParts(i,e){return Sz(this,this._editor,this._themeService,e,i)}set color(i){this._color=i}get color(){return this._color}};v0=Cz([wz(1,nn)],v0);async function yz(i,e,t,n){const o=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new dt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),h=new V(d),c=await fz(e,t,n,et.None),u=new Ffe(h,[],0);return u.colorPresentations=c||[],u.guessColorPresentation(h,o),i instanceof By?new $fe(i,L.lift(t.range),u,n):new qfe(i,L.lift(t.range),u,n)}function Sz(i,e,t,n,o){if(n.length===0||!e.hasModel())return B.None;if(o.setMinimumDimensions){const u=e.getOption(66)+8;o.setMinimumDimensions(new ft(302,u))}const s=new Y,r=n[0],a=e.getModel(),l=r.model,d=s.add(new jfe(o.fragment,l,e.getOption(141),t,i instanceof v0));o.setColorPicker(d);let h=!1,c=new L(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(i instanceof v0){const u=n[0].model.color;i.color=u,HC(a,l,u,c,r),s.add(l.onColorFlushed(g=>{i.color=g}))}else s.add(l.onColorFlushed(async u=>{await HC(a,l,u,c,r),h=!0,c=Lz(e,c,l,o)}));return s.add(l.onDidChangeColor(u=>{HC(a,l,u,c,r)})),s.add(e.onDidChangeModelContent(u=>{h?h=!1:(o.hide(),e.focus())})),s}function Lz(i,e,t,n){let o,s;if(t.presentation.textEdit){o=[t.presentation.textEdit],s=new L(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=i.getModel()._setTrackedRange(null,s,3);i.pushUndoStop(),i.executeEdits("colorpicker",o),s=i.getModel()._getTrackedRange(r)||s}else o=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],s=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),i.pushUndoStop(),i.executeEdits("colorpicker",o);return t.presentation.additionalTextEdits&&(o=[...t.presentation.additionalTextEdits],i.executeEdits("colorpicker",o),n&&n.hide()),i.pushUndoStop(),s}async function HC(i,e,t,n,o){const s=await fz(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},o.provider,et.None);e.colorPresentations=s||[]}function H2(i,e){return!!i[e]}class px{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=H2(e.event,t.triggerModifier),this.hasSideBySideModifier=H2(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Z6{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=H2(e,t.triggerModifier)}}class O1{constructor(e,t,n,o){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=o}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Y6(i){return i==="altKey"?ht?new O1(57,"metaKey",6,"altKey"):new O1(5,"ctrlKey",6,"altKey"):ht?new O1(6,"altKey",57,"metaKey"):new O1(6,"altKey",5,"ctrlKey")}class OL extends B{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new A),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new A),this.onExecute=this._onExecute.event,this._onCancel=this._register(new A),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:o=>o.target.position?o.target.position.lineNumber:0,this._opts=Y6(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(o=>{if(o.hasChanged(77)){const s=Y6(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(o=>this._onEditorMouseMove(new px(o,this._opts)))),this._register(this._editor.onMouseDown(o=>this._onEditorMouseDown(new px(o,this._opts)))),this._register(this._editor.onMouseUp(o=>this._onEditorMouseUp(new px(o,this._opts)))),this._register(this._editor.onKeyDown(o=>this._onEditorKeyDown(new Z6(o,this._opts)))),this._register(this._editor.onKeyUp(o=>this._onEditorKeyUp(new Z6(o,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(o=>this._onDidChangeCursorSelection(o))),this._register(this._editor.onDidChangeModel(o=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(o=>{(o.scrollTopChanged||o.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var Gfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},zl=function(i,e){return function(t,n){e(t,n,i)}};let ac=class extends Nm{constructor(i,e,t,n,o,s,r,a,l,d,h,c,u){super(i,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},t,o,s,r,a,l,d,h,c,u),this._parentEditor=n,this._overwriteOptions=e,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(i){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(i){cS(this._overwriteOptions,i,!0),super.updateOptions(this._overwriteOptions)}};ac=Gfe([zl(4,Me),zl(5,vt),zl(6,pi),zl(7,Ae),zl(8,nn),zl(9,Pi),zl(10,Rl),zl(11,Bt),zl(12,pe)],ac);const Q6=new V(new dt(0,122,204)),Zfe={showArrow:!0,showFrame:!0,className:"",frameColor:Q6,arrowColor:Q6,keepEditorSelection:!1},Yfe="vs.editor.contrib.zoneWidget";class Qfe{constructor(e,t,n,o,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=o,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Xfe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class FL{constructor(e){this._editor=e,this._ruleName=FL._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),gN(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(){gN(this._ruleName),Cw(`.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:L.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}FL._IdGenerator=new mA(".arrow-decoration-");class Jfe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Y,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Yl(t),cS(this.options,Zfe,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(n=>{const o=this._getWidth(n);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(n)+"px",this._onWidth(o)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new FL(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const o=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(o))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const n=L.isIRange(e)?L.lift(e):L.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:je.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),o=this.editor.getLayoutInfo(),s=this._getWidth(o);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(o)+"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(n)),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 Qfe(r,n.lineNumber,n.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 Xfe(Yfe+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 h=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,s),this.options.keepEditorSelection||this.editor.setSelection(e);const c=this.editor.getModel();if(c){const u=c.validateRange(new L(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===c.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 Hn(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const n=(t.currentY-e.startY)/this.editor.getOption(66),o=n<0?Math.ceil(n):Math.floor(n),s=e.heightInLines+o;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 kz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Dz=function(i,e){return function(t,n){e(t,n,i)}};const xz=tt("IPeekViewService");lt(xz,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const o=this._widgets.get(i);o&&o.widget===e&&(o.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var Ao;(function(i){i.inPeekEditor=new de("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(Ao||(Ao={}));let b0=class{constructor(i,e){i instanceof ac&&Ao.inPeekEditor.bindTo(e)}dispose(){}};b0.ID="editor.contrib.referenceController";b0=kz([Dz(1,Ae)],b0);pt(b0.ID,b0,0);function e_e(i){const e=i.get(vt).getFocusedCodeEditor();return e instanceof ac?e.getParentEditor():e}const t_e={headerBackgroundColor:V.white,primaryHeadingColor:V.fromHex("#333333"),secondaryHeadingColor:V.fromHex("#6c6c6cb3")};let Wy=class extends Jfe{constructor(i,e,t){super(i,e),this.instantiationService=t,this._onDidClose=new A,this.onDidClose=this._onDidClose.event,cS(this.options,t_e,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(i){const e=this.options;i.headerBackgroundColor&&(e.headerBackgroundColor=i.headerBackgroundColor),i.primaryHeadingColor&&(e.primaryHeadingColor=i.primaryHeadingColor),i.secondaryHeadingColor&&(e.secondaryHeadingColor=i.secondaryHeadingColor),super.style(i)}_applyStyles(){super._applyStyles();const i=this.options;this._headElement&&i.headerBackgroundColor&&(this._headElement.style.backgroundColor=i.headerBackgroundColor.toString()),this._primaryHeading&&i.primaryHeadingColor&&(this._primaryHeading.style.color=i.primaryHeadingColor.toString()),this._secondaryHeading&&i.secondaryHeadingColor&&(this._secondaryHeading.style.color=i.secondaryHeadingColor.toString()),this._bodyElement&&i.frameColor&&(this._bodyElement.style.borderColor=i.frameColor.toString())}_fillContainer(i){this.setCssClass("peekview-widget"),this._headElement=ee(".head"),this._bodyElement=ee(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),i.appendChild(this._headElement),i.appendChild(this._bodyElement)}_fillHead(i,e){this._titleElement=ee(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),bi(this._titleElement,"click",o=>this._onTitleClick(o))),Z(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=ee("span.filename"),this._secondaryHeading=ee("span.dirname"),this._metaHeading=ee("span.meta"),Z(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const t=ee(".peekview-actions");Z(this._headElement,t);const n=this._getActionBarOptions();this._actionbarWidget=new or(t,n),this._disposables.add(this._actionbarWidget),e||this._actionbarWidget.push(new vo("peekview.close",p("label.close","Close"),Ee.asClassName(oe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(i){}_getActionBarOptions(){return{actionViewItemProvider:Hle.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(i){}setTitle(i,e){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=i,this._primaryHeading.setAttribute("title",i),e?this._secondaryHeading.innerText=e:Ln(this._secondaryHeading))}setMetaTitle(i){this._metaHeading&&(i?(this._metaHeading.innerText=i,$o(this._metaHeading)):ho(this._metaHeading))}_doLayout(i,e){if(!this._isShowing&&i<0){this.dispose();return}const t=Math.ceil(this.editor.getOption(66)*1.2),n=Math.round(i-(t+2));this._doLayoutHead(t,e),this._doLayoutBody(n,e)}_doLayoutHead(i,e){this._headElement&&(this._headElement.style.height=`${i}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(i,e){this._bodyElement&&(this._bodyElement.style.height=`${i}px`)}};Wy=kz([Dz(2,Me)],Wy);const i_e=M("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},p("peekViewTitleBackground","Background color of the peek view title area.")),Ez=M("peekViewTitleLabel.foreground",{dark:V.white,light:V.black,hcDark:V.white,hcLight:wr},p("peekViewTitleForeground","Color of the peek view title.")),Nz=M("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),n_e=M("peekView.border",{dark:Mo,light:Mo,hcDark:rt,hcLight:rt},p("peekViewBorder","Color of the peek view borders and arrow.")),o_e=M("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},p("peekViewResultsBackground","Background color of the peek view result list."));M("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:V.white,hcLight:wr},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));M("peekViewResult.fileForeground",{dark:V.white,light:"#1E1E1E",hcDark:V.white,hcLight:wr},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));M("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));M("peekViewResult.selectionForeground",{dark:V.white,light:"#6C6C6C",hcDark:V.white,hcLight:wr},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const wh=M("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:V.black,hcLight:V.white},p("peekViewEditorBackground","Background color of the peek view editor."));M("peekViewEditorGutter.background",{dark:wh,light:wh,hcDark:wh,hcLight:wh},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));M("peekViewEditorStickyScroll.background",{dark:wh,light:wh,hcDark:wh,hcLight:wh},p("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));M("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));M("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));M("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:$t,hcLight:$t},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class lc{constructor(e,t,n,o){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=o,this.id=wI.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({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,nr(this.uri),this.range.startLineNumber,this.range.startColumn):p("aria.oneReference","in {0} on line {1} at column {2}",nr(this.uri),this.range.startLineNumber,this.range.startColumn)}}class s_e{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:o,startColumn:s,endLineNumber:r,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:o,column:s-t}),d=new L(o,l.startColumn,o,s),h=new L(r,a,r,1073741824),c=n.getValueInRange(d).replace(/^\s+/,""),u=n.getValueInRange(e),g=n.getValueInRange(h).replace(/\s+$/,"");return{value:c+u+g,highlight:{start:c.length,end:c.length+u.length}}}}class C0{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new xi}dispose(){kt(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}",nr(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,nr(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 n=await e.createModelReference(t.uri);this._previews.set(t.uri,new s_e(n))}catch(n){Ke(n)}return this}}class Jo{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new A,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(Jo._compareReferences);let o;for(const s of e)if((!o||!qt.isEqual(o.uri,s.uri,!0))&&(o=new C0(this,s.uri),this.groups.push(o)),o.children.length===0||Jo._compareReferences(s,o.children[o.children.length-1])!==0){const r=new lc(n===s,o,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),o.children.push(r)}}dispose(){kt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Jo(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:n}=e;let o=n.children.indexOf(e);const s=n.children.length,r=n.parent.groups.length;return r===1||t&&o+1<s||!t&&o>0?(t?o=(o+1)%s:o=(o+s-1)%s,n.children[o]):(o=n.parent.groups.indexOf(n),t?(o=(o+1)%r,n.parent.groups[o].children[0]):(o=(o+r-1)%r,n.parent.groups[o].children[n.parent.groups[o].children.length-1]))}nearestReference(e,t){const n=this.references.map((o,s)=>({idx:s,prefixLen:Ou(o.uri.toString(),e.toString()),offsetDist:Math.abs(o.range.startLineNumber-t.lineNumber)*100+Math.abs(o.range.startColumn-t.column)})).sort((o,s)=>o.prefixLen>s.prefixLen?-1:o.prefixLen<s.prefixLen?1:o.offsetDist<s.offsetDist?-1:o.offsetDist>s.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&L.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return qt.compare(e.uri,t.uri)||L.compareRangesUsingStarts(e.range,t.range)}}var BL=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},WL=function(i,e){return function(t,n){e(t,n,i)}},z2;let U2=class{constructor(i){this._resolverService=i}hasChildren(i){return i instanceof Jo||i instanceof C0}getChildren(i){if(i instanceof Jo)return i.groups;if(i instanceof C0)return i.resolve(this._resolverService).then(e=>e.children);throw new Error("bad tree")}};U2=BL([WL(0,Oo)],U2);class r_e{getHeight(){return 23}getTemplateId(e){return e instanceof C0?w0.id:xb.id}}let K2=class{constructor(i){this._keybindingService=i}getKeyboardNavigationLabel(i){var e;if(i instanceof lc){const t=(e=i.parent.getPreview(i))===null||e===void 0?void 0:e.preview(i.range);if(t)return t.value}return nr(i.uri)}};K2=BL([WL(0,Tt)],K2);class a_e{getId(e){return e instanceof lc?e.id:e.uri}}let j2=class extends B{constructor(i,e){super(),this._labelService=e;const t=document.createElement("div");t.classList.add("reference-file"),this.file=this._register(new yy(t,{supportHighlights:!0})),this.badge=new KI(Z(t,ee(".count")),{},yV),i.appendChild(t)}set(i,e){const t=QS(i.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(i.uri),this._labelService.getUriLabel(t,{relative:!0}),{title:this._labelService.getUriLabel(i.uri),matches:e});const n=i.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(p("referencesCount","{0} references",n)):this.badge.setTitleFormat(p("referenceCount","{0} reference",n))}};j2=BL([WL(1,Im)],j2);let w0=z2=class{constructor(i){this._instantiationService=i,this.templateId=z2.id}renderTemplate(i){return this._instantiationService.createInstance(j2,i)}renderElement(i,e,t){t.set(i.element,hb(i.filterData))}disposeTemplate(i){i.dispose()}};w0.id="FileReferencesRenderer";w0=z2=BL([WL(0,Me)],w0);class l_e{constructor(e){this.label=new Ah(e)}set(e,t){var n;const o=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!o||!o.value)this.label.set(`${nr(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=o;t&&!ga.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,hb(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class xb{constructor(){this.templateId=xb.id}renderTemplate(e){return new l_e(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}xb.id="OneReferenceRenderer";class d_e{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var h_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Ul=function(i,e){return function(t,n){e(t,n,i)}};class VL{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Y,this._callOnModelChange=new Y,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],n=[];for(let o=0,s=e.children.length;o<s;o++){const r=e.children[o];this._decorationIgnoreSet.has(r.id)||r.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:r.range,options:VL.DecorationOptions}),n.push(o))}this._editor.changeDecorations(o=>{const s=o.deltaDecorations([],t);for(let r=0;r<s.length;r++)this._decorations.set(s[r],e.children[n[r]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[n,o]of this._decorations){const s=t.getDecorationRange(n);if(!s)continue;let r=!1;if(!L.equalsRange(s,o.range)){if(L.spansMultipleLines(s))r=!0;else{const a=o.range.endColumn-o.range.startColumn,l=s.endColumn-s.startColumn;a!==l&&(r=!0)}r?(this._decorationIgnoreSet.add(o.id),e.push(n)):o.range=s}}for(let n=0,o=e.length;n<o;n++)this._decorations.delete(e[n]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}VL.DecorationOptions=je.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class c_e{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,n;try{const o=JSON.parse(e);t=o.ratio,n=o.heightInLines}catch{}return{ratio:t||.7,heightInLines:n||18}}}class u_e extends HI{}let $2=class extends Wy{constructor(i,e,t,n,o,s,r,a,l,d,h,c){super(i,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},s),this._defaultTreeKeyboardSupport=e,this.layoutData=t,this._textModelResolverService=o,this._instantiationService=s,this._peekViewService=r,this._uriLabel=a,this._undoRedoService=l,this._keybindingService=d,this._languageService=h,this._languageConfigurationService=c,this._disposeOnNewModel=new Y,this._callOnDispose=new Y,this._onDidSelectReference=new A,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new ft(0,0),this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(i,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),kt(this._preview),kt(this._previewNotAvailableMessage),kt(this._tree),kt(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(i){const e=i.getColor(n_e)||V.transparent;this.style({arrowColor:e,frameColor:e,headerBackgroundColor:i.getColor(i_e)||V.transparent,primaryHeadingColor:i.getColor(Ez),secondaryHeadingColor:i.getColor(Nz)})}show(i){super.show(i,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(i){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:i.ctrlKey||i.metaKey||i.altKey?"side":"open",source:"title"})}_fillBody(i){this.setCssClass("reference-zone-widget"),this._messageContainer=Z(i,ee("div.messages")),ho(this._messageContainer),this._splitView=new DV(i,{orientation:1}),this._previewContainer=Z(i,ee("div.preview.inline"));const e={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(ac,this._previewContainer,e,{},this.editor),ho(this._previewContainer),this._previewNotAvailableMessage=new Sl(p("missingPreviewMessage","no preview available"),Is,Sl.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=Z(i,ee("div.ref-tree.inline"));const t={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new d_e,keyboardNavigationLabelProvider:this._instantiationService.createInstance(K2),identityProvider:new a_e,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:o_e}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(bi(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(u_e,"ReferencesWidget",this._treeContainer,new r_e,[this._instantiationService.createInstance(w0),this._instantiationService.createInstance(xb)],this._instantiationService.createInstance(U2),t),this._splitView.addView({onDidChange:le.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},my.Distribute),this._splitView.addView({onDidChange:le.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},my.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(o,s)=>{o instanceof lc&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?n(o.element,"side"):o.editorOptions.pinned?n(o.element,"goto"):n(o.element,"show")}),ho(this._treeContainer)}_onWidth(i){this._dim&&this._doLayoutBody(this._dim.height,i)}_doLayoutBody(i,e){super._doLayoutBody(i,e),this._dim=new ft(e,i),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(e),this._splitView.resizeView(0,e*this.layoutData.ratio)}setSelection(i){return this._revealReference(i,!0).then(()=>{this._model&&(this._tree.setSelection([i]),this._tree.setFocus([i]))})}setModel(i){return this._disposeOnNewModel.clear(),this._model=i,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=p("noResults","No results"),$o(this._messageContainer),Promise.resolve(void 0)):(ho(this._messageContainer),this._decorationsManager=new VL(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(i=>this._tree.rerender(i))),this._disposeOnNewModel.add(this._preview.onMouseDown(i=>{const{event:e,target:t}=i;if(e.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:t.range},kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),$o(this._treeContainer),$o(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[i]=this._tree.getFocus();if(i instanceof lc)return i;if(i instanceof C0&&i.children.length>0)return i.children[0]}async revealReference(i){await this._revealReference(i,!1),this._onDidSelectReference.fire({element:i,kind:"goto",source:"tree"})}async _revealReference(i,e){if(this._revealedReference===i)return;this._revealedReference=i,i.uri.scheme!==$e.inMemory?this.setTitle(Ine(i.uri),this._uriLabel.getUriLabel(QS(i.uri))):this.setTitle(p("peekView.alternateTitle","References"));const t=this._textModelResolverService.createModelReference(i.uri);this._tree.getInput()===i.parent?this._tree.reveal(i):(e&&this._tree.reveal(i.parent),await this._tree.expand(i.parent),this._tree.reveal(i));const n=await t;if(!this._model){n.dispose();return}kt(this._previewModelReference);const o=n.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,r=L.lift(i.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(r),this._preview.revealRangeInCenter(r,s)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};$2=h_e([Ul(3,nn),Ul(4,Oo),Ul(5,Me),Ul(6,xz),Ul(7,Im),Ul(8,XS),Ul(9,Tt),Ul(10,Xt),Ul(11,Bt)],$2);var g_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},jg=function(i,e){return function(t,n){e(t,n,i)}},zC;const xg=new de("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let dc=zC=class{static get(i){return i.getContribution(zC.ID)}constructor(i,e,t,n,o,s,r,a){this._defaultTreeKeyboardSupport=i,this._editor=e,this._editorService=n,this._notificationService=o,this._instantiationService=s,this._storageService=r,this._configurationService=a,this._disposables=new Y,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=xg.bindTo(t)}dispose(){var i,e;this._referenceSearchVisible.reset(),this._disposables.dispose(),(i=this._widget)===null||i===void 0||i.dispose(),(e=this._model)===null||e===void 0||e.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(i,e,t){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&i.containsPosition(n))return;this._peekMode=t,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",s=c_e.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance($2,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(p("labelLoading","Loading...")),this._widget.show(i),this._disposables.add(this._widget.onDidClose(()=>{e.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(a=>{const{element:l,kind:d}=a;if(l)switch(d){case"open":(a.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(l,!1,!1);break;case"side":this.openReference(l,!0,!1);break;case"goto":t?this._gotoReference(l,!0):this.openReference(l,!1,!0);break}}));const r=++this._requestIdPool;e.then(a=>{var l;if(r!==this._requestIdPool||!this._widget){a.dispose();return}return(l=this._model)===null||l===void 0||l.dispose(),this._model=a,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 d=this._editor.getModel().uri,h=new P(i.startLineNumber,i.startColumn),c=this._model.nearestReference(d,h);if(c)return this._widget.setSelection(c).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},a=>{this._notificationService.error(a)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(i){if(!this._editor.hasModel()||!this._model||!this._widget)return;const e=this._widget.position;if(!e)return;const t=this._model.nearestReference(this._editor.getModel().uri,e);if(!t)return;const n=this._model.nextOrPreviousReference(t,i),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(i){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(i)}closeWidget(i=!0){var e,t;(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,i&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(i,e){var t;(t=this._widget)===null||t===void 0||t.hide(),this._ignoreModelChangeEvent=!0;const n=L.lift(i.range).collapseToStart();return this._editorService.openCodeEditor({resource:i.uri,options:{selection:n,selectionSource:"code.jump",pinned:e}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(n),this._widget.focusOnReferenceTree();else{const r=zC.get(o),a=this._model.clone();this.closeWidget(),o.focus(),r==null||r.toggleWidget(n,Yi(l=>Promise.resolve(a)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,Ke(o)})}openReference(i,e,t){e||this.closeWidget();const{uri:n,range:o}=i;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:"code.jump",pinned:t}},this._editor,e)}};dc.ID="editor.contrib.referencesController";dc=zC=g_e([jg(2,Ae),jg(3,vt),jg(4,Pi),jg(5,Me),jg(6,Pr),jg(7,at)],dc);function Eg(i,e){const t=e_e(i);if(!t)return;const n=dc.get(t);n&&e(n)}Ro.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:$i(2089,60),when:G.or(xg,Ao.inPeekEditor),handler(i){Eg(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Ro.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:G.or(xg,Ao.inPeekEditor),handler(i){Eg(i,e=>{e.goToNextOrPreviousReference(!0)})}});Ro.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:G.or(xg,Ao.inPeekEditor),handler(i){Eg(i,e=>{e.goToNextOrPreviousReference(!1)})}});ct.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");ct.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");ct.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");ct.registerCommand("closeReferenceSearch",i=>Eg(i,e=>e.closeWidget()));Ro.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:G.and(Ao.inPeekEditor,G.not("config.editor.stablePeek"))});Ro.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:G.and(xg,G.not("config.editor.stablePeek"))});Ro.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:G.and(xg,HV,TA.negate(),RA.negate()),handler(i){var e;const t=(e=i.get(lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(t)&&t[0]instanceof lc&&Eg(i,n=>n.revealReference(t[0]))}});Ro.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:G.and(xg,HV,TA.negate(),RA.negate()),handler(i){var e;const t=(e=i.get(lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(t)&&t[0]instanceof lc&&Eg(i,n=>n.openReference(t[0],!0,!0))}});ct.registerCommand("openReference",i=>{var e;const t=(e=i.get(lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(t)&&t[0]instanceof lc&&Eg(i,n=>n.openReference(t[0],!1,!0))});var Iz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},y_=function(i,e){return function(t,n){e(t,n,i)}};const uP=new de("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),HL=tt("ISymbolNavigationService");let q2=class{constructor(i,e,t,n){this._editorService=e,this._notificationService=t,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=uP.bindTo(i)}reset(){var i,e;this._ctxHasSymbols.reset(),(i=this._currentState)===null||i===void 0||i.dispose(),(e=this._currentMessage)===null||e===void 0||e.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(i){const e=i.parent.parent;if(e.references.length<=1){this.reset();return}this._currentModel=e,this._currentIdx=e.references.indexOf(i),this._ctxHasSymbols.set(!0),this._showMessage();const t=new G2(this._editorService),n=t.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const r=s.getModel(),a=s.getPosition();if(!r||!a)return;let l=!1,d=!1;for(const h of e.references)if(VR(h.uri,r.uri))l=!0,d=d||L.containsPosition(h.range,a);else if(l)break;(!l||!d)&&this.reset()});this._currentState=kr(t,n)}revealNext(i){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const e=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:e.uri,options:{selection:L.collapseToStart(e.range),selectionRevealType:3}},i).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var i;(i=this._currentMessage)===null||i===void 0||i.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?p("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):p("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};q2=Iz([y_(0,Ae),y_(1,vt),y_(2,Pi),y_(3,Tt)],q2);lt(HL,q2,1);re(new class extends gn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:uP,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(HL).revealNext(e)}});Ro.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:uP,primary:9,handler(i){i.get(HL).reset()}});let G2=class{constructor(i){this._listener=new Map,this._disposables=new Y,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._disposables.add(i.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(i.onCodeEditorAdd(this._onDidAddEditor,this)),i.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),kt(this._listener.values())}_onDidAddEditor(i){this._listener.set(i,kr(i.onDidChangeCursorPosition(e=>this._onDidChange.fire({editor:i})),i.onDidChangeModelContent(e=>this._onDidChange.fire({editor:i}))))}_onDidRemoveEditor(i){var e;(e=this._listener.get(i))===null||e===void 0||e.dispose(),this._listener.delete(i)}};G2=Iz([y_(0,vt)],G2);async function Eb(i,e,t,n){const o=t.ordered(i).map(r=>Promise.resolve(n(r,i,e)).then(void 0,a=>{Ti(a)})),s=await Promise.all(o);return pa(s.flat())}function zL(i,e,t,n){return Eb(e,t,i,(o,s,r)=>o.provideDefinition(s,r,n))}function Mz(i,e,t,n){return Eb(e,t,i,(o,s,r)=>o.provideDeclaration(s,r,n))}function Tz(i,e,t,n){return Eb(e,t,i,(o,s,r)=>o.provideImplementation(s,r,n))}function Rz(i,e,t,n){return Eb(e,t,i,(o,s,r)=>o.provideTypeDefinition(s,r,n))}function UL(i,e,t,n,o){return Eb(e,t,i,async(s,r,a)=>{const l=await s.provideReferences(r,a,{includeDeclaration:!0},o);if(!n||!l||l.length!==2)return l;const d=await s.provideReferences(r,a,{includeDeclaration:!1},o);return d&&d.length===1?d:l})}async function Nb(i){const e=await i(),t=new Jo(e,""),n=t.references.map(o=>o.link);return t.dispose(),n}Ml("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(pe),o=zL(n.definitionProvider,e,t,et.None);return Nb(()=>o)});Ml("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(pe),o=Rz(n.typeDefinitionProvider,e,t,et.None);return Nb(()=>o)});Ml("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(pe),o=Mz(n.declarationProvider,e,t,et.None);return Nb(()=>o)});Ml("_executeReferenceProvider",(i,e,t)=>{const n=i.get(pe),o=UL(n.referenceProvider,e,t,!1,et.None);return Nb(()=>o)});Ml("_executeImplementationProvider",(i,e,t)=>{const n=i.get(pe),o=Tz(n.implementationProvider,e,t,et.None);return Nb(()=>o)});var Yf,Qf,Xf,F1,B1,W1,V1,H1;yn.appendMenuItem(x.EditorContext,{submenu:x.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});class Um{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Um||P.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class no extends La{static all(){return no._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const n of it.wrap(t.menu))(n.id===x.EditorContext||n.id===x.EditorContextPeek)&&(n.when=G.and(e.precondition,n.when));return t}constructor(e,t){super(no._patchConfig(t)),this.configuration=e,no._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,o){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(Pi),r=e.get(vt),a=e.get(Sc),l=e.get(HL),d=e.get(pe),h=e.get(Me),c=t.getModel(),u=t.getPosition(),g=Um.is(n)?n:new Um(c,u),m=new oc(t,5),f=LS(this._getLocationModel(d,g.model,g.position,m.token),m.token).then(async _=>{var b;if(!_||m.token.isCancellationRequested)return;ir(_.ariaMessage);let v;if(_.referenceAt(c.uri,u)){const w=this._getAlternativeCommand(t);!no._activeAlternativeCommands.has(w)&&no._allSymbolNavigationCommands.has(w)&&(v=no._allSymbolNavigationCommands.get(w))}const C=_.references.length;if(C===0){if(!this.configuration.muteMessage){const w=c.getWordAtPosition(u);(b=Xo.get(t))===null||b===void 0||b.showMessage(this._getNoResultFoundMessage(w),u)}}else if(C===1&&v)no._activeAlternativeCommands.add(this.desc.id),h.invokeFunction(w=>v.runEditorCommand(w,t,n,o).finally(()=>{no._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,o)},_=>{s.error(_)}).finally(()=>{m.dispose()});return a.showWhile(f,250),f}async _onResult(e,t,n,o,s){const r=this._getGoToPreference(n);if(!(n instanceof ac)&&(this.configuration.openInPeek||r==="peek"&&o.references.length>1))this._openInPeek(n,o,s);else{const a=o.firstReference(),l=o.references.length>1&&r==="gotoAndPeek",d=await this._openReference(n,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,o,s):o.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,n,o,s){let r;if(Kq(n)&&(r=n.targetSelectionRange),r||(r=n.range),!r)return;const a=await t.openCodeEditor({resource:n.uri,options:{selection:L.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,o);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,n){const o=dc.get(e);o&&e.hasModel()?o.toggleWidget(n??e.getSelection(),Yi(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}no._allSymbolNavigationCommands=new Map;no._activeAlternativeCommands=new Set;class Ib extends no{async _getLocationModel(e,t,n,o){return new Jo(await zL(e.definitionProvider,t,n,o),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}}Gt((Yf=class extends Ib{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Yf.id,title:{value:p("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:p({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:G.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:[{when:E.editorTextFocus,primary:70,weight:100},{when:G.and(E.editorTextFocus,BV),primary:2118,weight:100}],menu:[{id:x.EditorContext,group:"navigation",order:1.1},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),ct.registerCommandAlias("editor.action.goToDeclaration",Yf.id)}},Yf.id="editor.action.revealDefinition",Yf));Gt((Qf=class extends Ib{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Qf.id,title:{value:p("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:G.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:[{when:E.editorTextFocus,primary:$i(2089,70),weight:100},{when:G.and(E.editorTextFocus,BV),primary:$i(2089,2118),weight:100}]}),ct.registerCommandAlias("editor.action.openDeclarationToTheSide",Qf.id)}},Qf.id="editor.action.revealDefinitionAside",Qf));Gt((Xf=class extends Ib{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Xf.id,title:{value:p("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:G.and(E.hasDefinitionProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:x.EditorContextPeek,group:"peek",order:2}}),ct.registerCommandAlias("editor.action.previewDeclaration",Xf.id)}},Xf.id="editor.action.peekDefinition",Xf));class Az extends no{async _getLocationModel(e,t,n,o){return new Jo(await Mz(e.declarationProvider,t,n,o),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}}Gt((F1=class extends Az{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:F1.id,title:{value:p("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:p({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:G.and(E.hasDeclarationProvider,E.isInWalkThroughSnippet.toNegated()),menu:[{id:x.EditorContext,group:"navigation",order:1.3},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(i){return i&&i.word?p("decl.noResultWord","No declaration found for '{0}'",i.word):p("decl.generic.noResults","No declaration found")}},F1.id="editor.action.revealDeclaration",F1));Gt(class extends Az{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:p("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:G.and(E.hasDeclarationProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:x.EditorContextPeek,group:"peek",order:3}})}});class Pz extends no{async _getLocationModel(e,t,n,o){return new Jo(await Rz(e.typeDefinitionProvider,t,n,o),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}}Gt((B1=class extends Pz{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:B1.ID,title:{value:p("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:p({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:G.and(E.hasTypeDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:0,weight:100},menu:[{id:x.EditorContext,group:"navigation",order:1.4},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},B1.ID="editor.action.goToTypeDefinition",B1));Gt((W1=class extends Pz{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:W1.ID,title:{value:p("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:G.and(E.hasTypeDefinitionProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:x.EditorContextPeek,group:"peek",order:4}})}},W1.ID="editor.action.peekTypeDefinition",W1));class Oz extends no{async _getLocationModel(e,t,n,o){return new Jo(await Tz(e.implementationProvider,t,n,o),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}}Gt((V1=class extends Oz{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:V1.ID,title:{value:p("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:p({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:G.and(E.hasImplementationProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:2118,weight:100},menu:[{id:x.EditorContext,group:"navigation",order:1.45},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},V1.ID="editor.action.goToImplementation",V1));Gt((H1=class extends Oz{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:H1.ID,title:{value:p("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:G.and(E.hasImplementationProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:3142,weight:100},menu:{id:x.EditorContextPeek,group:"peek",order:5}})}},H1.ID="editor.action.peekImplementation",H1));class Fz extends no{_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}}Gt(class extends Fz{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({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:G.and(E.hasReferenceProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:1094,weight:100},menu:[{id:x.EditorContext,group:"navigation",order:1.45},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(i,e,t,n){return new Jo(await UL(i.referenceProvider,e,t,!0,n),p("ref.title","References"))}});Gt(class extends Fz{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:G.and(E.hasReferenceProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:x.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(i,e,t,n){return new Jo(await UL(i.referenceProvider,e,t,!1,n),p("ref.title","References"))}});class p_e extends no{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:{value:p("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:G.and(Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}async _getLocationModel(e,t,n,o){return new Jo(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""}}ct.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:xe},{name:"position",description:"The position at which to start",constraint:P.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(i,e,t,n,o,s,r)=>{Et(xe.isUri(e)),Et(P.isIPosition(t)),Et(Array.isArray(n)),Et(typeof o>"u"||typeof o=="string"),Et(typeof r>"u"||typeof r=="boolean");const a=i.get(vt),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(xl(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const h=new class extends p_e{_getNoResultFoundMessage(c){return s||super._getNoResultFoundMessage(c)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},n,o);d.get(Me).invokeFunction(h.run.bind(h),l)})}});ct.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:xe},{name:"position",description:"The position at which to start",constraint:P.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(i,e,t,n,o)=>{i.get(pi).executeCommand("editor.action.goToLocations",e,t,n,o,void 0,!0)}});ct.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{Et(xe.isUri(e)),Et(P.isIPosition(t));const n=i.get(pe),o=i.get(vt);return o.openCodeEditor({resource:e},o.getFocusedCodeEditor()).then(s=>{if(!xl(s)||!s.hasModel())return;const r=dc.get(s);if(!r)return;const a=Yi(d=>UL(n.referenceProvider,s.getModel(),P.lift(t),!1,d).then(h=>new Jo(h,p("ref.title","References")))),l=new L(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});ct.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var m_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},mx=function(i,e){return function(t,n){e(t,n,i)}},S_;let ng=S_=class{constructor(i,e,t,n){this.textModelResolverService=e,this.languageService=t,this.languageFeaturesService=n,this.toUnhook=new Y,this.toUnhookForKeyboard=new Y,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=i,this.linkDecorations=this.editor.createDecorationsCollection();const o=new OL(i);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,r])=>{this.startFindDefinitionFromMouse(s,r??void 0)})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(r=>{Ke(r)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(i){return i.getContribution(S_.ID)}async startFindDefinitionFromCursor(i){await this.startFindDefinition(i),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(i,e){if(i.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(i,e)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const t=i.target.position;this.startFindDefinition(t)}async startFindDefinition(i){var e;this.toUnhookForKeyboard.clear();const t=i?(e=this.editor.getModel())===null||e===void 0?void 0:e.getWordAtPosition(i):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const n=new kH(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Yi(r=>this.findDefinition(i,r));let o;try{o=await this.previousPromise}catch(r){Ke(r);return}if(!o||!o.length||!n.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?L.lift(o[0].originSelectionRange):new L(i.lineNumber,t.startColumn,i.lineNumber,t.endColumn);if(o.length>1){let r=s;for(const{originSelectionRange:a}of o)a&&(r=L.plusRange(r,a));this.addDecoration(r,new Kn().appendText(p("multipleResults","Click to show {0} definitions.",o.length)))}else{const r=o[0];if(!r.uri)return;this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:l}}=a,{startLineNumber:d}=r.range;if(d<1||d>l.getLineCount()){a.dispose();return}const h=this.getPreviewValue(l,d,r),c=this.languageService.guessLanguageIdByFilepathOrFirstLine(l.uri);this.addDecoration(s,h?new Kn().appendCodeblock(c||"",h):void 0),a.dispose()})}}getPreviewValue(i,e,t){let n=t.range;return n.endLineNumber-n.startLineNumber>=S_.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(i,e)),this.stripIndentationFromPreviewRange(i,e,n)}stripIndentationFromPreviewRange(i,e,t){let n=i.getLineFirstNonWhitespaceColumn(e);for(let o=e+1;o<t.endLineNumber;o++){const s=i.getLineFirstNonWhitespaceColumn(o);n=Math.min(n,s)}return i.getValueInRange(t).replace(new RegExp(`^\\s{${n-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(i,e){const t=i.getLineFirstNonWhitespaceColumn(e),n=Math.min(i.getLineCount(),e+S_.MAX_SOURCE_PREVIEW_LINES);let o=e+1;for(;o<n;o++){const s=i.getLineFirstNonWhitespaceColumn(o);if(t===s)break}return new L(e,1,o+1,1)}addDecoration(i,e){const t={range:i,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:e}};this.linkDecorations.set([t])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(i,e){var t;return this.editor.hasModel()&&i.isLeftClick&&i.isNoneOrSingleMouseDown&&i.target.type===6&&!(((t=i.target.detail.injectedText)===null||t===void 0?void 0:t.options)instanceof ic)&&(i.hasTriggerModifier||(e?e.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(i,e){const t=this.editor.getModel();return t?zL(this.languageFeaturesService.definitionProvider,t,i,e):Promise.resolve(null)}gotoDefinition(i,e){return this.editor.setPosition(i),this.editor.invokeWithinContext(t=>{const n=!e&&this.editor.getOption(87)&&!this.isInPeekEditor(t);return new Ib({openToSide:e,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(t)})}isInPeekEditor(i){const e=i.get(Ae);return Ao.inPeekEditor.getValue(e)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};ng.ID="editor.contrib.gotodefinitionatposition";ng.MAX_SOURCE_PREVIEW_LINES=8;ng=S_=m_e([mx(1,Oo),mx(2,Xt),mx(3,pe)],ng);pt(ng.ID,ng,2);const z1=ee;class Bz extends B{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 ib(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class gP extends B{static render(e,t,n){return new gP(e,t,n)}constructor(e,t,n){super(),this.actionContainer=Z(e,z1("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Z(this.actionContainer,z1("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Z(this.action,z1(`span.icon.${t.iconClass}`));const o=Z(this.action,z1("span"));o.textContent=n?`${t.label} (${n})`:t.label,this._register($(this.actionContainer,ae.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register($(this.actionContainer,ae.KEY_DOWN,s=>{const r=new jt(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 f_e(i,e){return i&&e?p("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?p("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}let __e=class{constructor(i,e,t){this.value=i,this.isComplete=e,this.hasLoadingMessage=t}};class Wz extends B{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new A),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Mt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Mt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Mt(()=>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=iZ(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){Ke(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 __e(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 fx{constructor(e,t,n,o){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=o,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class UC{constructor(e,t,n,o,s,r){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=o,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 Ng=new class{constructor(){this._participants=[]}register(i){this._participants.push(i)}getAll(){return this._participants}};class pP{constructor(){this._onDidWillResize=new A,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new A,this.onDidResize=this._onDidResize.event,this._sashListener=new Y,this._size=new ft(0,0),this._minSize=new ft(0,0),this._maxSize=new ft(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Hn(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Hn(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Hn(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:gy.North}),this._southSash=new Hn(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:gy.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,n=0;this._sashListener.add(le.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(le.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(o=>{e&&(n=o.currentX-o.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(o=>{e&&(n=-(o.currentX-o.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(o=>{e&&(t=-(o.currentY-o.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(o=>{e&&(t=o.currentY-o.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(le.any(this._eastSash.onDidReset,this._westSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(le.any(this._northSash.onDidReset,this._southSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,n,o){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=o?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:o}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(n,Math.min(s,e)),t=Math.max(o,Math.min(r,t));const a=new ft(t,e);ft.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 v_e=30,b_e=24;class C_e extends B{constructor(e,t=new ft(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new pP),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=ft.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new ft(n.dimension.width,n.dimension.height)),n.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?P.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:ji(t).top+n.top-v_e}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const o=ji(t),s=Hu(t.ownerDocument.body),r=o.top+n.top+n.height;return s.height-r-b_e}_findPositionPreference(e,t){var n,o;const s=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),r=Math.min((o=this._availableVerticalSpaceAbove(t))!==null&&o!==void 0?o: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 mP=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},_u=function(i,e){return function(t,n){e(t,n,i)}},KC,Oa;const X6=ee;let Vy=KC=class extends B{constructor(i,e,t){super(),this._editor=i,this._instantiationService=e,this._keybindingService=t,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Fh,this._editor)),this._participants=[];for(const n of Ng.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,o)=>n.hoverOrdinal-o.hoverOrdinal),this._computer=new zy(this._editor,this._participants),this._hoverOperation=this._register(new Wz(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{if(!this._computer.anchor)return;const o=n.hasLoadingMessage?this._addLoadingMessage(n.value):n.value;this._withResult(new Vz(this._computer.anchor,o,n.isComplete))})),this._register(bi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(hi.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(i){if(this._widget.isResizing)return!0;const e=[];for(const n of this._participants)if(n.suggestHoverAnchor){const o=n.suggestHoverAnchor(i);o&&e.push(o)}const t=i.target;if(t.type===6&&e.push(new fx(0,t.range,i.event.posx,i.event.posy)),t.type===7){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!t.detail.isAfterLines&&typeof t.detail.horizontalDistanceToText=="number"&&t.detail.horizontalDistanceToText<n&&e.push(new fx(0,t.range,i.event.posx,i.event.posy))}return e.length===0?this._startShowingOrUpdateHover(null,0,0,!1,i):(e.sort((n,o)=>o.priority-n.priority),this._startShowingOrUpdateHover(e[0],0,0,!1,i))}startShowingAtRange(i,e,t,n){this._startShowingOrUpdateHover(new fx(0,i,void 0,void 0),e,t,n,null)}_startShowingOrUpdateHover(i,e,t,n,o){return!this._widget.position||!this._currentResult?i?(this._startHoverOperationIfNecessary(i,e,t,n,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(i&&this._startHoverOperationIfNecessary(i,e,t,n,!0),!0):i?i&&this._currentResult.anchor.equals(i)?!0:i.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(i)),this._startHoverOperationIfNecessary(i,e,t,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(i,e,t,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(i,e,t,n,o){this._computer.anchor&&this._computer.anchor.equals(i)||(this._hoverOperation.cancel(),this._computer.anchor=i,this._computer.shouldFocus=n,this._computer.source=t,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(e))}_setCurrentResult(i){this._currentResult!==i&&(i&&i.messages.length===0&&(i=null),this._currentResult=i,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(i){return i?this._widget.getDomNode().contains(i):!1}_addLoadingMessage(i){if(this._computer.anchor){for(const e of this._participants)if(e.createLoadingMessage){const t=e.createLoadingMessage(this._computer.anchor);if(t)return i.slice(0).concat([t])}}return i}_withResult(i){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!i.isComplete||this._computer.insistOnKeepingHoverVisible&&i.messages.length===0)||this._setCurrentResult(i)}_renderMessages(i,e){const{showAtPosition:t,showAtSecondaryPosition:n,highlightRange:o}=KC.computeHoverRanges(this._editor,i.range,e),s=new Y,r=s.add(new Hy(this._keybindingService)),a=document.createDocumentFragment();let l=null;const d={fragment:a,statusBar:r,setColorPicker:c=>l=c,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:c=>this._widget.setMinimumDimensions(c),hide:()=>this.hide()};for(const c of this._participants){const u=e.filter(g=>g.owner===c);u.length>0&&s.add(c.renderHoverParts(d,u))}const h=e.some(c=>c.isBeforeContent);if(r.hasContent&&a.appendChild(r.hoverElement),a.hasChildNodes()){if(o){const c=this._editor.createDecorationsCollection();c.set([{range:o,options:KC._DECORATION_OPTIONS}]),s.add(Ne(()=>{c.clear()}))}this._widget.showAt(a,new y_e(l,t,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,h,i.initialMousePosX,i.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(i,e,t){let n=1;if(i.hasModel()){const l=i._getViewModel(),d=l.coordinatesConverter,h=d.convertModelRangeToViewRange(e),c=new P(h.startLineNumber,l.getLineMinColumn(h.startLineNumber));n=d.convertViewPositionToModelPosition(c).column}const o=e.startLineNumber;let s=e.startColumn,r=t[0].range,a=null;for(const l of t)r=L.plusRange(r,l.range),l.range.startLineNumber===o&&l.range.endLineNumber===o&&(s=Math.max(Math.min(s,l.range.startColumn),n)),l.forceShowAtRange&&(a=l.range);return{showAtPosition:a?a.getStartPosition():new P(o,e.startColumn),showAtSecondaryPosition:a?a.getStartPosition():new P(o,s),highlightRange:r}}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()}};Vy._DECORATION_OPTIONS=je.register({description:"content-hover-highlight",className:"hoverHighlight"});Vy=KC=mP([_u(1,Me),_u(2,Tt)],Vy);class Vz{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new w_e(this,this.anchor,t,this.isComplete)}}class w_e extends Vz{constructor(e,t,n,o){super(t,n,o),this.original=e}filter(e){return this.original.filter(e)}}class y_e{constructor(e,t,n,o,s,r,a,l,d,h){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=n,this.preferAbove=o,this.stoleFocus=s,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=h,this.closestMouseDistance=void 0}}const J6=30,_x=10,S_e=6;let Fh=Oa=class extends C_e{get isColorPickerVisible(){var i;return!!(!((i=this._visibleData)===null||i===void 0)&&i.colorPicker)}get isVisibleFromKeyboard(){var i;return((i=this._visibleData)===null||i===void 0?void 0:i.source)===1}get isVisible(){var i;return(i=this._hoverVisibleKey.get())!==null&&i!==void 0?i:!1}get isFocused(){var i;return(i=this._hoverFocusedKey.get())!==null&&i!==void 0?i:!1}constructor(i,e,t,n,o){const s=i.getOption(66)+8,r=150,a=new ft(r,s);super(i,a),this._configurationService=t,this._accessibilityService=n,this._keybindingService=o,this._hover=this._register(new Bz),this._minimumSize=a,this._hoverVisibleKey=E.hoverVisible.bindTo(e),this._hoverFocusedKey=E.hoverFocused.bindTo(e),Z(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(50)&&this._updateFont()}));const l=this._register(bl(this._resizableNode.domNode));this._register(l.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(l.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var i;super.dispose(),(i=this._visibleData)===null||i===void 0||i.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Oa.ID}static _applyDimensions(i,e,t){const n=typeof e=="number"?`${e}px`:e,o=typeof t=="number"?`${t}px`:t;i.style.width=n,i.style.height=o}_setContentsDomNodeDimensions(i,e){const t=this._hover.contentsDomNode;return Oa._applyDimensions(t,i,e)}_setContainerDomNodeDimensions(i,e){const t=this._hover.containerDomNode;return Oa._applyDimensions(t,i,e)}_setHoverWidgetDimensions(i,e){this._setContentsDomNodeDimensions(i,e),this._setContainerDomNodeDimensions(i,e),this._layoutContentWidget()}static _applyMaxDimensions(i,e,t){const n=typeof e=="number"?`${e}px`:e,o=typeof t=="number"?`${t}px`:t;i.style.maxWidth=n,i.style.maxHeight=o}_setHoverWidgetMaxDimensions(i,e){Oa._applyMaxDimensions(this._hover.contentsDomNode,i,e),Oa._applyMaxDimensions(this._hover.containerDomNode,i,e),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof i=="number"?`${i}px`:i),this._layoutContentWidget()}_hasHorizontalScrollbar(){const i=this._hover.scrollbar.getScrollDimensions();return i.scrollWidth>i.width}_adjustContentsBottomPadding(){const i=this._hover.contentsDomNode,e=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;i.style.paddingBottom!==e&&(i.style.paddingBottom=e)}_setAdjustedHoverWidgetDimensions(i){this._setHoverWidgetMaxDimensions("none","none");const e=i.width,t=i.height;this._setHoverWidgetDimensions(e,t),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(e,t-_x))}_updateResizableNodeMaxDimensions(){var i,e;const t=(i=this._findMaximumRenderingWidth())!==null&&i!==void 0?i:1/0,n=(e=this._findMaximumRenderingHeight())!==null&&e!==void 0?e:1/0;this._resizableNode.maxSize=new ft(t,n),this._setHoverWidgetMaxDimensions(t,n)}_resize(i){var e,t;Oa._lastDimensions=new ft(i.width,i.height),this._setAdjustedHoverWidgetDimensions(i),this._resizableNode.layout(i.height,i.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(t=(e=this._visibleData)===null||e===void 0?void 0:e.colorPicker)===null||t===void 0||t.layout()}_findAvailableSpaceVertically(){var i;const e=(i=this._visibleData)===null||i===void 0?void 0:i.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const i=this._findAvailableSpaceVertically();if(!i)return;let e=S_e;return Array.from(this._hover.contentsDomNode.children).forEach(t=>{e+=t.clientHeight}),this._hasHorizontalScrollbar()&&(e+=_x),Math.min(i,e)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const i=Array.from(this._hover.contentsDomNode.children).some(e=>e.scrollWidth>e.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),i}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const i=this._isHoverTextOverflowing(),e=typeof this._contentWidth>"u"?0:this._contentWidth-2;return i||this._hover.containerDomNode.clientWidth<e?Hu(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(i,e){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=i,this._visibleData.initialMousePosY=e,!1;const t=ji(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=e9(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,t.left,t.top,t.width,t.height));const n=e9(i,e,t.left,t.top,t.width,t.height);return n>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!0)}_setHoverData(i){var e;(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._visibleData=i,this._hoverVisibleKey.set(!!i),this._hover.containerDomNode.classList.toggle("hidden",!i)}_updateFont(){const{fontSize:i,lineHeight:e}=this._editor.getOption(50),t=this._hover.contentsDomNode;t.style.fontSize=`${i}px`,t.style.lineHeight=`${e/i}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(n=>this._editor.applyFontInfo(n))}_updateContent(i){const e=this._hover.contentsDomNode;e.style.paddingBottom="",e.textContent="",e.appendChild(i)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const i=Math.max(this._editor.getLayoutInfo().height/4,250,Oa._lastDimensions.height),e=Math.max(this._editor.getLayoutInfo().width*.66,500,Oa._lastDimensions.width);this._setHoverWidgetMaxDimensions(e,i)}_render(i,e){this._setHoverData(e),this._updateFont(),this._updateContent(i),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var i;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(i=this._positionPreference)!==null&&i!==void 0?i:1]}:null}showAt(i,e){var t,n,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(i,e);const r=lu(this._hover.containerDomNode),a=e.showAtPosition;this._positionPreference=(t=this._findPositionPreference(r,a))!==null&&t!==void 0?t:1,this.onContentsChanged(),e.stoleFocus&&this._hover.containerDomNode.focus(),(n=e.colorPicker)===null||n===void 0||n.layout();const l=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&f_e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&s!==void 0?s:"");l&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+l)}hide(){if(!this._visibleData)return;const i=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new ft(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),i&&this._editor.focus()}_removeConstraintsRenderNormally(){const i=this._editor.getLayoutInfo();this._resizableNode.layout(i.height,i.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(i){var e;const t=this._hover.containerDomNode,n=this._hover.contentsDomNode,o=(e=this._findMaximumRenderingHeight())!==null&&e!==void 0?e:1/0;this._setContainerDomNodeDimensions(Do(t),Math.min(o,i)),this._setContentsDomNodeDimensions(Do(n),Math.min(o,i-_x))}setMinimumDimensions(i){this._minimumSize=new ft(Math.max(this._minimumSize.width,i.width),Math.max(this._minimumSize.height,i.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const i=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new ft(i,this._minimumSize.height)}onContentsChanged(){var i;this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=lu(e),n=Do(e);if(this._resizableNode.layout(t,n),this._setHoverWidgetDimensions(n,t),t=lu(e),n=Do(e),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(t)),!((i=this._visibleData)===null||i===void 0)&&i.showAtPosition){const o=lu(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const i=this._hover.scrollbar.getScrollPosition().scrollTop,e=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:i-e.lineHeight})}scrollDown(){const i=this._hover.scrollbar.getScrollPosition().scrollTop,e=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:i+e.lineHeight})}scrollLeft(){const i=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:i-J6})}scrollRight(){const i=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:i+J6})}pageUp(){const i=this._hover.scrollbar.getScrollPosition().scrollTop,e=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:i-e})}pageDown(){const i=this._hover.scrollbar.getScrollPosition().scrollTop,e=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:i+e})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Fh.ID="editor.contrib.resizableContentHoverWidget";Fh._lastDimensions=new ft(0,0);Fh=Oa=mP([_u(1,Ae),_u(2,at),_u(3,Rl),_u(4,Tt)],Fh);let Hy=class extends B{get hasContent(){return this._hasContent}constructor(i){super(),this._keybindingService=i,this._hasContent=!1,this.hoverElement=X6("div.hover-row.status-bar"),this.actionsElement=Z(this.hoverElement,X6("div.actions"))}addAction(i){const e=this._keybindingService.lookupKeybinding(i.commandId),t=e?e.getLabel():null;return this._hasContent=!0,this._register(gP.render(this.actionsElement,i,t))}append(i){const e=Z(this.actionsElement,i);return this._hasContent=!0,e}};Hy=mP([_u(0,Tt)],Hy);class zy{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const n=e.getModel(),o=t.range.startLineNumber;if(o>n.getLineCount())return[];const s=n.getLineMaxColumn(o);return e.getLineDecorations(o).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===o?r.range.startColumn:1,l=r.range.endLineNumber===o?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 Bi.EMPTY;const n=zy._getLineDecorations(this._editor,t);return Bi.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(t,n,e):Bi.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=zy._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return pa(t)}}function e9(i,e,t,n,o,s){const r=t+o/2,a=n+s/2,l=Math.max(Math.abs(i-r)-o/2,0),d=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+d*d)}const t9=ee;class nm extends B{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Y),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new Bz),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Id({editor:this._editor},t,n)),this._computer=new L_e(this._editor),this._hoverOperation=this._register(new Wz(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{this._withResult(o.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return nm.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(e=>this._editor.applyFontInfo(e))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const o of t){const s=t9("div.hover-row.markdown-hover"),r=Z(s,t9("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(o.value));r.appendChild(a.element),n.appendChild(s)}this._updateContents(n),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),s=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=n-o-(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`}}nm.ID="editor.contrib.modesGlyphHoverWidget";class L_e{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),n=[];if(!t)return n;for(const o of t){if(!o.options.glyphMarginClassName)continue;const s=o.options.glyphMarginHoverMessage;!s||Rm(s)||n.push(...DT(s).map(e))}return n}}class k_e{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}async function D_e(i,e,t,n,o){try{const s=await Promise.resolve(i.provideHover(t,n,o));if(s&&E_e(s))return new k_e(i,s,e)}catch(s){Ti(s)}}function fP(i,e,t,n){const o=i.ordered(e).map((s,r)=>D_e(s,r,e,t,n));return Bi.fromPromises(o).coalesce()}function x_e(i,e,t,n){return fP(i,e,t,n).map(o=>o.hover).toPromise()}Ml("_executeHoverProvider",(i,e,t)=>{const n=i.get(pe);return x_e(n.hoverProvider,e,t,et.None)});function E_e(i){const e=typeof i.range<"u",t=typeof i.contents<"u"&&i.contents&&i.contents.length>0;return e&&t}var N_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},U1=function(i,e){return function(t,n){e(t,n,i)}};const i9=ee;class oa{constructor(e,t,n,o,s){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=o,this.ordinal=s}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Uy=class{constructor(i,e,t,n,o){this._editor=i,this._languageService=e,this._openerService=t,this._configurationService=n,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(i){return new oa(this,i.range,[new Kn().appendText(p("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(i,e){if(!this._editor.hasModel()||i.type!==1)return[];const t=this._editor.getModel(),n=i.range.startLineNumber,o=t.getLineMaxColumn(n),s=[];let r=1e3;const a=t.getLineLength(n),l=t.getLanguageIdAtPosition(i.range.startLineNumber,i.range.startColumn),d=this._editor.getOption(116),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let c=!1;d>=0&&a>d&&i.range.startColumn>=d&&(c=!0,s.push(new oa(this,i.range,[{value:p("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,r++))),!c&&typeof h=="number"&&a>=h&&s.push(new oa(this,i.range,[{value:p("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,r++));let u=!1;for(const g of e){const m=g.range.startLineNumber===n?g.range.startColumn:1,f=g.range.endLineNumber===n?g.range.endColumn:o,_=g.options.hoverMessage;if(!_||Rm(_))continue;g.options.beforeContentClassName&&(u=!0);const b=new L(i.range.startLineNumber,m,i.range.startLineNumber,f);s.push(new oa(this,b,DT(_),u,r++))}return s}computeAsync(i,e,t){if(!this._editor.hasModel()||i.type!==1)return Bi.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return Bi.EMPTY;const o=new P(i.range.startLineNumber,i.range.startColumn);return fP(this._languageFeaturesService.hoverProvider,n,o,t).filter(s=>!Rm(s.hover.contents)).map(s=>{const r=s.hover.range?L.lift(s.hover.range):i.range;return new oa(this,r,s.hover.contents,!1,s.ordinal)})}renderHoverParts(i,e){return Hz(i,e,this._editor,this._languageService,this._openerService)}};Uy=N_e([U1(1,Xt),U1(2,as),U1(3,at),U1(4,pe)],Uy);function Hz(i,e,t,n,o){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new Y;for(const r of e)for(const a of r.contents){if(Rm(a))continue;const l=i9("div.hover-row.markdown-hover"),d=Z(l,i9("div.hover-contents")),h=s.add(new Id({editor:t},n,o));s.add(h.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",i.onContentsChanged()}));const c=s.add(h.render(a));d.appendChild(c.element),i.fragment.appendChild(l)}return s}var zz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Ky=function(i,e){return function(t,n){e(t,n,i)}};class n9{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let Z2=class{constructor(i,e,t){this._markerService=e,this._configService=t,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._dispoables=new Y,this._markers=[],this._nextIdx=-1,xe.isUri(i)?this._resourceFilter=r=>r.toString()===i.toString():i&&(this._resourceFilter=i);const n=this._configService.getValue("problems.sortOrder"),o=(r,a)=>{let l=bv(r.resource.toString(),a.resource.toString());return l===0&&(n==="position"?l=L.compareRangesUsingStarts(r,a)||gi.compare(r.severity,a.severity):l=gi.compare(r.severity,a.severity)||L.compareRangesUsingStarts(r,a)),l},s=()=>{this._markers=this._markerService.read({resource:xe.isUri(i)?i:void 0,severities:gi.Error|gi.Warning|gi.Info}),typeof i=="function"&&(this._markers=this._markers.filter(r=>this._resourceFilter(r.resource))),this._markers.sort(o)};s(),this._dispoables.add(e.onMarkerChanged(r=>{(!this._resourceFilter||r.some(a=>this._resourceFilter(a)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(i){return!this._resourceFilter&&!i?!0:!this._resourceFilter||!i?!1:this._resourceFilter(i)}get selected(){const i=this._markers[this._nextIdx];return i&&new n9(i,this._nextIdx+1,this._markers.length)}_initIdx(i,e,t){let n=!1,o=this._markers.findIndex(s=>s.resource.toString()===i.uri.toString());o<0&&(o=cv(this._markers,{resource:i.uri},(s,r)=>bv(s.resource.toString(),r.resource.toString())),o<0&&(o=~o));for(let s=o;s<this._markers.length;s++){let r=L.lift(this._markers[s]);if(r.isEmpty()){const a=i.getWordAtPosition(r.getStartPosition());a&&(r=new L(r.startLineNumber,a.startColumn,r.startLineNumber,a.endColumn))}if(e&&(r.containsPosition(e)||e.isBeforeOrEqual(r.getStartPosition()))){this._nextIdx=s,n=!0;break}if(this._markers[s].resource.toString()!==i.uri.toString())break}n||(this._nextIdx=t?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(i,e,t){if(this._markers.length===0)return!1;const n=this._nextIdx;return this._nextIdx===-1?this._initIdx(e,t,i):i?this._nextIdx=(this._nextIdx+1)%this._markers.length:i||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(i,e){let t=this._markers.findIndex(n=>n.resource.toString()===i.toString());if(!(t<0)){for(;t<this._markers.length;t++)if(L.containsPosition(this._markers[t],e))return new n9(this._markers[t],t+1,this._markers.length)}}};Z2=zz([Ky(1,Al),Ky(2,at)],Z2);const Uz=tt("IMarkerNavigationService");let Y2=class{constructor(i,e){this._markerService=i,this._configService=e,this._provider=new po}getMarkerList(i){for(const e of this._provider){const t=e.getMarkerList(i);if(t)return t}return new Z2(i,this._markerService,this._configService)}};Y2=zz([Ky(0,Al),Ky(1,at)],Y2);lt(Uz,Y2,1);var Q2;(function(i){function e(t){switch(t){case Li.Ignore:return"severity-ignore "+Ee.asClassName(oe.info);case Li.Info:return Ee.asClassName(oe.info);case Li.Warning:return Ee.asClassName(oe.warning);case Li.Error:return Ee.asClassName(oe.error);default:return""}}i.className=e})(Q2||(Q2={}));var I_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},$g=function(i,e){return function(t,n){e(t,n,i)}},X2;class M_e{constructor(e,t,n,o,s){this._openerService=o,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Y,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(bi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new jB(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(){kt(this._disposables)}update(e){const{source:t,message:n,relatedInformation:o,code:s}=e;let r=((t==null?void 0:t.length)||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=vl(n);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Ln(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=ee("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=m=>{this._openerService.open(s.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()};const g=Z(this._codeLink,ee("span"));g.innerText=s.value,u.appendChild(this._codeLink)}}if(Ln(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),jn(o)){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 o){const m=document.createElement("div"),f=document.createElement("a");f.classList.add("filename"),f.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,f.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(f,g);const _=document.createElement("span");_.innerText=g.message,m.appendChild(f),m.appendChild(_),this._lines+=1,u.appendChild(m)}}const d=this._editor.getOption(50),h=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),c=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:c})}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 gi.Error:t=p("Error","Error");break;case gi.Warning:t=p("Warning","Warning");break;case gi.Info:t=p("Info","Info");break;case gi.Hint:t=p("Hint","Hint");break}let n=p("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const o=this._editor.getModel();return o&&e.startLineNumber<=o.getLineCount()&&e.startLineNumber>=1&&(n=`${o.getLineContent(e.startLineNumber)}, ${n}`),n}}let Km=X2=class extends Wy{constructor(i,e,t,n,o,s,r){super(i,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=e,this._openerService=t,this._menuService=n,this._contextKeyService=s,this._labelService=r,this._callOnDispose=new Y,this._onDidSelectRelatedInformation=new A,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=gi.Warning,this._backgroundColor=V.white,this._applyTheme(e.getColorTheme()),this._callOnDispose.add(e.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(i){this._backgroundColor=i.getColor(P_e);let e=J2,t=T_e;this._severity===gi.Warning?(e=jC,t=R_e):this._severity===gi.Info&&(e=eM,t=A_e);const n=i.getColor(e),o=i.getColor(t);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:i.getColor(Ez),secondaryHeadingColor:i.getColor(Nz)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(i){super._fillHead(i),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(n=>this.editor.focus()));const e=[],t=this._menuService.createMenu(X2.TitleMenu,this._contextKeyService);_A(t,void 0,e),this._actionbarWidget.push(e,{label:!1,icon:!0,index:0}),t.dispose()}_fillTitleIcon(i){this._icon=Z(i,ee(""))}_fillBody(i){this._parentContainer=i,i.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),i.appendChild(this._container),this._message=new M_e(this._container,this.editor,e=>this._onDidSelectRelatedInformation.fire(e),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(i,e,t){this._container.classList.remove("stale"),this._message.update(i),this._severity=i.severity,this._applyTheme(this._themeService.getColorTheme());const n=L.lift(i),o=this.editor.getPosition(),s=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(s,this.computeRequiredHeight());const r=this.editor.getModel();if(r){const a=t>1?p("problems","{0} of {1} problems",e,t):p("change","{0} of {1} problem",e,t);this.setTitle(nr(r.uri),a)}this._icon.className=`codicon ${Q2.className(gi.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(i){this._container.classList.remove("stale"),this._message.update(i)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(i,e){super._doLayoutBody(i,e),this._heightInPixel=i,this._message.layout(i,e),this._container.style.height=`${i}px`}_onWidth(i){this._message.layout(this._heightInPixel,i)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Km.TitleMenu=new x("gotoErrorTitleMenu");Km=X2=I_e([$g(1,nn),$g(2,as),$g(3,Sa),$g(4,Me),$g(5,Ae),$g(6,Im)],Km);const o9=Fv(nl,uJ),s9=Fv(Ds,Pv),r9=Fv(Mo,Ov),J2=M("editorMarkerNavigationError.background",{dark:o9,light:o9,hcDark:rt,hcLight:rt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),T_e=M("editorMarkerNavigationError.headerBackground",{dark:ye(J2,.1),light:ye(J2,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),jC=M("editorMarkerNavigationWarning.background",{dark:s9,light:s9,hcDark:rt,hcLight:rt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),R_e=M("editorMarkerNavigationWarning.headerBackground",{dark:ye(jC,.1),light:ye(jC,.1),hcDark:"#0C141F",hcLight:ye(jC,.2)},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),eM=M("editorMarkerNavigationInfo.background",{dark:r9,light:r9,hcDark:rt,hcLight:rt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),A_e=M("editorMarkerNavigationInfo.headerBackground",{dark:ye(eM,.1),light:ye(eM,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),P_e=M("editorMarkerNavigation.background",{dark:tn,light:tn,hcDark:tn,hcLight:tn},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));var O_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},K1=function(i,e){return function(t,n){e(t,n,i)}},L_;let hc=L_=class{static get(i){return i.getContribution(L_.ID)}constructor(i,e,t,n,o){this._markerNavigationService=e,this._contextKeyService=t,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new Y,this._editor=i,this._widgetVisible=Kz.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(i){if(this._model&&this._model.matches(i))return this._model;let e=!1;return this._model&&(e=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(i),e&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(Km,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(t=>{var n,o,s;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!L.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,t.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const t=this._model.find(this._editor.getModel().uri,this._widget.position);t?this._widget.updateMarker(t.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(t=>{this._editorService.openCodeEditor({resource:t.resource,options:{pinned:!0,revealIfOpened:!0,selection:L.lift(t).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(i=!0){this._cleanUp(),i&&this._editor.focus()}showAtMarker(i){if(this._editor.hasModel()){const e=this._getOrCreateModel(this._editor.getModel().uri);e.resetIndex(),e.move(!0,this._editor.getModel(),new P(i.startLineNumber,i.startColumn)),e.selected&&this._widget.showAtMarker(e.selected.marker,e.selected.index,e.selected.total)}}async nagivate(i,e){var t,n;if(this._editor.hasModel()){const o=this._getOrCreateModel(e?void 0:this._editor.getModel().uri);if(o.move(i,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((t=L_.get(s))===null||t===void 0||t.close(),(n=L_.get(s))===null||n===void 0||n.nagivate(i,e))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}}};hc.ID="editor.contrib.markerController";hc=L_=O_e([K1(1,Uz),K1(2,Ae),K1(3,vt),K1(4,Me)],hc);class KL extends ce{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}async run(e,t){var n;t.hasModel()&&((n=hc.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))}}class Bh extends KL{constructor(){super(!0,!1,{id:Bh.ID,label:Bh.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:578,weight:100},menuOpts:{menuId:Km.TitleMenu,title:Bh.LABEL,icon:Ei("marker-navigation-next",oe.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Bh.ID="editor.action.marker.next";Bh.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Eu extends KL{constructor(){super(!1,!1,{id:Eu.ID,label:Eu.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:1602,weight:100},menuOpts:{menuId:Km.TitleMenu,title:Eu.LABEL,icon:Ei("marker-navigation-previous",oe.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Eu.ID="editor.action.marker.prev";Eu.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class F_e extends KL{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:E.focus,primary:66,weight:100},menuOpts:{menuId:x.MenubarGoMenu,title:p({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class B_e extends KL{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:E.focus,primary:1090,weight:100},menuOpts:{menuId:x.MenubarGoMenu,title:p({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}pt(hc.ID,hc,4);ie(Bh);ie(Eu);ie(F_e);ie(B_e);const Kz=new de("markersNavigationVisible",!1),W_e=gn.bindToContribution(hc.get);re(new W_e({id:"closeMarkersNavigation",precondition:Kz,handler:i=>i.close(),kbOpts:{weight:150,kbExpr:E.focus,primary:9,secondary:[1033]}}));var V_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},vx=function(i,e){return function(t,n){e(t,n,i)}};const cr=ee;class H_e{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const a9={type:1,filter:{include:Re.QuickFix},triggerAction:is.QuickFixHover};let tM=class{constructor(i,e,t,n){this._editor=i,this._markerDecorationsService=e,this._openerService=t,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(i,e){if(!this._editor.hasModel()||i.type!==1&&!i.supportsMarkerHover)return[];const t=this._editor.getModel(),n=i.range.startLineNumber,o=t.getLineMaxColumn(n),s=[];for(const r of e){const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:o,d=this._markerDecorationsService.getMarker(t.uri,r);if(!d)continue;const h=new L(i.range.startLineNumber,a,i.range.startLineNumber,l);s.push(new H_e(this,h,d))}return s}renderHoverParts(i,e){if(!e.length)return B.None;const t=new Y;e.forEach(o=>i.fragment.appendChild(this.renderMarkerHover(o,t)));const n=e.length===1?e[0]:e.sort((o,s)=>gi.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(i,n,t),t}renderMarkerHover(i,e){const t=cr("div.hover-row"),n=Z(t,cr("div.marker.hover-contents")),{source:o,message:s,code:r,relatedInformation:a}=i.marker;this._editor.applyFontInfo(n);const l=Z(n,cr("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=s,o||r)if(r&&typeof r!="string"){const d=cr("span");if(o){const g=Z(d,cr("span"));g.innerText=o}const h=Z(d,cr("a.code-link"));h.setAttribute("href",r.target.toString()),e.add($(h,"click",g=>{this._openerService.open(r.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const c=Z(h,cr("span"));c.innerText=r.value;const u=Z(n,d);u.style.opacity="0.6",u.style.paddingLeft="6px"}else{const d=Z(n,cr("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&r?`${o}(${r})`:o||`(${r})`}if(jn(a))for(const{message:d,resource:h,startLineNumber:c,startColumn:u}of a){const g=Z(n,cr("div"));g.style.marginTop="8px";const m=Z(g,cr("a"));m.innerText=`${nr(h)}(${c}, ${u}): `,m.style.cursor="pointer",e.add($(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:c,startColumn:u}}}).catch(Ke)}));const f=Z(g,cr("span"));f.innerText=d,this._editor.applyFontInfo(f)}return t}renderMarkerStatusbar(i,e,t){if((e.marker.severity===gi.Error||e.marker.severity===gi.Warning||e.marker.severity===gi.Info)&&i.statusBar.addAction({label:p("view problem","View Problem"),commandId:Bh.ID,run:()=>{var n;i.hide(),(n=hc.get(this._editor))===null||n===void 0||n.showAtMarker(e.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=i.statusBar.append(cr("div"));this.recentMarkerCodeActionsInfo&&(cy.makeKey(this.recentMarkerCodeActionsInfo.marker)===cy.makeKey(e.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=p("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?B.None:t.add(qh(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const s=this.getCodeActions(e.marker);t.add(Ne(()=>s.cancel())),s.then(r=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:e.marker,hasCodeActions:r.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){r.dispose(),n.textContent=p("noQuickFixes","No quick fixes available");return}n.style.display="none";let a=!1;t.add(Ne(()=>{a||r.dispose()})),i.statusBar.addAction({label:p("quick fixes","Quick Fix..."),commandId:rP,run:l=>{a=!0;const d=sc.get(this._editor),h=ji(l);i.hide(),d==null||d.showCodeActions(a9,r,{x:h.left,y:h.top,width:h.width,height:h.height})}})},Ke)}}getCodeActions(i){return Yi(e=>ev(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new L(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn),a9,Sd.None,e))}};tM=V_e([vx(1,CR),vx(2,as),vx(3,pe)],tM);const jz="editor.action.inlineSuggest.commit",$z="editor.action.inlineSuggest.showPrevious",qz="editor.action.inlineSuggest.showNext";var _P=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},sa=function(i,e){return function(t,n){e(t,n,i)}},$C;let iM=class extends B{constructor(i,e,t){super(),this.editor=i,this.model=e,this.instantiationService=t,this.alwaysShowToolbar=fi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=qe(this,n=>{var o,s,r;const a=(o=this.model.read(n))===null||o===void 0?void 0:o.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!a||a.parts.length===0)return this.sessionPosition=void 0,null;const l=a.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==a.lineNumber&&(this.sessionPosition=void 0);const d=new P(a.lineNumber,Math.min(l,(r=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&r!==void 0?r:Number.MAX_SAFE_INTEGER));return this.sessionPosition=d,d}),this._register(Fd((n,o)=>{const s=this.model.read(n);if(!s||!this.alwaysShowToolbar.read(n))return;const r=o.add(this.instantiationService.createInstance(cc,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]})));i.addContentWidget(r),o.add(Ne(()=>i.removeContentWidget(r))),o.add(yt(a=>{this.position.read(a)&&s.lastTriggerKind.read(a)!==Cd.Explicit&&s.triggerExplicitly()}))}))}};iM=_P([sa(2,Me)],iM);const z_e=Ei("inline-suggestion-hints-next",oe.chevronRight,p("parameterHintsNextIcon","Icon for show next parameter hint.")),U_e=Ei("inline-suggestion-hints-previous",oe.chevronLeft,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let cc=$C=class extends B{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(i,e,t){const n=new vo(i,e,t,!0,()=>this._commandService.executeCommand(i)),o=this.keybindingService.lookupKeybinding(i,this._contextKeyService);let s=e;return o&&(s=p({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",e,o.getLabel())),n.tooltip=s,n}constructor(i,e,t,n,o,s,r,a,l,d,h){super(),this.editor=i,this.withBorder=e,this._position=t,this._currentSuggestionIdx=n,this._suggestionCount=o,this._extraCommands=s,this._commandService=r,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${$C.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Qt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Qt("div@toolBar")]),this.previousAction=this.createCommandAction($z,p("previous","Previous"),Ee.asClassName(U_e)),this.availableSuggestionCountAction=new vo("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(qz,p("next","Next"),Ee.asClassName(z_e)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(x.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Mt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Mt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(a.createInstance(nM,this.nodes.toolBar,x.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},actionViewItemProvider:(c,u)=>{if(c instanceof Er)return a.createInstance(j_e,c,void 0);if(c===this.availableSuggestionCountAction){const g=new K_e(void 0,c,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(c=>{$C._dropDownVisible=c})),this._register(yt(c=>{this._position.read(c),this.editor.layoutContentWidget(this)})),this._register(yt(c=>{const u=this._suggestionCount.read(c),g=this._currentSuggestionIdx.read(c);u!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${u}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),u!==void 0&&u>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(yt(c=>{const u=this._extraCommands.read(c);if(vi(this.lastCommands,u))return;this.lastCommands=u;const g=u.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:f=>this._commandService.executeCommand(m.id)}));for(const[m,f]of this.inlineCompletionsActionsMenus.getActions())for(const _ of f)_ instanceof Er&&g.push(_);g.length>0&&g.unshift(new cn),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};cc._dropDownVisible=!1;cc.id=0;cc=$C=_P([sa(6,pi),sa(7,Me),sa(8,Tt),sa(9,Ae),sa(10,Sa)],cc);class K_e extends Am{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 j_e=class extends qu{updateLabel(){const i=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!i)return super.updateLabel();if(this.label){const e=Qt("div.keybinding").root;new mb(e,Ls,{disableTitle:!0,...mhe}).set(i),this.label.textContent=this._action.label,this.label.appendChild(e),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},nM=class extends Ay{constructor(i,e,t,n,o,s,r,a){super(i,{resetMenu:e,...t},n,o,s,r,a),this.menuId=e,this.options2=t,this.menuService=n,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var i,e,t,n,o,s,r;const a=[],l=[];_A(this.menu,(i=this.options2)===null||i===void 0?void 0:i.menuOptions,{primary:a,secondary:l},(t=(e=this.options2)===null||e===void 0?void 0:e.toolbarOptions)===null||t===void 0?void 0:t.primaryGroup,(o=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(r=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||r===void 0?void 0:r.useSeparatorsInPrimaryActions),l.push(...this.additionalActions),a.unshift(...this.prependedPrimaryActions),this.setActions(a,l)}setPrependedPrimaryActions(i){vi(this.prependedPrimaryActions,i,(e,t)=>e===t)||(this.prependedPrimaryActions=i,this.updateToolbar())}setAdditionalSecondaryActions(i){vi(this.additionalActions,i,(e,t)=>e===t)||(this.additionalActions=i,this.updateToolbar())}};nM=_P([sa(3,Sa),sa(4,Ae),sa(5,rr),sa(6,Tt),sa(7,ns)],nM);var $_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},j1=function(i,e){return function(t,n){e(t,n,i)}},oM;const q_e=!1;let Po=oM=class extends B{static get(i){return i.getContribution(oM.ID)}constructor(i,e,t,n,o){super(),this._editor=i,this._instantiationService=e,this._openerService=t,this._languageService=n,this._keybindingService=o,this._toUnhook=new Y,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Mt(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))}_hookEvents(){const i=this._editor.getOption(60);this._isHoverEnabled=i.enabled,this._isHoverSticky=i.sticky,this._hidingDelay=i.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(e=>this._onEditorMouseDown(e))),this._toUnhook.add(this._editor.onMouseUp(e=>this._onEditorMouseUp(e))),this._toUnhook.add(this._editor.onMouseMove(e=>this._onEditorMouseMove(e))),this._toUnhook.add(this._editor.onKeyDown(e=>this._onKeyDown(e)))):(this._toUnhook.add(this._editor.onMouseMove(e=>this._onEditorMouseMove(e))),this._toUnhook.add(this._editor.onKeyDown(e=>this._onKeyDown(e)))),this._toUnhook.add(this._editor.onMouseLeave(e=>this._onEditorMouseLeave(e))),this._toUnhook.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._toUnhook.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._toUnhook.add(this._editor.onDidScrollChange(e=>this._onEditorScrollChanged(e)))}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(i){(i.scrollTopChanged||i.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(i){var e;this._isMouseDown=!0;const t=i.target;if(t.type===9&&t.detail===Fh.ID){this._hoverClicked=!0;return}t.type===12&&t.detail===nm.ID||(t.type!==12&&(this._hoverClicked=!1),!((e=this._contentWidget)===null||e===void 0)&&e.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(i){this._isMouseDown=!1}_onEditorMouseLeave(i){var e,t;this._cancelScheduler();const n=i.event.browserEvent.relatedTarget;!((e=this._contentWidget)===null||e===void 0)&&e.widget.isResizing||!((t=this._contentWidget)===null||t===void 0)&&t.containsNode(n)||this._hideWidgets()}_isMouseOverWidget(i){var e,t,n,o,s;const r=i.target;return!!(this._isHoverSticky&&r.type===9&&r.detail===Fh.ID||this._isHoverSticky&&!((e=this._contentWidget)===null||e===void 0)&&e.containsNode((t=i.event.browserEvent.view)===null||t===void 0?void 0:t.document.activeElement)&&!(!((o=(n=i.event.browserEvent.view)===null||n===void 0?void 0:n.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&r.type===9&&r.detail===Fh.ID&&!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible||this._isHoverSticky&&r.type===12&&r.detail===nm.ID)}_onEditorMouseMove(i){var e,t,n,o;if(this._mouseMoveEvent=i,!(!((e=this._contentWidget)===null||e===void 0)&&e.isFocused||!((t=this._contentWidget)===null||t===void 0)&&t.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&!((n=this._contentWidget)===null||n===void 0)&&n.isVisibleFromKeyboard)){if(this._isMouseOverWidget(i)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(i)}}_reactToEditorMouseMove(i){var e,t,n;if(!i)return;const o=i.target,s=(e=o.element)===null||e===void 0?void 0:e.classList.contains("colorpicker-color-decoration"),r=this._editor.getOption(146);if(s&&(r==="click"&&!this._hoverActivatedByColorDecoratorClick||r==="hover"&&!this._isHoverEnabled&&!q_e||r==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!s&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(i)){(t=this._glyphWidget)===null||t===void 0||t.hide();return}if(o.type===2&&o.position){(n=this._contentWidget)===null||n===void 0||n.hide(),this._glyphWidget||(this._glyphWidget=new nm(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(o.position.lineNumber);return}this._hideWidgets()}_onKeyDown(i){var e;if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(i,this._editor.getDomNode()),n=t.kind===1||t.kind===2&&t.commandId==="editor.action.showHover"&&((e=this._contentWidget)===null||e===void 0?void 0:e.isVisible);i.keyCode!==5&&i.keyCode!==6&&i.keyCode!==57&&i.keyCode!==4&&!n&&this._hideWidgets()}_hideWidgets(){var i,e,t;this._isMouseDown&&this._hoverClicked&&!((i=this._contentWidget)===null||i===void 0)&&i.isColorPickerVisible||cc.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(e=this._glyphWidget)===null||e===void 0||e.hide(),(t=this._contentWidget)===null||t===void 0||t.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Vy,this._editor)),this._contentWidget}showContentHover(i,e,t,n,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(i,e,t,n)}focus(){var i;(i=this._contentWidget)===null||i===void 0||i.focus()}scrollUp(){var i;(i=this._contentWidget)===null||i===void 0||i.scrollUp()}scrollDown(){var i;(i=this._contentWidget)===null||i===void 0||i.scrollDown()}scrollLeft(){var i;(i=this._contentWidget)===null||i===void 0||i.scrollLeft()}scrollRight(){var i;(i=this._contentWidget)===null||i===void 0||i.scrollRight()}pageUp(){var i;(i=this._contentWidget)===null||i===void 0||i.pageUp()}pageDown(){var i;(i=this._contentWidget)===null||i===void 0||i.pageDown()}goToTop(){var i;(i=this._contentWidget)===null||i===void 0||i.goToTop()}goToBottom(){var i;(i=this._contentWidget)===null||i===void 0||i.goToBottom()}get isColorPickerVisible(){var i;return(i=this._contentWidget)===null||i===void 0?void 0:i.isColorPickerVisible}get isHoverVisible(){var i;return(i=this._contentWidget)===null||i===void 0?void 0:i.isVisible}dispose(){var i,e;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(i=this._glyphWidget)===null||i===void 0||i.dispose(),(e=this._contentWidget)===null||e===void 0||e.dispose()}};Po.ID="editor.contrib.hover";Po=oM=$_e([j1(1,Me),j1(2,as),j1(3,Xt),j1(4,Tt)],Po);var Kr;(function(i){i.NoAutoFocus="noAutoFocus",i.FocusIfVisible="focusIfVisible",i.AutoFocusImmediately="autoFocusImmediately"})(Kr||(Kr={}));class G_e extends ce{constructor(){super({id:"editor.action.showHover",label:p({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse."]},"Show or Focus Hover"),metadata:{description:"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:[Kr.NoAutoFocus,Kr.FocusIfVisible,Kr.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:Kr.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:$i(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const o=Po.get(t);if(!o)return;const s=n==null?void 0:n.focus;let r=Kr.FocusIfVisible;s in Kr?r=s:typeof s=="boolean"&&s&&(r=Kr.AutoFocusImmediately);const a=d=>{const h=t.getPosition(),c=new L(h.lineNumber,h.column,h.lineNumber,h.column);o.showContentHover(c,1,1,d)},l=t.getOption(2)===2;o.isHoverVisible?r!==Kr.NoAutoFocus?o.focus():a(l):a(l||r===Kr.AutoFocusImmediately)}}class Z_e extends ce{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:p({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=Po.get(t);if(!n)return;const o=t.getPosition();if(!o)return;const s=new L(o.lineNumber,o.column,o.lineNumber,o.column),r=ng.get(t);r&&r.startFindDefinitionFromCursor(o).then(()=>{n.showContentHover(s,1,1,!0)})}}class Y_e extends ce{constructor(){super({id:"editor.action.scrollUpHover",label:p({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:16,weight:100}})}run(e,t){const n=Po.get(t);n&&n.scrollUp()}}class Q_e extends ce{constructor(){super({id:"editor.action.scrollDownHover",label:p({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:18,weight:100}})}run(e,t){const n=Po.get(t);n&&n.scrollDown()}}class X_e extends ce{constructor(){super({id:"editor.action.scrollLeftHover",label:p({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:15,weight:100}})}run(e,t){const n=Po.get(t);n&&n.scrollLeft()}}class J_e extends ce{constructor(){super({id:"editor.action.scrollRightHover",label:p({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:17,weight:100}})}run(e,t){const n=Po.get(t);n&&n.scrollRight()}}class eve extends ce{constructor(){super({id:"editor.action.pageUpHover",label:p({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=Po.get(t);n&&n.pageUp()}}class tve extends ce{constructor(){super({id:"editor.action.pageDownHover",label:p({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=Po.get(t);n&&n.pageDown()}}class ive extends ce{constructor(){super({id:"editor.action.goToTopHover",label:p({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=Po.get(t);n&&n.goToTop()}}class nve extends ce{constructor(){super({id:"editor.action.goToBottomHover",label:p({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=Po.get(t);n&&n.goToBottom()}}pt(Po.ID,Po,2);ie(G_e);ie(Z_e);ie(Y_e);ie(Q_e);ie(X_e);ie(J_e);ie(eve);ie(tve);ie(ive);ie(nve);Ng.register(Uy);Ng.register(tM);Rr((i,e)=>{const t=i.getColor(xJ);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 sM extends B{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==vz||!n.range)return;const o=this._editor.getContribution(Po.ID);if(o&&!o.isColorPickerVisible){const s=new L(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);o.showContentHover(s,1,0,!1,!0)}}}sM.ID="editor.contrib.colorContribution";pt(sM.ID,sM,2);Ng.register(By);var Gz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},ta=function(i,e){return function(t,n){e(t,n,i)}},rM,aM;let uc=rM=class extends B{constructor(i,e,t,n,o,s,r){super(),this._editor=i,this._modelService=t,this._keybindingService=n,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=r,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=E.standaloneColorPickerVisible.bindTo(e),this._standaloneColorPickerFocused=E.standaloneColorPickerFocused.bindTo(e)}showOrFocus(){var i;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(i=this._standaloneColorPickerWidget)===null||i===void 0||i.focus():this._standaloneColorPickerWidget=new jy(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var i;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(i=this._standaloneColorPickerWidget)===null||i===void 0||i.hide(),this._editor.focus()}insertColor(){var i;(i=this._standaloneColorPickerWidget)===null||i===void 0||i.updateEditor(),this.hide()}static get(i){return i.getContribution(rM.ID)}};uc.ID="editor.contrib.standaloneColorPickerController";uc=rM=Gz([ta(1,Ae),ta(2,ti),ta(3,Tt),ta(4,Me),ta(5,pe),ta(6,Bt)],uc);pt(uc.ID,uc,1);const l9=8,ove=22;let jy=aM=class extends B{constructor(i,e,t,n,o,s,r,a){var l;super(),this._editor=i,this._standaloneColorPickerVisible=e,this._standaloneColorPickerFocused=t,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=r,this._languageConfigurationService=a,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new A),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(v0,this._editor),this._position=(l=this._editor._getViewModel())===null||l===void 0?void 0:l.getPrimaryCursorState().modelState.position;const d=this._editor.getSelection(),h=d?{startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},c=this._register(bl(this._body));this._register(c.onDidBlur(u=>{this.hide()})),this._register(c.onDidFocus(u=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(u=>{var g;const m=(g=u.target.element)===null||g===void 0?void 0:g.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(u=>{this._render(u.value,u.foundInEditor)})),this._start(h),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return aM.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const i=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:i?[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(i){const e=await this._computeAsync(i);e&&this._onResult.fire(new sve(e.result,e.foundInEditor))}async _computeAsync(i){if(!this._editor.hasModel())return null;const e={range:i,color:{red:0,green:0,blue:0,alpha:1}},t=await this._standaloneColorPickerParticipant.createColorHover(e,new hP(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return t?{result:t.colorHover,foundInEditor:t.foundInEditor}:null}_render(i,e){const t=document.createDocumentFragment(),n=this._register(new Hy(this._keybindingService));let o;const s={fragment:t,statusBar:n,setColorPicker:m=>o=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=i,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[i])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(t),o.layout();const r=o.body,a=r.saturationBox.domNode.clientWidth,l=r.domNode.clientWidth-a-ove-l9,d=o.body.enterButton;d==null||d.onClicked(()=>{this.updateEditor(),this.hide()});const h=o.header,c=h.pickedColorNode;c.style.width=a+l9+"px";const u=h.originalColorNode;u.style.width=l+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),e&&(d&&(d.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(i.range)),this._editor.layoutContentWidget(this)}};jy.ID="editor.contrib.standaloneColorPickerWidget";jy=aM=Gz([ta(3,Me),ta(4,ti),ta(5,Tt),ta(6,pe),ta(7,Bt)],jy);class sve{constructor(e,t){this.value=e,this.foundInEditor=t}}class rve extends La{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:p("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:p({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:x.CommandPalette}]})}runEditorCommand(e,t){var n;(n=uc.get(t))===null||n===void 0||n.showOrFocus()}}class ave extends ce{constructor(){super({id:"editor.action.hideColorPicker",label:p({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:E.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=uc.get(t))===null||n===void 0||n.hide()}}class lve extends ce{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:p({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:E.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=uc.get(t))===null||n===void 0||n.insertColor()}}ie(ave);ie(lve);Gt(rve);class yh{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const o=t.length,s=e.length;if(n+o>s)return!1;for(let r=0;r<o;r++){const a=e.charCodeAt(n+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,n,o,s,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,h=e.endColumn,c=s.getLineContent(a),u=s.getLineContent(d);let g=c.lastIndexOf(t,l-1+t.length),m=u.indexOf(n,h-1-n.length);if(g!==-1&&m!==-1)if(a===d)c.substring(g+t.length,m).indexOf(n)>=0&&(g=-1,m=-1);else{const _=c.substring(g+t.length),b=u.substring(0,m);(_.indexOf(n)>=0||b.indexOf(n)>=0)&&(g=-1,m=-1)}let f;g!==-1&&m!==-1?(o&&g+t.length<c.length&&c.charCodeAt(g+t.length)===32&&(t=t+" "),o&&m>0&&u.charCodeAt(m-1)===32&&(n=" "+n,m-=1),f=yh._createRemoveBlockCommentOperations(new L(a,g+t.length+1,d,m+1),t,n)):(f=yh._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=f.length===1?n:null);for(const _ of f)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,n){const o=[];return L.isEmpty(e)?o.push(oi.delete(new L(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(o.push(oi.delete(new L(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),o.push(oi.delete(new L(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),o}static _createAddBlockCommentOperations(e,t,n,o){const s=[];return L.isEmpty(e)?s.push(oi.replace(new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(s.push(oi.insert(new P(e.startLineNumber,e.startColumn),t+(o?" ":""))),s.push(oi.insert(new P(e.endLineNumber,e.endColumn),(o?" ":"")+n))),s}getEditOperations(e,t){const n=this._selection.startLineNumber,o=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const s=e.getLanguageIdAtPosition(n,o),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 n=t.getInverseEditOperations();if(n.length===2){const o=n[0],s=n[1];return new ve(o.range.endLineNumber,o.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const o=n[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new ve(o.endLineNumber,o.endColumn+s,o.endLineNumber,o.endColumn+s)}}}class Zl{constructor(e,t,n,o,s,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=o,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,o){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=o.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let d=0,h=n-t+1;d<h;d++)l[d]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,n,o,s,r,a,l){let d=!0,h;e===0?h=!0:e===1?h=!1:h=!0;for(let c=0,u=o.length;c<u;c++){const g=o[c],m=s+c;if(m===s&&a){g.ignore=!0;continue}const f=n.getLineContent(m),_=oo(f);if(_===-1){g.ignore=r,g.commentStrOffset=f.length;continue}if(d=!1,g.ignore=!1,g.commentStrOffset=_,h&&!yh._haystackHasNeedleAtOffset(f,g.commentStr,_)&&(e===0?h=!1:e===1||(g.ignore=!0)),h&&t){const b=_+g.commentStrLength;b<f.length&&f.charCodeAt(b)===32&&(g.commentStrLength+=1)}}if(e===0&&d){h=!1;for(let c=0,u=o.length;c<u;c++)o[c].ignore=!1}return{supported:!0,shouldRemoveComments:h,lines:o}}static _gatherPreflightData(e,t,n,o,s,r,a,l){const d=Zl._gatherPreflightCommentStrings(n,o,s,l);return d===null?{supported:!1}:Zl._analyzeLines(e,t,n,d,o,r,a,l)}_executeLineComments(e,t,n,o){let s;n.shouldRemoveComments?s=Zl._createRemoveLineCommentsOperations(n.lines,o.startLineNumber):(Zl._normalizeInsertionPoint(e,n.lines,o.startLineNumber,this._tabSize),s=this._createAddLineCommentsOperations(n.lines,o.startLineNumber));const r=new P(o.positionLineNumber,o.positionColumn);for(let a=0,l=s.length;a<l;a++)t.addEditOperation(s[a].range,s[a].text),L.isEmpty(s[a].range)&&L.getStartPosition(s[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(s[a].text||"").length);this._selectionId=t.trackSelection(o)}_attemptRemoveBlockComment(e,t,n,o){let s=t.startLineNumber,r=t.endLineNumber;const a=o.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(s).lastIndexOf(n,a-1),d=e.getLineContent(r).indexOf(o,t.endColumn-1-n.length);return l!==-1&&d===-1&&(d=e.getLineContent(s).indexOf(o,l+n.length),r=s),l===-1&&d!==-1&&(l=e.getLineContent(r).lastIndexOf(n,d),s=r),t.isEmpty()&&(l===-1||d===-1)&&(l=e.getLineContent(s).indexOf(n),l!==-1&&(d=e.getLineContent(s).indexOf(o,l+n.length))),l!==-1&&e.getLineContent(s).charCodeAt(l+n.length)===32&&(n+=" "),d!==-1&&e.getLineContent(r).charCodeAt(d-1)===32&&(o=" "+o,d-=1),l!==-1&&d!==-1?yh._createRemoveBlockCommentOperations(new L(s,l+n.length+1,r,d+1),n,o):null}_executeBlockComment(e,t,n){e.tokenization.tokenizeIfCheap(n.startLineNumber);const o=e.getLanguageIdAtPosition(n.startLineNumber,1),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;if(!s||!s.blockCommentStartToken||!s.blockCommentEndToken)return;const r=s.blockCommentStartToken,a=s.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,n,r,a);if(!l){if(n.isEmpty()){const d=e.getLineContent(n.startLineNumber);let h=oo(d);h===-1&&(h=d.length),l=yh._createAddBlockCommentOperations(new L(n.startLineNumber,h+1,n.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=yh._createAddBlockCommentOperations(new L(n.startLineNumber,e.getLineFirstNonWhitespaceColumn(n.startLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),r,a,this._insertSpace);l.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(n);for(const d of l)t.addEditOperation(d.range,d.text)}getEditOperations(e,t){let n=this._selection;if(this._moveEndPositionDown=!1,n.startLineNumber===n.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new L(n.startLineNumber,e.getLineMaxColumn(n.startLineNumber),n.startLineNumber+1,1),n.startLineNumber===e.getLineCount()?"":`
|
|
1073
|
+
*-----------------------------------------------------------------------------*/var gme=Object.defineProperty,pme=Object.getOwnPropertyDescriptor,mme=Object.getOwnPropertyNames,fme=Object.prototype.hasOwnProperty,_me=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of mme(e))!fme.call(i,o)&&o!==t&&gme(i,o,{get:()=>e[o],enumerable:!(n=pme(e,o))||n.enumerable});return i},vme=(i,e,t)=>(_me(i,e,"default"),t),bme="5.0.2",Hm={};vme(Hm,yb);var WH=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(WH||{}),VH=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(VH||{}),HH=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(HH||{}),zH=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(zH||{}),UH=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(UH||{}),KH=class{constructor(i,e,t,n,o){Si(this,"_onDidChange",new Hm.Emitter),Si(this,"_onDidExtraLibsChange",new Hm.Emitter),Si(this,"_extraLibs"),Si(this,"_removedExtraLibs"),Si(this,"_eagerModelSync"),Si(this,"_compilerOptions"),Si(this,"_diagnosticsOptions"),Si(this,"_workerOptions"),Si(this,"_onDidExtraLibsChangeTimeout"),Si(this,"_inlayHintsOptions"),Si(this,"_modeConfiguration"),this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(o),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(i,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let o=this._extraLibs[t];o&&o.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let o=1;this._removedExtraLibs[t]&&(o=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:o}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},Cme=bme,jH={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},$H=new KH({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},jH),qH=new KH({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},jH),wme=()=>TL().then(i=>i.getTypeScriptWorker()),yme=()=>TL().then(i=>i.getJavaScriptWorker());Hm.languages.typescript={ModuleKind:WH,JsxEmit:VH,NewLineKind:HH,ScriptTarget:zH,ModuleResolutionKind:UH,typescriptVersion:Cme,typescriptDefaults:$H,javascriptDefaults:qH,getTypeScriptWorker:wme,getJavaScriptWorker:yme};function TL(){return Ce(()=>import("./tsMode-Dj44YKby-BecbNaDB.js"),__vite__mapDeps([18,1,2,3,4]))}Hm.languages.onLanguage("typescript",()=>TL().then(i=>i.setupTypeScript($H)));Hm.languages.onLanguage("javascript",()=>TL().then(i=>i.setupJavaScript(qH)));class Sme extends Os{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:p("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:oe.map,toggled:G.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:G.has("isInDiffEditor"),menu:{when:G.has("isInDiffEditor"),id:x.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(at),o=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}}Gt(Sme);class GH extends Os{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:p("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:G.has("isInDiffEditor")})}run(e,...t){const n=e.get(at),o=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",o)}}Gt(GH);class ZH extends Os{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:G.has("isInDiffEditor")})}run(e,...t){const n=e.get(at),o=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}}Gt(ZH);yn.appendMenuItem(x.EditorTitle,{command:{id:new ZH().desc.id,title:p("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:G.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:G.has("isInDiffEditor")},order:11,group:"1_diff",when:G.and(E.diffEditorRenderSideBySideInlineBreakpointReached,G.has("isInDiffEditor"))});yn.appendMenuItem(x.EditorTitle,{command:{id:new GH().desc.id,title:p("showMoves","Show Moved Code Blocks"),icon:oe.move,toggled:nf.create("config.diffEditor.experimental.showMoves",!0),precondition:G.has("isInDiffEditor")},order:10,group:"1_diff",when:G.has("isInDiffEditor")});const RL={value:p("diffEditor","Diff Editor"),original:"Diff Editor"};class Lme extends La{constructor(){super({id:"diffEditor.switchSide",title:{value:p("switchSide","Switch Side"),original:"Switch Side"},icon:oe.arrowSwap,precondition:G.has("isInDiffEditor"),f1:!0,category:RL})}runEditorCommand(e,t,n){const o=vf(e);if(o instanceof nc){if(n&&n.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}}Gt(Lme);class kme extends La{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:p("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:oe.close,precondition:E.comparingMovedCode,f1:!1,category:RL,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const o=vf(e);o instanceof nc&&o.exitCompareMove()}}Gt(kme);class Dme extends La{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:p("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:oe.fold,precondition:G.has("isInDiffEditor"),f1:!0,category:RL})}runEditorCommand(e,t,...n){const o=vf(e);o instanceof nc&&o.collapseAllUnchangedRegions()}}Gt(Dme);class xme extends La{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:p("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:oe.unfold,precondition:G.has("isInDiffEditor"),f1:!0,category:RL})}runEditorCommand(e,t,...n){const o=vf(e);o instanceof nc&&o.showAllUnchangedRegions()}}Gt(xme);const YH={value:p("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class _f extends Os{constructor(){super({id:_f.id,title:{value:p("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:YH,precondition:G.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=vf(e);t==null||t.accessibleDiffViewerNext()}}_f.id="editor.action.accessibleDiffViewer.next";yn.appendMenuItem(x.EditorTitle,{command:{id:_f.id,title:p("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:G.has("isInDiffEditor")},order:10,group:"2_diff",when:G.and(E.accessibleDiffViewerVisible.negate(),G.has("isInDiffEditor"))});class Lb extends Os{constructor(){super({id:Lb.id,title:{value:p("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:YH,precondition:G.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=vf(e);t==null||t.accessibleDiffViewerPrev()}}Lb.id="editor.action.accessibleDiffViewer.prev";function vf(i){var e;const t=i.get(vt),n=t.listDiffEditors(),o=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!o)return null;for(let r=0,a=n.length;r<a;r++){const l=n[r];if(l.getModifiedEditor().getId()===o.getId()||l.getOriginalEditor().getId()===o.getId())return l}const s=Ns();if(s)for(const r of n){const a=r.getContainerDomNode();if(Eme(a,s))return r}return null}function Eme(i,e){let t=e;for(;t;){if(t===i)return!0;t=t.parentElement}return!1}ct.registerCommandAlias("editor.action.diffReview.next",_f.id);Gt(_f);ct.registerCommandAlias("editor.action.diffReview.prev",Lb.id);Gt(Lb);var Nme=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Ime=function(i,e){return function(t,n){e(t,n,i)}},I2;const AL=new de("selectionAnchorSet",!1);let Nd=I2=class{static get(i){return i.getContribution(I2.ID)}constructor(i,e){this.editor=i,this.selectionAnchorSetContextKey=AL.bindTo(e),this.modelChangeListener=i.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const i=this.editor.getPosition();this.editor.changeDecorations(e=>{this.decorationId&&e.removeDecoration(this.decorationId),this.decorationId=e.addDecoration(ve.fromPositions(i,i),{description:"selection-anchor",stickiness:1,hoverMessage:new Kn().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ir(p("anchorSet","Anchor set at {0}:{1}",i.lineNumber,i.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const i=this.editor.getModel().getDecorationRange(this.decorationId);i&&this.editor.setPosition(i.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const i=this.editor.getModel().getDecorationRange(this.decorationId);if(i){const e=this.editor.getPosition();this.editor.setSelection(ve.fromPositions(i.getStartPosition(),e)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const i=this.decorationId;this.editor.changeDecorations(e=>{e.removeDecoration(i),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Nd.ID="editor.contrib.selectionAnchorController";Nd=I2=Nme([Ime(1,Ae)],Nd);class Mme extends ce{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:$i(2089,2080),weight:100}})}async run(e,t){var n;(n=Nd.get(t))===null||n===void 0||n.setSelectionAnchor()}}class Tme extends ce{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:AL})}async run(e,t){var n;(n=Nd.get(t))===null||n===void 0||n.goToSelectionAnchor()}}class Rme extends ce{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:AL,kbOpts:{kbExpr:E.editorTextFocus,primary:$i(2089,2089),weight:100}})}async run(e,t){var n;(n=Nd.get(t))===null||n===void 0||n.selectFromAnchorToCursor()}}class Ame extends ce{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:AL,kbOpts:{kbExpr:E.editorTextFocus,primary:9,weight:100}})}async run(e,t){var n;(n=Nd.get(t))===null||n===void 0||n.cancelSelectionAnchor()}}pt(Nd.ID,Nd,4);ie(Mme);ie(Tme);ie(Rme);ie(Ame);const Pme=M("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class Ome extends ce{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=xr.get(t))===null||n===void 0||n.jumpToBracket()}}class Fme extends ce{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:a$("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,n){var o;let s=!0;n&&n.selectBrackets===!1&&(s=!1),(o=xr.get(t))===null||o===void 0||o.selectToBracket(s)}}class Bme extends ce{constructor(){super({id:"editor.action.removeBrackets",label:p("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=xr.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class Wme{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class xr extends B{static get(e){return e.getContribution(xr.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Mt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(n=>{const o=n.getStartPosition(),s=e.bracketPairs.matchBracket(o);let r=null;if(s)s[0].containsPosition(o)&&!s[1].containsPosition(o)?r=s[1].getStartPosition():s[1].containsPosition(o)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(o);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(o);l&&l.range&&(r=l.range.getStartPosition())}}return r?new ve(r.lineNumber,r.column,r.lineNumber,r.column):new ve(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(o=>{const s=o.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(L.compareRangesUsingStarts);const[d,h]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?h.getEndPosition():h.getStartPosition(),h.containsPosition(s)){const c=a;a=l,l=c}}a&&l&&n.push(new ve(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const o=n.getPosition();let s=t.bracketPairs.matchBracket(o);s||(s=t.bracketPairs.findEnclosingBrackets(o)),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 n of this._lastBracketsData){const o=n.brackets;o&&(e[t++]={range:o[0],options:n.options},e[t++]={range:o[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),n=t.getVersionId();let o=[];this._lastVersionId===n&&(o=this._lastBracketsData);const s=[];let r=0;for(let c=0,u=e.length;c<u;c++){const g=e[c];g.isEmpty()&&(s[r++]=g.getStartPosition())}s.length>1&&s.sort(P.compare);const a=[];let l=0,d=0;const h=o.length;for(let c=0,u=s.length;c<u;c++){const g=s[c];for(;d<h&&o[d].position.isBefore(g);)d++;if(d<h&&o[d].position.equals(g))a[l++]=o[d];else{let m=t.bracketPairs.matchBracket(g,20),f=xr._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(g,20),f=xr._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new Wme(g,m,f)}}this._lastBracketsData=a,this._lastVersionId=n}}xr.ID="editor.contrib.bracketMatchingController";xr._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=je.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ci(Pme),position:Ts.Center}});xr._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=je.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});pt(xr.ID,xr,1);ie(Fme);ie(Ome);ie(Bme);yn.appendMenuItem(x.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:p({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class Vme{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const n=this._selection.startLineNumber,o=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&o===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(n)))if(this._isMovingLeft){const r=new L(n,o-1,n,o),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(n,s,n,s),a)}else{const r=new L(n,s,n,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(n,o,n,o),a)}}computeCursorState(e,t){return this._isMovingLeft?new ve(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ve(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class QH extends ce{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const n=[],o=t.getSelections();for(const s of o)n.push(new Vme(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class Hme extends QH{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:p("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:E.writable})}}class zme extends QH{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:p("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:E.writable})}}ie(Hme);ie(zme);class Ume extends ce{constructor(){super({id:"editor.action.transposeLetters",label:p("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const n=t.getModel(),o=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,d=n.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const h=l===d?r.getPosition():Lt.rightPosition(n,r.getPosition().lineNumber,r.getPosition().column),c=Lt.leftPosition(n,h),u=Lt.leftPosition(n,c),g=n.getValueInRange(L.fromPositions(u,c)),m=n.getValueInRange(L.fromPositions(c,h)),f=L.fromPositions(u,h);o.push(new En(f,m+g))}o.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}}ie(Ume);const Ju="9_cutcopypaste",Kme=da||document.queryCommandSupported("cut"),XH=da||document.queryCommandSupported("copy"),jme=typeof navigator.clipboard>"u"||Xs?document.queryCommandSupported("paste"):!0;function sP(i){return i.register(),i}const $me=Kme?sP(new sf({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:da?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:x.MenubarEditMenu,group:"2_ccp",title:p({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:x.EditorContext,group:Ju,title:p("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1},{menuId:x.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:x.SimpleEditorContext,group:Ju,title:p("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1}]})):void 0,qme=XH?sP(new sf({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:da?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:x.MenubarEditMenu,group:"2_ccp",title:p({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:x.EditorContext,group:Ju,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:x.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:x.SimpleEditorContext,group:Ju,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;yn.appendMenuItem(x.MenubarEditMenu,{submenu:x.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});yn.appendMenuItem(x.EditorContext,{submenu:x.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:Ju,order:3});yn.appendMenuItem(x.EditorContext,{submenu:x.EditorContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1,when:G.and(G.notEquals("resourceScheme","output"),E.editorTextFocus)});yn.appendMenuItem(x.EditorTitleContext,{submenu:x.EditorTitleContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});yn.appendMenuItem(x.ExplorerContext,{submenu:x.ExplorerContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});const dx=jme?sP(new sf({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:da?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:x.MenubarEditMenu,group:"2_ccp",title:p({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:x.EditorContext,group:Ju,title:p("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4},{menuId:x.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:x.SimpleEditorContext,group:Ju,title:p("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4}]})):void 0;class Gme extends ce{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:E.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(RN.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),RN.forceCopyWithSyntaxHighlighting=!1)}}function JH(i,e){i&&(i.addImplementation(1e4,"code-editor",(t,n)=>{const o=t.get(vt).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const s=o.getOption(37),r=o.getSelection();return r&&r.isEmpty()&&!s||o.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(of().execCommand(e),!0)))}JH($me,"cut");JH(qme,"copy");dx&&(dx.addImplementation(1e4,"code-editor",(i,e)=>{const t=i.get(vt),n=i.get(Od),o=t.getFocusedCodeEditor();return o&&o.hasTextFocus()?!o.getContainerDomNode().ownerDocument.execCommand("paste")&&fc?(async()=>{const s=await n.readText();if(s!==""){const r=Vv.INSTANCE.get(s);let a=!1,l=null,d=null;r&&(a=o.getOption(37)&&!!r.isFromEmptySelection,l=typeof r.multicursorText<"u"?r.multicursorText:null,d=r.mode),o.trigger("keyboard","paste",{text:s,pasteOnNewLine:a,multicursorText:l,mode:d})}})():!0:!1}),dx.addImplementation(0,"generic-dom",(i,e)=>(of().execCommand("paste"),!0)));XH&&ie(Gme);class Re{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+Re.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Re(this.value+Re.sep+e)}}Re.sep=".";Re.None=new Re("@@none@@");Re.Empty=new Re("");Re.QuickFix=new Re("quickfix");Re.Refactor=new Re("refactor");Re.RefactorExtract=Re.Refactor.append("extract");Re.RefactorInline=Re.Refactor.append("inline");Re.RefactorMove=Re.Refactor.append("move");Re.RefactorRewrite=Re.Refactor.append("rewrite");Re.Notebook=new Re("notebook");Re.Source=new Re("source");Re.SourceOrganizeImports=Re.Source.append("organizeImports");Re.SourceFixAll=Re.Source.append("fixAll");Re.SurroundWith=Re.Refactor.append("surround");var is;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(is||(is={}));function Zme(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>ez(e,t,i.include))||!i.includeSourceActions&&Re.Source.contains(e))}function Yme(i,e){const t=e.kind?new Re(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>ez(t,n,i.include))||!i.includeSourceActions&&t&&Re.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function ez(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class Qa{static fromUser(e,t){return!e||typeof e!="object"?new Qa(t.kind,t.apply,!1):new Qa(Qa.getKindFromUser(e,t.kind),Qa.getApplyFromUser(e,t.apply),Qa.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 Re(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class Qme{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let n;try{n=await this.provider.resolveCodeAction(this.action,e)}catch(o){Ti(o)}n&&(this.action.edit=n.edit)}return this}}const tz="editor.action.codeAction",rP="editor.action.quickFix",iz="editor.action.autoFix",nz="editor.action.refactor",oz="editor.action.sourceAction",aP="editor.action.organizeImports",lP="editor.action.fixAll";class J_ extends B{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:jn(e.diagnostics)?jn(t.diagnostics)?J_.codeActionsPreferredComparator(e,t):-1:jn(t.diagnostics)?1:J_.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(J_.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Re.QuickFix.contains(new Re(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 V6={actions:[],documentation:void 0};async function ev(i,e,t,n,o,s){var r;const a=n.filter||{},l={...a,excludes:[...a.excludes||[],Re.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:n.type},h=new JA(e,s),c=n.type===2,u=Xme(i,e,c?l:a),g=new Y,m=u.map(async _=>{try{o.report(_);const b=await _.provideCodeActions(e,t,d,h.token);if(b&&g.add(b),h.token.isCancellationRequested)return V6;const v=((b==null?void 0:b.actions)||[]).filter(w=>w&&Yme(a,w)),C=efe(_,v,a.include);return{actions:v.map(w=>new Qme(w,_)),documentation:C}}catch(b){if(ya(b))throw b;return Ti(b),V6}}),f=i.onDidChange(()=>{const _=i.all(e);vi(_,u)||h.cancel()});try{const _=await Promise.all(m),b=_.map(C=>C.actions).flat(),v=[...pa(_.map(C=>C.documentation)),...Jme(i,e,n,b)];return new J_(b,v,g)}finally{f.dispose(),h.dispose()}}function Xme(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(o=>Zme(t,new Re(o))):!0)}function*Jme(i,e,t,n){var o,s,r;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)===null||o===void 0?void 0:o.call(a,{trigger:t.type,only:(r=(s=t.filter)===null||s===void 0?void 0:s.include)===null||r===void 0?void 0:r.value},n.map(l=>l.action)))}function efe(i,e,t){if(!i.documentation)return;const n=i.documentation.map(o=>({kind:new Re(o.kind),command:o.command}));if(t){let o;for(const s of n)s.kind.contains(t)&&(o?o.kind.contains(s.kind)&&(o=s):o=s);if(o)return o==null?void 0:o.command}for(const o of e)if(o.kind){for(const s of n)if(s.kind.contains(new Re(o.kind)))return s.command}}var Oy;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions"})(Oy||(Oy={}));async function tfe(i,e,t,n,o=et.None){var s;const r=i.get(db),a=i.get(pi),l=i.get(ns),d=i.get(Pi);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(o),!o.isCancellationRequested&&!(!((s=e.action.edit)===null||s===void 0)&&s.edits.length&&!(await r.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Oy.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(h){const c=ife(h);d.error(typeof c=="string"?c:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function ife(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}ct.registerCommand("_executeCodeActionProvider",async function(i,e,t,n,o){if(!(e instanceof xe))throw Zs();const{codeActionProvider:s}=i.get(pe),r=i.get(ti).getModel(e);if(!r)throw Zs();const a=ve.isISelection(t)?ve.liftSelection(t):L.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Zs();const l=typeof n=="string"?new Re(n):void 0,d=await ev(s,r,a,{type:1,triggerAction:is.Default,filter:{includeSourceActions:!0,include:l}},Sd.None,et.None),h=[],c=Math.min(d.validActions.length,typeof o=="number"?o:0);for(let u=0;u<c;u++)h.push(d.validActions[u].resolve(et.None));try{return await Promise.all(h),d.validActions.map(u=>u.action)}finally{setTimeout(()=>d.dispose(),100)}});var nfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},ofe=function(i,e){return function(t,n){e(t,n,i)}},M2;let Fy=M2=class{constructor(i){this.keybindingService=i}getResolver(){const i=new bc(()=>this.keybindingService.getKeybindings().filter(e=>M2.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return e.command===aP?t={kind:Re.SourceOrganizeImports.value}:e.command===lP&&(t={kind:Re.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...Qa.fromUser(t,{kind:Re.None,apply:"never"})}}));return e=>{if(e.kind){const t=this.bestKeybindingForCodeAction(e,i.value);return t==null?void 0:t.resolvedKeybinding}}}bestKeybindingForCodeAction(i,e){if(!i.kind)return;const t=new Re(i.kind);return e.filter(n=>n.kind.contains(t)).filter(n=>n.preferred?i.isPreferred:!0).reduceRight((n,o)=>n?n.kind.contains(o.kind)?o:n:o,void 0)}};Fy.codeActionCommands=[nz,tz,oz,aP,lP];Fy=M2=nfe([ofe(0,Tt)],Fy);M("symbolIcon.arrayForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.booleanForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("symbolIcon.colorForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.constantForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("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."));M("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."));M("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."));M("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."));M("symbolIcon.fileForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.folderForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("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."));M("symbolIcon.keyForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.keywordForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("symbolIcon.moduleForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.namespaceForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.nullForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.numberForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.objectForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.operatorForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.packageForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.propertyForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.referenceForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.snippetForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.stringForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.structForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.textForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.typeParameterForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.unitForeground",{dark:se,light:se,hcDark:se,hcLight:se},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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 sz=Object.freeze({kind:Re.Empty,title:p("codeAction.widget.id.more","More Actions...")}),sfe=Object.freeze([{kind:Re.QuickFix,title:p("codeAction.widget.id.quickfix","Quick Fix")},{kind:Re.RefactorExtract,title:p("codeAction.widget.id.extract","Extract"),icon:oe.wrench},{kind:Re.RefactorInline,title:p("codeAction.widget.id.inline","Inline"),icon:oe.wrench},{kind:Re.RefactorRewrite,title:p("codeAction.widget.id.convert","Rewrite"),icon:oe.wrench},{kind:Re.RefactorMove,title:p("codeAction.widget.id.move","Move"),icon:oe.wrench},{kind:Re.SurroundWith,title:p("codeAction.widget.id.surround","Surround With"),icon:oe.symbolSnippet},{kind:Re.Source,title:p("codeAction.widget.id.source","Source Action"),icon:oe.symbolFile},sz]);function rfe(i,e,t){if(!e)return i.map(s=>{var r;return{kind:"action",item:s,group:sz,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!(!((r=s.action.edit)===null||r===void 0)&&r.edits.length)}});const n=sfe.map(s=>({group:s,actions:[]}));for(const s of i){const r=s.action.kind?new Re(s.action.kind):Re.None;for(const a of n)if(a.group.kind.contains(r)){a.actions.push(s);break}}const o=[];for(const s of n)if(s.actions.length){o.push({kind:"header",group:s.group});for(const r of s.actions){const a=s.group;o.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:oe.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return o}var afe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},H6=function(i,e){return function(t,n){e(t,n,i)}},T2,Ip;(function(i){i.Hidden={type:0};class e{constructor(n,o,s,r){this.actions=n,this.trigger=o,this.editorPosition=s,this.widgetPosition=r,this.type=1}}i.Showing=e})(Ip||(Ip={}));let eg=T2=class extends B{constructor(i,e,t){super(),this._editor=i,this._keybindingService=e,this._onClick=this._register(new A),this.onClick=this._onClick.event,this._state=Ip.Hidden,this._iconClasses=[],this._domNode=ee("div.lightBulbWidget"),this._register(Pt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(AZ(this._domNode,n=>{var o;if(this.state.type!==1)return;const s=this._editor.getOption(64).experimental.showAiIcon;if((s===jo.On||s===jo.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){const h=this.state.actions.validActions[0].action;if(!((o=h.command)===null||o===void 0)&&o.id){t.executeCommand(h.command.id,...h.command.arguments||[]),n.preventDefault();return}}this._editor.focus(),n.preventDefault();const{top:r,height:a}=ji(this._domNode),l=this._editor.getOption(66);let d=Math.floor(l/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(d+=l),this._onClick.fire({x:n.posx,y:r+a+d,actions:this.state.actions,trigger:this.state.trigger})})),this._register($(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(le.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var n,o,s,r;this._preferredKbLabel=(o=(n=this._keybindingService.lookupKeybinding(iz))===null||n===void 0?void 0:n.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(r=(s=this._keybindingService.lookupKeybinding(rP))===null||s===void 0?void 0:s.getLabel())!==null&&r!==void 0?r:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(i,e,t){if(i.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:r}=o.validatePosition(t),a=o.getOptions().tabSize,l=n.get(50),d=o.getLineContent(s),h=ZS(d,a),c=l.spaceWidth*h>22,u=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let g=s;if(!c){if(s>1&&!u(s-1))g-=1;else if(!u(s+1))g+=1;else if(r*l.spaceWidth<22)return this.hide()}this.state=new Ip.Showing(i,e,t,{position:{lineNumber:g,column:o.getLineContent(g).match(/^\S\s*$/)?2:1},preference:T2._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==Ip.Hidden&&(this.state=Ip.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(i){this._state=i,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){var i,e,t;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))},o=()=>{this._quickFixKbLabel?this.title=p("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=p("codeAction","Show Code Actions")};let s;const r=this._editor.getOption(64).experimental.showAiIcon;if(r===jo.On||r===jo.OnCode)if(r===jo.On&&this.state.actions.allAIFixes)if(s=oe.sparkleFilled,this.state.actions.allAIFixes&&this.state.actions.validActions.length===1)if(((i=this.state.actions.validActions[0].action.command)===null||i===void 0?void 0:i.id)==="inlineChat.start"){const a=(t=(e=this._keybindingService.lookupKeybinding("inlineChat.start"))===null||e===void 0?void 0:e.getLabel())!==null&&t!==void 0?t:void 0;this.title=a?p("codeActionStartInlineChatWithKb","Start Inline Chat ({0})",a):p("codeActionStartInlineChat","Start Inline Chat")}else this.title=p("codeActionTriggerAiAction","Trigger AI Action");else o();else this.state.actions.hasAutoFix?(this.state.actions.hasAIFix?s=oe.lightbulbSparkleAutofix:s=oe.lightbulbAutofix,n()):this.state.actions.hasAIFix?(s=oe.lightbulbSparkle,o()):(s=oe.lightBulb,o());else this.state.actions.hasAutoFix?(s=oe.lightbulbAutofix,n()):(s=oe.lightBulb,o());this._iconClasses=Ee.asClassNameArray(s),this._domNode.classList.add(...this._iconClasses)}set title(i){this._domNode.title=i}};eg.ID="editor.contrib.lightbulbWidget";eg._posPref=[0];eg=T2=afe([H6(1,Tt),H6(2,pi)],eg);var lfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},z6=function(i,e){return function(t,n){e(t,n,i)}},R2;let Id=R2=class{constructor(i,e,t){this._options=i,this._languageService=e,this._openerService=t,this._onDidRenderAsync=new A,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(i,e,t){if(!i)return{element:document.createElement("span"),dispose:()=>{}};const n=new Y,o=n.add(rL(i,{...this._getRenderOptions(i,n),...e},t));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>n.dispose()}}_getRenderOptions(i,e){return{codeBlockRenderer:async(t,n)=>{var o,s,r;let a;t?a=this._languageService.getLanguageIdByLanguageName(t):this._options.editor&&(a=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),a||(a=Is);const l=await ise(this._languageService,n,a),d=document.createElement("span");if(d.innerHTML=(r=(s=R2._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(l))!==null&&r!==void 0?r:l,this._options.editor){const h=this._options.editor.getOption(50);Pn(d,h)}else this._options.codeBlockFontFamily&&(d.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(d.style.fontSize=this._options.codeBlockFontSize),d},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:t=>rz(this._openerService,t,i.isTrusted),disposables:e}}}};Id._ttpTokenizer=Td("tokenizeToString",{createHTML(i){return i}});Id=R2=lfe([z6(1,Xt),z6(2,as)],Id);async function rz(i,e,t){try{return await i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:dfe(t)})}catch(n){return Ke(n),!1}}function dfe(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var hfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},U6=function(i,e){return function(t,n){e(t,n,i)}},WC;let Xo=WC=class{static get(i){return i.getContribution(WC.ID)}constructor(i,e,t){this._openerService=t,this._messageWidget=new un,this._messageListeners=new Y,this._mouseOverMessage=!1,this._editor=i,this._visible=WC.MESSAGE_VISIBLE.bindTo(e)}dispose(){var i;(i=this._message)===null||i===void 0||i.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(i,e){ir(Mh(i)?i.value:i),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Mh(i)?rL(i,{actionHandler:{callback:n=>rz(this._openerService,n,Mh(i)?i.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new K6(this._editor,e,typeof i=="string"?i:this._message.element),this._messageListeners.add(le.debounce(this._editor.onDidBlurEditorText,(n,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&An(Ns(),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($(this._messageWidget.value.getDomNode(),ae.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add($(this._messageWidget.value.getDomNode(),ae.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let t;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(t?t.containsPosition(n.target.position)||this.closeMessage():t=new L(e.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(K6.fadeOut(this._messageWidget.value))}};Xo.ID="editor.contrib.messageController";Xo.MESSAGE_VISIBLE=new de("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));Xo=WC=hfe([U6(1,Ae),U6(2,as)],Xo);const cfe=gn.bindToContribution(Xo.get);re(new cfe({id:"leaveEditorMessage",precondition:Xo.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:130,primary:9}}));let K6=class{static fadeOut(i){const e=()=>{i.dispose(),clearTimeout(t),i.getDomNode().removeEventListener("animationend",e)},t=setTimeout(e,110);return i.getDomNode().addEventListener("animationend",e),i.getDomNode().classList.add("fadeOut"),{dispose:e}}constructor(i,{lineNumber:e,column:t},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=i,this._editor.revealLinesInCenterIfOutsideViewport(e,e,0),this._position={lineNumber:e,column:t},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");typeof n=="string"?(s.classList.add("message"),s.textContent=n):(n.classList.add("message"),s.appendChild(n)),this._domNode.appendChild(s);const r=document.createElement("div");r.classList.add("anchor","below"),this._domNode.appendChild(r),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(i){this._domNode.classList.toggle("below",i===2)}};pt(Xo.ID,Xo,4);var az=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},A2=function(i,e){return function(t,n){e(t,n,i)}};const lz="acceptSelectedCodeAction",dz="previewSelectedCodeAction";class ufe{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,n){var o,s;n.text.textContent=(s=(o=e.group)===null||o===void 0?void 0:o.title)!==null&&s!==void 0?s:""}disposeTemplate(e){}}let P2=class{get templateId(){return"action"}constructor(i,e){this._supportsPreview=i,this._keybindingService=e}renderTemplate(i){i.classList.add(this.templateId);const e=document.createElement("div");e.className="icon",i.append(e);const t=document.createElement("span");t.className="title",i.append(t);const n=new mb(i,Ls);return{container:i,icon:e,text:t,keybinding:n}}renderElement(i,e,t){var n,o,s;if(!((n=i.group)===null||n===void 0)&&n.icon?(t.icon.className=Ee.asClassName(i.group.icon),i.group.icon.color&&(t.icon.style.color=he(i.group.icon.color.id))):(t.icon.className=Ee.asClassName(oe.lightBulb),t.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!i.item||!i.label)return;t.text.textContent=hz(i.label),t.keybinding.set(i.keybinding),YZ(!!i.keybinding,t.keybinding.element);const r=(o=this._keybindingService.lookupKeybinding(lz))===null||o===void 0?void 0:o.getLabel(),a=(s=this._keybindingService.lookupKeybinding(dz))===null||s===void 0?void 0:s.getLabel();t.container.classList.toggle("option-disabled",i.disabled),i.disabled?t.container.title=i.label:r&&a?this._supportsPreview&&i.canPreview?t.container.title=p({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",r,a):t.container.title=p({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",r):t.container.title=""}disposeTemplate(i){}};P2=az([A2(1,Tt)],P2);class gfe extends UIEvent{constructor(){super("acceptSelectedAction")}}class j6 extends UIEvent{constructor(){super("previewSelectedAction")}}function pfe(i){if(i.kind==="action")return i.label}let O2=class extends B{constructor(i,e,t,n,o,s){super(),this._delegate=n,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Ri),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const r={getHeight:a=>a.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:a=>a.kind};this._list=this._register(new Ar(i,this.domNode,r,[new P2(e,this._keybindingService),new ufe],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:pfe},accessibilityProvider:{getAriaLabel:a=>{if(a.kind==="action"){let l=a.label?hz(a==null?void 0:a.label):"";return a.disabled&&(l=p({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",l,a.disabled)),l}return null},getWidgetAriaLabel:()=>p({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:a=>a.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(wg),this._register(this._list.onMouseClick(a=>this.onListClick(a))),this._register(this._list.onMouseOver(a=>this.onListHover(a))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(a=>this.onListSelection(a))),this._allMenuItems=t,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(i){return!i.disabled&&i.kind==="action"}hide(i){this._delegate.onHide(i),this.cts.cancel(),this._contextViewService.hideContextView()}layout(i){const e=this._allMenuItems.filter(s=>s.kind==="header").length,t=this._allMenuItems.length*this._actionLineHeight+e*this._headerLineHeight-e*this._actionLineHeight;this._list.layout(t);let n=i;if(this._allMenuItems.length>=50)n=380;else{const s=this._allMenuItems.map((r,a)=>{const l=this.domNode.ownerDocument.getElementById(this._list.getElementID(a));if(l){l.style.width="auto";const d=l.getBoundingClientRect().width;return l.style.width="",d}return 0});n=Math.max(...s,i)}const o=Math.min(t,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(o,n),this.domNode.style.height=`${o}px`,this._list.domFocus(),n}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(i){const e=this._list.getFocus();if(e.length===0)return;const t=e[0],n=this._list.element(t);if(!this.focusCondition(n))return;const o=i?new j6:new gfe;this._list.setSelection([t],o)}onListSelection(i){if(!i.elements.length)return;const e=i.elements[0];e.item&&this.focusCondition(e)?this._delegate.onSelect(e.item,i.browserEvent instanceof j6):this._list.setSelection([])}onFocus(){var i,e;this._list.domFocus();const t=this._list.getFocus();if(t.length===0)return;const n=t[0],o=this._list.element(n);(e=(i=this._delegate).onFocus)===null||e===void 0||e.call(i,o.item)}async onListHover(i){const e=i.element;if(e&&e.item&&this.focusCondition(e)){if(this._delegate.onHover&&!e.disabled&&e.kind==="action"){const t=await this._delegate.onHover(e.item,this.cts.token);e.canPreview=t?t.canPreview:void 0}i.index&&this._list.splice(i.index,1,[e])}this._list.setFocus(typeof i.index=="number"?[i.index]:[])}onListClick(i){i.element&&this.focusCondition(i.element)&&this._list.setFocus([])}};O2=az([A2(4,Rd),A2(5,Tt)],O2);function hz(i){return i.replace(/\r\n|\r|\n/g," ")}var mfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},hx=function(i,e){return function(t,n){e(t,n,i)}};M("actionBar.toggledBackground",{dark:du,light:du,hcDark:du,hcLight:du},p("actionBar.toggledBackground","Background color for toggled action items in action bar."));const tg={Visible:new de("codeActionMenuVisible",!1,p("codeActionMenuVisible","Whether the action widget list is visible"))},kg=tt("actionWidgetService");let ig=class extends B{get isVisible(){return tg.Visible.getValue(this._contextKeyService)||!1}constructor(i,e,t){super(),this._contextViewService=i,this._contextKeyService=e,this._instantiationService=t,this._list=this._register(new un)}show(i,e,t,n,o,s,r){const a=tg.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(O2,i,e,t,n);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(a.set(!0),this._renderWidget(d,l,r??[])),onHide:d=>{a.reset(),this._onWidgetClosed(d)}},s,!1)}acceptSelected(i){var e;(e=this._list.value)===null||e===void 0||e.acceptSelected(i)}focusPrevious(){var i,e;(e=(i=this._list)===null||i===void 0?void 0:i.value)===null||e===void 0||e.focusPrevious()}focusNext(){var i,e;(e=(i=this._list)===null||i===void 0?void 0:i.value)===null||e===void 0||e.focusNext()}hide(){var i;(i=this._list.value)===null||i===void 0||i.hide(),this._list.clear()}_renderWidget(i,e,t){var n;const o=document.createElement("div");if(o.classList.add("action-widget"),i.appendChild(o),this._list.value=e,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Y,r=document.createElement("div"),a=i.appendChild(r);a.classList.add("context-view-block"),s.add($(a,ae.MOUSE_DOWN,g=>g.stopPropagation()));const l=document.createElement("div"),d=i.appendChild(l);d.classList.add("context-view-pointerBlock"),s.add($(d,ae.POINTER_MOVE,()=>d.remove())),s.add($(d,ae.MOUSE_DOWN,()=>d.remove()));let h=0;if(t.length){const g=this._createActionBar(".action-widget-action-bar",t);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),h=g.getContainer().offsetWidth)}const c=(n=this._list.value)===null||n===void 0?void 0:n.layout(h);o.style.width=`${c}px`;const u=s.add(bl(i));return s.add(u.onDidBlur(()=>this.hide())),s}_createActionBar(i,e){if(!e.length)return;const t=ee(i),n=new or(t);return n.push(e,{icon:!1,label:!0}),n}_onWidgetClosed(i){var e;(e=this._list.value)===null||e===void 0||e.hide(i)}};ig=mfe([hx(0,Rd),hx(1,Ae),hx(2,Me)],ig);lt(kg,ig,1);const kb=1100;Gt(class extends Os{constructor(){super({id:"hideCodeActionWidget",title:{value:p("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:tg.Visible,keybinding:{weight:kb,primary:9,secondary:[1033]}})}run(i){i.get(kg).hide()}});Gt(class extends Os{constructor(){super({id:"selectPrevCodeAction",title:{value:p("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:tg.Visible,keybinding:{weight:kb,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(kg);e instanceof ig&&e.focusPrevious()}});Gt(class extends Os{constructor(){super({id:"selectNextCodeAction",title:{value:p("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:tg.Visible,keybinding:{weight:kb,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(kg);e instanceof ig&&e.focusNext()}});Gt(class extends Os{constructor(){super({id:lz,title:{value:p("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:tg.Visible,keybinding:{weight:kb,primary:3,secondary:[2137]}})}run(i){const e=i.get(kg);e instanceof ig&&e.acceptSelected()}});Gt(class extends Os{constructor(){super({id:dz,title:{value:p("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:tg.Visible,keybinding:{weight:kb,primary:2051}})}run(i){const e=i.get(kg);e instanceof ig&&e.acceptSelected(!0)}});const cz=new de("supportedCodeAction","");class ffe extends B{constructor(e,t,n,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=o,this._autoTriggerTimer=this._register(new Mr),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(n=>VR(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:is.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){var t;if(!this._editor.hasModel())return;const n=this._editor.getModel(),o=this._editor.getSelection();if(o.isEmpty()&&e.type===2){const{lineNumber:s,column:r}=o.getPosition(),a=n.getLineContent(s);if(a.length===0){if(((t=this._editor.getOption(64).experimental)===null||t===void 0?void 0:t.showAiIcon)!==jo.On)return}else if(r===1){if(/\s/.test(a[0]))return}else if(r===n.getLineMaxColumn(s)){if(/\s/.test(a[a.length-1]))return}else if(/\s/.test(a[r-2])&&/\s/.test(a[r-1]))return}return o}}var su;(function(i){i.Empty={type:0};class e{constructor(n,o,s){this.trigger=n,this.position=o,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(ya(r))return uz;throw r})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(su||(su={}));const uz=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class _fe extends B{constructor(e,t,n,o,s,r){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new un),this._state=su.Empty,this._onDidChangeState=this._register(new A),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=cz.bindTo(o),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(su.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(su.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(n=>{var o;return(o=n.providedCodeActionKinds)!==null&&o!==void 0?o:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new ffe(this._editor,this._markerService,n=>{var o;if(!n){this.setState(su.Empty);return}const s=n.selection.getStartPosition(),r=Yi(async a=>{var l,d,h,c,u,g;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===is.QuickFix||!((d=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Re.QuickFix))){const m=await ev(this._registry,e,n.selection,n.trigger,Sd.None,a),f=[...m.allActions];if(a.isCancellationRequested)return uz;if(!(!((h=m.validActions)===null||h===void 0)&&h.some(_=>_.action.kind?Re.QuickFix.contains(new Re(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const b=n.selection.getPosition();let v=b,C=Number.MAX_VALUE;const w=[...m.validActions];for(const k of _){const D=k.endColumn,N=k.endLineNumber,R=k.startLineNumber;if(N===b.lineNumber||R===b.lineNumber){v=new P(N,D);const z={type:n.trigger.type,triggerAction:n.trigger.triggerAction,filter:{include:!((c=n.trigger.filter)===null||c===void 0)&&c.include?(u=n.trigger.filter)===null||u===void 0?void 0:u.include:Re.QuickFix},autoApply:n.trigger.autoApply,context:{notAvailableMessage:((g=n.trigger.context)===null||g===void 0?void 0:g.notAvailableMessage)||"",position:v}},H=new ve(v.lineNumber,v.column,v.lineNumber,v.column),W=await ev(this._registry,e,H,z,Sd.None,a);if(W.validActions.length!==0){for(const j of W.validActions)j.highlightRange=j.action.isPreferred;m.allActions.length===0&&f.push(...W.allActions),Math.abs(b.column-D)<C?w.unshift(...W.validActions):w.push(...W.validActions)}C=Math.abs(b.column-D)}}const y=w.filter((k,D,N)=>N.findIndex(R=>R.action.title===k.action.title)===D);return y.sort((k,D)=>k.action.isPreferred&&!D.action.isPreferred?-1:!k.action.isPreferred&&D.action.isPreferred||k.action.isAI&&!D.action.isAI?1:!k.action.isAI&&D.action.isAI?-1:0),{validActions:y,allActions:f,documentation:m.documentation,hasAutoFix:m.hasAutoFix,hasAIFix:m.hasAIFix,allAIFixes:m.allAIFixes,dispose:()=>{m.dispose()}}}}}return ev(this._registry,e,n.selection,n.trigger,Sd.None,a)});n.trigger.type===1&&((o=this._progressService)===null||o===void 0||o.showWhile(r,250)),this.setState(new su.Triggered(n.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:is.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 vfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Hl=function(i,e){return function(t,n){e(t,n,i)}},VC;const bfe="quickfix-edit-highlight";let sc=VC=class extends B{static get(i){return i.getContribution(VC.ID)}constructor(i,e,t,n,o,s,r,a,l,d){super(),this._commandService=r,this._configurationService=a,this._actionWidgetService=l,this._instantiationService=d,this._activeCodeActions=this._register(new un),this._showDisabled=!1,this._disposed=!1,this._editor=i,this._model=this._register(new _fe(this._editor,o.codeActionProvider,e,t,s,a)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new bc(()=>{const h=this._editor.getContribution(eg.ID);return h&&this._register(h.onClick(c=>this.showCodeActionList(c.actions,c,{includeDisabledActions:!1,fromLightbulb:!0}))),h}),this._resolver=n.createInstance(Fy),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(i,e,t){return this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(i,e,t,n){var o;if(!this._editor.hasModel())return;(o=Xo.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:e,filter:t,autoApply:n,context:{notAvailableMessage:i,position:s}})}_trigger(i){return this._model.trigger(i)}async _applyCodeAction(i,e,t){try{await this._instantiationService.invokeFunction(tfe,i,Oy.FromCodeActions,{preview:t,editor:this._editor})}finally{e&&this._trigger({type:2,triggerAction:is.QuickFix,filter:{}})}}async update(i){var e,t,n,o,s,r,a;if(i.type!==1){(e=this._lightBulbWidget.rawValue)===null||e===void 0||e.hide();return}let l;try{l=await i.actions}catch(d){Ke(d);return}if(!this._disposed)if((t=this._lightBulbWidget.value)===null||t===void 0||t.update(l,i.trigger,i.position),i.trigger.type===1){if(!((n=i.trigger.filter)===null||n===void 0)&&n.include){const h=this.tryGetValidActionToApply(i.trigger,l);if(h){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),await this._applyCodeAction(h,!1,!1)}finally{l.dispose()}return}if(i.trigger.context){const c=this.getInvalidActionThatWouldHaveBeenApplied(i.trigger,l);if(c&&c.action.disabled){(s=Xo.get(this._editor))===null||s===void 0||s.showMessage(c.action.disabled,i.trigger.context.position),l.dispose();return}}}const d=!!(!((r=i.trigger.filter)===null||r===void 0)&&r.include);if(i.trigger.context&&(!l.allActions.length||!d&&!l.validActions.length)){(a=Xo.get(this._editor))===null||a===void 0||a.showMessage(i.trigger.context.notAvailableMessage,i.trigger.context.position),this._activeCodeActions.value=l,l.dispose();return}this._activeCodeActions.value=l,this.showCodeActionList(l,this.toCoords(i.position),{includeDisabledActions:d,fromLightbulb:!1})}else this._actionWidgetService.isVisible?l.dispose():this._activeCodeActions.value=l}getInvalidActionThatWouldHaveBeenApplied(i,e){if(e.allActions.length&&(i.autoApply==="first"&&e.validActions.length===0||i.autoApply==="ifSingle"&&e.allActions.length===1))return e.allActions.find(({action:t})=>t.disabled)}tryGetValidActionToApply(i,e){if(e.validActions.length&&(i.autoApply==="first"&&e.validActions.length>0||i.autoApply==="ifSingle"&&e.validActions.length===1))return e.validActions[0]}async showCodeActionList(i,e,t){const n=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=t.includeDisabledActions&&(this._showDisabled||i.validActions.length===0)?i.allActions:i.validActions;if(!s.length)return;const r=P.isIPosition(e)?this.toCoords(e):e,a={onSelect:async(l,d)=>{this._applyCodeAction(l,!0,!!d),this._actionWidgetService.hide(),n.clear()},onHide:()=>{var l;(l=this._editor)===null||l===void 0||l.focus(),n.clear()},onHover:async(l,d)=>{var h;if(await l.resolve(d),!d.isCancellationRequested)return{canPreview:!!(!((h=l.action.edit)===null||h===void 0)&&h.edits.length)}},onFocus:l=>{var d,h;if(l&&l.highlightRange&&l.action.diagnostics){const c=[{range:l.action.diagnostics[0],options:VC.DECORATION}];n.set(c);const u=l.action.diagnostics[0],g=(h=(d=this._editor.getModel())===null||d===void 0?void 0:d.getWordAtPosition({lineNumber:u.startLineNumber,column:u.startColumn}))===null||h===void 0?void 0:h.word;Qh(p("editingNewSelection","Context: {0} at line {1} and column {2}.",g,u.startLineNumber,u.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,rfe(s,this._shouldShowHeaders(),this._resolver.getResolver()),a,r,o,this._getActionBarActions(i,e,t))}toCoords(i){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(i,1),this._editor.render();const e=this._editor.getScrolledVisiblePosition(i),t=ji(this._editor.getDomNode()),n=t.left+e.left,o=t.top+e.top+e.height;return{x:n,y:o}}_shouldShowHeaders(){var i;const e=(i=this._editor)===null||i===void 0?void 0:i.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e==null?void 0:e.uri})}_getActionBarActions(i,e,t){if(t.fromLightbulb)return[];const n=i.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var r;return this._commandService.executeCommand(o.id,...(r=o.arguments)!==null&&r!==void 0?r:[])}}});return t.includeDisabledActions&&i.validActions.length>0&&i.allActions.length!==i.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(i,e,t))}:{id:"showMoreActions",label:p("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(i,e,t))}),n}};sc.ID="editor.contrib.codeActionController";sc.DECORATION=je.register({description:"quickfix-highlight",className:bfe});sc=VC=vfe([Hl(1,Al),Hl(2,Ae),Hl(3,Me),Hl(4,pe),Hl(5,Sc),Hl(6,pi),Hl(7,at),Hl(8,kg),Hl(9,Me)],sc);Rr((i,e)=>{((n,o)=>{o&&e.addRule(`.monaco-editor ${n} { background-color: ${o}; }`)})(".quickfix-edit-highlight",i.getColor(rl));const t=i.getColor(ph);t&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${ua(i.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`)});function Db(i){return G.regex(cz.keys()[0],new RegExp("(\\s|^)"+Ms(i.value)+"\\b"))}const dP={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 Dg(i,e,t,n,o=is.Default){if(i.hasModel()){const s=sc.get(i);s==null||s.manualTriggerAtCurrentPosition(e,o,t,n)}}class Cfe extends ce{constructor(){super({id:rP,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:G.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:2137,weight:100}})}run(e,t){return Dg(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,is.QuickFix)}}class wfe extends gn{constructor(){super({id:tz,precondition:G.and(E.writable,E.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:dP}]}})}runEditorCommand(e,t,n){const o=Qa.fromUser(n,{kind:Re.Empty,apply:"ifSingle"});return Dg(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?p("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):p("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):o.preferred?p("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):p("editor.action.codeAction.noneMessage","No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}}class yfe extends ce{constructor(){super({id:nz,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:G.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:G.and(E.writable,Db(Re.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:dP}]}})}run(e,t,n){const o=Qa.fromUser(n,{kind:Re.Refactor,apply:"never"});return Dg(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?p("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):p("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):o.preferred?p("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):p("editor.action.refactor.noneMessage","No refactorings available"),{include:Re.Refactor.contains(o.kind)?o.kind:Re.None,onlyIncludePreferredActions:o.preferred},o.apply,is.Refactor)}}class Sfe extends ce{constructor(){super({id:oz,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:G.and(E.writable,E.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:G.and(E.writable,Db(Re.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:dP}]}})}run(e,t,n){const o=Qa.fromUser(n,{kind:Re.Source,apply:"never"});return Dg(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?p("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):p("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):o.preferred?p("editor.action.source.noneMessage.preferred","No preferred source actions available"):p("editor.action.source.noneMessage","No source actions available"),{include:Re.Source.contains(o.kind)?o.kind:Re.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,is.SourceAction)}}class Lfe extends ce{constructor(){super({id:aP,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:G.and(E.writable,Db(Re.SourceOrganizeImports)),kbOpts:{kbExpr:E.textInputFocus,primary:1581,weight:100}})}run(e,t){return Dg(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:Re.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",is.OrganizeImports)}}class kfe extends ce{constructor(){super({id:lP,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:G.and(E.writable,Db(Re.SourceFixAll))})}run(e,t){return Dg(t,p("fixAll.noneMessage","No fix all action available"),{include:Re.SourceFixAll,includeSourceActions:!0},"ifSingle",is.FixAll)}}class Dfe extends ce{constructor(){super({id:iz,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:G.and(E.writable,Db(Re.QuickFix)),kbOpts:{kbExpr:E.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Dg(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Re.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",is.AutoFix)}}pt(sc.ID,sc,3);pt(eg.ID,eg,4);ie(Cfe);ie(yfe);ie(Sfe);ie(Lfe);ie(Dfe);ie(kfe);re(new wfe);ai.as(ka.Configuration).registerConfiguration({...tL,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:p("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});ai.as(ka.Configuration).registerConfiguration({...tL,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 F2{constructor(){this.lenses=[],this._disposables=new Y}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}async function gz(i,e,t){const n=i.ordered(e),o=new Map,s=new F2,r=n.map(async(a,l)=>{o.set(a,l);try{const d=await Promise.resolve(a.provideCodeLenses(e,t));d&&s.add(d,a)}catch(d){Ti(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:o.get(a.provider)<o.get(l.provider)?-1:o.get(a.provider)>o.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),s}ct.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;Et(xe.isUri(t)),Et(typeof n=="number"||!n);const{codeLensProvider:o}=i.get(pe),s=i.get(ti).getModel(t);if(!s)throw Zs();const r=[],a=new Y;return gz(o,s,et.None).then(l=>{a.add(l);const d=[];for(const h of l.lenses)n==null||h.symbol.command?r.push(h.symbol):n-- >0&&h.provider.resolveCodeLens&&d.push(Promise.resolve(h.provider.resolveCodeLens(s,h.symbol,et.None)).then(c=>r.push(c||h.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var xfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Efe=function(i,e){return function(t,n){e(t,n,i)}};const pz=tt("ICodeLensCache");class $6{constructor(e,t){this.lineCount=e,this.data=t}}let B2=class{constructor(i){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Cc(20,.75);const e="codelens/cache";r_(si,()=>i.remove(e,1));const t="codelens/cache2",n=i.get(t,1,"{}");this._deserialize(n),le.once(i.onWillSaveState)(o=>{o.reason===n0.SHUTDOWN&&i.store(t,this._serialize(),1,1)})}put(i,e){const t=e.lenses.map(s=>{var r;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(r=s.symbol.command)===null||r===void 0?void 0:r.title}}}),n=new F2;n.add({lenses:t,dispose:()=>{}},this._fakeProvider);const o=new $6(i.getLineCount(),n);this._cache.set(i.uri.toString(),o)}get(i){const e=this._cache.get(i.uri.toString());return e&&e.lineCount===i.getLineCount()?e.data:void 0}delete(i){this._cache.delete(i.uri.toString())}_serialize(){const i=Object.create(null);for(const[e,t]of this._cache){const n=new Set;for(const o of t.data.lenses)n.add(o.symbol.range.startLineNumber);i[e]={lineCount:t.lineCount,lines:[...n.values()]}}return JSON.stringify(i)}_deserialize(i){try{const e=JSON.parse(i);for(const t in e){const n=e[t],o=[];for(const r of n.lines)o.push({range:new L(r,1,r,11)});const s=new F2;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(t,new $6(n.lineCount,s))}}catch{}}};B2=xfe([Efe(0,Pr)],B2);lt(pz,B2,1);class Nfe{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class PL{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${PL._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let o=!1;for(let s=0;s<e.length;s++){const r=e[s];if(r&&(o=!0,r.command)){const a=Th(r.command.title.trim());r.command.id?(n.push(ee("a",{id:String(s),title:r.command.tooltip,role:"button"},...a)),this._commands.set(String(s),r.command)):n.push(ee("span",{title:r.command.tooltip},...a)),s+1<e.length&&n.push(ee("span",void 0," | "))}}o?(On(this._domNode,...n),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):On(this._domNode,ee("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}}PL._idPool=0;class cx{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 n=0,o=t.length;n<o;n++)this._addDecorationsCallbacks[n](t[n])}}const q6=je.register({collapseOnReplaceEdit:!0,description:"codelens"});class G6{constructor(e,t,n,o,s,r){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a;const l=[];this._data.forEach((d,h)=>{d.symbol.command&&l.push(d.symbol),n.addDecoration({range:d.symbol.range,options:q6},c=>this._decorationIds[h]=c),a?a=L.plusRange(a,d.symbol.range):a=L.lift(d.symbol.range)}),this._viewZone=new Nfe(a.startLineNumber-1,s,r),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new PL(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const n=this._editor.getModel().getDecorationRange(e),o=this._data[t].symbol;return!!(n&&L.isEmpty(o.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,o)=>{t.addDecoration({range:n.symbol.range,options:q6},s=>this._decorationIds[o]=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 n=e.getDecorationRange(this._decorationIds[t]);n&&(this._data[t].symbol.range=n)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const n=e[t];if(n){const{symbol:o}=this._data[t];o.command=n.command||o.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 Ife=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Zf=function(i,e){return function(t,n){e(t,n,i)}};let zm=class{constructor(i,e,t,n,o,s){this._editor=i,this._languageFeaturesService=e,this._commandService=n,this._notificationService=o,this._codeLensCache=s,this._disposables=new Y,this._localToDispose=new Y,this._lenses=[],this._oldCodeLensModels=new Y,this._provideCodeLensDebounce=t.for(e.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=t.for(e.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Mt(()=>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(r=>{(r.hasChanged(50)||r.hasChanged(19)||r.hasChanged(18))&&this._updateLensStyle(),r.hasChanged(17)&&this._onModelChange()})),this._disposables.add(e.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var i;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_getLayoutInfo(){const i=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let e=this._editor.getOption(19);return(!e||e<5)&&(e=this._editor.getOption(52)*.9|0),{fontSize:e,codeLensHeight:e*i|0}}_updateLensStyle(){const{codeLensHeight:i,fontSize:e}=this._getLayoutInfo(),t=this._editor.getOption(18),n=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${i}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),t&&(o.setProperty("--vscode-editorCodeLens-fontFamily",t),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Yo.fontFamily)),this._editor.changeViewZones(s=>{for(const r of this._lenses)r.updateHeight(i,s)})}_localDispose(){var i,e,t;(i=this._getCodeLensModelPromise)===null||i===void 0||i.cancel(),this._getCodeLensModelPromise=void 0,(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(t=this._currentCodeLensModel)===null||t===void 0||t.dispose()}_onModelChange(){this._localDispose();const i=this._editor.getModel();if(!i||!this._editor.getOption(17)||i.isTooLargeForTokenization())return;const e=this._codeLensCache.get(i);if(e&&this._renderCodeLensSymbols(e),!this._languageFeaturesService.codeLensProvider.has(i)){e&&qh(()=>{const n=this._codeLensCache.get(i);e===n&&(this._codeLensCache.delete(i),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(i))if(typeof n.onDidChange=="function"){const o=n.onDidChange(()=>t.schedule());this._localToDispose.add(o)}const t=new Mt(()=>{var n;const o=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=Yi(s=>gz(this._languageFeaturesService.codeLensProvider,i,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(i,s);const r=this._provideCodeLensDebounce.update(i,Date.now()-o);t.delay=r,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},Ke)},this._provideCodeLensDebounce.get(i));this._localToDispose.add(t),this._localToDispose.add(Ne(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var n;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const r=[];let a=-1;this._lenses.forEach(d=>{!d.isValid()||a===d.getLineNumber()?r.push(d):(d.update(s),a=d.getLineNumber())});const l=new cx;r.forEach(d=>{d.dispose(l,s),this._lenses.splice(this._lenses.indexOf(d),1)}),l.commit(o)})}),t.schedule(),this._resolveCodeLensesScheduler.cancel(),(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{t.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{t.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(Ne(()=>{if(this._editor.getModel()){const n=Ca.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),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 o=n.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const r=s.getCommand(o);if(r){this._commandService.executeCommand(r.id,...r.arguments||[]).catch(a=>this._notificationService.error(a));break}}})),t.schedule()}_disposeAllLenses(i,e){const t=new cx;for(const n of this._lenses)n.dispose(t,e);i&&t.commit(i),this._lenses.length=0}_renderCodeLensSymbols(i){if(!this._editor.hasModel())return;const e=this._editor.getModel().getLineCount(),t=[];let n;for(const r of i.lenses){const a=r.symbol.range.startLineNumber;a<1||a>e||(n&&n[n.length-1].symbol.range.startLineNumber===a?n.push(r):(n=[r],t.push(n)))}if(!t.length&&!this._lenses.length)return;const o=Ca.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(r=>{this._editor.changeViewZones(a=>{const l=new cx;let d=0,h=0;for(;h<t.length&&d<this._lenses.length;){const c=t[h][0].symbol.range.startLineNumber,u=this._lenses[d].getLineNumber();u<c?(this._lenses[d].dispose(l,a),this._lenses.splice(d,1)):u===c?(this._lenses[d].updateCodeLensSymbols(t[h],l),h++,d++):(this._lenses.splice(d,0,new G6(t[h],this._editor,l,a,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),d++,h++)}for(;d<this._lenses.length;)this._lenses[d].dispose(l,a),this._lenses.splice(d,1);for(;h<t.length;)this._lenses.push(new G6(t[h],this._editor,l,a,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;l.commit(r)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var i;(i=this._resolveCodeLensesPromise)===null||i===void 0||i.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],n=[];if(this._lenses.forEach(r=>{const a=r.computeIfNecessary(e);a&&(t.push(a),n.push(r))}),t.length===0)return;const o=Date.now(),s=Yi(r=>{const a=t.map((l,d)=>{const h=new Array(l.length),c=l.map((u,g)=>!u.symbol.command&&typeof u.provider.resolveCodeLens=="function"?Promise.resolve(u.provider.resolveCodeLens(e,u.symbol,r)).then(m=>{h[g]=m},Ti):(h[g]=u.symbol,Promise.resolve(void 0)));return Promise.all(c).then(()=>{!r.isCancellationRequested&&!n[d].isDisposed()&&n[d].updateCommands(h)})});return Promise.all(a)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const r=this._resolveCodeLensesDebounce.update(e,Date.now()-o);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{Ke(r),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var i;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((i=this._currentCodeLensModel)===null||i===void 0)&&i.isDisposed?void 0:this._currentCodeLensModel}};zm.ID="css.editor.codeLens";zm=Ife([Zf(1,pe),Zf(2,sr),Zf(3,pi),Zf(4,Pi),Zf(5,pz)],zm);pt(zm.ID,zm,1);ie(class extends ce{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:E.hasCodeLensProvider,label:p("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(i,e){if(!e.hasModel())return;const t=i.get(Da),n=i.get(pi),o=i.get(Pi),s=e.getSelection().positionLineNumber,r=e.getContribution(zm.ID);if(!r)return;const a=await r.getModel();if(!a)return;const l=[];for(const c of a.lenses)c.symbol.command&&c.symbol.range.startLineNumber===s&&l.push({label:c.symbol.command.title,command:c.symbol.command});if(l.length===0)return;const d=await t.pick(l,{canPickMany:!1,placeHolder:p("placeHolder","Select a command")});if(!d)return;let h=d.command;if(a.isDisposed){const c=await r.getModel(),u=c==null?void 0:c.lenses.find(g=>{var m;return g.symbol.range.startLineNumber===s&&((m=g.symbol.command)===null||m===void 0?void 0:m.title)===h.title});if(!u||!u.symbol.command)return;h=u.symbol.command}try{await n.executeCommand(h.id,...h.arguments||[])}catch(c){o.error(c)}}});var Mfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},ux=function(i,e){return function(t,n){e(t,n,i)}};class hP{constructor(e,t){this._editorWorkerClient=new mR(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){const o=t.range,s=t.color,r=s.alpha,a=new V(new dt(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?V.Format.CSS.formatRGB(a):V.Format.CSS.formatRGBA(a),d=r?V.Format.CSS.formatHSL(a):V.Format.CSS.formatHSLA(a),h=r?V.Format.CSS.formatHex(a):V.Format.CSS.formatHexA(a),c=[];return c.push({label:l,textEdit:{range:o,text:l}}),c.push({label:d,textEdit:{range:o,text:d}}),c.push({label:h,textEdit:{range:o,text:h}}),c}}let W2=class extends B{constructor(i,e,t){super(),this._register(t.colorProvider.register("*",new hP(i,e)))}};W2=Mfe([ux(0,ti),ux(1,Bt),ux(2,pe)],W2);wL(W2);async function mz(i,e,t,n=!0){return cP(new Tfe,i,e,t,n)}function fz(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class Tfe{constructor(){}async compute(e,t,n,o){const s=await e.provideDocumentColors(t,n);if(Array.isArray(s))for(const r of s)o.push({colorInfo:r,provider:e});return Array.isArray(s)}}class Rfe{constructor(){}async compute(e,t,n,o){const s=await e.provideDocumentColors(t,n);if(Array.isArray(s))for(const r of s)o.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)}}class Afe{constructor(e){this.colorInfo=e}async compute(e,t,n,o){const s=await e.provideColorPresentations(t,this.colorInfo,et.None);return Array.isArray(s)&&o.push(...s),Array.isArray(s)}}async function cP(i,e,t,n,o){let s=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const h=l[d];if(h instanceof hP)r=h;else try{await i.compute(h,t,n,a)&&(s=!0)}catch(c){Ti(c)}}return s?a:r&&o?(await i.compute(r,t,n,a),a):[]}function _z(i,e){const{colorProvider:t}=i.get(pe),n=i.get(ti).getModel(e);if(!n)throw Zs();const o=i.get(at).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:o}}ct.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof xe))throw Zs();const{model:n,colorProviderRegistry:o,isDefaultColorDecoratorsEnabled:s}=_z(i,t);return cP(new Rfe,o,n,et.None,s)});ct.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:o,range:s}=n;if(!(o instanceof xe)||!Array.isArray(t)||t.length!==4||!L.isIRange(s))throw Zs();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=_z(i,o),[d,h,c,u]=t;return cP(new Afe({range:s,color:{red:d,green:h,blue:c,alpha:u}}),a,r,et.None,l)});var Pfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},gx=function(i,e){return function(t,n){e(t,n,i)}},V2;const vz=Object.create({});let rc=V2=class extends B{constructor(i,e,t,n){super(),this._editor=i,this._configurationService=e,this._languageFeaturesService=t,this._localToDispose=this._register(new Y),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new eb(this._editor),this._decoratorLimitReporter=new Ofe,this._colorDecorationClassRefs=this._register(new Y),this._debounceInformation=n.for(t.colorProvider,"Document Colors",{min:V2.RECOMPUTE_TIME}),this._register(i.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(i.onDidChangeModelLanguage(()=>this.updateColors())),this._register(t.colorProvider.onDidChange(()=>this.updateColors())),this._register(i.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const r=s!==this._isColorDecoratorsEnabled||o.hasChanged(21),a=o.hasChanged(145);(r||a)&&(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 i=this._editor.getModel();if(!i)return!1;const e=i.getLanguageId(),t=this._configurationService.getValue(e);if(t&&typeof t=="object"){const n=t.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(20)}static get(i){return i.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const i=this._editor.getModel();!i||!this._languageFeaturesService.colorProvider.has(i)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Mr,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(i)))})),this.beginCompute())}async beginCompute(){this._computePromise=Yi(async i=>{const e=this._editor.getModel();if(!e)return[];const t=new $n(!1),n=await mz(this._languageFeaturesService.colorProvider,e,i,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(e,t.elapsed()),n});try{const i=await this._computePromise;this.updateDecorations(i),this.updateColorDecorators(i),this._computePromise=null}catch(i){Ke(i)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(i){const e=i.map(t=>({range:{startLineNumber:t.colorInfo.range.startLineNumber,startColumn:t.colorInfo.range.startColumn,endLineNumber:t.colorInfo.range.endLineNumber,endColumn:t.colorInfo.range.endColumn},options:je.EMPTY}));this._editor.changeDecorations(t=>{this._decorationsIds=t.deltaDecorations(this._decorationsIds,e),this._colorDatas=new Map,this._decorationsIds.forEach((n,o)=>this._colorDatas.set(n,i[o]))})}updateColorDecorators(i){this._colorDecorationClassRefs.clear();const e=[],t=this._editor.getOption(21);for(let o=0;o<i.length&&e.length<t;o++){const{red:s,green:r,blue:a,alpha:l}=i[o].colorInfo.color,d=new dt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),h=`rgba(${d.r}, ${d.g}, ${d.b}, ${d.a})`,c=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:h}));e.push({range:{startLineNumber:i[o].colorInfo.range.startLineNumber,startColumn:i[o].colorInfo.range.startColumn,endLineNumber:i[o].colorInfo.range.endLineNumber,endColumn:i[o].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:v8,inlineClassName:`${c.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:vz}}})}const n=t<i.length?t:!1;this._decoratorLimitReporter.update(i.length,n),this._colorDecoratorIds.set(e)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(i){const e=this._editor.getModel();if(!e)return null;const t=e.getDecorationsInRange(L.fromPositions(i,i)).filter(n=>this._colorDatas.has(n.id));return t.length===0?null:this._colorDatas.get(t[0].id)}isColorDecoration(i){return this._colorDecoratorIds.has(i)}};rc.ID="editor.contrib.colorDetector";rc.RECOMPUTE_TIME=1e3;rc=V2=Pfe([gx(1,at),gx(2,pe),gx(3,sr)],rc);class Ofe{constructor(){this._onDidChange=new A,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}pt(rc.ID,rc,1);class Ffe{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,n){this.presentationIndex=n,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new A,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new A,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let n=-1;for(let o=0;o<this.colorPresentations.length;o++)if(t.toLowerCase()===this.colorPresentations[o].label){n=o;break}if(n===-1){const o=t.split("(")[0].toLowerCase();for(let s=0;s<this.colorPresentations.length;s++)if(this.colorPresentations[s].label.toLowerCase().startsWith(o)){n=s;break}}n!==-1&&n!==this.presentationIndex&&(this.presentationIndex=n,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const Ss=ee;class Bfe extends B{constructor(e,t,n,o=!1){super(),this.model=t,this.showingStandaloneColorPicker=o,this._closeButton=null,this._domNode=Ss(".colorpicker-header"),Z(e,this._domNode),this._pickedColorNode=Z(this._domNode,Ss(".picked-color")),Z(this._pickedColorNode,Ss("span.codicon.codicon-color-mode")),this._pickedColorPresentation=Z(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=Z(this._domNode,Ss(".original-color")),this._originalColorNode.style.backgroundColor=V.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=n.getColorTheme().getColor(Mw)||V.white,this._register(n.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor(Mw)||V.white})),this._register($(this._pickedColorNode,ae.CLICK,()=>this.model.selectNextColorPresentation())),this._register($(this._originalColorNode,ae.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=V.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 Wfe(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=V.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 Wfe extends B{constructor(e){super(),this._onClicked=this._register(new A),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Z(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Z(this._button,t),Z(t,Ss(".button"+Ee.asCSSSelector(Ei("color-picker-close",oe.close,p("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class Vfe extends B{constructor(e,t,n,o=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=Ss(".colorpicker-body"),Z(e,this._domNode),this._saturationBox=new Hfe(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 zfe(this._domNode,this.model,o),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Ufe(this._domNode,this.model,o),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),o&&(this._insertButton=this._register(new Kfe(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new V(new el(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new V(new el(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new V(new el(n===360?0:n,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class Hfe extends B{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Ss(".saturation-wrap"),Z(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Z(this._domNode,this._canvas),this.selection=Ss(".saturation-selection"),Z(this._domNode,this.selection),this.layout(),this._register($(this._domNode,ae.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new lf);const t=ji(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangePosition(o.pageX-t.left,o.pageY-t.top),()=>null);const n=$(e.target.ownerDocument,ae.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),o=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,o),this._onDidChange.fire({s:n,v:o})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new V(new el(e.h,1,1,1)),n=this._canvas.getContext("2d"),o=n.createLinearGradient(0,0,this._canvas.width,0);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)");const s=n.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=V.Format.CSS.format(t),n.fill(),n.fillStyle=o,n.fill(),n.fillStyle=s,n.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class bz extends B{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=Z(e,Ss(".standalone-strip")),this.overlay=Z(this.domNode,Ss(".standalone-overlay"))):(this.domNode=Z(e,Ss(".strip")),this.overlay=Z(this.domNode,Ss(".overlay"))),this.slider=Z(this.domNode,Ss(".slider")),this.slider.style.top="0px",this._register($(this.domNode,ae.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new lf),n=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-n.top),()=>null);const o=$(e.target.ownerDocument,ae.POINTER_UP,()=>{this._onColorFlushed.fire(),o.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class zfe extends bz{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:o}=e.rgba,s=new V(new dt(t,n,o,1)),r=new V(new dt(t,n,o,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Ufe extends bz{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Kfe extends B{constructor(e){super(),this._onClicked=this._register(new A),this.onClicked=this._onClicked.event,this._button=Z(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 jfe extends Tr{constructor(e,t,n,o,s=!1){super(),this.model=t,this.pixelRatio=n,this._register(Cv.onDidChange(()=>this.layout()));const r=Ss(".colorpicker-widget");e.appendChild(r),this.header=this._register(new Bfe(r,this.model,o,s)),this.body=this._register(new Vfe(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var Cz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},wz=function(i,e){return function(t,n){e(t,n,i)}};class $fe{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let By=class{constructor(i,e){this._editor=i,this._themeService=e,this.hoverOrdinal=2}computeSync(i,e){return[]}computeAsync(i,e,t){return Bi.fromPromise(this._computeAsync(i,e,t))}async _computeAsync(i,e,t){if(!this._editor.hasModel())return[];const n=rc.get(this._editor);if(!n)return[];for(const o of e){if(!n.isColorDecoration(o))continue;const s=n.getColorData(o.range.getStartPosition());if(s)return[await yz(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]}renderHoverParts(i,e){return Sz(this,this._editor,this._themeService,e,i)}};By=Cz([wz(1,nn)],By);class qfe{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o}}let v0=class{constructor(i,e){this._editor=i,this._themeService=e,this._color=null}async createColorHover(i,e,t){if(!this._editor.hasModel()||!rc.get(this._editor))return null;const n=await mz(t,this._editor.getModel(),et.None);let o=null,s=null;for(const d of n){const h=d.colorInfo;L.containsRange(h.range,i.range)&&(o=h,s=d.provider)}const r=o??i,a=s??e,l=!!o;return{colorHover:await yz(this,this._editor.getModel(),r,a),foundInEditor:l}}async updateEditorModel(i){if(!this._editor.hasModel())return;const e=i.model;let t=new L(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn);this._color&&(await HC(this._editor.getModel(),e,this._color,t,i),t=Lz(this._editor,t,e))}renderHoverParts(i,e){return Sz(this,this._editor,this._themeService,e,i)}set color(i){this._color=i}get color(){return this._color}};v0=Cz([wz(1,nn)],v0);async function yz(i,e,t,n){const o=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new dt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),h=new V(d),c=await fz(e,t,n,et.None),u=new Ffe(h,[],0);return u.colorPresentations=c||[],u.guessColorPresentation(h,o),i instanceof By?new $fe(i,L.lift(t.range),u,n):new qfe(i,L.lift(t.range),u,n)}function Sz(i,e,t,n,o){if(n.length===0||!e.hasModel())return B.None;if(o.setMinimumDimensions){const u=e.getOption(66)+8;o.setMinimumDimensions(new ft(302,u))}const s=new Y,r=n[0],a=e.getModel(),l=r.model,d=s.add(new jfe(o.fragment,l,e.getOption(141),t,i instanceof v0));o.setColorPicker(d);let h=!1,c=new L(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(i instanceof v0){const u=n[0].model.color;i.color=u,HC(a,l,u,c,r),s.add(l.onColorFlushed(g=>{i.color=g}))}else s.add(l.onColorFlushed(async u=>{await HC(a,l,u,c,r),h=!0,c=Lz(e,c,l,o)}));return s.add(l.onDidChangeColor(u=>{HC(a,l,u,c,r)})),s.add(e.onDidChangeModelContent(u=>{h?h=!1:(o.hide(),e.focus())})),s}function Lz(i,e,t,n){let o,s;if(t.presentation.textEdit){o=[t.presentation.textEdit],s=new L(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=i.getModel()._setTrackedRange(null,s,3);i.pushUndoStop(),i.executeEdits("colorpicker",o),s=i.getModel()._getTrackedRange(r)||s}else o=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],s=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),i.pushUndoStop(),i.executeEdits("colorpicker",o);return t.presentation.additionalTextEdits&&(o=[...t.presentation.additionalTextEdits],i.executeEdits("colorpicker",o),n&&n.hide()),i.pushUndoStop(),s}async function HC(i,e,t,n,o){const s=await fz(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},o.provider,et.None);e.colorPresentations=s||[]}function H2(i,e){return!!i[e]}class px{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=H2(e.event,t.triggerModifier),this.hasSideBySideModifier=H2(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Z6{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=H2(e,t.triggerModifier)}}class O1{constructor(e,t,n,o){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=o}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Y6(i){return i==="altKey"?ht?new O1(57,"metaKey",6,"altKey"):new O1(5,"ctrlKey",6,"altKey"):ht?new O1(6,"altKey",57,"metaKey"):new O1(6,"altKey",5,"ctrlKey")}class OL extends B{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new A),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new A),this.onExecute=this._onExecute.event,this._onCancel=this._register(new A),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:o=>o.target.position?o.target.position.lineNumber:0,this._opts=Y6(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(o=>{if(o.hasChanged(77)){const s=Y6(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(o=>this._onEditorMouseMove(new px(o,this._opts)))),this._register(this._editor.onMouseDown(o=>this._onEditorMouseDown(new px(o,this._opts)))),this._register(this._editor.onMouseUp(o=>this._onEditorMouseUp(new px(o,this._opts)))),this._register(this._editor.onKeyDown(o=>this._onEditorKeyDown(new Z6(o,this._opts)))),this._register(this._editor.onKeyUp(o=>this._onEditorKeyUp(new Z6(o,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(o=>this._onDidChangeCursorSelection(o))),this._register(this._editor.onDidChangeModel(o=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(o=>{(o.scrollTopChanged||o.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var Gfe=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},zl=function(i,e){return function(t,n){e(t,n,i)}};let ac=class extends Nm{constructor(i,e,t,n,o,s,r,a,l,d,h,c,u){super(i,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},t,o,s,r,a,l,d,h,c,u),this._parentEditor=n,this._overwriteOptions=e,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(i){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(i){cS(this._overwriteOptions,i,!0),super.updateOptions(this._overwriteOptions)}};ac=Gfe([zl(4,Me),zl(5,vt),zl(6,pi),zl(7,Ae),zl(8,nn),zl(9,Pi),zl(10,Rl),zl(11,Bt),zl(12,pe)],ac);const Q6=new V(new dt(0,122,204)),Zfe={showArrow:!0,showFrame:!0,className:"",frameColor:Q6,arrowColor:Q6,keepEditorSelection:!1},Yfe="vs.editor.contrib.zoneWidget";class Qfe{constructor(e,t,n,o,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=o,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Xfe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class FL{constructor(e){this._editor=e,this._ruleName=FL._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),gN(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(){gN(this._ruleName),Cw(`.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:L.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}FL._IdGenerator=new mA(".arrow-decoration-");class Jfe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Y,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Yl(t),cS(this.options,Zfe,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(n=>{const o=this._getWidth(n);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(n)+"px",this._onWidth(o)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new FL(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const o=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(o))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const n=L.isIRange(e)?L.lift(e):L.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:je.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),o=this.editor.getLayoutInfo(),s=this._getWidth(o);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(o)+"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(n)),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 Qfe(r,n.lineNumber,n.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 Xfe(Yfe+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 h=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,s),this.options.keepEditorSelection||this.editor.setSelection(e);const c=this.editor.getModel();if(c){const u=c.validateRange(new L(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===c.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 Hn(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const n=(t.currentY-e.startY)/this.editor.getOption(66),o=n<0?Math.ceil(n):Math.floor(n),s=e.heightInLines+o;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 kz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Dz=function(i,e){return function(t,n){e(t,n,i)}};const xz=tt("IPeekViewService");lt(xz,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const o=this._widgets.get(i);o&&o.widget===e&&(o.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var Ao;(function(i){i.inPeekEditor=new de("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(Ao||(Ao={}));let b0=class{constructor(i,e){i instanceof ac&&Ao.inPeekEditor.bindTo(e)}dispose(){}};b0.ID="editor.contrib.referenceController";b0=kz([Dz(1,Ae)],b0);pt(b0.ID,b0,0);function e_e(i){const e=i.get(vt).getFocusedCodeEditor();return e instanceof ac?e.getParentEditor():e}const t_e={headerBackgroundColor:V.white,primaryHeadingColor:V.fromHex("#333333"),secondaryHeadingColor:V.fromHex("#6c6c6cb3")};let Wy=class extends Jfe{constructor(i,e,t){super(i,e),this.instantiationService=t,this._onDidClose=new A,this.onDidClose=this._onDidClose.event,cS(this.options,t_e,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(i){const e=this.options;i.headerBackgroundColor&&(e.headerBackgroundColor=i.headerBackgroundColor),i.primaryHeadingColor&&(e.primaryHeadingColor=i.primaryHeadingColor),i.secondaryHeadingColor&&(e.secondaryHeadingColor=i.secondaryHeadingColor),super.style(i)}_applyStyles(){super._applyStyles();const i=this.options;this._headElement&&i.headerBackgroundColor&&(this._headElement.style.backgroundColor=i.headerBackgroundColor.toString()),this._primaryHeading&&i.primaryHeadingColor&&(this._primaryHeading.style.color=i.primaryHeadingColor.toString()),this._secondaryHeading&&i.secondaryHeadingColor&&(this._secondaryHeading.style.color=i.secondaryHeadingColor.toString()),this._bodyElement&&i.frameColor&&(this._bodyElement.style.borderColor=i.frameColor.toString())}_fillContainer(i){this.setCssClass("peekview-widget"),this._headElement=ee(".head"),this._bodyElement=ee(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),i.appendChild(this._headElement),i.appendChild(this._bodyElement)}_fillHead(i,e){this._titleElement=ee(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),bi(this._titleElement,"click",o=>this._onTitleClick(o))),Z(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=ee("span.filename"),this._secondaryHeading=ee("span.dirname"),this._metaHeading=ee("span.meta"),Z(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const t=ee(".peekview-actions");Z(this._headElement,t);const n=this._getActionBarOptions();this._actionbarWidget=new or(t,n),this._disposables.add(this._actionbarWidget),e||this._actionbarWidget.push(new vo("peekview.close",p("label.close","Close"),Ee.asClassName(oe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(i){}_getActionBarOptions(){return{actionViewItemProvider:Hle.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(i){}setTitle(i,e){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=i,this._primaryHeading.setAttribute("title",i),e?this._secondaryHeading.innerText=e:Ln(this._secondaryHeading))}setMetaTitle(i){this._metaHeading&&(i?(this._metaHeading.innerText=i,$o(this._metaHeading)):ho(this._metaHeading))}_doLayout(i,e){if(!this._isShowing&&i<0){this.dispose();return}const t=Math.ceil(this.editor.getOption(66)*1.2),n=Math.round(i-(t+2));this._doLayoutHead(t,e),this._doLayoutBody(n,e)}_doLayoutHead(i,e){this._headElement&&(this._headElement.style.height=`${i}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(i,e){this._bodyElement&&(this._bodyElement.style.height=`${i}px`)}};Wy=kz([Dz(2,Me)],Wy);const i_e=M("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},p("peekViewTitleBackground","Background color of the peek view title area.")),Ez=M("peekViewTitleLabel.foreground",{dark:V.white,light:V.black,hcDark:V.white,hcLight:wr},p("peekViewTitleForeground","Color of the peek view title.")),Nz=M("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),n_e=M("peekView.border",{dark:Mo,light:Mo,hcDark:rt,hcLight:rt},p("peekViewBorder","Color of the peek view borders and arrow.")),o_e=M("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},p("peekViewResultsBackground","Background color of the peek view result list."));M("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:V.white,hcLight:wr},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));M("peekViewResult.fileForeground",{dark:V.white,light:"#1E1E1E",hcDark:V.white,hcLight:wr},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));M("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));M("peekViewResult.selectionForeground",{dark:V.white,light:"#6C6C6C",hcDark:V.white,hcLight:wr},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const wh=M("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:V.black,hcLight:V.white},p("peekViewEditorBackground","Background color of the peek view editor."));M("peekViewEditorGutter.background",{dark:wh,light:wh,hcDark:wh,hcLight:wh},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));M("peekViewEditorStickyScroll.background",{dark:wh,light:wh,hcDark:wh,hcLight:wh},p("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));M("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));M("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));M("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:$t,hcLight:$t},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class lc{constructor(e,t,n,o){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=o,this.id=wI.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({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,nr(this.uri),this.range.startLineNumber,this.range.startColumn):p("aria.oneReference","in {0} on line {1} at column {2}",nr(this.uri),this.range.startLineNumber,this.range.startColumn)}}class s_e{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:o,startColumn:s,endLineNumber:r,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:o,column:s-t}),d=new L(o,l.startColumn,o,s),h=new L(r,a,r,1073741824),c=n.getValueInRange(d).replace(/^\s+/,""),u=n.getValueInRange(e),g=n.getValueInRange(h).replace(/\s+$/,"");return{value:c+u+g,highlight:{start:c.length,end:c.length+u.length}}}}class C0{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new xi}dispose(){kt(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}",nr(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,nr(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 n=await e.createModelReference(t.uri);this._previews.set(t.uri,new s_e(n))}catch(n){Ke(n)}return this}}class Jo{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new A,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(Jo._compareReferences);let o;for(const s of e)if((!o||!qt.isEqual(o.uri,s.uri,!0))&&(o=new C0(this,s.uri),this.groups.push(o)),o.children.length===0||Jo._compareReferences(s,o.children[o.children.length-1])!==0){const r=new lc(n===s,o,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),o.children.push(r)}}dispose(){kt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Jo(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:n}=e;let o=n.children.indexOf(e);const s=n.children.length,r=n.parent.groups.length;return r===1||t&&o+1<s||!t&&o>0?(t?o=(o+1)%s:o=(o+s-1)%s,n.children[o]):(o=n.parent.groups.indexOf(n),t?(o=(o+1)%r,n.parent.groups[o].children[0]):(o=(o+r-1)%r,n.parent.groups[o].children[n.parent.groups[o].children.length-1]))}nearestReference(e,t){const n=this.references.map((o,s)=>({idx:s,prefixLen:Ou(o.uri.toString(),e.toString()),offsetDist:Math.abs(o.range.startLineNumber-t.lineNumber)*100+Math.abs(o.range.startColumn-t.column)})).sort((o,s)=>o.prefixLen>s.prefixLen?-1:o.prefixLen<s.prefixLen?1:o.offsetDist<s.offsetDist?-1:o.offsetDist>s.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&L.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return qt.compare(e.uri,t.uri)||L.compareRangesUsingStarts(e.range,t.range)}}var BL=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},WL=function(i,e){return function(t,n){e(t,n,i)}},z2;let U2=class{constructor(i){this._resolverService=i}hasChildren(i){return i instanceof Jo||i instanceof C0}getChildren(i){if(i instanceof Jo)return i.groups;if(i instanceof C0)return i.resolve(this._resolverService).then(e=>e.children);throw new Error("bad tree")}};U2=BL([WL(0,Oo)],U2);class r_e{getHeight(){return 23}getTemplateId(e){return e instanceof C0?w0.id:xb.id}}let K2=class{constructor(i){this._keybindingService=i}getKeyboardNavigationLabel(i){var e;if(i instanceof lc){const t=(e=i.parent.getPreview(i))===null||e===void 0?void 0:e.preview(i.range);if(t)return t.value}return nr(i.uri)}};K2=BL([WL(0,Tt)],K2);class a_e{getId(e){return e instanceof lc?e.id:e.uri}}let j2=class extends B{constructor(i,e){super(),this._labelService=e;const t=document.createElement("div");t.classList.add("reference-file"),this.file=this._register(new yy(t,{supportHighlights:!0})),this.badge=new KI(Z(t,ee(".count")),{},yV),i.appendChild(t)}set(i,e){const t=QS(i.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(i.uri),this._labelService.getUriLabel(t,{relative:!0}),{title:this._labelService.getUriLabel(i.uri),matches:e});const n=i.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(p("referencesCount","{0} references",n)):this.badge.setTitleFormat(p("referenceCount","{0} reference",n))}};j2=BL([WL(1,Im)],j2);let w0=z2=class{constructor(i){this._instantiationService=i,this.templateId=z2.id}renderTemplate(i){return this._instantiationService.createInstance(j2,i)}renderElement(i,e,t){t.set(i.element,hb(i.filterData))}disposeTemplate(i){i.dispose()}};w0.id="FileReferencesRenderer";w0=z2=BL([WL(0,Me)],w0);class l_e{constructor(e){this.label=new Ah(e)}set(e,t){var n;const o=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!o||!o.value)this.label.set(`${nr(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=o;t&&!ga.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,hb(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class xb{constructor(){this.templateId=xb.id}renderTemplate(e){return new l_e(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}xb.id="OneReferenceRenderer";class d_e{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var h_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Ul=function(i,e){return function(t,n){e(t,n,i)}};class VL{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Y,this._callOnModelChange=new Y,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],n=[];for(let o=0,s=e.children.length;o<s;o++){const r=e.children[o];this._decorationIgnoreSet.has(r.id)||r.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:r.range,options:VL.DecorationOptions}),n.push(o))}this._editor.changeDecorations(o=>{const s=o.deltaDecorations([],t);for(let r=0;r<s.length;r++)this._decorations.set(s[r],e.children[n[r]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[n,o]of this._decorations){const s=t.getDecorationRange(n);if(!s)continue;let r=!1;if(!L.equalsRange(s,o.range)){if(L.spansMultipleLines(s))r=!0;else{const a=o.range.endColumn-o.range.startColumn,l=s.endColumn-s.startColumn;a!==l&&(r=!0)}r?(this._decorationIgnoreSet.add(o.id),e.push(n)):o.range=s}}for(let n=0,o=e.length;n<o;n++)this._decorations.delete(e[n]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}VL.DecorationOptions=je.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class c_e{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,n;try{const o=JSON.parse(e);t=o.ratio,n=o.heightInLines}catch{}return{ratio:t||.7,heightInLines:n||18}}}class u_e extends HI{}let $2=class extends Wy{constructor(i,e,t,n,o,s,r,a,l,d,h,c){super(i,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},s),this._defaultTreeKeyboardSupport=e,this.layoutData=t,this._textModelResolverService=o,this._instantiationService=s,this._peekViewService=r,this._uriLabel=a,this._undoRedoService=l,this._keybindingService=d,this._languageService=h,this._languageConfigurationService=c,this._disposeOnNewModel=new Y,this._callOnDispose=new Y,this._onDidSelectReference=new A,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new ft(0,0),this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(i,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),kt(this._preview),kt(this._previewNotAvailableMessage),kt(this._tree),kt(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(i){const e=i.getColor(n_e)||V.transparent;this.style({arrowColor:e,frameColor:e,headerBackgroundColor:i.getColor(i_e)||V.transparent,primaryHeadingColor:i.getColor(Ez),secondaryHeadingColor:i.getColor(Nz)})}show(i){super.show(i,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(i){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:i.ctrlKey||i.metaKey||i.altKey?"side":"open",source:"title"})}_fillBody(i){this.setCssClass("reference-zone-widget"),this._messageContainer=Z(i,ee("div.messages")),ho(this._messageContainer),this._splitView=new DV(i,{orientation:1}),this._previewContainer=Z(i,ee("div.preview.inline"));const e={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(ac,this._previewContainer,e,{},this.editor),ho(this._previewContainer),this._previewNotAvailableMessage=new Sl(p("missingPreviewMessage","no preview available"),Is,Sl.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=Z(i,ee("div.ref-tree.inline"));const t={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new d_e,keyboardNavigationLabelProvider:this._instantiationService.createInstance(K2),identityProvider:new a_e,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:o_e}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(bi(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(u_e,"ReferencesWidget",this._treeContainer,new r_e,[this._instantiationService.createInstance(w0),this._instantiationService.createInstance(xb)],this._instantiationService.createInstance(U2),t),this._splitView.addView({onDidChange:le.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},my.Distribute),this._splitView.addView({onDidChange:le.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},my.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(o,s)=>{o instanceof lc&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?n(o.element,"side"):o.editorOptions.pinned?n(o.element,"goto"):n(o.element,"show")}),ho(this._treeContainer)}_onWidth(i){this._dim&&this._doLayoutBody(this._dim.height,i)}_doLayoutBody(i,e){super._doLayoutBody(i,e),this._dim=new ft(e,i),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(e),this._splitView.resizeView(0,e*this.layoutData.ratio)}setSelection(i){return this._revealReference(i,!0).then(()=>{this._model&&(this._tree.setSelection([i]),this._tree.setFocus([i]))})}setModel(i){return this._disposeOnNewModel.clear(),this._model=i,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=p("noResults","No results"),$o(this._messageContainer),Promise.resolve(void 0)):(ho(this._messageContainer),this._decorationsManager=new VL(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(i=>this._tree.rerender(i))),this._disposeOnNewModel.add(this._preview.onMouseDown(i=>{const{event:e,target:t}=i;if(e.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:t.range},kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),$o(this._treeContainer),$o(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[i]=this._tree.getFocus();if(i instanceof lc)return i;if(i instanceof C0&&i.children.length>0)return i.children[0]}async revealReference(i){await this._revealReference(i,!1),this._onDidSelectReference.fire({element:i,kind:"goto",source:"tree"})}async _revealReference(i,e){if(this._revealedReference===i)return;this._revealedReference=i,i.uri.scheme!==$e.inMemory?this.setTitle(Ine(i.uri),this._uriLabel.getUriLabel(QS(i.uri))):this.setTitle(p("peekView.alternateTitle","References"));const t=this._textModelResolverService.createModelReference(i.uri);this._tree.getInput()===i.parent?this._tree.reveal(i):(e&&this._tree.reveal(i.parent),await this._tree.expand(i.parent),this._tree.reveal(i));const n=await t;if(!this._model){n.dispose();return}kt(this._previewModelReference);const o=n.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,r=L.lift(i.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(r),this._preview.revealRangeInCenter(r,s)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};$2=h_e([Ul(3,nn),Ul(4,Oo),Ul(5,Me),Ul(6,xz),Ul(7,Im),Ul(8,XS),Ul(9,Tt),Ul(10,Xt),Ul(11,Bt)],$2);var g_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},jg=function(i,e){return function(t,n){e(t,n,i)}},zC;const xg=new de("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let dc=zC=class{static get(i){return i.getContribution(zC.ID)}constructor(i,e,t,n,o,s,r,a){this._defaultTreeKeyboardSupport=i,this._editor=e,this._editorService=n,this._notificationService=o,this._instantiationService=s,this._storageService=r,this._configurationService=a,this._disposables=new Y,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=xg.bindTo(t)}dispose(){var i,e;this._referenceSearchVisible.reset(),this._disposables.dispose(),(i=this._widget)===null||i===void 0||i.dispose(),(e=this._model)===null||e===void 0||e.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(i,e,t){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&i.containsPosition(n))return;this._peekMode=t,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",s=c_e.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance($2,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(p("labelLoading","Loading...")),this._widget.show(i),this._disposables.add(this._widget.onDidClose(()=>{e.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(a=>{const{element:l,kind:d}=a;if(l)switch(d){case"open":(a.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(l,!1,!1);break;case"side":this.openReference(l,!0,!1);break;case"goto":t?this._gotoReference(l,!0):this.openReference(l,!1,!0);break}}));const r=++this._requestIdPool;e.then(a=>{var l;if(r!==this._requestIdPool||!this._widget){a.dispose();return}return(l=this._model)===null||l===void 0||l.dispose(),this._model=a,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 d=this._editor.getModel().uri,h=new P(i.startLineNumber,i.startColumn),c=this._model.nearestReference(d,h);if(c)return this._widget.setSelection(c).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},a=>{this._notificationService.error(a)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(i){if(!this._editor.hasModel()||!this._model||!this._widget)return;const e=this._widget.position;if(!e)return;const t=this._model.nearestReference(this._editor.getModel().uri,e);if(!t)return;const n=this._model.nextOrPreviousReference(t,i),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(i){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(i)}closeWidget(i=!0){var e,t;(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,i&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(i,e){var t;(t=this._widget)===null||t===void 0||t.hide(),this._ignoreModelChangeEvent=!0;const n=L.lift(i.range).collapseToStart();return this._editorService.openCodeEditor({resource:i.uri,options:{selection:n,selectionSource:"code.jump",pinned:e}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(n),this._widget.focusOnReferenceTree();else{const r=zC.get(o),a=this._model.clone();this.closeWidget(),o.focus(),r==null||r.toggleWidget(n,Yi(l=>Promise.resolve(a)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,Ke(o)})}openReference(i,e,t){e||this.closeWidget();const{uri:n,range:o}=i;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:"code.jump",pinned:t}},this._editor,e)}};dc.ID="editor.contrib.referencesController";dc=zC=g_e([jg(2,Ae),jg(3,vt),jg(4,Pi),jg(5,Me),jg(6,Pr),jg(7,at)],dc);function Eg(i,e){const t=e_e(i);if(!t)return;const n=dc.get(t);n&&e(n)}Ro.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:$i(2089,60),when:G.or(xg,Ao.inPeekEditor),handler(i){Eg(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Ro.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:G.or(xg,Ao.inPeekEditor),handler(i){Eg(i,e=>{e.goToNextOrPreviousReference(!0)})}});Ro.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:G.or(xg,Ao.inPeekEditor),handler(i){Eg(i,e=>{e.goToNextOrPreviousReference(!1)})}});ct.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");ct.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");ct.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");ct.registerCommand("closeReferenceSearch",i=>Eg(i,e=>e.closeWidget()));Ro.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:G.and(Ao.inPeekEditor,G.not("config.editor.stablePeek"))});Ro.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:G.and(xg,G.not("config.editor.stablePeek"))});Ro.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:G.and(xg,HV,TA.negate(),RA.negate()),handler(i){var e;const t=(e=i.get(lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(t)&&t[0]instanceof lc&&Eg(i,n=>n.revealReference(t[0]))}});Ro.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:G.and(xg,HV,TA.negate(),RA.negate()),handler(i){var e;const t=(e=i.get(lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(t)&&t[0]instanceof lc&&Eg(i,n=>n.openReference(t[0],!0,!0))}});ct.registerCommand("openReference",i=>{var e;const t=(e=i.get(lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(t)&&t[0]instanceof lc&&Eg(i,n=>n.openReference(t[0],!1,!0))});var Iz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},y_=function(i,e){return function(t,n){e(t,n,i)}};const uP=new de("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),HL=tt("ISymbolNavigationService");let q2=class{constructor(i,e,t,n){this._editorService=e,this._notificationService=t,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=uP.bindTo(i)}reset(){var i,e;this._ctxHasSymbols.reset(),(i=this._currentState)===null||i===void 0||i.dispose(),(e=this._currentMessage)===null||e===void 0||e.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(i){const e=i.parent.parent;if(e.references.length<=1){this.reset();return}this._currentModel=e,this._currentIdx=e.references.indexOf(i),this._ctxHasSymbols.set(!0),this._showMessage();const t=new G2(this._editorService),n=t.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const r=s.getModel(),a=s.getPosition();if(!r||!a)return;let l=!1,d=!1;for(const h of e.references)if(VR(h.uri,r.uri))l=!0,d=d||L.containsPosition(h.range,a);else if(l)break;(!l||!d)&&this.reset()});this._currentState=kr(t,n)}revealNext(i){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const e=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:e.uri,options:{selection:L.collapseToStart(e.range),selectionRevealType:3}},i).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var i;(i=this._currentMessage)===null||i===void 0||i.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?p("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):p("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};q2=Iz([y_(0,Ae),y_(1,vt),y_(2,Pi),y_(3,Tt)],q2);lt(HL,q2,1);re(new class extends gn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:uP,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(HL).revealNext(e)}});Ro.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:uP,primary:9,handler(i){i.get(HL).reset()}});let G2=class{constructor(i){this._listener=new Map,this._disposables=new Y,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._disposables.add(i.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(i.onCodeEditorAdd(this._onDidAddEditor,this)),i.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),kt(this._listener.values())}_onDidAddEditor(i){this._listener.set(i,kr(i.onDidChangeCursorPosition(e=>this._onDidChange.fire({editor:i})),i.onDidChangeModelContent(e=>this._onDidChange.fire({editor:i}))))}_onDidRemoveEditor(i){var e;(e=this._listener.get(i))===null||e===void 0||e.dispose(),this._listener.delete(i)}};G2=Iz([y_(0,vt)],G2);async function Eb(i,e,t,n){const o=t.ordered(i).map(r=>Promise.resolve(n(r,i,e)).then(void 0,a=>{Ti(a)})),s=await Promise.all(o);return pa(s.flat())}function zL(i,e,t,n){return Eb(e,t,i,(o,s,r)=>o.provideDefinition(s,r,n))}function Mz(i,e,t,n){return Eb(e,t,i,(o,s,r)=>o.provideDeclaration(s,r,n))}function Tz(i,e,t,n){return Eb(e,t,i,(o,s,r)=>o.provideImplementation(s,r,n))}function Rz(i,e,t,n){return Eb(e,t,i,(o,s,r)=>o.provideTypeDefinition(s,r,n))}function UL(i,e,t,n,o){return Eb(e,t,i,async(s,r,a)=>{const l=await s.provideReferences(r,a,{includeDeclaration:!0},o);if(!n||!l||l.length!==2)return l;const d=await s.provideReferences(r,a,{includeDeclaration:!1},o);return d&&d.length===1?d:l})}async function Nb(i){const e=await i(),t=new Jo(e,""),n=t.references.map(o=>o.link);return t.dispose(),n}Ml("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(pe),o=zL(n.definitionProvider,e,t,et.None);return Nb(()=>o)});Ml("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(pe),o=Rz(n.typeDefinitionProvider,e,t,et.None);return Nb(()=>o)});Ml("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(pe),o=Mz(n.declarationProvider,e,t,et.None);return Nb(()=>o)});Ml("_executeReferenceProvider",(i,e,t)=>{const n=i.get(pe),o=UL(n.referenceProvider,e,t,!1,et.None);return Nb(()=>o)});Ml("_executeImplementationProvider",(i,e,t)=>{const n=i.get(pe),o=Tz(n.implementationProvider,e,t,et.None);return Nb(()=>o)});var Yf,Qf,Xf,F1,B1,W1,V1,H1;yn.appendMenuItem(x.EditorContext,{submenu:x.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});class Um{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Um||P.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class no extends La{static all(){return no._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const n of it.wrap(t.menu))(n.id===x.EditorContext||n.id===x.EditorContextPeek)&&(n.when=G.and(e.precondition,n.when));return t}constructor(e,t){super(no._patchConfig(t)),this.configuration=e,no._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,o){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(Pi),r=e.get(vt),a=e.get(Sc),l=e.get(HL),d=e.get(pe),h=e.get(Me),c=t.getModel(),u=t.getPosition(),g=Um.is(n)?n:new Um(c,u),m=new oc(t,5),f=LS(this._getLocationModel(d,g.model,g.position,m.token),m.token).then(async _=>{var b;if(!_||m.token.isCancellationRequested)return;ir(_.ariaMessage);let v;if(_.referenceAt(c.uri,u)){const w=this._getAlternativeCommand(t);!no._activeAlternativeCommands.has(w)&&no._allSymbolNavigationCommands.has(w)&&(v=no._allSymbolNavigationCommands.get(w))}const C=_.references.length;if(C===0){if(!this.configuration.muteMessage){const w=c.getWordAtPosition(u);(b=Xo.get(t))===null||b===void 0||b.showMessage(this._getNoResultFoundMessage(w),u)}}else if(C===1&&v)no._activeAlternativeCommands.add(this.desc.id),h.invokeFunction(w=>v.runEditorCommand(w,t,n,o).finally(()=>{no._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,o)},_=>{s.error(_)}).finally(()=>{m.dispose()});return a.showWhile(f,250),f}async _onResult(e,t,n,o,s){const r=this._getGoToPreference(n);if(!(n instanceof ac)&&(this.configuration.openInPeek||r==="peek"&&o.references.length>1))this._openInPeek(n,o,s);else{const a=o.firstReference(),l=o.references.length>1&&r==="gotoAndPeek",d=await this._openReference(n,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,o,s):o.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,n,o,s){let r;if(Kq(n)&&(r=n.targetSelectionRange),r||(r=n.range),!r)return;const a=await t.openCodeEditor({resource:n.uri,options:{selection:L.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,o);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,n){const o=dc.get(e);o&&e.hasModel()?o.toggleWidget(n??e.getSelection(),Yi(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}no._allSymbolNavigationCommands=new Map;no._activeAlternativeCommands=new Set;class Ib extends no{async _getLocationModel(e,t,n,o){return new Jo(await zL(e.definitionProvider,t,n,o),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}}Gt((Yf=class extends Ib{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Yf.id,title:{value:p("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:p({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:G.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:[{when:E.editorTextFocus,primary:70,weight:100},{when:G.and(E.editorTextFocus,BV),primary:2118,weight:100}],menu:[{id:x.EditorContext,group:"navigation",order:1.1},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),ct.registerCommandAlias("editor.action.goToDeclaration",Yf.id)}},Yf.id="editor.action.revealDefinition",Yf));Gt((Qf=class extends Ib{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Qf.id,title:{value:p("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:G.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:[{when:E.editorTextFocus,primary:$i(2089,70),weight:100},{when:G.and(E.editorTextFocus,BV),primary:$i(2089,2118),weight:100}]}),ct.registerCommandAlias("editor.action.openDeclarationToTheSide",Qf.id)}},Qf.id="editor.action.revealDefinitionAside",Qf));Gt((Xf=class extends Ib{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Xf.id,title:{value:p("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:G.and(E.hasDefinitionProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:x.EditorContextPeek,group:"peek",order:2}}),ct.registerCommandAlias("editor.action.previewDeclaration",Xf.id)}},Xf.id="editor.action.peekDefinition",Xf));class Az extends no{async _getLocationModel(e,t,n,o){return new Jo(await Mz(e.declarationProvider,t,n,o),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}}Gt((F1=class extends Az{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:F1.id,title:{value:p("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:p({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:G.and(E.hasDeclarationProvider,E.isInWalkThroughSnippet.toNegated()),menu:[{id:x.EditorContext,group:"navigation",order:1.3},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(i){return i&&i.word?p("decl.noResultWord","No declaration found for '{0}'",i.word):p("decl.generic.noResults","No declaration found")}},F1.id="editor.action.revealDeclaration",F1));Gt(class extends Az{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:p("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:G.and(E.hasDeclarationProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:x.EditorContextPeek,group:"peek",order:3}})}});class Pz extends no{async _getLocationModel(e,t,n,o){return new Jo(await Rz(e.typeDefinitionProvider,t,n,o),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}}Gt((B1=class extends Pz{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:B1.ID,title:{value:p("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:p({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:G.and(E.hasTypeDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:0,weight:100},menu:[{id:x.EditorContext,group:"navigation",order:1.4},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},B1.ID="editor.action.goToTypeDefinition",B1));Gt((W1=class extends Pz{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:W1.ID,title:{value:p("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:G.and(E.hasTypeDefinitionProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:x.EditorContextPeek,group:"peek",order:4}})}},W1.ID="editor.action.peekTypeDefinition",W1));class Oz extends no{async _getLocationModel(e,t,n,o){return new Jo(await Tz(e.implementationProvider,t,n,o),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}}Gt((V1=class extends Oz{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:V1.ID,title:{value:p("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:p({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:G.and(E.hasImplementationProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:2118,weight:100},menu:[{id:x.EditorContext,group:"navigation",order:1.45},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},V1.ID="editor.action.goToImplementation",V1));Gt((H1=class extends Oz{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:H1.ID,title:{value:p("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:G.and(E.hasImplementationProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:3142,weight:100},menu:{id:x.EditorContextPeek,group:"peek",order:5}})}},H1.ID="editor.action.peekImplementation",H1));class Fz extends no{_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}}Gt(class extends Fz{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({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:G.and(E.hasReferenceProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:1094,weight:100},menu:[{id:x.EditorContext,group:"navigation",order:1.45},{id:x.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(i,e,t,n){return new Jo(await UL(i.referenceProvider,e,t,!0,n),p("ref.title","References"))}});Gt(class extends Fz{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:G.and(E.hasReferenceProvider,Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:x.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(i,e,t,n){return new Jo(await UL(i.referenceProvider,e,t,!1,n),p("ref.title","References"))}});class p_e extends no{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:{value:p("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:G.and(Ao.notInPeekEditor,E.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}async _getLocationModel(e,t,n,o){return new Jo(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""}}ct.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:xe},{name:"position",description:"The position at which to start",constraint:P.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(i,e,t,n,o,s,r)=>{Et(xe.isUri(e)),Et(P.isIPosition(t)),Et(Array.isArray(n)),Et(typeof o>"u"||typeof o=="string"),Et(typeof r>"u"||typeof r=="boolean");const a=i.get(vt),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(xl(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const h=new class extends p_e{_getNoResultFoundMessage(c){return s||super._getNoResultFoundMessage(c)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},n,o);d.get(Me).invokeFunction(h.run.bind(h),l)})}});ct.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:xe},{name:"position",description:"The position at which to start",constraint:P.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(i,e,t,n,o)=>{i.get(pi).executeCommand("editor.action.goToLocations",e,t,n,o,void 0,!0)}});ct.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{Et(xe.isUri(e)),Et(P.isIPosition(t));const n=i.get(pe),o=i.get(vt);return o.openCodeEditor({resource:e},o.getFocusedCodeEditor()).then(s=>{if(!xl(s)||!s.hasModel())return;const r=dc.get(s);if(!r)return;const a=Yi(d=>UL(n.referenceProvider,s.getModel(),P.lift(t),!1,d).then(h=>new Jo(h,p("ref.title","References")))),l=new L(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});ct.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var m_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},mx=function(i,e){return function(t,n){e(t,n,i)}},S_;let ng=S_=class{constructor(i,e,t,n){this.textModelResolverService=e,this.languageService=t,this.languageFeaturesService=n,this.toUnhook=new Y,this.toUnhookForKeyboard=new Y,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=i,this.linkDecorations=this.editor.createDecorationsCollection();const o=new OL(i);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,r])=>{this.startFindDefinitionFromMouse(s,r??void 0)})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(r=>{Ke(r)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(i){return i.getContribution(S_.ID)}async startFindDefinitionFromCursor(i){await this.startFindDefinition(i),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(i,e){if(i.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(i,e)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const t=i.target.position;this.startFindDefinition(t)}async startFindDefinition(i){var e;this.toUnhookForKeyboard.clear();const t=i?(e=this.editor.getModel())===null||e===void 0?void 0:e.getWordAtPosition(i):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const n=new kH(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Yi(r=>this.findDefinition(i,r));let o;try{o=await this.previousPromise}catch(r){Ke(r);return}if(!o||!o.length||!n.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?L.lift(o[0].originSelectionRange):new L(i.lineNumber,t.startColumn,i.lineNumber,t.endColumn);if(o.length>1){let r=s;for(const{originSelectionRange:a}of o)a&&(r=L.plusRange(r,a));this.addDecoration(r,new Kn().appendText(p("multipleResults","Click to show {0} definitions.",o.length)))}else{const r=o[0];if(!r.uri)return;this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:l}}=a,{startLineNumber:d}=r.range;if(d<1||d>l.getLineCount()){a.dispose();return}const h=this.getPreviewValue(l,d,r),c=this.languageService.guessLanguageIdByFilepathOrFirstLine(l.uri);this.addDecoration(s,h?new Kn().appendCodeblock(c||"",h):void 0),a.dispose()})}}getPreviewValue(i,e,t){let n=t.range;return n.endLineNumber-n.startLineNumber>=S_.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(i,e)),this.stripIndentationFromPreviewRange(i,e,n)}stripIndentationFromPreviewRange(i,e,t){let n=i.getLineFirstNonWhitespaceColumn(e);for(let o=e+1;o<t.endLineNumber;o++){const s=i.getLineFirstNonWhitespaceColumn(o);n=Math.min(n,s)}return i.getValueInRange(t).replace(new RegExp(`^\\s{${n-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(i,e){const t=i.getLineFirstNonWhitespaceColumn(e),n=Math.min(i.getLineCount(),e+S_.MAX_SOURCE_PREVIEW_LINES);let o=e+1;for(;o<n;o++){const s=i.getLineFirstNonWhitespaceColumn(o);if(t===s)break}return new L(e,1,o+1,1)}addDecoration(i,e){const t={range:i,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:e}};this.linkDecorations.set([t])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(i,e){var t;return this.editor.hasModel()&&i.isLeftClick&&i.isNoneOrSingleMouseDown&&i.target.type===6&&!(((t=i.target.detail.injectedText)===null||t===void 0?void 0:t.options)instanceof ic)&&(i.hasTriggerModifier||(e?e.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(i,e){const t=this.editor.getModel();return t?zL(this.languageFeaturesService.definitionProvider,t,i,e):Promise.resolve(null)}gotoDefinition(i,e){return this.editor.setPosition(i),this.editor.invokeWithinContext(t=>{const n=!e&&this.editor.getOption(87)&&!this.isInPeekEditor(t);return new Ib({openToSide:e,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(t)})}isInPeekEditor(i){const e=i.get(Ae);return Ao.inPeekEditor.getValue(e)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};ng.ID="editor.contrib.gotodefinitionatposition";ng.MAX_SOURCE_PREVIEW_LINES=8;ng=S_=m_e([mx(1,Oo),mx(2,Xt),mx(3,pe)],ng);pt(ng.ID,ng,2);const z1=ee;class Bz extends B{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 ib(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class gP extends B{static render(e,t,n){return new gP(e,t,n)}constructor(e,t,n){super(),this.actionContainer=Z(e,z1("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Z(this.actionContainer,z1("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Z(this.action,z1(`span.icon.${t.iconClass}`));const o=Z(this.action,z1("span"));o.textContent=n?`${t.label} (${n})`:t.label,this._register($(this.actionContainer,ae.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register($(this.actionContainer,ae.KEY_DOWN,s=>{const r=new jt(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 f_e(i,e){return i&&e?p("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?p("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}let __e=class{constructor(i,e,t){this.value=i,this.isComplete=e,this.hasLoadingMessage=t}};class Wz extends B{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new A),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Mt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Mt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Mt(()=>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=iZ(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){Ke(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 __e(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 fx{constructor(e,t,n,o){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=o,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class UC{constructor(e,t,n,o,s,r){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=o,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 Ng=new class{constructor(){this._participants=[]}register(i){this._participants.push(i)}getAll(){return this._participants}};class pP{constructor(){this._onDidWillResize=new A,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new A,this.onDidResize=this._onDidResize.event,this._sashListener=new Y,this._size=new ft(0,0),this._minSize=new ft(0,0),this._maxSize=new ft(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Hn(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Hn(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Hn(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:gy.North}),this._southSash=new Hn(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:gy.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,n=0;this._sashListener.add(le.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(le.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(o=>{e&&(n=o.currentX-o.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(o=>{e&&(n=-(o.currentX-o.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(o=>{e&&(t=-(o.currentY-o.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(o=>{e&&(t=o.currentY-o.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(le.any(this._eastSash.onDidReset,this._westSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(le.any(this._northSash.onDidReset,this._southSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,n,o){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=o?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:o}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(n,Math.min(s,e)),t=Math.max(o,Math.min(r,t));const a=new ft(t,e);ft.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 v_e=30,b_e=24;class C_e extends B{constructor(e,t=new ft(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new pP),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=ft.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new ft(n.dimension.width,n.dimension.height)),n.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?P.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:ji(t).top+n.top-v_e}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const o=ji(t),s=Hu(t.ownerDocument.body),r=o.top+n.top+n.height;return s.height-r-b_e}_findPositionPreference(e,t){var n,o;const s=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),r=Math.min((o=this._availableVerticalSpaceAbove(t))!==null&&o!==void 0?o: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 mP=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},_u=function(i,e){return function(t,n){e(t,n,i)}},KC,Oa;const X6=ee;let Vy=KC=class extends B{constructor(i,e,t){super(),this._editor=i,this._instantiationService=e,this._keybindingService=t,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Fh,this._editor)),this._participants=[];for(const n of Ng.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,o)=>n.hoverOrdinal-o.hoverOrdinal),this._computer=new zy(this._editor,this._participants),this._hoverOperation=this._register(new Wz(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{if(!this._computer.anchor)return;const o=n.hasLoadingMessage?this._addLoadingMessage(n.value):n.value;this._withResult(new Vz(this._computer.anchor,o,n.isComplete))})),this._register(bi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(hi.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(i){if(this._widget.isResizing)return!0;const e=[];for(const n of this._participants)if(n.suggestHoverAnchor){const o=n.suggestHoverAnchor(i);o&&e.push(o)}const t=i.target;if(t.type===6&&e.push(new fx(0,t.range,i.event.posx,i.event.posy)),t.type===7){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!t.detail.isAfterLines&&typeof t.detail.horizontalDistanceToText=="number"&&t.detail.horizontalDistanceToText<n&&e.push(new fx(0,t.range,i.event.posx,i.event.posy))}return e.length===0?this._startShowingOrUpdateHover(null,0,0,!1,i):(e.sort((n,o)=>o.priority-n.priority),this._startShowingOrUpdateHover(e[0],0,0,!1,i))}startShowingAtRange(i,e,t,n){this._startShowingOrUpdateHover(new fx(0,i,void 0,void 0),e,t,n,null)}_startShowingOrUpdateHover(i,e,t,n,o){return!this._widget.position||!this._currentResult?i?(this._startHoverOperationIfNecessary(i,e,t,n,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(i&&this._startHoverOperationIfNecessary(i,e,t,n,!0),!0):i?i&&this._currentResult.anchor.equals(i)?!0:i.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(i)),this._startHoverOperationIfNecessary(i,e,t,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(i,e,t,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(i,e,t,n,o){this._computer.anchor&&this._computer.anchor.equals(i)||(this._hoverOperation.cancel(),this._computer.anchor=i,this._computer.shouldFocus=n,this._computer.source=t,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(e))}_setCurrentResult(i){this._currentResult!==i&&(i&&i.messages.length===0&&(i=null),this._currentResult=i,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(i){return i?this._widget.getDomNode().contains(i):!1}_addLoadingMessage(i){if(this._computer.anchor){for(const e of this._participants)if(e.createLoadingMessage){const t=e.createLoadingMessage(this._computer.anchor);if(t)return i.slice(0).concat([t])}}return i}_withResult(i){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!i.isComplete||this._computer.insistOnKeepingHoverVisible&&i.messages.length===0)||this._setCurrentResult(i)}_renderMessages(i,e){const{showAtPosition:t,showAtSecondaryPosition:n,highlightRange:o}=KC.computeHoverRanges(this._editor,i.range,e),s=new Y,r=s.add(new Hy(this._keybindingService)),a=document.createDocumentFragment();let l=null;const d={fragment:a,statusBar:r,setColorPicker:c=>l=c,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:c=>this._widget.setMinimumDimensions(c),hide:()=>this.hide()};for(const c of this._participants){const u=e.filter(g=>g.owner===c);u.length>0&&s.add(c.renderHoverParts(d,u))}const h=e.some(c=>c.isBeforeContent);if(r.hasContent&&a.appendChild(r.hoverElement),a.hasChildNodes()){if(o){const c=this._editor.createDecorationsCollection();c.set([{range:o,options:KC._DECORATION_OPTIONS}]),s.add(Ne(()=>{c.clear()}))}this._widget.showAt(a,new y_e(l,t,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,h,i.initialMousePosX,i.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(i,e,t){let n=1;if(i.hasModel()){const l=i._getViewModel(),d=l.coordinatesConverter,h=d.convertModelRangeToViewRange(e),c=new P(h.startLineNumber,l.getLineMinColumn(h.startLineNumber));n=d.convertViewPositionToModelPosition(c).column}const o=e.startLineNumber;let s=e.startColumn,r=t[0].range,a=null;for(const l of t)r=L.plusRange(r,l.range),l.range.startLineNumber===o&&l.range.endLineNumber===o&&(s=Math.max(Math.min(s,l.range.startColumn),n)),l.forceShowAtRange&&(a=l.range);return{showAtPosition:a?a.getStartPosition():new P(o,e.startColumn),showAtSecondaryPosition:a?a.getStartPosition():new P(o,s),highlightRange:r}}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()}};Vy._DECORATION_OPTIONS=je.register({description:"content-hover-highlight",className:"hoverHighlight"});Vy=KC=mP([_u(1,Me),_u(2,Tt)],Vy);class Vz{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new w_e(this,this.anchor,t,this.isComplete)}}class w_e extends Vz{constructor(e,t,n,o){super(t,n,o),this.original=e}filter(e){return this.original.filter(e)}}class y_e{constructor(e,t,n,o,s,r,a,l,d,h){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=n,this.preferAbove=o,this.stoleFocus=s,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=h,this.closestMouseDistance=void 0}}const J6=30,_x=10,S_e=6;let Fh=Oa=class extends C_e{get isColorPickerVisible(){var i;return!!(!((i=this._visibleData)===null||i===void 0)&&i.colorPicker)}get isVisibleFromKeyboard(){var i;return((i=this._visibleData)===null||i===void 0?void 0:i.source)===1}get isVisible(){var i;return(i=this._hoverVisibleKey.get())!==null&&i!==void 0?i:!1}get isFocused(){var i;return(i=this._hoverFocusedKey.get())!==null&&i!==void 0?i:!1}constructor(i,e,t,n,o){const s=i.getOption(66)+8,r=150,a=new ft(r,s);super(i,a),this._configurationService=t,this._accessibilityService=n,this._keybindingService=o,this._hover=this._register(new Bz),this._minimumSize=a,this._hoverVisibleKey=E.hoverVisible.bindTo(e),this._hoverFocusedKey=E.hoverFocused.bindTo(e),Z(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(50)&&this._updateFont()}));const l=this._register(bl(this._resizableNode.domNode));this._register(l.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(l.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var i;super.dispose(),(i=this._visibleData)===null||i===void 0||i.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Oa.ID}static _applyDimensions(i,e,t){const n=typeof e=="number"?`${e}px`:e,o=typeof t=="number"?`${t}px`:t;i.style.width=n,i.style.height=o}_setContentsDomNodeDimensions(i,e){const t=this._hover.contentsDomNode;return Oa._applyDimensions(t,i,e)}_setContainerDomNodeDimensions(i,e){const t=this._hover.containerDomNode;return Oa._applyDimensions(t,i,e)}_setHoverWidgetDimensions(i,e){this._setContentsDomNodeDimensions(i,e),this._setContainerDomNodeDimensions(i,e),this._layoutContentWidget()}static _applyMaxDimensions(i,e,t){const n=typeof e=="number"?`${e}px`:e,o=typeof t=="number"?`${t}px`:t;i.style.maxWidth=n,i.style.maxHeight=o}_setHoverWidgetMaxDimensions(i,e){Oa._applyMaxDimensions(this._hover.contentsDomNode,i,e),Oa._applyMaxDimensions(this._hover.containerDomNode,i,e),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof i=="number"?`${i}px`:i),this._layoutContentWidget()}_hasHorizontalScrollbar(){const i=this._hover.scrollbar.getScrollDimensions();return i.scrollWidth>i.width}_adjustContentsBottomPadding(){const i=this._hover.contentsDomNode,e=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;i.style.paddingBottom!==e&&(i.style.paddingBottom=e)}_setAdjustedHoverWidgetDimensions(i){this._setHoverWidgetMaxDimensions("none","none");const e=i.width,t=i.height;this._setHoverWidgetDimensions(e,t),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(e,t-_x))}_updateResizableNodeMaxDimensions(){var i,e;const t=(i=this._findMaximumRenderingWidth())!==null&&i!==void 0?i:1/0,n=(e=this._findMaximumRenderingHeight())!==null&&e!==void 0?e:1/0;this._resizableNode.maxSize=new ft(t,n),this._setHoverWidgetMaxDimensions(t,n)}_resize(i){var e,t;Oa._lastDimensions=new ft(i.width,i.height),this._setAdjustedHoverWidgetDimensions(i),this._resizableNode.layout(i.height,i.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(t=(e=this._visibleData)===null||e===void 0?void 0:e.colorPicker)===null||t===void 0||t.layout()}_findAvailableSpaceVertically(){var i;const e=(i=this._visibleData)===null||i===void 0?void 0:i.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const i=this._findAvailableSpaceVertically();if(!i)return;let e=S_e;return Array.from(this._hover.contentsDomNode.children).forEach(t=>{e+=t.clientHeight}),this._hasHorizontalScrollbar()&&(e+=_x),Math.min(i,e)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const i=Array.from(this._hover.contentsDomNode.children).some(e=>e.scrollWidth>e.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),i}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const i=this._isHoverTextOverflowing(),e=typeof this._contentWidth>"u"?0:this._contentWidth-2;return i||this._hover.containerDomNode.clientWidth<e?Hu(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(i,e){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=i,this._visibleData.initialMousePosY=e,!1;const t=ji(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=e9(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,t.left,t.top,t.width,t.height));const n=e9(i,e,t.left,t.top,t.width,t.height);return n>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!0)}_setHoverData(i){var e;(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._visibleData=i,this._hoverVisibleKey.set(!!i),this._hover.containerDomNode.classList.toggle("hidden",!i)}_updateFont(){const{fontSize:i,lineHeight:e}=this._editor.getOption(50),t=this._hover.contentsDomNode;t.style.fontSize=`${i}px`,t.style.lineHeight=`${e/i}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(n=>this._editor.applyFontInfo(n))}_updateContent(i){const e=this._hover.contentsDomNode;e.style.paddingBottom="",e.textContent="",e.appendChild(i)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const i=Math.max(this._editor.getLayoutInfo().height/4,250,Oa._lastDimensions.height),e=Math.max(this._editor.getLayoutInfo().width*.66,500,Oa._lastDimensions.width);this._setHoverWidgetMaxDimensions(e,i)}_render(i,e){this._setHoverData(e),this._updateFont(),this._updateContent(i),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var i;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(i=this._positionPreference)!==null&&i!==void 0?i:1]}:null}showAt(i,e){var t,n,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(i,e);const r=lu(this._hover.containerDomNode),a=e.showAtPosition;this._positionPreference=(t=this._findPositionPreference(r,a))!==null&&t!==void 0?t:1,this.onContentsChanged(),e.stoleFocus&&this._hover.containerDomNode.focus(),(n=e.colorPicker)===null||n===void 0||n.layout();const l=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&f_e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&s!==void 0?s:"");l&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+l)}hide(){if(!this._visibleData)return;const i=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new ft(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),i&&this._editor.focus()}_removeConstraintsRenderNormally(){const i=this._editor.getLayoutInfo();this._resizableNode.layout(i.height,i.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(i){var e;const t=this._hover.containerDomNode,n=this._hover.contentsDomNode,o=(e=this._findMaximumRenderingHeight())!==null&&e!==void 0?e:1/0;this._setContainerDomNodeDimensions(Do(t),Math.min(o,i)),this._setContentsDomNodeDimensions(Do(n),Math.min(o,i-_x))}setMinimumDimensions(i){this._minimumSize=new ft(Math.max(this._minimumSize.width,i.width),Math.max(this._minimumSize.height,i.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const i=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new ft(i,this._minimumSize.height)}onContentsChanged(){var i;this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=lu(e),n=Do(e);if(this._resizableNode.layout(t,n),this._setHoverWidgetDimensions(n,t),t=lu(e),n=Do(e),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(t)),!((i=this._visibleData)===null||i===void 0)&&i.showAtPosition){const o=lu(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const i=this._hover.scrollbar.getScrollPosition().scrollTop,e=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:i-e.lineHeight})}scrollDown(){const i=this._hover.scrollbar.getScrollPosition().scrollTop,e=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:i+e.lineHeight})}scrollLeft(){const i=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:i-J6})}scrollRight(){const i=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:i+J6})}pageUp(){const i=this._hover.scrollbar.getScrollPosition().scrollTop,e=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:i-e})}pageDown(){const i=this._hover.scrollbar.getScrollPosition().scrollTop,e=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:i+e})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Fh.ID="editor.contrib.resizableContentHoverWidget";Fh._lastDimensions=new ft(0,0);Fh=Oa=mP([_u(1,Ae),_u(2,at),_u(3,Rl),_u(4,Tt)],Fh);let Hy=class extends B{get hasContent(){return this._hasContent}constructor(i){super(),this._keybindingService=i,this._hasContent=!1,this.hoverElement=X6("div.hover-row.status-bar"),this.actionsElement=Z(this.hoverElement,X6("div.actions"))}addAction(i){const e=this._keybindingService.lookupKeybinding(i.commandId),t=e?e.getLabel():null;return this._hasContent=!0,this._register(gP.render(this.actionsElement,i,t))}append(i){const e=Z(this.actionsElement,i);return this._hasContent=!0,e}};Hy=mP([_u(0,Tt)],Hy);class zy{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const n=e.getModel(),o=t.range.startLineNumber;if(o>n.getLineCount())return[];const s=n.getLineMaxColumn(o);return e.getLineDecorations(o).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===o?r.range.startColumn:1,l=r.range.endLineNumber===o?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 Bi.EMPTY;const n=zy._getLineDecorations(this._editor,t);return Bi.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(t,n,e):Bi.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=zy._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return pa(t)}}function e9(i,e,t,n,o,s){const r=t+o/2,a=n+s/2,l=Math.max(Math.abs(i-r)-o/2,0),d=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+d*d)}const t9=ee;class nm extends B{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Y),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new Bz),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Id({editor:this._editor},t,n)),this._computer=new L_e(this._editor),this._hoverOperation=this._register(new Wz(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{this._withResult(o.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return nm.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(e=>this._editor.applyFontInfo(e))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const o of t){const s=t9("div.hover-row.markdown-hover"),r=Z(s,t9("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(o.value));r.appendChild(a.element),n.appendChild(s)}this._updateContents(n),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),s=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=n-o-(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`}}nm.ID="editor.contrib.modesGlyphHoverWidget";class L_e{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),n=[];if(!t)return n;for(const o of t){if(!o.options.glyphMarginClassName)continue;const s=o.options.glyphMarginHoverMessage;!s||Rm(s)||n.push(...DT(s).map(e))}return n}}class k_e{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}async function D_e(i,e,t,n,o){try{const s=await Promise.resolve(i.provideHover(t,n,o));if(s&&E_e(s))return new k_e(i,s,e)}catch(s){Ti(s)}}function fP(i,e,t,n){const o=i.ordered(e).map((s,r)=>D_e(s,r,e,t,n));return Bi.fromPromises(o).coalesce()}function x_e(i,e,t,n){return fP(i,e,t,n).map(o=>o.hover).toPromise()}Ml("_executeHoverProvider",(i,e,t)=>{const n=i.get(pe);return x_e(n.hoverProvider,e,t,et.None)});function E_e(i){const e=typeof i.range<"u",t=typeof i.contents<"u"&&i.contents&&i.contents.length>0;return e&&t}var N_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},U1=function(i,e){return function(t,n){e(t,n,i)}};const i9=ee;class oa{constructor(e,t,n,o,s){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=o,this.ordinal=s}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Uy=class{constructor(i,e,t,n,o){this._editor=i,this._languageService=e,this._openerService=t,this._configurationService=n,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(i){return new oa(this,i.range,[new Kn().appendText(p("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(i,e){if(!this._editor.hasModel()||i.type!==1)return[];const t=this._editor.getModel(),n=i.range.startLineNumber,o=t.getLineMaxColumn(n),s=[];let r=1e3;const a=t.getLineLength(n),l=t.getLanguageIdAtPosition(i.range.startLineNumber,i.range.startColumn),d=this._editor.getOption(116),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let c=!1;d>=0&&a>d&&i.range.startColumn>=d&&(c=!0,s.push(new oa(this,i.range,[{value:p("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,r++))),!c&&typeof h=="number"&&a>=h&&s.push(new oa(this,i.range,[{value:p("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,r++));let u=!1;for(const g of e){const m=g.range.startLineNumber===n?g.range.startColumn:1,f=g.range.endLineNumber===n?g.range.endColumn:o,_=g.options.hoverMessage;if(!_||Rm(_))continue;g.options.beforeContentClassName&&(u=!0);const b=new L(i.range.startLineNumber,m,i.range.startLineNumber,f);s.push(new oa(this,b,DT(_),u,r++))}return s}computeAsync(i,e,t){if(!this._editor.hasModel()||i.type!==1)return Bi.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return Bi.EMPTY;const o=new P(i.range.startLineNumber,i.range.startColumn);return fP(this._languageFeaturesService.hoverProvider,n,o,t).filter(s=>!Rm(s.hover.contents)).map(s=>{const r=s.hover.range?L.lift(s.hover.range):i.range;return new oa(this,r,s.hover.contents,!1,s.ordinal)})}renderHoverParts(i,e){return Hz(i,e,this._editor,this._languageService,this._openerService)}};Uy=N_e([U1(1,Xt),U1(2,as),U1(3,at),U1(4,pe)],Uy);function Hz(i,e,t,n,o){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new Y;for(const r of e)for(const a of r.contents){if(Rm(a))continue;const l=i9("div.hover-row.markdown-hover"),d=Z(l,i9("div.hover-contents")),h=s.add(new Id({editor:t},n,o));s.add(h.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",i.onContentsChanged()}));const c=s.add(h.render(a));d.appendChild(c.element),i.fragment.appendChild(l)}return s}var zz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Ky=function(i,e){return function(t,n){e(t,n,i)}};class n9{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let Z2=class{constructor(i,e,t){this._markerService=e,this._configService=t,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._dispoables=new Y,this._markers=[],this._nextIdx=-1,xe.isUri(i)?this._resourceFilter=r=>r.toString()===i.toString():i&&(this._resourceFilter=i);const n=this._configService.getValue("problems.sortOrder"),o=(r,a)=>{let l=bv(r.resource.toString(),a.resource.toString());return l===0&&(n==="position"?l=L.compareRangesUsingStarts(r,a)||gi.compare(r.severity,a.severity):l=gi.compare(r.severity,a.severity)||L.compareRangesUsingStarts(r,a)),l},s=()=>{this._markers=this._markerService.read({resource:xe.isUri(i)?i:void 0,severities:gi.Error|gi.Warning|gi.Info}),typeof i=="function"&&(this._markers=this._markers.filter(r=>this._resourceFilter(r.resource))),this._markers.sort(o)};s(),this._dispoables.add(e.onMarkerChanged(r=>{(!this._resourceFilter||r.some(a=>this._resourceFilter(a)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(i){return!this._resourceFilter&&!i?!0:!this._resourceFilter||!i?!1:this._resourceFilter(i)}get selected(){const i=this._markers[this._nextIdx];return i&&new n9(i,this._nextIdx+1,this._markers.length)}_initIdx(i,e,t){let n=!1,o=this._markers.findIndex(s=>s.resource.toString()===i.uri.toString());o<0&&(o=cv(this._markers,{resource:i.uri},(s,r)=>bv(s.resource.toString(),r.resource.toString())),o<0&&(o=~o));for(let s=o;s<this._markers.length;s++){let r=L.lift(this._markers[s]);if(r.isEmpty()){const a=i.getWordAtPosition(r.getStartPosition());a&&(r=new L(r.startLineNumber,a.startColumn,r.startLineNumber,a.endColumn))}if(e&&(r.containsPosition(e)||e.isBeforeOrEqual(r.getStartPosition()))){this._nextIdx=s,n=!0;break}if(this._markers[s].resource.toString()!==i.uri.toString())break}n||(this._nextIdx=t?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(i,e,t){if(this._markers.length===0)return!1;const n=this._nextIdx;return this._nextIdx===-1?this._initIdx(e,t,i):i?this._nextIdx=(this._nextIdx+1)%this._markers.length:i||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(i,e){let t=this._markers.findIndex(n=>n.resource.toString()===i.toString());if(!(t<0)){for(;t<this._markers.length;t++)if(L.containsPosition(this._markers[t],e))return new n9(this._markers[t],t+1,this._markers.length)}}};Z2=zz([Ky(1,Al),Ky(2,at)],Z2);const Uz=tt("IMarkerNavigationService");let Y2=class{constructor(i,e){this._markerService=i,this._configService=e,this._provider=new po}getMarkerList(i){for(const e of this._provider){const t=e.getMarkerList(i);if(t)return t}return new Z2(i,this._markerService,this._configService)}};Y2=zz([Ky(0,Al),Ky(1,at)],Y2);lt(Uz,Y2,1);var Q2;(function(i){function e(t){switch(t){case Li.Ignore:return"severity-ignore "+Ee.asClassName(oe.info);case Li.Info:return Ee.asClassName(oe.info);case Li.Warning:return Ee.asClassName(oe.warning);case Li.Error:return Ee.asClassName(oe.error);default:return""}}i.className=e})(Q2||(Q2={}));var I_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},$g=function(i,e){return function(t,n){e(t,n,i)}},X2;class M_e{constructor(e,t,n,o,s){this._openerService=o,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Y,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(bi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new jB(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(){kt(this._disposables)}update(e){const{source:t,message:n,relatedInformation:o,code:s}=e;let r=((t==null?void 0:t.length)||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=vl(n);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Ln(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=ee("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=m=>{this._openerService.open(s.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()};const g=Z(this._codeLink,ee("span"));g.innerText=s.value,u.appendChild(this._codeLink)}}if(Ln(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),jn(o)){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 o){const m=document.createElement("div"),f=document.createElement("a");f.classList.add("filename"),f.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,f.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(f,g);const _=document.createElement("span");_.innerText=g.message,m.appendChild(f),m.appendChild(_),this._lines+=1,u.appendChild(m)}}const d=this._editor.getOption(50),h=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),c=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:c})}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 gi.Error:t=p("Error","Error");break;case gi.Warning:t=p("Warning","Warning");break;case gi.Info:t=p("Info","Info");break;case gi.Hint:t=p("Hint","Hint");break}let n=p("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const o=this._editor.getModel();return o&&e.startLineNumber<=o.getLineCount()&&e.startLineNumber>=1&&(n=`${o.getLineContent(e.startLineNumber)}, ${n}`),n}}let Km=X2=class extends Wy{constructor(i,e,t,n,o,s,r){super(i,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=e,this._openerService=t,this._menuService=n,this._contextKeyService=s,this._labelService=r,this._callOnDispose=new Y,this._onDidSelectRelatedInformation=new A,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=gi.Warning,this._backgroundColor=V.white,this._applyTheme(e.getColorTheme()),this._callOnDispose.add(e.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(i){this._backgroundColor=i.getColor(P_e);let e=J2,t=T_e;this._severity===gi.Warning?(e=jC,t=R_e):this._severity===gi.Info&&(e=eM,t=A_e);const n=i.getColor(e),o=i.getColor(t);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:i.getColor(Ez),secondaryHeadingColor:i.getColor(Nz)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(i){super._fillHead(i),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(n=>this.editor.focus()));const e=[],t=this._menuService.createMenu(X2.TitleMenu,this._contextKeyService);_A(t,void 0,e),this._actionbarWidget.push(e,{label:!1,icon:!0,index:0}),t.dispose()}_fillTitleIcon(i){this._icon=Z(i,ee(""))}_fillBody(i){this._parentContainer=i,i.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),i.appendChild(this._container),this._message=new M_e(this._container,this.editor,e=>this._onDidSelectRelatedInformation.fire(e),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(i,e,t){this._container.classList.remove("stale"),this._message.update(i),this._severity=i.severity,this._applyTheme(this._themeService.getColorTheme());const n=L.lift(i),o=this.editor.getPosition(),s=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(s,this.computeRequiredHeight());const r=this.editor.getModel();if(r){const a=t>1?p("problems","{0} of {1} problems",e,t):p("change","{0} of {1} problem",e,t);this.setTitle(nr(r.uri),a)}this._icon.className=`codicon ${Q2.className(gi.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(i){this._container.classList.remove("stale"),this._message.update(i)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(i,e){super._doLayoutBody(i,e),this._heightInPixel=i,this._message.layout(i,e),this._container.style.height=`${i}px`}_onWidth(i){this._message.layout(this._heightInPixel,i)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Km.TitleMenu=new x("gotoErrorTitleMenu");Km=X2=I_e([$g(1,nn),$g(2,as),$g(3,Sa),$g(4,Me),$g(5,Ae),$g(6,Im)],Km);const o9=Fv(nl,uJ),s9=Fv(Ds,Pv),r9=Fv(Mo,Ov),J2=M("editorMarkerNavigationError.background",{dark:o9,light:o9,hcDark:rt,hcLight:rt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),T_e=M("editorMarkerNavigationError.headerBackground",{dark:ye(J2,.1),light:ye(J2,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),jC=M("editorMarkerNavigationWarning.background",{dark:s9,light:s9,hcDark:rt,hcLight:rt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),R_e=M("editorMarkerNavigationWarning.headerBackground",{dark:ye(jC,.1),light:ye(jC,.1),hcDark:"#0C141F",hcLight:ye(jC,.2)},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),eM=M("editorMarkerNavigationInfo.background",{dark:r9,light:r9,hcDark:rt,hcLight:rt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),A_e=M("editorMarkerNavigationInfo.headerBackground",{dark:ye(eM,.1),light:ye(eM,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),P_e=M("editorMarkerNavigation.background",{dark:tn,light:tn,hcDark:tn,hcLight:tn},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));var O_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},K1=function(i,e){return function(t,n){e(t,n,i)}},L_;let hc=L_=class{static get(i){return i.getContribution(L_.ID)}constructor(i,e,t,n,o){this._markerNavigationService=e,this._contextKeyService=t,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new Y,this._editor=i,this._widgetVisible=Kz.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(i){if(this._model&&this._model.matches(i))return this._model;let e=!1;return this._model&&(e=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(i),e&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(Km,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(t=>{var n,o,s;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!L.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,t.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const t=this._model.find(this._editor.getModel().uri,this._widget.position);t?this._widget.updateMarker(t.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(t=>{this._editorService.openCodeEditor({resource:t.resource,options:{pinned:!0,revealIfOpened:!0,selection:L.lift(t).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(i=!0){this._cleanUp(),i&&this._editor.focus()}showAtMarker(i){if(this._editor.hasModel()){const e=this._getOrCreateModel(this._editor.getModel().uri);e.resetIndex(),e.move(!0,this._editor.getModel(),new P(i.startLineNumber,i.startColumn)),e.selected&&this._widget.showAtMarker(e.selected.marker,e.selected.index,e.selected.total)}}async nagivate(i,e){var t,n;if(this._editor.hasModel()){const o=this._getOrCreateModel(e?void 0:this._editor.getModel().uri);if(o.move(i,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((t=L_.get(s))===null||t===void 0||t.close(),(n=L_.get(s))===null||n===void 0||n.nagivate(i,e))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}}};hc.ID="editor.contrib.markerController";hc=L_=O_e([K1(1,Uz),K1(2,Ae),K1(3,vt),K1(4,Me)],hc);class KL extends ce{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}async run(e,t){var n;t.hasModel()&&((n=hc.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))}}class Bh extends KL{constructor(){super(!0,!1,{id:Bh.ID,label:Bh.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:578,weight:100},menuOpts:{menuId:Km.TitleMenu,title:Bh.LABEL,icon:Ei("marker-navigation-next",oe.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Bh.ID="editor.action.marker.next";Bh.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Eu extends KL{constructor(){super(!1,!1,{id:Eu.ID,label:Eu.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:1602,weight:100},menuOpts:{menuId:Km.TitleMenu,title:Eu.LABEL,icon:Ei("marker-navigation-previous",oe.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Eu.ID="editor.action.marker.prev";Eu.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class F_e extends KL{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:E.focus,primary:66,weight:100},menuOpts:{menuId:x.MenubarGoMenu,title:p({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class B_e extends KL{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:E.focus,primary:1090,weight:100},menuOpts:{menuId:x.MenubarGoMenu,title:p({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}pt(hc.ID,hc,4);ie(Bh);ie(Eu);ie(F_e);ie(B_e);const Kz=new de("markersNavigationVisible",!1),W_e=gn.bindToContribution(hc.get);re(new W_e({id:"closeMarkersNavigation",precondition:Kz,handler:i=>i.close(),kbOpts:{weight:150,kbExpr:E.focus,primary:9,secondary:[1033]}}));var V_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},vx=function(i,e){return function(t,n){e(t,n,i)}};const cr=ee;class H_e{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const a9={type:1,filter:{include:Re.QuickFix},triggerAction:is.QuickFixHover};let tM=class{constructor(i,e,t,n){this._editor=i,this._markerDecorationsService=e,this._openerService=t,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(i,e){if(!this._editor.hasModel()||i.type!==1&&!i.supportsMarkerHover)return[];const t=this._editor.getModel(),n=i.range.startLineNumber,o=t.getLineMaxColumn(n),s=[];for(const r of e){const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:o,d=this._markerDecorationsService.getMarker(t.uri,r);if(!d)continue;const h=new L(i.range.startLineNumber,a,i.range.startLineNumber,l);s.push(new H_e(this,h,d))}return s}renderHoverParts(i,e){if(!e.length)return B.None;const t=new Y;e.forEach(o=>i.fragment.appendChild(this.renderMarkerHover(o,t)));const n=e.length===1?e[0]:e.sort((o,s)=>gi.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(i,n,t),t}renderMarkerHover(i,e){const t=cr("div.hover-row"),n=Z(t,cr("div.marker.hover-contents")),{source:o,message:s,code:r,relatedInformation:a}=i.marker;this._editor.applyFontInfo(n);const l=Z(n,cr("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=s,o||r)if(r&&typeof r!="string"){const d=cr("span");if(o){const g=Z(d,cr("span"));g.innerText=o}const h=Z(d,cr("a.code-link"));h.setAttribute("href",r.target.toString()),e.add($(h,"click",g=>{this._openerService.open(r.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const c=Z(h,cr("span"));c.innerText=r.value;const u=Z(n,d);u.style.opacity="0.6",u.style.paddingLeft="6px"}else{const d=Z(n,cr("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&r?`${o}(${r})`:o||`(${r})`}if(jn(a))for(const{message:d,resource:h,startLineNumber:c,startColumn:u}of a){const g=Z(n,cr("div"));g.style.marginTop="8px";const m=Z(g,cr("a"));m.innerText=`${nr(h)}(${c}, ${u}): `,m.style.cursor="pointer",e.add($(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:c,startColumn:u}}}).catch(Ke)}));const f=Z(g,cr("span"));f.innerText=d,this._editor.applyFontInfo(f)}return t}renderMarkerStatusbar(i,e,t){if((e.marker.severity===gi.Error||e.marker.severity===gi.Warning||e.marker.severity===gi.Info)&&i.statusBar.addAction({label:p("view problem","View Problem"),commandId:Bh.ID,run:()=>{var n;i.hide(),(n=hc.get(this._editor))===null||n===void 0||n.showAtMarker(e.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=i.statusBar.append(cr("div"));this.recentMarkerCodeActionsInfo&&(cy.makeKey(this.recentMarkerCodeActionsInfo.marker)===cy.makeKey(e.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=p("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?B.None:t.add(qh(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const s=this.getCodeActions(e.marker);t.add(Ne(()=>s.cancel())),s.then(r=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:e.marker,hasCodeActions:r.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){r.dispose(),n.textContent=p("noQuickFixes","No quick fixes available");return}n.style.display="none";let a=!1;t.add(Ne(()=>{a||r.dispose()})),i.statusBar.addAction({label:p("quick fixes","Quick Fix..."),commandId:rP,run:l=>{a=!0;const d=sc.get(this._editor),h=ji(l);i.hide(),d==null||d.showCodeActions(a9,r,{x:h.left,y:h.top,width:h.width,height:h.height})}})},Ke)}}getCodeActions(i){return Yi(e=>ev(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new L(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn),a9,Sd.None,e))}};tM=V_e([vx(1,CR),vx(2,as),vx(3,pe)],tM);const jz="editor.action.inlineSuggest.commit",$z="editor.action.inlineSuggest.showPrevious",qz="editor.action.inlineSuggest.showNext";var _P=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},sa=function(i,e){return function(t,n){e(t,n,i)}},$C;let iM=class extends B{constructor(i,e,t){super(),this.editor=i,this.model=e,this.instantiationService=t,this.alwaysShowToolbar=fi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=qe(this,n=>{var o,s,r;const a=(o=this.model.read(n))===null||o===void 0?void 0:o.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!a||a.parts.length===0)return this.sessionPosition=void 0,null;const l=a.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==a.lineNumber&&(this.sessionPosition=void 0);const d=new P(a.lineNumber,Math.min(l,(r=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&r!==void 0?r:Number.MAX_SAFE_INTEGER));return this.sessionPosition=d,d}),this._register(Fd((n,o)=>{const s=this.model.read(n);if(!s||!this.alwaysShowToolbar.read(n))return;const r=o.add(this.instantiationService.createInstance(cc,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]})));i.addContentWidget(r),o.add(Ne(()=>i.removeContentWidget(r))),o.add(yt(a=>{this.position.read(a)&&s.lastTriggerKind.read(a)!==Cd.Explicit&&s.triggerExplicitly()}))}))}};iM=_P([sa(2,Me)],iM);const z_e=Ei("inline-suggestion-hints-next",oe.chevronRight,p("parameterHintsNextIcon","Icon for show next parameter hint.")),U_e=Ei("inline-suggestion-hints-previous",oe.chevronLeft,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let cc=$C=class extends B{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(i,e,t){const n=new vo(i,e,t,!0,()=>this._commandService.executeCommand(i)),o=this.keybindingService.lookupKeybinding(i,this._contextKeyService);let s=e;return o&&(s=p({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",e,o.getLabel())),n.tooltip=s,n}constructor(i,e,t,n,o,s,r,a,l,d,h){super(),this.editor=i,this.withBorder=e,this._position=t,this._currentSuggestionIdx=n,this._suggestionCount=o,this._extraCommands=s,this._commandService=r,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${$C.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Qt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Qt("div@toolBar")]),this.previousAction=this.createCommandAction($z,p("previous","Previous"),Ee.asClassName(U_e)),this.availableSuggestionCountAction=new vo("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(qz,p("next","Next"),Ee.asClassName(z_e)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(x.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Mt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Mt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(a.createInstance(nM,this.nodes.toolBar,x.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},actionViewItemProvider:(c,u)=>{if(c instanceof Er)return a.createInstance(j_e,c,void 0);if(c===this.availableSuggestionCountAction){const g=new K_e(void 0,c,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(c=>{$C._dropDownVisible=c})),this._register(yt(c=>{this._position.read(c),this.editor.layoutContentWidget(this)})),this._register(yt(c=>{const u=this._suggestionCount.read(c),g=this._currentSuggestionIdx.read(c);u!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${u}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),u!==void 0&&u>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(yt(c=>{const u=this._extraCommands.read(c);if(vi(this.lastCommands,u))return;this.lastCommands=u;const g=u.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:f=>this._commandService.executeCommand(m.id)}));for(const[m,f]of this.inlineCompletionsActionsMenus.getActions())for(const _ of f)_ instanceof Er&&g.push(_);g.length>0&&g.unshift(new cn),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};cc._dropDownVisible=!1;cc.id=0;cc=$C=_P([sa(6,pi),sa(7,Me),sa(8,Tt),sa(9,Ae),sa(10,Sa)],cc);class K_e extends Am{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 j_e=class extends qu{updateLabel(){const i=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!i)return super.updateLabel();if(this.label){const e=Qt("div.keybinding").root;new mb(e,Ls,{disableTitle:!0,...mhe}).set(i),this.label.textContent=this._action.label,this.label.appendChild(e),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},nM=class extends Ay{constructor(i,e,t,n,o,s,r,a){super(i,{resetMenu:e,...t},n,o,s,r,a),this.menuId=e,this.options2=t,this.menuService=n,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var i,e,t,n,o,s,r;const a=[],l=[];_A(this.menu,(i=this.options2)===null||i===void 0?void 0:i.menuOptions,{primary:a,secondary:l},(t=(e=this.options2)===null||e===void 0?void 0:e.toolbarOptions)===null||t===void 0?void 0:t.primaryGroup,(o=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(r=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||r===void 0?void 0:r.useSeparatorsInPrimaryActions),l.push(...this.additionalActions),a.unshift(...this.prependedPrimaryActions),this.setActions(a,l)}setPrependedPrimaryActions(i){vi(this.prependedPrimaryActions,i,(e,t)=>e===t)||(this.prependedPrimaryActions=i,this.updateToolbar())}setAdditionalSecondaryActions(i){vi(this.additionalActions,i,(e,t)=>e===t)||(this.additionalActions=i,this.updateToolbar())}};nM=_P([sa(3,Sa),sa(4,Ae),sa(5,rr),sa(6,Tt),sa(7,ns)],nM);var $_e=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},j1=function(i,e){return function(t,n){e(t,n,i)}},oM;const q_e=!1;let Po=oM=class extends B{static get(i){return i.getContribution(oM.ID)}constructor(i,e,t,n,o){super(),this._editor=i,this._instantiationService=e,this._openerService=t,this._languageService=n,this._keybindingService=o,this._toUnhook=new Y,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Mt(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))}_hookEvents(){const i=this._editor.getOption(60);this._isHoverEnabled=i.enabled,this._isHoverSticky=i.sticky,this._hidingDelay=i.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(e=>this._onEditorMouseDown(e))),this._toUnhook.add(this._editor.onMouseUp(e=>this._onEditorMouseUp(e))),this._toUnhook.add(this._editor.onMouseMove(e=>this._onEditorMouseMove(e))),this._toUnhook.add(this._editor.onKeyDown(e=>this._onKeyDown(e)))):(this._toUnhook.add(this._editor.onMouseMove(e=>this._onEditorMouseMove(e))),this._toUnhook.add(this._editor.onKeyDown(e=>this._onKeyDown(e)))),this._toUnhook.add(this._editor.onMouseLeave(e=>this._onEditorMouseLeave(e))),this._toUnhook.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._toUnhook.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._toUnhook.add(this._editor.onDidScrollChange(e=>this._onEditorScrollChanged(e)))}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(i){(i.scrollTopChanged||i.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(i){var e;this._isMouseDown=!0;const t=i.target;if(t.type===9&&t.detail===Fh.ID){this._hoverClicked=!0;return}t.type===12&&t.detail===nm.ID||(t.type!==12&&(this._hoverClicked=!1),!((e=this._contentWidget)===null||e===void 0)&&e.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(i){this._isMouseDown=!1}_onEditorMouseLeave(i){var e,t;this._cancelScheduler();const n=i.event.browserEvent.relatedTarget;!((e=this._contentWidget)===null||e===void 0)&&e.widget.isResizing||!((t=this._contentWidget)===null||t===void 0)&&t.containsNode(n)||this._hideWidgets()}_isMouseOverWidget(i){var e,t,n,o,s;const r=i.target;return!!(this._isHoverSticky&&r.type===9&&r.detail===Fh.ID||this._isHoverSticky&&!((e=this._contentWidget)===null||e===void 0)&&e.containsNode((t=i.event.browserEvent.view)===null||t===void 0?void 0:t.document.activeElement)&&!(!((o=(n=i.event.browserEvent.view)===null||n===void 0?void 0:n.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&r.type===9&&r.detail===Fh.ID&&!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible||this._isHoverSticky&&r.type===12&&r.detail===nm.ID)}_onEditorMouseMove(i){var e,t,n,o;if(this._mouseMoveEvent=i,!(!((e=this._contentWidget)===null||e===void 0)&&e.isFocused||!((t=this._contentWidget)===null||t===void 0)&&t.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&!((n=this._contentWidget)===null||n===void 0)&&n.isVisibleFromKeyboard)){if(this._isMouseOverWidget(i)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(i)}}_reactToEditorMouseMove(i){var e,t,n;if(!i)return;const o=i.target,s=(e=o.element)===null||e===void 0?void 0:e.classList.contains("colorpicker-color-decoration"),r=this._editor.getOption(146);if(s&&(r==="click"&&!this._hoverActivatedByColorDecoratorClick||r==="hover"&&!this._isHoverEnabled&&!q_e||r==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!s&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(i)){(t=this._glyphWidget)===null||t===void 0||t.hide();return}if(o.type===2&&o.position){(n=this._contentWidget)===null||n===void 0||n.hide(),this._glyphWidget||(this._glyphWidget=new nm(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(o.position.lineNumber);return}this._hideWidgets()}_onKeyDown(i){var e;if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(i,this._editor.getDomNode()),n=t.kind===1||t.kind===2&&t.commandId==="editor.action.showHover"&&((e=this._contentWidget)===null||e===void 0?void 0:e.isVisible);i.keyCode!==5&&i.keyCode!==6&&i.keyCode!==57&&i.keyCode!==4&&!n&&this._hideWidgets()}_hideWidgets(){var i,e,t;this._isMouseDown&&this._hoverClicked&&!((i=this._contentWidget)===null||i===void 0)&&i.isColorPickerVisible||cc.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(e=this._glyphWidget)===null||e===void 0||e.hide(),(t=this._contentWidget)===null||t===void 0||t.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Vy,this._editor)),this._contentWidget}showContentHover(i,e,t,n,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(i,e,t,n)}focus(){var i;(i=this._contentWidget)===null||i===void 0||i.focus()}scrollUp(){var i;(i=this._contentWidget)===null||i===void 0||i.scrollUp()}scrollDown(){var i;(i=this._contentWidget)===null||i===void 0||i.scrollDown()}scrollLeft(){var i;(i=this._contentWidget)===null||i===void 0||i.scrollLeft()}scrollRight(){var i;(i=this._contentWidget)===null||i===void 0||i.scrollRight()}pageUp(){var i;(i=this._contentWidget)===null||i===void 0||i.pageUp()}pageDown(){var i;(i=this._contentWidget)===null||i===void 0||i.pageDown()}goToTop(){var i;(i=this._contentWidget)===null||i===void 0||i.goToTop()}goToBottom(){var i;(i=this._contentWidget)===null||i===void 0||i.goToBottom()}get isColorPickerVisible(){var i;return(i=this._contentWidget)===null||i===void 0?void 0:i.isColorPickerVisible}get isHoverVisible(){var i;return(i=this._contentWidget)===null||i===void 0?void 0:i.isVisible}dispose(){var i,e;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(i=this._glyphWidget)===null||i===void 0||i.dispose(),(e=this._contentWidget)===null||e===void 0||e.dispose()}};Po.ID="editor.contrib.hover";Po=oM=$_e([j1(1,Me),j1(2,as),j1(3,Xt),j1(4,Tt)],Po);var Kr;(function(i){i.NoAutoFocus="noAutoFocus",i.FocusIfVisible="focusIfVisible",i.AutoFocusImmediately="autoFocusImmediately"})(Kr||(Kr={}));class G_e extends ce{constructor(){super({id:"editor.action.showHover",label:p({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse."]},"Show or Focus Hover"),metadata:{description:"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:[Kr.NoAutoFocus,Kr.FocusIfVisible,Kr.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:Kr.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:$i(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const o=Po.get(t);if(!o)return;const s=n==null?void 0:n.focus;let r=Kr.FocusIfVisible;s in Kr?r=s:typeof s=="boolean"&&s&&(r=Kr.AutoFocusImmediately);const a=d=>{const h=t.getPosition(),c=new L(h.lineNumber,h.column,h.lineNumber,h.column);o.showContentHover(c,1,1,d)},l=t.getOption(2)===2;o.isHoverVisible?r!==Kr.NoAutoFocus?o.focus():a(l):a(l||r===Kr.AutoFocusImmediately)}}class Z_e extends ce{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:p({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=Po.get(t);if(!n)return;const o=t.getPosition();if(!o)return;const s=new L(o.lineNumber,o.column,o.lineNumber,o.column),r=ng.get(t);r&&r.startFindDefinitionFromCursor(o).then(()=>{n.showContentHover(s,1,1,!0)})}}class Y_e extends ce{constructor(){super({id:"editor.action.scrollUpHover",label:p({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:16,weight:100}})}run(e,t){const n=Po.get(t);n&&n.scrollUp()}}class Q_e extends ce{constructor(){super({id:"editor.action.scrollDownHover",label:p({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:18,weight:100}})}run(e,t){const n=Po.get(t);n&&n.scrollDown()}}class X_e extends ce{constructor(){super({id:"editor.action.scrollLeftHover",label:p({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:15,weight:100}})}run(e,t){const n=Po.get(t);n&&n.scrollLeft()}}class J_e extends ce{constructor(){super({id:"editor.action.scrollRightHover",label:p({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:17,weight:100}})}run(e,t){const n=Po.get(t);n&&n.scrollRight()}}class eve extends ce{constructor(){super({id:"editor.action.pageUpHover",label:p({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=Po.get(t);n&&n.pageUp()}}class tve extends ce{constructor(){super({id:"editor.action.pageDownHover",label:p({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=Po.get(t);n&&n.pageDown()}}class ive extends ce{constructor(){super({id:"editor.action.goToTopHover",label:p({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=Po.get(t);n&&n.goToTop()}}class nve extends ce{constructor(){super({id:"editor.action.goToBottomHover",label:p({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=Po.get(t);n&&n.goToBottom()}}pt(Po.ID,Po,2);ie(G_e);ie(Z_e);ie(Y_e);ie(Q_e);ie(X_e);ie(J_e);ie(eve);ie(tve);ie(ive);ie(nve);Ng.register(Uy);Ng.register(tM);Rr((i,e)=>{const t=i.getColor(xJ);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 sM extends B{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==vz||!n.range)return;const o=this._editor.getContribution(Po.ID);if(o&&!o.isColorPickerVisible){const s=new L(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);o.showContentHover(s,1,0,!1,!0)}}}sM.ID="editor.contrib.colorContribution";pt(sM.ID,sM,2);Ng.register(By);var Gz=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},ta=function(i,e){return function(t,n){e(t,n,i)}},rM,aM;let uc=rM=class extends B{constructor(i,e,t,n,o,s,r){super(),this._editor=i,this._modelService=t,this._keybindingService=n,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=r,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=E.standaloneColorPickerVisible.bindTo(e),this._standaloneColorPickerFocused=E.standaloneColorPickerFocused.bindTo(e)}showOrFocus(){var i;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(i=this._standaloneColorPickerWidget)===null||i===void 0||i.focus():this._standaloneColorPickerWidget=new jy(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var i;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(i=this._standaloneColorPickerWidget)===null||i===void 0||i.hide(),this._editor.focus()}insertColor(){var i;(i=this._standaloneColorPickerWidget)===null||i===void 0||i.updateEditor(),this.hide()}static get(i){return i.getContribution(rM.ID)}};uc.ID="editor.contrib.standaloneColorPickerController";uc=rM=Gz([ta(1,Ae),ta(2,ti),ta(3,Tt),ta(4,Me),ta(5,pe),ta(6,Bt)],uc);pt(uc.ID,uc,1);const l9=8,ove=22;let jy=aM=class extends B{constructor(i,e,t,n,o,s,r,a){var l;super(),this._editor=i,this._standaloneColorPickerVisible=e,this._standaloneColorPickerFocused=t,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=r,this._languageConfigurationService=a,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new A),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(v0,this._editor),this._position=(l=this._editor._getViewModel())===null||l===void 0?void 0:l.getPrimaryCursorState().modelState.position;const d=this._editor.getSelection(),h=d?{startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},c=this._register(bl(this._body));this._register(c.onDidBlur(u=>{this.hide()})),this._register(c.onDidFocus(u=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(u=>{var g;const m=(g=u.target.element)===null||g===void 0?void 0:g.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(u=>{this._render(u.value,u.foundInEditor)})),this._start(h),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return aM.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const i=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:i?[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(i){const e=await this._computeAsync(i);e&&this._onResult.fire(new sve(e.result,e.foundInEditor))}async _computeAsync(i){if(!this._editor.hasModel())return null;const e={range:i,color:{red:0,green:0,blue:0,alpha:1}},t=await this._standaloneColorPickerParticipant.createColorHover(e,new hP(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return t?{result:t.colorHover,foundInEditor:t.foundInEditor}:null}_render(i,e){const t=document.createDocumentFragment(),n=this._register(new Hy(this._keybindingService));let o;const s={fragment:t,statusBar:n,setColorPicker:m=>o=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=i,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[i])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(t),o.layout();const r=o.body,a=r.saturationBox.domNode.clientWidth,l=r.domNode.clientWidth-a-ove-l9,d=o.body.enterButton;d==null||d.onClicked(()=>{this.updateEditor(),this.hide()});const h=o.header,c=h.pickedColorNode;c.style.width=a+l9+"px";const u=h.originalColorNode;u.style.width=l+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),e&&(d&&(d.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(i.range)),this._editor.layoutContentWidget(this)}};jy.ID="editor.contrib.standaloneColorPickerWidget";jy=aM=Gz([ta(3,Me),ta(4,ti),ta(5,Tt),ta(6,pe),ta(7,Bt)],jy);class sve{constructor(e,t){this.value=e,this.foundInEditor=t}}class rve extends La{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:p("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:p({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:x.CommandPalette}]})}runEditorCommand(e,t){var n;(n=uc.get(t))===null||n===void 0||n.showOrFocus()}}class ave extends ce{constructor(){super({id:"editor.action.hideColorPicker",label:p({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:E.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=uc.get(t))===null||n===void 0||n.hide()}}class lve extends ce{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:p({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:E.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=uc.get(t))===null||n===void 0||n.insertColor()}}ie(ave);ie(lve);Gt(rve);class yh{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const o=t.length,s=e.length;if(n+o>s)return!1;for(let r=0;r<o;r++){const a=e.charCodeAt(n+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,n,o,s,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,h=e.endColumn,c=s.getLineContent(a),u=s.getLineContent(d);let g=c.lastIndexOf(t,l-1+t.length),m=u.indexOf(n,h-1-n.length);if(g!==-1&&m!==-1)if(a===d)c.substring(g+t.length,m).indexOf(n)>=0&&(g=-1,m=-1);else{const _=c.substring(g+t.length),b=u.substring(0,m);(_.indexOf(n)>=0||b.indexOf(n)>=0)&&(g=-1,m=-1)}let f;g!==-1&&m!==-1?(o&&g+t.length<c.length&&c.charCodeAt(g+t.length)===32&&(t=t+" "),o&&m>0&&u.charCodeAt(m-1)===32&&(n=" "+n,m-=1),f=yh._createRemoveBlockCommentOperations(new L(a,g+t.length+1,d,m+1),t,n)):(f=yh._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=f.length===1?n:null);for(const _ of f)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,n){const o=[];return L.isEmpty(e)?o.push(oi.delete(new L(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(o.push(oi.delete(new L(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),o.push(oi.delete(new L(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),o}static _createAddBlockCommentOperations(e,t,n,o){const s=[];return L.isEmpty(e)?s.push(oi.replace(new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(s.push(oi.insert(new P(e.startLineNumber,e.startColumn),t+(o?" ":""))),s.push(oi.insert(new P(e.endLineNumber,e.endColumn),(o?" ":"")+n))),s}getEditOperations(e,t){const n=this._selection.startLineNumber,o=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const s=e.getLanguageIdAtPosition(n,o),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 n=t.getInverseEditOperations();if(n.length===2){const o=n[0],s=n[1];return new ve(o.range.endLineNumber,o.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const o=n[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new ve(o.endLineNumber,o.endColumn+s,o.endLineNumber,o.endColumn+s)}}}class Zl{constructor(e,t,n,o,s,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=o,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,o){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=o.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let d=0,h=n-t+1;d<h;d++)l[d]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,n,o,s,r,a,l){let d=!0,h;e===0?h=!0:e===1?h=!1:h=!0;for(let c=0,u=o.length;c<u;c++){const g=o[c],m=s+c;if(m===s&&a){g.ignore=!0;continue}const f=n.getLineContent(m),_=oo(f);if(_===-1){g.ignore=r,g.commentStrOffset=f.length;continue}if(d=!1,g.ignore=!1,g.commentStrOffset=_,h&&!yh._haystackHasNeedleAtOffset(f,g.commentStr,_)&&(e===0?h=!1:e===1||(g.ignore=!0)),h&&t){const b=_+g.commentStrLength;b<f.length&&f.charCodeAt(b)===32&&(g.commentStrLength+=1)}}if(e===0&&d){h=!1;for(let c=0,u=o.length;c<u;c++)o[c].ignore=!1}return{supported:!0,shouldRemoveComments:h,lines:o}}static _gatherPreflightData(e,t,n,o,s,r,a,l){const d=Zl._gatherPreflightCommentStrings(n,o,s,l);return d===null?{supported:!1}:Zl._analyzeLines(e,t,n,d,o,r,a,l)}_executeLineComments(e,t,n,o){let s;n.shouldRemoveComments?s=Zl._createRemoveLineCommentsOperations(n.lines,o.startLineNumber):(Zl._normalizeInsertionPoint(e,n.lines,o.startLineNumber,this._tabSize),s=this._createAddLineCommentsOperations(n.lines,o.startLineNumber));const r=new P(o.positionLineNumber,o.positionColumn);for(let a=0,l=s.length;a<l;a++)t.addEditOperation(s[a].range,s[a].text),L.isEmpty(s[a].range)&&L.getStartPosition(s[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(s[a].text||"").length);this._selectionId=t.trackSelection(o)}_attemptRemoveBlockComment(e,t,n,o){let s=t.startLineNumber,r=t.endLineNumber;const a=o.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(s).lastIndexOf(n,a-1),d=e.getLineContent(r).indexOf(o,t.endColumn-1-n.length);return l!==-1&&d===-1&&(d=e.getLineContent(s).indexOf(o,l+n.length),r=s),l===-1&&d!==-1&&(l=e.getLineContent(r).lastIndexOf(n,d),s=r),t.isEmpty()&&(l===-1||d===-1)&&(l=e.getLineContent(s).indexOf(n),l!==-1&&(d=e.getLineContent(s).indexOf(o,l+n.length))),l!==-1&&e.getLineContent(s).charCodeAt(l+n.length)===32&&(n+=" "),d!==-1&&e.getLineContent(r).charCodeAt(d-1)===32&&(o=" "+o,d-=1),l!==-1&&d!==-1?yh._createRemoveBlockCommentOperations(new L(s,l+n.length+1,r,d+1),n,o):null}_executeBlockComment(e,t,n){e.tokenization.tokenizeIfCheap(n.startLineNumber);const o=e.getLanguageIdAtPosition(n.startLineNumber,1),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;if(!s||!s.blockCommentStartToken||!s.blockCommentEndToken)return;const r=s.blockCommentStartToken,a=s.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,n,r,a);if(!l){if(n.isEmpty()){const d=e.getLineContent(n.startLineNumber);let h=oo(d);h===-1&&(h=d.length),l=yh._createAddBlockCommentOperations(new L(n.startLineNumber,h+1,n.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=yh._createAddBlockCommentOperations(new L(n.startLineNumber,e.getLineFirstNonWhitespaceColumn(n.startLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),r,a,this._insertSpace);l.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(n);for(const d of l)t.addEditOperation(d.range,d.text)}getEditOperations(e,t){let n=this._selection;if(this._moveEndPositionDown=!1,n.startLineNumber===n.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new L(n.startLineNumber,e.getLineMaxColumn(n.startLineNumber),n.startLineNumber+1,1),n.startLineNumber===e.getLineCount()?"":`
|
|
1074
1074
|
`),this._selectionId=t.trackSelection(n);return}n.startLineNumber<n.endLineNumber&&n.endColumn===1&&(this._moveEndPositionDown=!0,n=n.setEndPosition(n.endLineNumber-1,e.getLineMaxColumn(n.endLineNumber-1)));const o=Zl._gatherPreflightData(this._type,this._insertSpace,e,n.startLineNumber,n.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return o.supported?this._executeLineComments(e,t,o,n):this._executeBlockComment(e,t,n)}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),new ve(n.selectionStartLineNumber,n.selectionStartColumn+this._deltaColumn,n.positionLineNumber,n.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const n=[];for(let o=0,s=e.length;o<s;o++){const r=e[o];r.ignore||n.push(oi.delete(new L(t+o,r.commentStrOffset+1,t+o,r.commentStrOffset+r.commentStrLength+1)))}return n}_createAddLineCommentsOperations(e,t){const n=[],o=this._insertSpace?" ":"";for(let s=0,r=e.length;s<r;s++){const a=e[s];a.ignore||n.push(oi.insert(new P(t+s,a.commentStrOffset+1),a.commentStr+o))}return n}static nextVisibleColumn(e,t,n,o){return n?e+(t-e%t):e+o}static _normalizeInsertionPoint(e,t,n,o){let s=1073741824,r,a;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const h=e.getLineContent(n+l);let c=0;for(let u=0,g=t[l].commentStrOffset;c<s&&u<g;u++)c=Zl.nextVisibleColumn(c,o,h.charCodeAt(u)===9,1);c<s&&(s=c)}s=Math.floor(s/o)*o;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const h=e.getLineContent(n+l);let c=0;for(r=0,a=t[l].commentStrOffset;c<s&&r<a;r++)c=Zl.nextVisibleColumn(c,o,h.charCodeAt(r)===9,1);c>s?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class vP extends ce{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Bt);if(!t.hasModel())return;const o=t.getModel(),s=[],r=o.getOptions(),a=t.getOption(23),l=t.getSelections().map((h,c)=>({selection:h,index:c,ignoreFirstLine:!1}));l.sort((h,c)=>L.compareRangesUsingStarts(h.selection,c.selection));let d=l[0];for(let h=1;h<l.length;h++){const c=l[h];d.selection.endLineNumber===c.selection.startLineNumber&&(d.index<c.index?c.ignoreFirstLine=!0:(d.ignoreFirstLine=!0,d=c))}for(const h of l)s.push(new Zl(n,h.selection,r.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,h.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class dve extends vP{constructor(){super(0,{id:"editor.action.commentLine",label:p("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:x.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class hve extends vP{constructor(){super(1,{id:"editor.action.addCommentLine",label:p("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:$i(2089,2081),weight:100}})}}class cve extends vP{constructor(){super(2,{id:"editor.action.removeCommentLine",label:p("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:$i(2089,2099),weight:100}})}}class uve extends ce{constructor(){super({id:"editor.action.blockComment",label:p("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:x.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const n=e.get(Bt);if(!t.hasModel())return;const o=t.getOption(23),s=[],r=t.getSelections();for(const a of r)s.push(new yh(a,o.insertSpace,n));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}ie(dve);ie(hve);ie(cve);ie(uve);var gve=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Bc=function(i,e){return function(t,n){e(t,n,i)}},lM;let jm=lM=class{static get(i){return i.getContribution(lM.ID)}constructor(i,e,t,n,o,s,r,a){this._contextMenuService=e,this._contextViewService=t,this._contextKeyService=n,this._keybindingService=o,this._menuService=s,this._configurationService=r,this._workspaceContextService=a,this._toDispose=new Y,this._contextMenuIsBeingShownCount=0,this._editor=i,this._toDispose.add(this._editor.onContextMenu(l=>this._onContextMenu(l))),this._toDispose.add(this._editor.onMouseWheel(l=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=l.srcElement;h.shadowRoot&&zu(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(l=>{this._editor.getOption(24)&&l.keyCode===58&&(l.preventDefault(),l.stopPropagation(),this.showContextMenu())}))}_onContextMenu(i){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),i.target.position&&!this._editor.getSelection().containsPosition(i.target.position)&&this._editor.setPosition(i.target.position);return}if(i.target.type===12||i.target.type===6&&i.target.detail.injectedText)return;if(i.event.preventDefault(),i.event.stopPropagation(),i.target.type===11)return this._showScrollbarContextMenu(i.event);if(i.target.type!==6&&i.target.type!==7&&i.target.type!==1)return;if(this._editor.focus(),i.target.position){let t=!1;for(const n of this._editor.getSelections())if(n.containsPosition(i.target.position)){t=!0;break}t||this._editor.setPosition(i.target.position)}let e=null;i.target.type!==1&&(e=i.event),this.showContextMenu(e)}showContextMenu(i){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const e=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?x.SimpleEditorContext:x.EditorContext);e.length>0&&this._doShowContextMenu(e,i)}_getMenuActions(i,e){const t=[],n=this._menuService.createMenu(e,this._contextKeyService),o=n.getActions({arg:i.uri});n.dispose();for(const s of o){const[,r]=s;let a=0;for(const l of r)if(l instanceof Sv){const d=this._getMenuActions(i,l.item.submenu);d.length>0&&(t.push(new mm(l.id,l.label,d)),a++)}else t.push(l),a++;a&&t.push(new cn)}return t.length&&t.pop(),t}_doShowContextMenu(i,e=null){if(!this._editor.hasModel())return;const t=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let n=e;if(!n){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),r=ji(this._editor.getDomNode()),a=r.left+s.left,l=r.top+s.top+s.height;n={x:a,y:l}}const o=this._editor.getOption(126)&&!ma;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>i,getActionViewItem:s=>{const r=this._keybindingFor(s);if(r)return new Am(s,s,{label:!0,keybinding:r.getLabel(),isMenu:!0});const a=s;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new Am(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:t})}})}_showScrollbarContextMenu(i){if(!this._editor.hasModel()||Vre(this._workspaceContextService.getWorkspace()))return;const e=this._editor.getOption(72);let t=0;const n=l=>({id:`menu-action-${++t}`,label:l.label,tooltip:"",class:void 0,enabled:typeof l.enabled>"u"?!0:l.enabled,checked:l.checked,run:l.run}),o=(l,d)=>new mm(`menu-action-${++t}`,l,d,void 0),s=(l,d,h,c,u)=>{if(!d)return n({label:l,enabled:d,run:()=>{}});const g=f=>()=>{this._configurationService.updateValue(h,f)},m=[];for(const f of u)m.push(n({label:f.label,checked:c===f.value,run:g(f.value)}));return o(l,m)},r=[];r.push(n({label:p("context.minimap.minimap","Minimap"),checked:e.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!e.enabled)}})),r.push(new cn),r.push(n({label:p("context.minimap.renderCharacters","Render Characters"),enabled:e.enabled,checked:e.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!e.renderCharacters)}})),r.push(s(p("context.minimap.size","Vertical size"),e.enabled,"editor.minimap.size",e.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"}])),r.push(s(p("context.minimap.slider","Slider"),e.enabled,"editor.minimap.showSlider",e.showSlider,[{label:p("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:p("context.minimap.slider.always","Always"),value:"always"}]));const a=this._editor.getOption(126)&&!ma;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:a?this._editor.getDomNode():void 0,getAnchor:()=>i,getActions:()=>r,onHide:l=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(i){return this._keybindingService.lookupKeybinding(i.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};jm.ID="editor.contrib.contextmenu";jm=lM=gve([Bc(1,rr),Bc(2,Rd),Bc(3,Ae),Bc(4,Tt),Bc(5,Sa),Bc(6,at),Bc(7,ju)],jm);class pve extends ce{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:E.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=jm.get(t))===null||n===void 0||n.showContextMenu()}}pt(jm.ID,jm,2);ie(pve);class bx{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let o=0;o<t;o++)if(!this.selections[o].equalsSelection(e.selections[o]))return!1;return!0}}class Cx{constructor(e,t,n){this.cursorState=e,this.scrollTop=t,this.scrollLeft=n}}class og extends B{static get(e){return e.getContribution(og.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 n=new bx(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new Cx(n,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new Cx(new bx(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 Cx(new bx(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}}og.ID="editor.contrib.cursorUndoRedoController";class mve extends ce{constructor(){super({id:"cursorUndo",label:p("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var o;(o=og.get(t))===null||o===void 0||o.cursorUndo()}}class fve extends ce{constructor(){super({id:"cursorRedo",label:p("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var o;(o=og.get(t))===null||o===void 0||o.cursorRedo()}}pt(og.ID,og,0);ie(mve);ie(fve);class _ve{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new L(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new ve(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 ve(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 ve(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 ve(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 ve(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 qg(i){return ht?i.altKey:i.ctrlKey}class Ld extends B{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)||(qg(e)&&(this._modifierPressed=!0),this._mouseDown&&qg(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(qg(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Ld.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(o=>t.position&&o.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}qg(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 P(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const o=this._editor.getSelection();if(o){const{selectionStartLineNumber:s,selectionStartColumn:r}=o;n=[new ve(s,r,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(o=>o.containsPosition(t)?new ve(t.lineNumber,t.column,t.lineNumber,t.column):o);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(qg(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Ld.ID,new _ve(this._dragSelection,t,qg(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 L(e.lineNumber,e.column,e.lineNumber,e.column),options:Ld._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()}}Ld.ID="editor.contrib.dragAndDrop";Ld.TRIGGER_KEY_VALUE=ht?6:5;Ld._DECORATION_OPTIONS=je.register({description:"dnd-target",className:"dnd-target"});pt(Ld.ID,Ld,2);const jL=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let o=0;o<n.length;o++)n[o]=Math.floor(Math.random()*256);return n};const e=new Uint8Array(16),t=[];for(let n=0;n<256;n++)t.push(n.toString(16).padStart(2,"0"));return function(){i(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,o="";return o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o}}();function bP(i){return{asString:async()=>i,asFile:()=>{},value:typeof i=="string"?i:void 0}}function vve(i,e,t){const n={id:jL(),name:i,uri:e,data:t};return{asString:async()=>"",asFile:()=>n,value:void 0}}class Zz{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 it.some(this,([n,o])=>o.asFile())&&t.push("files"),Qz($y(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const n=this._entries.get(e);n?n.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const n of t)yield[e,n]}toKey(e){return $y(e)}}function $y(i){return i.toLowerCase()}function Yz(i,e){return Qz($y(i),e.map($y))}function Qz(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,o,s]=t;return s==="*"?e.some(r=>r.startsWith(o+"/")):!1}const $L=Object.freeze({create:i=>zh(i.map(e=>e.toString())).join(`\r
|
|
1075
1075
|
`),split:i=>i.split(`\r
|
|
1076
1076
|
`),parse:i=>$L.split(i).filter(e=>!e.startsWith("#"))}),d9={EDITORS:"CodeEditors",FILES:"CodeFiles"};class bve{}const Cve={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ai.add(Cve.DragAndDropContribution,new bve);class y0{constructor(){}static getInstance(){return y0.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}y0.INSTANCE=new y0;function Xz(i){const e=new Zz;for(const t of i.items){const n=t.type;if(t.kind==="string"){const o=new Promise(s=>t.getAsString(s));e.append(n,bP(o))}else if(t.kind==="file"){const o=t.getAsFile();o&&e.append(n,wve(o))}}return e}function wve(i){const e=i.path?xe.parse(i.path):void 0;return vve(i.name,e,async()=>new Uint8Array(await i.arrayBuffer()))}const yve=Object.freeze([d9.EDITORS,d9.FILES,t0.RESOURCES,t0.INTERNAL_URI_LIST]);function Jz(i,e=!1){const t=Xz(i),n=t.get(t0.INTERNAL_URI_LIST);if(n)t.replace(Di.uriList,n);else if(e||!t.has(Di.uriList)){const o=[];for(const s of i.items){const r=s.getAsFile();if(r){const a=r.path;try{a?o.push(xe.file(a).toString()):o.push(xe.parse(r.name,!0).toString())}catch{}}}o.length&&t.replace(Di.uriList,bP($L.create(o)))}for(const o of yve)t.delete(o);return t}function Sve(i,e,t){var n,o;return{edits:[...e.map(s=>new yd(i,typeof t.insertText=="string"?{range:s,text:t.insertText,insertAsSnippet:!1}:{range:s,text:t.insertText.snippet,insertAsSnippet:!0})),...(o=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&o!==void 0?o:[]]}}function eU(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const d of i)if(d!==a&&t(l,d)){let h=n.get(a);h||(h=[],n.set(a,h)),h.push(d)}if(!n.size)return Array.from(i);const o=new Set,s=[];function r(a){if(!a.length)return[];const l=a[0];if(s.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(o.has(l))return r(a.slice(1));let d=[];const h=n.get(l);return h&&(s.push(l),d=r(h),s.pop()),o.add(l),[...d,l,...r(a.slice(1))]}return r(Array.from(i))}var Lve=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},kve=function(i,e){return function(t,n){e(t,n,i)}};const Dve=je.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:v8,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class qL extends B{constructor(e,t,n,o,s){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(o),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=ee(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ee("span.icon");this.domNode.append(t),t.classList.add(...Ee.asClassNameArray(oe.loading),"codicon-modifier-spin");const n=()=>{const o=this.editor.getOption(66);this.domNode.style.height=`${o}px`,this.domNode.style.width=`${Math.ceil(.8*o)}px`};n(),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(52)||o.hasChanged(66))&&n()})),this._register($(this.domNode,ae.CLICK,o=>{this.delegate.cancel()}))}getId(){return qL.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}qL.baseId="editor.widget.inlineProgressWidget";let qy=class extends B{constructor(i,e,t){super(),this.id=i,this._editor=e,this._instantiationService=t,this._showDelay=500,this._showPromise=this._register(new un),this._currentWidget=new un,this._operationIdPool=0,this._currentDecorations=e.createDecorationsCollection()}async showWhile(i,e,t){const n=this._operationIdPool++;this._currentOperation=n,this.clear(),this._showPromise.value=qh(()=>{const o=L.fromPositions(i);this._currentDecorations.set([{range:o,options:Dve}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(qL,this.id,this._editor,o,e,t))},this._showDelay);try{return await t}finally{this._currentOperation===n&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};qy=Lve([kve(2,Me)],qy);var tU=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},tv=function(i,e){return function(t,n){e(t,n,i)}},dM;let Gy=dM=class extends B{constructor(i,e,t,n,o,s,r,a,l,d){super(),this.typeId=i,this.editor=e,this.showCommand=n,this.range=o,this.edits=s,this.onSelectNewEdit=r,this._contextMenuService=a,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=t.bindTo(l),this.visibleContext.set(!0),this._register(Ne(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ne(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{o.containsPosition(h.position)||this.dispose()})),this._register(le.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var i;const e=(i=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||i===void 0?void 0:i.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=ee(".post-edit-widget"),this.button=this._register(new wy(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register($(this.domNode,ae.CLICK,()=>this.showSelector()))}getId(){return dM.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const i=ji(this.button.element);return{x:i.left+i.width,y:i.top+i.height}},getActions:()=>this.edits.allEdits.map((i,e)=>Bp({id:"",label:i.label,checked:e===this.edits.activeEditIndex,run:()=>{if(e!==this.edits.activeEditIndex)return this.onSelectNewEdit(e)}}))})}};Gy.baseId="editor.widget.postEditWidget";Gy=dM=tU([tv(7,rr),tv(8,Ae),tv(9,Tt)],Gy);let Zy=class extends B{constructor(i,e,t,n,o,s){super(),this._id=i,this._editor=e,this._visibleContext=t,this._showCommand=n,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new un),this._register(le.any(e.onDidChangeModel,e.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(i,e,t,n){var o,s;const r=this._editor.getModel();if(!r||!i.length)return;const a=e.allEdits[e.activeEditIndex];if(!a)return;let l=[];(typeof a.insertText=="string"?a.insertText==="":a.insertText.snippet==="")?l=[]:l=i.map(m=>new yd(r.uri,typeof a.insertText=="string"?{range:m,text:a.insertText,insertAsSnippet:!1}:{range:m,text:a.insertText.snippet,insertAsSnippet:!0}));const d={edits:[...l,...(s=(o=a.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&s!==void 0?s:[]]},h=i[0],c=r.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let u,g;try{u=await this._bulkEditService.apply(d,{editor:this._editor,token:n}),g=r.getDecorationRange(c[0])}finally{r.deltaDecorations(c,[])}t&&u.isApplied&&e.allEdits.length>1&&this.show(g??h,e,async m=>{const f=this._editor.getModel();f&&(await f.undo(),this.applyEditAndShowIfNeeded(i,{activeEditIndex:m,allEdits:e.allEdits},t,n))})}show(i,e,t){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(Gy,this._id,this._editor,this._visibleContext,this._showCommand,i,e,t))}clear(){this._currentWidget.clear()}tryShowSelector(){var i;(i=this._currentWidget.value)===null||i===void 0||i.showSelector()}};Zy=tU([tv(4,Me),tv(5,db)],Zy);var xve=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Gg=function(i,e){return function(t,n){e(t,n,i)}},hM;const iU="editor.changePasteType",nU=new de("pasteWidgetVisible",!1,p("pasteWidgetVisible","Whether the paste widget is showing")),wx="application/vnd.code.copyMetadata";let sg=hM=class extends B{static get(i){return i.getContribution(hM.ID)}constructor(i,e,t,n,o,s,r){super(),this._bulkEditService=t,this._clipboardService=n,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=r,this._editor=i;const a=i.getContainerDomNode();this._register($(a,"copy",l=>this.handleCopy(l))),this._register($(a,"cut",l=>this.handleCopy(l))),this._register($(a,"paste",l=>this.handlePaste(l),!0)),this._pasteProgressManager=this._register(new qy("pasteIntoEditor",i,e)),this._postPasteWidgetManager=this._register(e.createInstance(Zy,"pasteIntoEditor",i,nU,{id:iU,label:p("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(i){this._editor.focus();try{this._pasteAsActionContext={preferredId:i},of().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(i){var e,t;if(!this._editor.hasTextFocus()||(fc&&this._clipboardService.writeResources([]),!i.clipboardData||!this.isPasteAsEnabled()))return;const n=this._editor.getModel(),o=this._editor.getSelections();if(!n||!(o!=null&&o.length))return;const s=this._editor.getOption(37);let r=o;const a=o.length===1&&o[0].isEmpty();if(a){if(!s)return;r=[new L(r[0].startLineNumber,1,r[0].startLineNumber,1+n.getLineLength(r[0].startLineNumber))]}const l=(e=this._editor._getViewModel())===null||e===void 0?void 0:e.getPlainTextToCopy(o,s,Bn),d={multicursorText:Array.isArray(l)?l:null,pasteOnNewLine:a,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(f=>!!f.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(i.clipboardData,{defaultPastePayload:d});return}const c=Xz(i.clipboardData),u=h.flatMap(f=>{var _;return(_=f.copyMimeTypes)!==null&&_!==void 0?_:[]}),g=jL();this.setCopyMetadata(i.clipboardData,{id:g,providerCopyMimeTypes:u,defaultPastePayload:d});const m=Yi(async f=>{const _=pa(await Promise.all(h.map(async b=>{try{return await b.prepareDocumentPaste(n,r,c,f)}catch(v){console.error(v);return}})));_.reverse();for(const b of _)for(const[v,C]of b)c.replace(v,C);return c});(t=this._currentCopyOperation)===null||t===void 0||t.dataTransferPromise.cancel(),this._currentCopyOperation={handle:g,dataTransferPromise:m}}async handlePaste(i){var e,t;if(!i.clipboardData||!this._editor.hasTextFocus())return;(e=this._currentPasteOperation)===null||e===void 0||e.cancel(),this._currentPasteOperation=void 0;const n=this._editor.getModel(),o=this._editor.getSelections();if(!(o!=null&&o.length)||!n||!this.isPasteAsEnabled())return;const s=this.fetchCopyMetadata(i),r=Jz(i.clipboardData);r.delete(wx);const a=[...i.clipboardData.types,...(t=s==null?void 0:s.providerCopyMimeTypes)!==null&&t!==void 0?t:[],Di.uriList],l=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(d=>{var h;return(h=d.pasteMimeTypes)===null||h===void 0?void 0:h.some(c=>Yz(c,a))});l.length&&(i.preventDefault(),i.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,l,o,r,s):this.doPasteInline(l,o,r,s))}doPasteInline(i,e,t,n){const o=Yi(async s=>{const r=this._editor;if(!r.hasModel())return;const a=r.getModel(),l=new oc(r,3,void 0,s);try{if(await this.mergeInDataFromCopy(t,n,l.token),l.token.isCancellationRequested)return;const d=i.filter(c=>h9(c,t));if(!d.length||d.length===1&&d[0].id==="text"){await this.applyDefaultPasteHandler(t,n,l.token);return}const h=await this.getPasteEdits(d,t,a,e,l.token);if(l.token.isCancellationRequested)return;if(h.length===1&&h[0].providerId==="text"){await this.applyDefaultPasteHandler(t,n,l.token);return}if(h.length){const c=r.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(e,{activeEditIndex:0,allEdits:h},c,l.token)}await this.applyDefaultPasteHandler(t,n,l.token)}finally{l.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(e[0].getEndPosition(),p("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),o),this._currentPasteOperation=o}showPasteAsPick(i,e,t,n,o){const s=Yi(async r=>{const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),d=new oc(a,3,void 0,r);try{if(await this.mergeInDataFromCopy(n,o,d.token),d.token.isCancellationRequested)return;let h=e.filter(m=>h9(m,n));i&&(h=h.filter(m=>m.id===i));const c=await this.getPasteEdits(h,n,l,t,d.token);if(d.token.isCancellationRequested||!c.length)return;let u;if(i)u=c.at(0);else{const m=await this._quickInputService.pick(c.map(f=>({label:f.label,description:f.providerId,detail:f.detail,edit:f})),{placeHolder:p("pasteAsPickerPlaceholder","Select Paste Action")});u=m==null?void 0:m.edit}if(!u)return;const g=Sve(l.uri,t,u);await this._bulkEditService.apply(g,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:p("pasteAsProgress","Running paste handlers")},()=>s)}setCopyMetadata(i,e){i.setData(wx,JSON.stringify(e))}fetchCopyMetadata(i){var e;if(!i.clipboardData)return;const t=i.clipboardData.getData(wx);if(t)try{return JSON.parse(t)}catch{return}const[n,o]=PN.getTextData(i.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(e=o.multicursorText)!==null&&e!==void 0?e:null,pasteOnNewLine:!!o.isFromEmptySelection}}}async mergeInDataFromCopy(i,e,t){var n;if(e!=null&&e.id&&((n=this._currentCopyOperation)===null||n===void 0?void 0:n.handle)===e.id){const o=await this._currentCopyOperation.dataTransferPromise;if(t.isCancellationRequested)return;for(const[s,r]of o)i.replace(s,r)}if(!i.has(Di.uriList)){const o=await this._clipboardService.readResources();if(t.isCancellationRequested)return;o.length&&i.append(Di.uriList,bP($L.create(o)))}}async getPasteEdits(i,e,t,n,o){const s=await LS(Promise.all(i.map(async a=>{var l;try{const d=await((l=a.provideDocumentPasteEdits)===null||l===void 0?void 0:l.call(a,t,n,e,o));if(d)return{...d,providerId:a.id}}catch(d){console.error(d)}})),o),r=pa(s??[]);return eU(r)}async applyDefaultPasteHandler(i,e,t){var n,o,s;const r=(n=i.get(Di.text))!==null&&n!==void 0?n:i.get("text");if(!r)return;const a=await r.asString();if(t.isCancellationRequested)return;const l={text:a,pasteOnNewLine:(o=e==null?void 0:e.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(s=e==null?void 0:e.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",l)}};sg.ID="editor.contrib.copyPasteActionController";sg=hM=xve([Gg(1,Me),Gg(2,db),Gg(3,Od),Gg(4,pe),Gg(5,Da),Gg(6,XW)],sg);function h9(i,e){var t;return!!(!((t=i.pasteMimeTypes)===null||t===void 0)&&t.some(n=>e.matches(n)))}var CP=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},S0=function(i,e){return function(t,n){e(t,n,i)}};const wP=p("builtIn","Built-in");class yP{async provideDocumentPasteEdits(e,t,n,o){const s=await this.getEdit(n,o);return s?{insertText:s.insertText,label:s.label,detail:s.detail,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,n,o){const s=await this.getEdit(n,o);return s?{insertText:s.insertText,label:s.label,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}}class oU extends yP{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[Di.text],this.pasteMimeTypes=[Di.text]}async getEdit(e,t){const n=e.get(Di.text);if(!n||e.has(Di.uriList))return;const o=await n.asString();return{handledMimeType:Di.text,label:p("text.label","Insert Plain Text"),detail:wP,insertText:o}}}class sU extends yP{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[Di.uriList],this.pasteMimeTypes=[Di.uriList]}async getEdit(e,t){const n=await rU(e);if(!n.length||t.isCancellationRequested)return;let o=0;const s=n.map(({uri:a,originalText:l})=>a.scheme===$e.file?a.fsPath:(o++,l)).join(" ");let r;return o>0?r=n.length>1?p("defaultDropProvider.uriList.uris","Insert Uris"):p("defaultDropProvider.uriList.uri","Insert Uri"):r=n.length>1?p("defaultDropProvider.uriList.paths","Insert Paths"):p("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Di.uriList,insertText:s,label:r,detail:wP}}}let Yy=class extends yP{constructor(i){super(),this._workspaceContextService=i,this.id="relativePath",this.dropMimeTypes=[Di.uriList],this.pasteMimeTypes=[Di.uriList]}async getEdit(i,e){const t=await rU(i);if(!t.length||e.isCancellationRequested)return;const n=pa(t.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?Ane(s.uri,o):void 0}));if(n.length)return{handledMimeType:Di.uriList,insertText:n.join(" "),label:t.length>1?p("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):p("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:wP}}};Yy=CP([S0(0,ju)],Yy);async function rU(i){const e=i.get(Di.uriList);if(!e)return[];const t=await e.asString(),n=[];for(const o of $L.parse(t))try{n.push({uri:xe.parse(o),originalText:o})}catch{}return n}let cM=class extends B{constructor(i,e){super(),this._register(i.documentOnDropEditProvider.register("*",new oU)),this._register(i.documentOnDropEditProvider.register("*",new sU)),this._register(i.documentOnDropEditProvider.register("*",new Yy(e)))}};cM=CP([S0(0,pe),S0(1,ju)],cM);let uM=class extends B{constructor(i,e){super(),this._register(i.documentPasteEditProvider.register("*",new oU)),this._register(i.documentPasteEditProvider.register("*",new sU)),this._register(i.documentPasteEditProvider.register("*",new Yy(e)))}};uM=CP([S0(0,pe),S0(1,ju)],uM);pt(sg.ID,sg,0);wL(uM);re(new class extends gn{constructor(){super({id:iU,precondition:nU,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=sg.get(e))===null||n===void 0?void 0:n.changePasteType()}});ie(class extends ce{constructor(){super({id:"editor.action.pasteAs",label:p("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:p("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const o=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=sg.get(e))===null||n===void 0?void 0:n.pasteAs(o)}});class Eve{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class c9{constructor(e){this.identifier=e}}const aU=tt("treeViewsDndService");lt(aU,Eve,1);var Nve=function(i,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},$1=function(i,e){return function(t,n){e(t,n,i)}},gM;const lU="editor.experimental.dropIntoEditor.defaultProvider",dU="editor.changeDropType",hU=new de("dropWidgetVisible",!1,p("dropWidgetVisible","Whether the drop widget is showing"));let $m=gM=class extends B{static get(i){return i.getContribution(gM.ID)}constructor(i,e,t,n,o){super(),this._configService=t,this._languageFeaturesService=n,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=y0.getInstance(),this._dropProgressManager=this._register(e.createInstance(qy,"dropIntoEditor",i)),this._postDropWidgetManager=this._register(e.createInstance(Zy,"dropIntoEditor",i,hU,{id:dU,label:p("postDropWidgetTitle","Show drop options...")})),this._register(i.onDropIntoEditor(s=>this.onDropIntoEditor(i,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(i,e,t){var n;if(!t.dataTransfer||!i.hasModel())return;(n=this._currentOperation)===null||n===void 0||n.cancel(),i.focus(),i.setPosition(e);const o=Yi(async s=>{const r=new oc(i,1,void 0,s);try{const a=await this.extractDataTransferData(t);if(a.size===0||r.token.isCancellationRequested)return;const l=i.getModel();if(!l)return;const d=this._languageFeaturesService.documentOnDropEditProvider.ordered(l).filter(c=>c.dropMimeTypes?c.dropMimeTypes.some(u=>a.matches(u)):!0),h=await this.getDropEdits(d,l,e,a,r);if(r.token.isCancellationRequested)return;if(h.length){const c=this.getInitialActiveEditIndex(l,h),u=i.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([L.fromPositions(e)],{activeEditIndex:c,allEdits:h},u,s)}}finally{r.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(e,p("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o}async getDropEdits(i,e,t,n,o){const s=await LS(Promise.all(i.map(async a=>{try{const l=await a.provideDocumentOnDropEdits(e,t,n,o.token);if(l)return{...l,providerId:a.id}}catch(l){console.error(l)}})),o.token),r=pa(s??[]);return eU(r)}getInitialActiveEditIndex(i,e){const t=this._configService.getValue(lU,{resource:i.uri});for(const[n,o]of Object.entries(t)){const s=e.findIndex(r=>o===r.providerId&&r.handledMimeType&&Yz(n,[r.handledMimeType]));if(s>=0)return s}return 0}async extractDataTransferData(i){if(!i.dataTransfer)return new Zz;const e=Jz(i.dataTransfer);if(this.treeItemsTransfer.hasData(c9.prototype)){const t=this.treeItemsTransfer.getData(c9.prototype);if(Array.isArray(t))for(const n of t){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(o)for(const[s,r]of o)e.replace(s,r)}}return e}};$m.ID="editor.contrib.dropIntoEditorController";$m=gM=Nve([$1(1,Me),$1(2,at),$1(3,pe),$1(4,aU)],$m);pt($m.ID,$m,2);re(new class extends gn{constructor(){super({id:dU,precondition:hU,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=$m.get(e))===null||n===void 0||n.changeDropType()}});wL(cM);ai.as(ka.Configuration).registerConfiguration({...tL,properties:{[lU]:{type:"object",scope:5,description:p("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class to{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(e){const t=this._editor.getModel().getDecorationsInRange(e);for(const n of t){const o=n.options;if(o===to._FIND_MATCH_DECORATION||o===to._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(n.id)}return 0}setCurrentFindMatch(e){let t=null,n=0;if(e)for(let o=0,s=this._decorations.length;o<s;o++){const r=this._editor.getModel().getDecorationRange(this._decorations[o]);if(e.equalsRange(r)){t=this._decorations[o],n=o+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(o=>{if(this._highlightedDecorationId!==null&&(o.changeDecorationOptions(this._highlightedDecorationId,to._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,o.changeDecorationOptions(this._highlightedDecorationId,to._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(o.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let s=this._editor.getModel().getDecorationRange(t);if(s.startLineNumber!==s.endLineNumber&&s.endColumn===1){const r=s.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);s=new L(s.startLineNumber,s.startColumn,r,a)}this._rangeHighlightDecorationId=o.addDecoration(s,to._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let o=to._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){o=to._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),l=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/l));let h=e[0].range.startLineNumber,c=e[0].range.endLineNumber;for(let u=1,g=e.length;u<g;u++){const m=e[u].range;c+d>=m.startLineNumber?m.endLineNumber>c&&(c=m.endLineNumber):(s.push({range:new L(h,1,c,1),options:to._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,c=m.endLineNumber)}s.push({range:new L(h,1,c,1),options:to._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;a<l;a++)r[a]={range:e[a].range,options:o};this._decorations=n.deltaDecorations(this._decorations,r),this._overviewRulerApproximateDecorations=n.deltaDecorations(this._overviewRulerApproximateDecorations,s),this._rangeHighlightDecorationId&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>n.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,to._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],o=this._editor.getModel().getDecorationRange(n);if(!(!o||o.endLineNumber>e.lineNumber)&&(o.endLineNumber<e.lineNumber||!(o.endColumn>e.column)))return o}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;t<n;t++){const o=this._decorations[t],s=this._editor.getModel().getDecorationRange(o);if(!(!s||s.startLineNumber<e.lineNumber)&&(s.startLineNumber>e.lineNumber||!(s.startColumn<e.column)))return s}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}}to._CURRENT_FIND_MATCH_DECORATION=je.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:ci(DR),position:Ts.Center},minimap:{color:ci(bp),position:Qo.Inline}});to._FIND_MATCH_DECORATION=je.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:ci(DR),position:Ts.Center},minimap:{color:ci(bp),position:Qo.Inline}});to._FIND_MATCH_NO_OVERVIEW_DECORATION=je.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});to._FIND_MATCH_ONLY_OVERVIEW_DECORATION=je.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:ci(DR),position:Ts.Center}});to._RANGE_HIGHLIGHT_DECORATION=je.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});to._FIND_SCOPE_DECORATION=je.register({description:"find-scope",className:"findScope",isWholeLine:!0});class Ive{constructor(e,t,n){this._editorSelection=e,this._ranges=t,this._replaceStrings=n,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const n=[];for(let r=0;r<this._ranges.length;r++)n.push({range:this._ranges[r],text:this._replaceStrings[r]});n.sort((r,a)=>L.compareRangesUsingStarts(r.range,a.range));const o=[];let s=n[0];for(let r=1;r<n.length;r++)s.range.endLineNumber===n[r].range.startLineNumber&&s.range.endColumn===n[r].range.startColumn?(s.range=s.range.plusRange(n[r].range),s.text=s.text+n[r].text):(o.push(s),s=n[r]);o.push(s);for(const r of o)t.addEditOperation(r.range,r.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function cU(i,e){if(i&&i[0]!==""){const t=u9(i,e,"-"),n=u9(i,e,"_");return t&&!n?g9(i,e,"-"):!t&&n?g9(i,e,"_"):i[0].toUpperCase()===i[0]?e.toUpperCase():i[0].toLowerCase()===i[0]?e.toLowerCase():rG(i[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function u9(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function g9(i,e,t){const n=e.split(t),o=i[0].split(t);let s="";return n.forEach((r,a)=>{s+=cU([o[a]],r)+t}),s.slice(0,-1)}class p9{constructor(e){this.staticValue=e,this.kind=0}}class Mve{constructor(e){this.pieces=e,this.kind=1}}class qm{static fromStaticValue(e){return new qm([Nu.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new p9(""):e.length===1&&e[0].staticValue!==null?this._state=new p9(e[0].staticValue):this._state=new Mve(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?cU(e,this._state.staticValue):this._state.staticValue;let n="";for(let o=0,s=this._state.pieces.length;o<s;o++){const r=this._state.pieces[o];if(r.staticValue!==null){n+=r.staticValue;continue}let a=qm._substitute(r.matchIndex,e);if(r.caseOps!==null&&r.caseOps.length>0){const l=[],d=r.caseOps.length;let h=0;for(let c=0,u=a.length;c<u;c++){if(h>=d){l.push(a.slice(c));break}switch(r.caseOps[h]){case"U":l.push(a[c].toUpperCase());break;case"u":l.push(a[c].toUpperCase()),h++;break;case"L":l.push(a[c].toLowerCase());break;case"l":l.push(a[c].toLowerCase()),h++;break;default:l.push(a[c])}}a=l.join("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e<t.length)return(t[e]||"")+n;n=String(e%10)+n,e=Math.floor(e/10)}return"$"+n}}class Nu{static staticValue(e){return new Nu(e,-1,null)}static caseOps(e,t){return new Nu(null,e,t)}constructor(e,t,n){this.staticValue=e,this.matchIndex=t,!n||n.length===0?this.caseOps=null:this.caseOps=n.slice(0)}}class Tve{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,n){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Nu.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=Nu.caseOps(e,n),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Nu.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new qm(this._result)}}function Rve(i){if(!i||i.length===0)return new qm(null);const e=[],t=new Tve(i);for(let n=0,o=i.length;n<o;n++){const s=i.charCodeAt(n);if(s===92){if(n++,n>=o)break;const r=i.charCodeAt(n);switch(r){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(`
|
|
@@ -1151,4 +1151,4 @@ Duplicate "graphql" modules cannot be used at the same time since different
|
|
|
1151
1151
|
versions may have different capabilities and behavior. The data from one
|
|
1152
1152
|
version used in the function from another could produce confusing and
|
|
1153
1153
|
spurious results.`)}}return!1};function ySe(i,e,t){const n=Object.create(null);for(const o of i)n[e(o)]=t(o);return n}function PK(i,e){const t=Object.create(null);for(const n of Object.keys(i))t[n]=e(i[n],n);return t}function Nk(i){if(i==null)return Object.create(null);if(Object.getPrototypeOf(i)===null)return i;const e=Object.create(null);for(const[t,n]of Object.entries(i))e[t]=n;return e}function Ik(i){if(i!=null||_d(!1,"Must provide name."),typeof i=="string"||_d(!1,"Expected name to be a string."),i.length===0)throw new dv("Expected name to be a non-empty string.");for(let e=1;e<i.length;++e)if(!pSe(i.charCodeAt(e)))throw new dv(`Names must only contain [_a-zA-Z0-9] but "${i}" does not.`);if(!gSe(i.charCodeAt(0)))throw new dv(`Names must start with [_a-zA-Z] but "${i}" does not.`);return i}function SSe(i){return AK(i,xSe)}function LSe(i){return AK(i,ISe)}function kSe(i){return typeof i=="function"?i():i}function DSe(i){return typeof i=="function"?i():i}var xSe=class{constructor(i){var e;this.name=Ik(i.name),this.description=i.description,this.isTypeOf=i.isTypeOf,this.extensions=Nk(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(e=i.extensionASTNodes)!==null&&e!==void 0?e:[],this._fields=()=>FK(i),this._interfaces=()=>OK(i),i.isTypeOf==null||typeof i.isTypeOf=="function"||_d(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${xk(i.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:BK(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function OK(i){var e;const t=kSe((e=i.interfaces)!==null&&e!==void 0?e:[]);return Array.isArray(t)||_d(!1,`${i.name} interfaces must be an Array or a function which returns an Array.`),t}function FK(i){const e=DSe(i.fields);return Wx(e)||_d(!1,`${i.name} fields must be an object with field names as keys or a function which returns such an object.`),PK(e,(t,n)=>{var o;Wx(t)||_d(!1,`${i.name}.${n} field config must be an object.`),t.resolve==null||typeof t.resolve=="function"||_d(!1,`${i.name}.${n} field resolver must be a function if provided, but got: ${xk(t.resolve)}.`);const s=(o=t.args)!==null&&o!==void 0?o:{};return Wx(s)||_d(!1,`${i.name}.${n} args must be an object with argument names as keys.`),{name:Ik(n),description:t.description,type:t.type,args:ESe(s),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:Nk(t.extensions),astNode:t.astNode}})}function ESe(i){return Object.entries(i).map(([e,t])=>({name:Ik(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Nk(t.extensions),astNode:t.astNode}))}function Wx(i){return NK(i)&&!Array.isArray(i)}function BK(i){return PK(i,e=>({description:e.description,type:e.type,args:NSe(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function NSe(i){return ySe(i,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}var ISe=class{constructor(i){var e;this.name=Ik(i.name),this.description=i.description,this.resolveType=i.resolveType,this.extensions=Nk(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(e=i.extensionASTNodes)!==null&&e!==void 0?e:[],this._fields=FK.bind(void 0,i),this._interfaces=OK.bind(void 0,i),i.resolveType==null||typeof i.resolveType=="function"||_d(!1,`${this.name} must provide "resolveType" as a function, but got: ${xk(i.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:BK(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},MSe=(i={})=>{const[e,t]=Eo.useState(null),[n,o]=Eo.useState(null),s=Eo.useMemo(()=>i.sharedLanguageService||new EK({schemaString:i.schema,schemaConfig:{buildSchemaOptions:{assumeValid:!0,assumeValidSDL:!0}}}),[i.sharedLanguageService]);return Eo.useEffect(()=>{if(n&&e){if(i.keyboardShortcuts)for(const h of i.keyboardShortcuts(e,n))e.addAction(h);for(const h of i.actions||[])e.addAction({id:h.id,label:h.label,keybindings:h.keybindings,contextMenuGroupId:h.contextMenuGroupId||"navigation",contextMenuOrder:h.contextMenuOrder,async run(c){const u=c.getModel(),g=c.getPosition();if(u&&g){const m=await s.buildBridgeForProviders(u,g);m&&h.onRun({editor:e,monaco:n,bridge:m})}}});const r=s.getModelChangeHandler();r(e,n,i.diagnosticsProviders||[],i.decorationsProviders||[]);const a=e.onDidChangeModelContent(()=>r(e,n,i.diagnosticsProviders||[],i.decorationsProviders||[])),l=n.languages.registerDefinitionProvider("graphql",s.getDefinitionProvider(i.definitionProviders||[])),d=n.languages.registerHoverProvider("graphql",s.getHoverProvider(i.hoverProviders||[]));return()=>{d==null||d.dispose(),l==null||l.dispose(),a==null||a.dispose()}}},[e,n]),{setEditor:t,setMonaco:o,editorRef:e,monacoRef:n,languageService:s,setSchema:r=>s.trySchema(r),editorApi:{jumpToType:r=>{s.getSchemaSafe().then(a=>{var l;if(a){const d=a.getType(r);if((l=d==null?void 0:d.astNode)!=null&&l.loc){const h=vT(d.astNode.loc);e==null||e.setSelection(h),e==null||e.revealPositionInCenter({column:0,lineNumber:h.startLineNumber},0)}}})},jumpToField(r,a){s.getSchemaSafe().then(l=>{var d;if(l){const h=l.getType(r);if(h&&(SSe(h)||LSe(h))){const c=h.getFields()[a];if((d=c==null?void 0:c.astNode)!=null&&d.loc){const u=vT(c.astNode.loc);e==null||e.setSelection(u),e==null||e.revealPositionInCenter({column:0,lineNumber:u.startLineNumber},0)}}}})},deselect:()=>e==null?void 0:e.setSelection(yK)}}};function TSe(i,e){const{resolvedTheme:t}=aSe(),{languageService:n,setMonaco:o,setEditor:s,editorApi:r,editorRef:a,setSchema:l}=MSe(i);Eo.useImperativeHandle(e,()=>r,[a,n]),Eo.useEffect(()=>{var m;n&&((m=i.onLanguageServiceReady)==null||m.call(i,n))},[n,i.onLanguageServiceReady]);const[d,h]=Eo.useState();Eo.useEffect(()=>{if(a&&i.onBlur){d==null||d.dispose();const m=a.onDidBlurEditorText(()=>{var f;(f=i.onBlur)==null||f.call(i,a.getValue()||"")});h(m)}},[i.onBlur,a]);const c=Eo.useCallback(m=>{var f;o(m),(f=i.beforeMount)==null||f.call(i,m)},[i.beforeMount]),u=Eo.useCallback((m,f)=>{var _;s(m),(_=i.onMount)==null||_.call(i,m,f)},[i.onMount]),g=Eo.useCallback(async(m,f)=>{var _,b;if((_=i.onChange)==null||_.call(i,m,f),!!m)try{const v=await l(m);v&&((b=i.onSchemaChange)==null||b.call(i,v,m))}catch(v){if(!i.onSchemaError)return;const C=v instanceof dv?v:new dv(v.message,void 0,void 0,void 0,void 0,v);i.onSchemaError([C],m,n)}},[i.onChange,i.onSchemaChange,i.onSchemaError]);return HK.jsx(oj,{height:"70vh",theme:t==="dark"?"vs-dark":"light",...i,beforeMount:c,onMount:u,onChange:g,options:{glyphMargin:!0,...i.options},language:"graphql",defaultValue:i.defaultValue||i.schema})}var RSe=Eo.forwardRef(TSe);const zSe=Object.freeze(Object.defineProperty({__proto__:null,EnrichedLanguageService:EK,SchemaEditor:RSe,coreDefinitionSource:LK,coreDiagnosticsSource:SK,coreHoverSource:kK,emptyLocation:yK,getRange:dS,locToRange:vT,removeFalsey:_T,toGraphQLPosition:DK,toMarkerData:bT,toMonacoRange:xK},Symbol.toStringTag,{value:"Module"}));export{zSe as i,yb as m,$H as t};
|
|
1154
|
-
//# sourceMappingURL=index-CnxM4IIa-
|
|
1154
|
+
//# sourceMappingURL=index-CnxM4IIa-CoekJPsT.js.map
|