@reformer/builder 3.0.0-beta.4 → 3.0.0-beta.5
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/{App-BzMuBv1U.js → App-BupMDG_t.js} +6 -6
- package/dist/assets/{BootError-CH4BoW__.js → BootError-CWnToysV.js} +1 -1
- package/dist/assets/{ChatPanel-9qHpjmLO.js → ChatPanel-B4wt7hBH.js} +3 -3
- package/dist/assets/{CodeEditor-CuHAtGtB.js → CodeEditor-Cca8j3Z3.js} +1 -1
- package/dist/assets/{MarkdownPreview-DwyxNTbn.js → MarkdownPreview-CmqjlfzE.js} +3 -3
- package/dist/assets/{RawJsonEditor-jYY7XCW2.js → RawJsonEditor-D5mwkIJa.js} +1 -1
- package/dist/assets/{boot-DTWnczkO.js → boot-BCJd6Ujw.js} +1 -1
- package/dist/assets/{byok-BM21dMSQ.js → byok-B9mwOrn0.js} +1 -1
- package/dist/assets/{editor.api-B4g2PJYj.js → editor.api-BWDeQ8t4.js} +1 -1
- package/dist/assets/{freemarker2-BlPZHoyx.js → freemarker2-DQaxDgne.js} +1 -1
- package/dist/assets/{handlebars-Dd8yor3z.js → handlebars-e1hbsCFi.js} +1 -1
- package/dist/assets/{html-C3wl1HPz.js → html-QXilGQ4Y.js} +1 -1
- package/dist/assets/index-BwhW-Atz.js +3 -0
- package/dist/assets/{index-OZOUDUGD.js → index-CF7RI8Bt.js} +1 -1
- package/dist/assets/{index-CU07HM8S.js → index-CLTXPf4k.js} +1 -1
- package/dist/assets/{index-CY45QPm-.js → index-DhcNqNgT.js} +2 -2
- package/dist/assets/{index-DCa3wFwm.js → index-U9gpmElw.js} +3 -3
- package/dist/assets/{index-BmJVVkA_.js → index-eRs9yupj.js} +1 -1
- package/dist/assets/{javascript-BF-EEvQI.js → javascript-C7cOj8ds.js} +1 -1
- package/dist/assets/{jsonMode-DGlgsS1d.js → jsonMode-DEqS3I0B.js} +1 -1
- package/dist/assets/{liquid-C0Gfg9TY.js → liquid-grdNDW6i.js} +1 -1
- package/dist/assets/{load-FrEYc91y.js → load-QsSQTL2T.js} +3 -3
- package/dist/assets/{mdx-bIG0iFaA.js → mdx-BGpbXlZS.js} +1 -1
- package/dist/assets/{monaco-languages-D5Bh48hh.js → monaco-languages-BZWxuU3F.js} +2 -2
- package/dist/assets/{monaco-setup-CAOrXrMd.js → monaco-setup-1PbjxubL.js} +3 -3
- package/dist/assets/{python-CciOb-4N.js → python-D5X7CY5Y.js} +1 -1
- package/dist/assets/{razor-cbEBt-Vr.js → razor-B2pbhZKy.js} +1 -1
- package/dist/assets/{reformer-ui-kit-11-BhXMU01R.js → reformer-ui-kit-11-bLtlFFvp.js} +1 -1
- package/dist/assets/{reformer-ui-kit-D8fAdwPH.js → reformer-ui-kit-tUqYBSLv.js} +1 -1
- package/dist/assets/{typescript-4hiO_obL.js → typescript-Ccn-IGn9.js} +1 -1
- package/dist/assets/{typescript-CNVC9ZHk.js → typescript-DL3gRsAd.js} +1 -1
- package/dist/assets/useFormField-BLbvmpme-Dwz_jyMW.js +1 -0
- package/dist/assets/{xml-RU_PX54U.js → xml-NgTjWpvZ.js} +1 -1
- package/dist/assets/{yaml-DsXE0ah6.js → yaml-CboCRslW.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/index-BC3M-FCZ.js +0 -3
- package/dist/assets/useFormField-BLbvmpme-BASGgtAT.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as L,A as tt,C as T,I as Ie,D as tl,b as Ue,g as If,M as q,c as U,d as vi,e as C,r as he,f as Mi,h as m,i as dR,j as Ee,R as ie,S as J,k as It,n as mi,o as pe,p as ae,q as P,s as F,K as Ge,t as V,u as A,v as et,w as I,x as te,O as wn,y as Xe,P as $,z as Tc,B as cR,F as Cp,G as Pc,H as Ux,$ as B,T as ce,J as re,L as Pe,N as ee,Q as Ke,U as no,V as W,W as Zh,X as xf,Y as hR,Z as Ve,_ as uR,a0 as Xr,a1 as Mt,a2 as K,a3 as so,a4 as G,a5 as Nt,a6 as _o,a7 as gR,a8 as $x,a9 as Le,aa as mt,ab as wm,ac as zx,ad as jx,ae as Te,af as Lf,ag as fR,ah as Oc,ai as Mc,aj as ye,ak as pR,al as pi,am as mR,an as oo,ao as Je,ap as Y,aq as ke,ar as tS,as as Es,at as _R,au as z,av as Vn,aw as od,ax as vR,ay as Ht,az as Xh,aA as bR,aB as iS,aC as Rn,aD as os,aE as wp,aF as As,aG as SR,aH as Tt,aI as Ac,aJ as Lt,aK as Tr,aL as CR,aM as rs,aN as nS,aO as dt,aP as qx,aQ as GC,aR as sS,aS as il,aT as wR,aU as yR,aV as Pt,aW as li,aX as it,aY as Ai,aZ as IR,a_ as Dl,a$ as Kx,b0 as oS,b1 as Gx,b2 as Yh,b3 as xR,b4 as LR,b5 as DR,b6 as Jh,b7 as ER,b8 as Ze,b9 as Gn,ba as Yt,bb as de,bc as Un,bd as RR,be as sn,bf as ri,bg as vo,bh as rS,bi as $d,bj as Pr,bk as Zx,bl as aS,bm as nt,bn as Fc,bo as ro,bp as rd,bq as ze,br as ym,bs as Ne,bt as R,bu as Xx,bv as NR,bw as le,bx as lS,by as we,bz as Df,bA as nl,bB as kR,bC as Yx,bD as zd,bE as ao,bF as jd,bG as Nn,bH as Ef,bI as dS,bJ as cS,bK as Ce,bL as Wi,bM as Wc,bN as TR,bO as Th,bP as hS,bQ as PR,bR as Qh,bS as uS,bT as sl,bU as Hi,bV as as,bW as fe,bX as ol,bY as Jx,bZ as _i,b_ as gS,b$ as rl,c0 as j,c1 as qd,c2 as Or,c3 as Kd,c4 as bo,c5 as Im,c6 as fS,c7 as Qx,c8 as OR,c9 as eL,ca as Hc,cb as xt,cc as Vc,cd as ni,ce as So,cf as MR,cg as xe,ch as ya,ci as ZC,cj as Bc,ck as tL,cl as Ia,cm as AR,cn as Ei,co as Co,cp as yn,cq as bi,cr as FR,cs as iL,ct as XC,cu as yp,cv as WR,cw as kt,cx as nL,cy as HR,cz as sL,cA as Uc,cB as VR,cC as oL,cD as di,cE as BR,cF as lo,cG as pS,cH as UR,cI as YC,cJ as JC,cK as $R,cL as xa,cM as rL,cN as zR,cO as jR,cP as Ln,cQ as qR,cR as KR,cS as Yn,cT as aL,cU as lL,cV as $t,cW as wo,cX as Gd,cY as dL,cZ as gi,c_ as Mr,c$ as Ar,d0 as GR,d1 as ZR,d2 as XR,d3 as cL,d4 as Ph,d5 as xm,d6 as YR,d7 as yt,d8 as mS,d9 as hL,da as st,db as Rf,dc as _S,dd as vS,de as JR,df as QR,dg as QC,dh as e0,di as $c,dj as Lm,dk as Fr,dl as We,dm as co,dn as t0,dp as ki,dq as si,dr as ew,ds as El,dt as Jn,du as on,dv as i0,dw as ci,dx as al,dy as Nf,dz as uL,dA as n0,dB as s0,dC as bS,dD as o0,dE as Zd,dF as r0,dG as tw,dH as a0,dI as eu,dJ as gL,dK as iw,dL as l0,dM as d0,dN as c0,dO as SS,dP as fL,dQ as pL,dR as mL,dS as _L,dT as h0,dU as Fs,dV as u0,dW as vL,dX as bL,dY as g0,dZ as kf,d_ as f0,d$ as SL,e0 as $e,e1 as CS,e2 as p0,e3 as Ao,e4 as nw,e5 as m0,e6 as _0,e7 as v0,e8 as b0,e9 as S0,ea as C0,eb as at,ec as Tf,ed as CL,ee as Rl,ef as Dm,eg as w0,eh as y0,ei as Em,ej as I0,ek as x0,el as L0,em as D0,en as E0,eo as R0,ep as Pf,eq as Of,er as wL,es as yL,et as N0,eu as Ye,ev as sw,ew as k0,ex as Nl,ey as T0,ez as ad,eA as wS,eB as ow,eC as Xd,eD as tu,eE as P0,eF as O0,eG as IL,eH as M0,eI as A0,eJ as F0,eK as rw,eL as xL,eM as _t,eN as ih,eO as W0,eP as yS,eQ as H0,eR as V0,eS as B0,eT as U0,eU as $0,eV as iu,eW as z0,eX as Qn,eY as Sd,eZ as Ct,e_ as Cd,e$ as ll,f0 as nh,f1 as LL,f2 as Ip,f3 as DL,f4 as EL,f5 as j0,f6 as q0,f7 as Oh,f8 as RL,f9 as K0,fa as G0,fb as Z0,fc as IS,fd as X0,fe as Ma,ff as xp,fg as Y0,fh as J0,fi as Q0,fj as aw,fk as lw,fl as dw,fm as eN,fn as tN,fo as $n,fp as en,fq as iN,fr as xs,fs as nN,ft as NL,fu as Ae,fv as dl,fw as In,fx as kL,fy as sN,fz as oN,fA as rN,fB as Rm,fC as Mf,fD as aN,fE as lN,fF as ai,fG as es,fH as TL,fI as xS,fJ as Be,fK as dN,fL as Mh,fM as LS,fN as cN,fO as hN,fP as uN,fQ as gN,fR as Ul,fS as cw,fT as fN,fU as DS,fV as pN,fW as mN,fX as _N,fY as Zn,fZ as ES,f_ as vN,f$ as Rs,g0 as bN,g1 as SN,g2 as RS,g3 as CN,g4 as wN,g5 as hw,g6 as NS,g7 as Nm,g8 as yN,g9 as IN,ga as xn,gb as PL,gc as OL,gd as xN,ge as ML,gf as AL,gg as LN,gh as DN,gi as EN,gj as uw,gk as gw,gl as RN,gm as NN,gn as kN,go as Aa,gp as TN,gq as PN,gr as ON,gs as kS,gt as MN,gu as AN,gv as FN,gw as nu,gx as WN,gy as HN,gz as fw,gA as pn,gB as pw,gC as Qe,gD as _e,gE as mw,gF as TS,gG as Ah,gH as VN,gI as BN,gJ as Af,gK as FL,gL as WL,gM as UN,gN as $N,gO as zN,gP as jN,gQ as qN,gR as km,gS as KN,gT as GN,gU as ZN,gV as XN,gW as HL,gX as YN,gY as su,gZ as ls,g_ as VL,g$ as JN,h0 as BL,h1 as QN,h2 as _w,h3 as vw,h4 as Tm,h5 as Lp,h6 as ek,h7 as tk,h8 as ik,h9 as kl,ha as UL,hb as nk,hc as ou,hd as $L,he as sk,hf as zL,hg as jL,hh as qL,hi as ok,hj as Pi,hk as rk,hl as Vo,hm as La,hn as sh,ho as KL,hp as GL,hq as Fh,hr as PS,hs as zn,ht as ak,hu as bw,hv as lk,hw as ZL,hx as XL,hy as dk,hz as OS,hA as ck,hB as Sw,hC as hk,hD as Ff,hE as uk,hF as gk,hG as fk,hH as Wf,hI as Hf,hJ as Vf,hK as Bf,hL as YL,hM as pk,hN as mk,hO as _k,hP as vk,hQ as JL,hR as MS,hS as QL,hT as bk,hU as Cw,hV as ww,hW as yw,hX as Sk,hY as Ck,hZ as wk,h_ as Iw,h$ as yk,i0 as Ik,i1 as zc,i2 as xk,i3 as Lk,i4 as e1,i5 as $l,i6 as Dk,i7 as Ek,i8 as Wh,i9 as Rk,ia as xw,ib as Nk,ic as kk,id as Tk,ie as AS,ig as FS,ih as Pk,ii as Ok,ij as Mk,ik as Ak,il as t1,im as Uf,io as Fk,ip as ru,iq as Ws,ir as Wk,is as Hk,it as Vk,iu as WS,iv as i1,iw as Lw,ix as Dw,iy as Bk,iz as Uk,iA as Ew,iB as Dp,iC as $k,iD as zk,iE as jk,iF as Ep,iG as n1,iH as s1,iI as o1,iJ as r1,iK as ts,iL as a1,iM as HS,iN as Rw,iO as qk,iP as l1,iQ as Kk,iR as Gk,iS as $f,iT as Yr,iU as zf,iV as jc,iW as Zk,iX as jf,iY as Xk,iZ as Nw,i_ as Yk,i$ as d1,j0 as zl,j1 as Jk,j2 as Qk,j3 as eT,j4 as tT,j5 as Tl,j6 as iT,j7 as c1,j8 as h1,j9 as nT,ja as qf,jb as Pm,jc as sT,jd as oT,je as rT,jf as Om,jg as aT,jh as lT,ji as dT,jj as cT,jk as hT,jl as uT,jm as gT,jn as fT,jo as u1,jp as pT,jq as mT,jr as _T,js as kw,jt as vT,ju as bT,jv as Ri,jw as g1,l as pt,jx as f1,jy as jl}from"./editor.api-B4g2PJYj.js";import"./index-CY45QPm-.js";class ST extends tt{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:L(101,"Toggle Collapse Unchanged Regions"),icon:U.map,toggled:T.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:T.has("isInDiffEditor"),menu:{when:T.has("isInDiffEditor"),id:q.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Ie),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class p1 extends tt{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:L(102,"Toggle Show Moved Code Blocks"),precondition:T.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ie),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class m1 extends tt{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:L(103,"Toggle Use Inline View When Space Is Limited"),precondition:T.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ie),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const qc=L(104,"Diff Editor");class CT extends vi{constructor(){super({id:"diffEditor.switchSide",title:L(105,"Switch Side"),icon:U.arrowSwap,precondition:T.has("isInDiffEditor"),f1:!0,category:qc})}runEditorCommand(e,t,i){const n=Jr(e);if(n instanceof tl){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class wT extends vi{constructor(){super({id:"diffEditor.exitCompareMove",title:L(106,"Exit Compare Move"),icon:U.close,precondition:C.comparingMovedCode,f1:!1,category:qc,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Jr(e);n instanceof tl&&n.exitCompareMove()}}class yT extends vi{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:L(107,"Collapse All Unchanged Regions"),icon:U.fold,precondition:T.has("isInDiffEditor"),f1:!0,category:qc})}runEditorCommand(e,t,...i){const n=Jr(e);n instanceof tl&&n.collapseAllUnchangedRegions()}}class IT extends vi{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:L(108,"Show All Unchanged Regions"),icon:U.unfold,precondition:T.has("isInDiffEditor"),f1:!0,category:qc})}runEditorCommand(e,t,...i){const n=Jr(e);n instanceof tl&&n.showAllUnchangedRegions()}}class Mm extends tt{constructor(){super({id:"diffEditor.revert",title:L(109,"Revert"),f1:!0,category:qc,precondition:T.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){const t=Jr(e);t instanceof tl&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){const i=xT(e,t.originalUri,t.modifiedUri);i instanceof tl&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const _1=L(110,"Accessible Diff Viewer"),Rg=class Rg extends tt{constructor(){super({id:Rg.id,title:L(111,"Go to Next Difference"),category:_1,precondition:T.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){Jr(e)?.accessibleDiffViewerNext()}};Rg.id="editor.action.accessibleDiffViewer.next";let Yd=Rg;const Ng=class Ng extends tt{constructor(){super({id:Ng.id,title:L(112,"Go to Previous Difference"),category:_1,precondition:T.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){Jr(e)?.accessibleDiffViewerPrev()}};Ng.id="editor.action.accessibleDiffViewer.prev";let au=Ng;function xT(o,e,t){return o.get(Ue).listDiffEditors().find(s=>{const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function Jr(o){const t=o.get(Ue).listDiffEditors(),i=If();if(i){for(const n of t)if(n.getContainerDomNode().contains(i))return n}return null}he(ST);he(p1);he(m1);Mi.appendMenuItem(q.EditorTitle,{command:{id:new m1().desc.id,title:m(135,"Use Inline View When Space Is Limited"),toggled:T.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:T.has("isInDiffEditor")},order:11,group:"1_diff",when:T.and(C.diffEditorRenderSideBySideInlineBreakpointReached,T.has("isInDiffEditor"))});Mi.appendMenuItem(q.EditorTitle,{command:{id:new p1().desc.id,title:m(136,"Show Moved Code Blocks"),icon:U.move,toggled:dR.create("config.diffEditor.experimental.showMoves",!0),precondition:T.has("isInDiffEditor")},order:10,group:"1_diff",when:T.has("isInDiffEditor")});he(Mm);for(const o of[{icon:U.arrowRight,key:C.diffEditorInlineMode.toNegated()},{icon:U.discard,key:C.diffEditorInlineMode}])Mi.appendMenuItem(q.DiffEditorHunkToolbar,{command:{id:new Mm().desc.id,title:m(137,"Revert Block"),icon:o.icon},when:T.and(C.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),Mi.appendMenuItem(q.DiffEditorSelectionToolbar,{command:{id:new Mm().desc.id,title:m(138,"Revert Selection"),icon:o.icon},when:T.and(C.diffEditorModifiedWritable,o.key),order:5,group:"primary"});he(CT);he(wT);he(yT);he(IT);Mi.appendMenuItem(q.EditorTitle,{command:{id:Yd.id,title:m(139,"Open Accessible Diff Viewer"),precondition:T.has("isInDiffEditor")},order:10,group:"2_diff",when:T.and(C.accessibleDiffViewerVisible.negate(),T.has("isInDiffEditor"))});Ee.registerCommandAlias("editor.action.diffReview.next",Yd.id);he(Yd);Ee.registerCommandAlias("editor.action.diffReview.prev",au.id);he(au);var LT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},DT=function(o,e){return function(t,i){e(t,i,o)}},Am;const Kf=new ie("selectionAnchorSet",!1);var Ko;let ho=(Ko=class{static get(e){return e.getContribution(Am.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Kf.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(J.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new It().appendText(m(834,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),mi(m(835,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(J.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},Am=Ko,Ko.ID="editor.contrib.selectionAnchorController",Ko);ho=Am=LT([DT(1,pe)],ho);class ET extends F{constructor(){super({id:"editor.action.setSelectionAnchor",label:L(836,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:C.editorTextFocus,primary:Ge(2089,2080),weight:100}})}async run(e,t){ho.get(t)?.setSelectionAnchor()}}class RT extends F{constructor(){super({id:"editor.action.goToSelectionAnchor",label:L(837,"Go to Selection Anchor"),precondition:Kf})}async run(e,t){ho.get(t)?.goToSelectionAnchor()}}class NT extends F{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:L(838,"Select from Anchor to Cursor"),precondition:Kf,kbOpts:{kbExpr:C.editorTextFocus,primary:Ge(2089,2089),weight:100}})}async run(e,t){ho.get(t)?.selectFromAnchorToCursor()}}class kT extends F{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:L(839,"Cancel Selection Anchor"),precondition:Kf,kbOpts:{kbExpr:C.editorTextFocus,primary:9,weight:100}})}async run(e,t){ho.get(t)?.cancelSelectionAnchor()}}ae(ho.ID,ho,4);P(ET);P(RT);P(NT);P(kT);const TT=V("editorOverviewRuler.bracketMatchForeground","#A0A0A0",m(840,"Overview ruler marker color for matching brackets."));class PT extends F{constructor(){super({id:"editor.action.jumpToBracket",label:L(842,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:C.editorTextFocus,primary:3165,weight:100}})}run(e,t){Wr.get(t)?.jumpToBracket()}}class OT extends F{constructor(){super({id:"editor.action.selectToBracket",label:L(843,"Select to Bracket"),precondition:void 0,metadata:{description:L(844,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let n=!0;i&&i.selectBrackets===!1&&(n=!1),Wr.get(t)?.selectToBracket(n)}}class MT extends F{constructor(){super({id:"editor.action.removeBrackets",label:L(845,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:C.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Wr.get(t)?.removeBrackets(this.id)}}class AT{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const bs=class bs extends A{static get(e){return e.getContribution(bs.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new et(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),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(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new J(r.lineNumber,r.column,r.lineNumber,r.column):new J(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const d=t.bracketPairs.findNextBracket(s);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(I.compareRangesUsingStarts);const[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new J(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let h=0,g=e.length;h<g;h++){const u=e[h];u.isEmpty()&&(s[r++]=u.getStartPosition())}s.length>1&&s.sort($.compare);const a=[];let l=0,d=0;const c=n.length;for(let h=0,g=s.length;h<g;h++){const u=s[h];for(;d<c&&n[d].position.isBefore(u);)d++;if(d<c&&n[d].position.equals(u))a[l++]=n[d];else{let f=t.bracketPairs.matchBracket(u,20),p=bs._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!f&&this._matchBrackets==="always"&&(f=t.bracketPairs.findEnclosingBrackets(u,20),p=bs._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new AT(u,f,p)}}this._lastBracketsData=a,this._lastVersionId=i}};bs.ID="editor.contrib.bracketMatchingController",bs._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=te.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",inlineClassName:"bracket-match-inline",overviewRuler:{color:Xe(TT),position:wn.Center}}),bs._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=te.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match",inlineClassName:"bracket-match-inline"});let Wr=bs;ae(Wr.ID,Wr,1);P(OT);P(PT);P(MT);Mi.appendMenuItem(q.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:m(841,"Go to &&Bracket")},order:2});Tc((o,e)=>{const t=o.getColor(cR);t&&e.addRule(`.monaco-editor .bracket-match-inline { color: ${t} !important; }`)});class FT{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new I(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new I(i,s,i,s),a)}else{const r=new I(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new I(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new J(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new J(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class v1 extends F{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new FT(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class WT extends v1{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:L(846,"Move Selected Text Left"),precondition:C.writable})}}class HT extends v1{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:L(847,"Move Selected Text Right"),precondition:C.writable})}}P(WT);P(HT);class VT extends F{constructor(){super({id:"editor.action.transposeLetters",label:L(848,"Transpose Letters"),precondition:C.writable,kbOpts:{kbExpr:C.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const c=l===d?r.getPosition():Cp.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),h=Cp.leftPosition(i,c),g=Cp.leftPosition(i,h),u=i.getValueInRange(I.fromPositions(g,h)),f=i.getValueInRange(I.fromPositions(h,c)),p=I.fromPositions(g,c);n.push(new Pc(p,f+u))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}P(VT);const hn=class hn{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+hn.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new hn((this.value?[this.value,...e]:e).join(hn.sep))}};hn.sep=".",hn.None=new hn("@@none@@"),hn.Empty=new hn("");let Oe=hn;var BT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},UT=function(o,e){return function(t,i){e(t,i,o)}};const $T=te.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Ux,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),kg=class kg extends A{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=B(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=B("span.icon");this.domNode.append(t),t.classList.add(...ce.asClassNameArray(U.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(75);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(61)||n.hasChanged(75))&&i()})),this._register(re(this.domNode,Pe.CLICK,n=>{this.delegate.cancel()}))}getId(){return kg.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)}};kg.baseId="editor.widget.inlineProgressWidget";let Fm=kg,lu=class extends A{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Ke),this._currentWidget=this._register(new Ke),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=no(()=>{const a=I.fromPositions(e);this._currentDecorations.set([{range:a,options:$T}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Fm,this.id,this._editor,a,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};lu=BT([UT(2,ee)],lu);var zT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tw=function(o,e){return function(t,i){e(t,i,o)}},Hh,Bs;let qt=(Bs=class{static get(e){return e.getContribution(Hh.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Ke,this._messageListeners=new W,this._mouseOverMessage=!1,this._editor=e,this._visible=Hh.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(mi(Zh(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Zh(e)){const n=this._messageListeners.add(xf(e,{actionHandler:(s,r)=>{this.closeMessage(),hR(this._openerService,s,r.isTrusted)}}));this._messageWidget.value=new Rp(this._editor,t,n.element)}else this._messageWidget.value=new Rp(this._editor,t,e);this._messageListeners.add(Ve.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&uR(If(),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(re(this._messageWidget.value.getDomNode(),Pe.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(re(this._messageWidget.value.getDomNode(),Pe.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new I(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Rp.fadeOut(this._messageWidget.value))}},Hh=Bs,Bs.ID="editor.contrib.messageController",Bs.MESSAGE_VISIBLE=new ie("messageVisible",!1,m(1333,"Whether the editor is currently showing an inline message")),Bs);qt=Hh=zT([Tw(1,pe),Tw(2,Xr)],qt);const jT=Mt.bindToContribution(qt.get);K(new jT({id:"leaveEditorMessage",precondition:qt.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let Rp=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};ae(qt.ID,qt,4);var VS=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jd=function(o,e){return function(t,i){e(t,i,o)}};class BS{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const Tg=class Tg extends BS{constructor(){super(Oe.Empty.append("text","plain")),this.id=Tg.id,this.dropMimeTypes=[Nt.text],this.pasteMimeTypes=[Nt.text]}async getEdit(e,t){const i=e.get(Nt.text);if(!i||e.has(Nt.uriList))return;const n=await i.asString();return{handledMimeType:Nt.text,title:m(965,"Insert Plain Text"),insertText:n,kind:this.kind}}};Tg.id="text";let Hr=Tg;class b1 extends BS{constructor(){super(Oe.Empty.append("uri","path","absolute")),this.dropMimeTypes=[Nt.uriList],this.pasteMimeTypes=[Nt.uriList]}async getEdit(e,t){const i=await S1(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===mt.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?m(966,"Insert Uris"):m(967,"Insert Uri"):r=i.length>1?m(968,"Insert Paths"):m(969,"Insert Path"),{handledMimeType:Nt.uriList,insertText:s,title:r,kind:this.kind}}}let du=class extends BS{constructor(e){super(Oe.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[Nt.uriList],this.pasteMimeTypes=[Nt.uriList]}async getEdit(e,t){const i=await S1(e);if(!i.length||t.isCancellationRequested)return;const n=_o(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?gR(r.uri,s):void 0}));if(n.length)return{handledMimeType:Nt.uriList,insertText:n.join(" "),title:i.length>1?m(970,"Insert Relative Paths"):m(971,"Insert Relative Path"),kind:this.kind}}};du=VS([Jd(0,so)],du);class qT{constructor(){this.kind=new Oe("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Nt.text}]}async provideDocumentPasteEdits(e,t,i,n,s){if(n.triggerKind!==wm.PasteAs&&!n.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:m(972,"Insert HTML"),kind:this.kind}]}}}async function S1(o){const e=o.get(Nt.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of $x.parse(t))try{i.push({uri:Le.parse(n),originalText:n})}catch{}return i}const Bo={scheme:"*",hasAccessToAllModels:!0};let Wm=class extends A{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(Bo,new Hr)),this._register(e.documentDropEditProvider.register(Bo,new b1)),this._register(e.documentDropEditProvider.register(Bo,new du(t)))}};Wm=VS([Jd(0,G),Jd(1,so)],Wm);let Hm=class extends A{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(Bo,new Hr)),this._register(e.documentPasteEditProvider.register(Bo,new b1)),this._register(e.documentPasteEditProvider.register(Bo,new du(t))),this._register(e.documentPasteEditProvider.register(Bo,new qT))}};Hm=VS([Jd(0,G),Jd(1,so)],Hm);const xi=class xi{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=xi._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(xi.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(xi.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(xi.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(xi.isVariableCharacter(i)||xi.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof xi._table[i]>"u"&&!xi.isDigitCharacter(i)&&!xi.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};xi._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let Vm=xi;class Pl{constructor(){this._children=[]}appendChild(e){return e instanceof Rt&&this._children[this._children.length-1]instanceof Rt?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function r(a,l){for(const d of a)d.parent=l,r(d.children,d)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof Kc)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Rt extends Pl{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Rt(this.value)}}class C1 extends Pl{}class fi extends C1{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Ol?this._children[0]:void 0}clone(){const e=new fi(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Ol extends Pl{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Rt&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Ol;return this.options.forEach(e.appendChild,e),e}}class US extends Pl{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof Ki&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Ki){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new US;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Ki extends Pl{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":this.shorthandName==="kebabcase"?e?this._toKebabCase(e):"":this.shorthandName==="snakecase"?e?this._toSnakeCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toKebabCase(e){if(!e.match(/[\p{L}0-9]+/gu))return e;if(!e.match(/[\p{L}0-9]/u))return e.trim().toLowerCase().replace(/^_+|_+$/g,"").replace(/[\s_]+/g,"-");const i=e.trim().replace(/^_+|_+$/g,""),n=i.match(new RegExp("\\p{Lu}{2,}(?=\\p{Lu}\\p{Ll}+[0-9]*|[\\s_-]|$)|\\p{Lu}?\\p{Ll}+[0-9]*|\\p{Lu}(?=\\p{Lu}\\p{Ll})|\\p{Lu}(?=[\\s_-]|$)|[0-9]+","gu"));return n?n.map(s=>s.toLowerCase()).join("-"):i.split(/[\s_-]+/).filter(s=>s.length>0).map(s=>s.toLowerCase()).join("-")}_toPascalCase(e){const t=e.match(/[\p{L}0-9]+/gu);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[\p{L}0-9]+/gu);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toSnakeCase(e){return e.replace(new RegExp("(\\p{Ll})(\\p{Lu})","gu"),"$1_$2").replace(/[\s\-]+/g,"_").toLowerCase()}clone(){return new Ki(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Vr extends C1{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Rt(t)],!0):!1}clone(){const e=new Vr(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Pw(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class Kc extends Pl{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof fi&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return Pw([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof fi&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Vr&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new Kc;return e._children=this.children.map(t=>t.clone()),e}walk(e){Pw(this.children,e)}}class Br{constructor(){this._scanner=new Vm,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new Kc;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(l=>(l instanceof fi&&(l.isFinalTabstop?n.set(0,void 0):!n.has(l.index)&&l.children.length>0?n.set(l.index,l.children):s.push(l)),!0));const r=(l,d)=>{const c=n.get(l.index);if(!c)return;const h=new fi(l.index);h.transform=l.transform;for(const g of c){const u=g.clone();h.appendChild(u),u instanceof fi&&n.has(u.index)&&!d.has(u.index)&&(d.add(u.index),r(u,d),d.delete(u.index))}t.replace(l,[h])},a=new Set;for(const l of s)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new fi(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Rt(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new fi(Number(t)):new Vr(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new fi(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new Rt("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new Ol;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(r),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Rt(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new Vr(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new Rt("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new US;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new Rt(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Ki(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Ki(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Ki(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new Ki(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new Ki(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const r=this._until(4);if(r)return e.appendChild(new Ki(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new Ki(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Rt(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function w1(o,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new zx(o,{range:i,text:typeof t.insertText=="string"?Br.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function y1(o){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of o)for(const a of r.yieldTo??[])for(const l of o)if(l!==r&&e(a,l)){let d=t.get(r);d||(d=[],t.set(r,d)),d.push(l)}if(!t.size)return Array.from(o);const i=new Set,n=[];function s(r){if(!r.length)return[];const a=r[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return s(r.slice(1));let l=[];const d=t.get(a);return d&&(n.push(a),l=s(d),n.pop()),i.add(a),[...l,a,...s(r.slice(1))]}return s(Array.from(o))}function Np(o,e){return e&&(o.stack||o.stacktrace)?m(33,"{0}: {1}",Mw(o),Ow(o.stack)||Ow(o.stacktrace)):Mw(o)}function Ow(o){return Array.isArray(o)?o.join(`
|
|
1
|
+
import{a as L,A as tt,C as T,I as Ie,D as tl,b as Ue,g as If,M as q,c as U,d as vi,e as C,r as he,f as Mi,h as m,i as dR,j as Ee,R as ie,S as J,k as It,n as mi,o as pe,p as ae,q as P,s as F,K as Ge,t as V,u as A,v as et,w as I,x as te,O as wn,y as Xe,P as $,z as Tc,B as cR,F as Cp,G as Pc,H as Ux,$ as B,T as ce,J as re,L as Pe,N as ee,Q as Ke,U as no,V as W,W as Zh,X as xf,Y as hR,Z as Ve,_ as uR,a0 as Xr,a1 as Mt,a2 as K,a3 as so,a4 as G,a5 as Nt,a6 as _o,a7 as gR,a8 as $x,a9 as Le,aa as mt,ab as wm,ac as zx,ad as jx,ae as Te,af as Lf,ag as fR,ah as Oc,ai as Mc,aj as ye,ak as pR,al as pi,am as mR,an as oo,ao as Je,ap as Y,aq as ke,ar as tS,as as Es,at as _R,au as z,av as Vn,aw as od,ax as vR,ay as Ht,az as Xh,aA as bR,aB as iS,aC as Rn,aD as os,aE as wp,aF as As,aG as SR,aH as Tt,aI as Ac,aJ as Lt,aK as Tr,aL as CR,aM as rs,aN as nS,aO as dt,aP as qx,aQ as GC,aR as sS,aS as il,aT as wR,aU as yR,aV as Pt,aW as li,aX as it,aY as Ai,aZ as IR,a_ as Dl,a$ as Kx,b0 as oS,b1 as Gx,b2 as Yh,b3 as xR,b4 as LR,b5 as DR,b6 as Jh,b7 as ER,b8 as Ze,b9 as Gn,ba as Yt,bb as de,bc as Un,bd as RR,be as sn,bf as ri,bg as vo,bh as rS,bi as $d,bj as Pr,bk as Zx,bl as aS,bm as nt,bn as Fc,bo as ro,bp as rd,bq as ze,br as ym,bs as Ne,bt as R,bu as Xx,bv as NR,bw as le,bx as lS,by as we,bz as Df,bA as nl,bB as kR,bC as Yx,bD as zd,bE as ao,bF as jd,bG as Nn,bH as Ef,bI as dS,bJ as cS,bK as Ce,bL as Wi,bM as Wc,bN as TR,bO as Th,bP as hS,bQ as PR,bR as Qh,bS as uS,bT as sl,bU as Hi,bV as as,bW as fe,bX as ol,bY as Jx,bZ as _i,b_ as gS,b$ as rl,c0 as j,c1 as qd,c2 as Or,c3 as Kd,c4 as bo,c5 as Im,c6 as fS,c7 as Qx,c8 as OR,c9 as eL,ca as Hc,cb as xt,cc as Vc,cd as ni,ce as So,cf as MR,cg as xe,ch as ya,ci as ZC,cj as Bc,ck as tL,cl as Ia,cm as AR,cn as Ei,co as Co,cp as yn,cq as bi,cr as FR,cs as iL,ct as XC,cu as yp,cv as WR,cw as kt,cx as nL,cy as HR,cz as sL,cA as Uc,cB as VR,cC as oL,cD as di,cE as BR,cF as lo,cG as pS,cH as UR,cI as YC,cJ as JC,cK as $R,cL as xa,cM as rL,cN as zR,cO as jR,cP as Ln,cQ as qR,cR as KR,cS as Yn,cT as aL,cU as lL,cV as $t,cW as wo,cX as Gd,cY as dL,cZ as gi,c_ as Mr,c$ as Ar,d0 as GR,d1 as ZR,d2 as XR,d3 as cL,d4 as Ph,d5 as xm,d6 as YR,d7 as yt,d8 as mS,d9 as hL,da as st,db as Rf,dc as _S,dd as vS,de as JR,df as QR,dg as QC,dh as e0,di as $c,dj as Lm,dk as Fr,dl as We,dm as co,dn as t0,dp as ki,dq as si,dr as ew,ds as El,dt as Jn,du as on,dv as i0,dw as ci,dx as al,dy as Nf,dz as uL,dA as n0,dB as s0,dC as bS,dD as o0,dE as Zd,dF as r0,dG as tw,dH as a0,dI as eu,dJ as gL,dK as iw,dL as l0,dM as d0,dN as c0,dO as SS,dP as fL,dQ as pL,dR as mL,dS as _L,dT as h0,dU as Fs,dV as u0,dW as vL,dX as bL,dY as g0,dZ as kf,d_ as f0,d$ as SL,e0 as $e,e1 as CS,e2 as p0,e3 as Ao,e4 as nw,e5 as m0,e6 as _0,e7 as v0,e8 as b0,e9 as S0,ea as C0,eb as at,ec as Tf,ed as CL,ee as Rl,ef as Dm,eg as w0,eh as y0,ei as Em,ej as I0,ek as x0,el as L0,em as D0,en as E0,eo as R0,ep as Pf,eq as Of,er as wL,es as yL,et as N0,eu as Ye,ev as sw,ew as k0,ex as Nl,ey as T0,ez as ad,eA as wS,eB as ow,eC as Xd,eD as tu,eE as P0,eF as O0,eG as IL,eH as M0,eI as A0,eJ as F0,eK as rw,eL as xL,eM as _t,eN as ih,eO as W0,eP as yS,eQ as H0,eR as V0,eS as B0,eT as U0,eU as $0,eV as iu,eW as z0,eX as Qn,eY as Sd,eZ as Ct,e_ as Cd,e$ as ll,f0 as nh,f1 as LL,f2 as Ip,f3 as DL,f4 as EL,f5 as j0,f6 as q0,f7 as Oh,f8 as RL,f9 as K0,fa as G0,fb as Z0,fc as IS,fd as X0,fe as Ma,ff as xp,fg as Y0,fh as J0,fi as Q0,fj as aw,fk as lw,fl as dw,fm as eN,fn as tN,fo as $n,fp as en,fq as iN,fr as xs,fs as nN,ft as NL,fu as Ae,fv as dl,fw as In,fx as kL,fy as sN,fz as oN,fA as rN,fB as Rm,fC as Mf,fD as aN,fE as lN,fF as ai,fG as es,fH as TL,fI as xS,fJ as Be,fK as dN,fL as Mh,fM as LS,fN as cN,fO as hN,fP as uN,fQ as gN,fR as Ul,fS as cw,fT as fN,fU as DS,fV as pN,fW as mN,fX as _N,fY as Zn,fZ as ES,f_ as vN,f$ as Rs,g0 as bN,g1 as SN,g2 as RS,g3 as CN,g4 as wN,g5 as hw,g6 as NS,g7 as Nm,g8 as yN,g9 as IN,ga as xn,gb as PL,gc as OL,gd as xN,ge as ML,gf as AL,gg as LN,gh as DN,gi as EN,gj as uw,gk as gw,gl as RN,gm as NN,gn as kN,go as Aa,gp as TN,gq as PN,gr as ON,gs as kS,gt as MN,gu as AN,gv as FN,gw as nu,gx as WN,gy as HN,gz as fw,gA as pn,gB as pw,gC as Qe,gD as _e,gE as mw,gF as TS,gG as Ah,gH as VN,gI as BN,gJ as Af,gK as FL,gL as WL,gM as UN,gN as $N,gO as zN,gP as jN,gQ as qN,gR as km,gS as KN,gT as GN,gU as ZN,gV as XN,gW as HL,gX as YN,gY as su,gZ as ls,g_ as VL,g$ as JN,h0 as BL,h1 as QN,h2 as _w,h3 as vw,h4 as Tm,h5 as Lp,h6 as ek,h7 as tk,h8 as ik,h9 as kl,ha as UL,hb as nk,hc as ou,hd as $L,he as sk,hf as zL,hg as jL,hh as qL,hi as ok,hj as Pi,hk as rk,hl as Vo,hm as La,hn as sh,ho as KL,hp as GL,hq as Fh,hr as PS,hs as zn,ht as ak,hu as bw,hv as lk,hw as ZL,hx as XL,hy as dk,hz as OS,hA as ck,hB as Sw,hC as hk,hD as Ff,hE as uk,hF as gk,hG as fk,hH as Wf,hI as Hf,hJ as Vf,hK as Bf,hL as YL,hM as pk,hN as mk,hO as _k,hP as vk,hQ as JL,hR as MS,hS as QL,hT as bk,hU as Cw,hV as ww,hW as yw,hX as Sk,hY as Ck,hZ as wk,h_ as Iw,h$ as yk,i0 as Ik,i1 as zc,i2 as xk,i3 as Lk,i4 as e1,i5 as $l,i6 as Dk,i7 as Ek,i8 as Wh,i9 as Rk,ia as xw,ib as Nk,ic as kk,id as Tk,ie as AS,ig as FS,ih as Pk,ii as Ok,ij as Mk,ik as Ak,il as t1,im as Uf,io as Fk,ip as ru,iq as Ws,ir as Wk,is as Hk,it as Vk,iu as WS,iv as i1,iw as Lw,ix as Dw,iy as Bk,iz as Uk,iA as Ew,iB as Dp,iC as $k,iD as zk,iE as jk,iF as Ep,iG as n1,iH as s1,iI as o1,iJ as r1,iK as ts,iL as a1,iM as HS,iN as Rw,iO as qk,iP as l1,iQ as Kk,iR as Gk,iS as $f,iT as Yr,iU as zf,iV as jc,iW as Zk,iX as jf,iY as Xk,iZ as Nw,i_ as Yk,i$ as d1,j0 as zl,j1 as Jk,j2 as Qk,j3 as eT,j4 as tT,j5 as Tl,j6 as iT,j7 as c1,j8 as h1,j9 as nT,ja as qf,jb as Pm,jc as sT,jd as oT,je as rT,jf as Om,jg as aT,jh as lT,ji as dT,jj as cT,jk as hT,jl as uT,jm as gT,jn as fT,jo as u1,jp as pT,jq as mT,jr as _T,js as kw,jt as vT,ju as bT,jv as Ri,jw as g1,l as pt,jx as f1,jy as jl}from"./editor.api-BWDeQ8t4.js";import"./index-DhcNqNgT.js";class ST extends tt{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:L(101,"Toggle Collapse Unchanged Regions"),icon:U.map,toggled:T.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:T.has("isInDiffEditor"),menu:{when:T.has("isInDiffEditor"),id:q.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Ie),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class p1 extends tt{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:L(102,"Toggle Show Moved Code Blocks"),precondition:T.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ie),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class m1 extends tt{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:L(103,"Toggle Use Inline View When Space Is Limited"),precondition:T.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ie),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const qc=L(104,"Diff Editor");class CT extends vi{constructor(){super({id:"diffEditor.switchSide",title:L(105,"Switch Side"),icon:U.arrowSwap,precondition:T.has("isInDiffEditor"),f1:!0,category:qc})}runEditorCommand(e,t,i){const n=Jr(e);if(n instanceof tl){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class wT extends vi{constructor(){super({id:"diffEditor.exitCompareMove",title:L(106,"Exit Compare Move"),icon:U.close,precondition:C.comparingMovedCode,f1:!1,category:qc,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Jr(e);n instanceof tl&&n.exitCompareMove()}}class yT extends vi{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:L(107,"Collapse All Unchanged Regions"),icon:U.fold,precondition:T.has("isInDiffEditor"),f1:!0,category:qc})}runEditorCommand(e,t,...i){const n=Jr(e);n instanceof tl&&n.collapseAllUnchangedRegions()}}class IT extends vi{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:L(108,"Show All Unchanged Regions"),icon:U.unfold,precondition:T.has("isInDiffEditor"),f1:!0,category:qc})}runEditorCommand(e,t,...i){const n=Jr(e);n instanceof tl&&n.showAllUnchangedRegions()}}class Mm extends tt{constructor(){super({id:"diffEditor.revert",title:L(109,"Revert"),f1:!0,category:qc,precondition:T.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){const t=Jr(e);t instanceof tl&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){const i=xT(e,t.originalUri,t.modifiedUri);i instanceof tl&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const _1=L(110,"Accessible Diff Viewer"),Rg=class Rg extends tt{constructor(){super({id:Rg.id,title:L(111,"Go to Next Difference"),category:_1,precondition:T.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){Jr(e)?.accessibleDiffViewerNext()}};Rg.id="editor.action.accessibleDiffViewer.next";let Yd=Rg;const Ng=class Ng extends tt{constructor(){super({id:Ng.id,title:L(112,"Go to Previous Difference"),category:_1,precondition:T.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){Jr(e)?.accessibleDiffViewerPrev()}};Ng.id="editor.action.accessibleDiffViewer.prev";let au=Ng;function xT(o,e,t){return o.get(Ue).listDiffEditors().find(s=>{const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function Jr(o){const t=o.get(Ue).listDiffEditors(),i=If();if(i){for(const n of t)if(n.getContainerDomNode().contains(i))return n}return null}he(ST);he(p1);he(m1);Mi.appendMenuItem(q.EditorTitle,{command:{id:new m1().desc.id,title:m(135,"Use Inline View When Space Is Limited"),toggled:T.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:T.has("isInDiffEditor")},order:11,group:"1_diff",when:T.and(C.diffEditorRenderSideBySideInlineBreakpointReached,T.has("isInDiffEditor"))});Mi.appendMenuItem(q.EditorTitle,{command:{id:new p1().desc.id,title:m(136,"Show Moved Code Blocks"),icon:U.move,toggled:dR.create("config.diffEditor.experimental.showMoves",!0),precondition:T.has("isInDiffEditor")},order:10,group:"1_diff",when:T.has("isInDiffEditor")});he(Mm);for(const o of[{icon:U.arrowRight,key:C.diffEditorInlineMode.toNegated()},{icon:U.discard,key:C.diffEditorInlineMode}])Mi.appendMenuItem(q.DiffEditorHunkToolbar,{command:{id:new Mm().desc.id,title:m(137,"Revert Block"),icon:o.icon},when:T.and(C.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),Mi.appendMenuItem(q.DiffEditorSelectionToolbar,{command:{id:new Mm().desc.id,title:m(138,"Revert Selection"),icon:o.icon},when:T.and(C.diffEditorModifiedWritable,o.key),order:5,group:"primary"});he(CT);he(wT);he(yT);he(IT);Mi.appendMenuItem(q.EditorTitle,{command:{id:Yd.id,title:m(139,"Open Accessible Diff Viewer"),precondition:T.has("isInDiffEditor")},order:10,group:"2_diff",when:T.and(C.accessibleDiffViewerVisible.negate(),T.has("isInDiffEditor"))});Ee.registerCommandAlias("editor.action.diffReview.next",Yd.id);he(Yd);Ee.registerCommandAlias("editor.action.diffReview.prev",au.id);he(au);var LT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},DT=function(o,e){return function(t,i){e(t,i,o)}},Am;const Kf=new ie("selectionAnchorSet",!1);var Ko;let ho=(Ko=class{static get(e){return e.getContribution(Am.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Kf.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(J.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new It().appendText(m(834,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),mi(m(835,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(J.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},Am=Ko,Ko.ID="editor.contrib.selectionAnchorController",Ko);ho=Am=LT([DT(1,pe)],ho);class ET extends F{constructor(){super({id:"editor.action.setSelectionAnchor",label:L(836,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:C.editorTextFocus,primary:Ge(2089,2080),weight:100}})}async run(e,t){ho.get(t)?.setSelectionAnchor()}}class RT extends F{constructor(){super({id:"editor.action.goToSelectionAnchor",label:L(837,"Go to Selection Anchor"),precondition:Kf})}async run(e,t){ho.get(t)?.goToSelectionAnchor()}}class NT extends F{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:L(838,"Select from Anchor to Cursor"),precondition:Kf,kbOpts:{kbExpr:C.editorTextFocus,primary:Ge(2089,2089),weight:100}})}async run(e,t){ho.get(t)?.selectFromAnchorToCursor()}}class kT extends F{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:L(839,"Cancel Selection Anchor"),precondition:Kf,kbOpts:{kbExpr:C.editorTextFocus,primary:9,weight:100}})}async run(e,t){ho.get(t)?.cancelSelectionAnchor()}}ae(ho.ID,ho,4);P(ET);P(RT);P(NT);P(kT);const TT=V("editorOverviewRuler.bracketMatchForeground","#A0A0A0",m(840,"Overview ruler marker color for matching brackets."));class PT extends F{constructor(){super({id:"editor.action.jumpToBracket",label:L(842,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:C.editorTextFocus,primary:3165,weight:100}})}run(e,t){Wr.get(t)?.jumpToBracket()}}class OT extends F{constructor(){super({id:"editor.action.selectToBracket",label:L(843,"Select to Bracket"),precondition:void 0,metadata:{description:L(844,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let n=!0;i&&i.selectBrackets===!1&&(n=!1),Wr.get(t)?.selectToBracket(n)}}class MT extends F{constructor(){super({id:"editor.action.removeBrackets",label:L(845,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:C.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Wr.get(t)?.removeBrackets(this.id)}}class AT{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const bs=class bs extends A{static get(e){return e.getContribution(bs.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new et(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),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(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new J(r.lineNumber,r.column,r.lineNumber,r.column):new J(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const d=t.bracketPairs.findNextBracket(s);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(I.compareRangesUsingStarts);const[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new J(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let h=0,g=e.length;h<g;h++){const u=e[h];u.isEmpty()&&(s[r++]=u.getStartPosition())}s.length>1&&s.sort($.compare);const a=[];let l=0,d=0;const c=n.length;for(let h=0,g=s.length;h<g;h++){const u=s[h];for(;d<c&&n[d].position.isBefore(u);)d++;if(d<c&&n[d].position.equals(u))a[l++]=n[d];else{let f=t.bracketPairs.matchBracket(u,20),p=bs._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!f&&this._matchBrackets==="always"&&(f=t.bracketPairs.findEnclosingBrackets(u,20),p=bs._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new AT(u,f,p)}}this._lastBracketsData=a,this._lastVersionId=i}};bs.ID="editor.contrib.bracketMatchingController",bs._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=te.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",inlineClassName:"bracket-match-inline",overviewRuler:{color:Xe(TT),position:wn.Center}}),bs._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=te.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match",inlineClassName:"bracket-match-inline"});let Wr=bs;ae(Wr.ID,Wr,1);P(OT);P(PT);P(MT);Mi.appendMenuItem(q.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:m(841,"Go to &&Bracket")},order:2});Tc((o,e)=>{const t=o.getColor(cR);t&&e.addRule(`.monaco-editor .bracket-match-inline { color: ${t} !important; }`)});class FT{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new I(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new I(i,s,i,s),a)}else{const r=new I(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new I(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new J(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new J(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class v1 extends F{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new FT(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class WT extends v1{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:L(846,"Move Selected Text Left"),precondition:C.writable})}}class HT extends v1{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:L(847,"Move Selected Text Right"),precondition:C.writable})}}P(WT);P(HT);class VT extends F{constructor(){super({id:"editor.action.transposeLetters",label:L(848,"Transpose Letters"),precondition:C.writable,kbOpts:{kbExpr:C.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const c=l===d?r.getPosition():Cp.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),h=Cp.leftPosition(i,c),g=Cp.leftPosition(i,h),u=i.getValueInRange(I.fromPositions(g,h)),f=i.getValueInRange(I.fromPositions(h,c)),p=I.fromPositions(g,c);n.push(new Pc(p,f+u))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}P(VT);const hn=class hn{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+hn.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new hn((this.value?[this.value,...e]:e).join(hn.sep))}};hn.sep=".",hn.None=new hn("@@none@@"),hn.Empty=new hn("");let Oe=hn;var BT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},UT=function(o,e){return function(t,i){e(t,i,o)}};const $T=te.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Ux,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),kg=class kg extends A{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=B(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=B("span.icon");this.domNode.append(t),t.classList.add(...ce.asClassNameArray(U.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(75);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(61)||n.hasChanged(75))&&i()})),this._register(re(this.domNode,Pe.CLICK,n=>{this.delegate.cancel()}))}getId(){return kg.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)}};kg.baseId="editor.widget.inlineProgressWidget";let Fm=kg,lu=class extends A{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Ke),this._currentWidget=this._register(new Ke),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=no(()=>{const a=I.fromPositions(e);this._currentDecorations.set([{range:a,options:$T}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Fm,this.id,this._editor,a,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};lu=BT([UT(2,ee)],lu);var zT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tw=function(o,e){return function(t,i){e(t,i,o)}},Hh,Bs;let qt=(Bs=class{static get(e){return e.getContribution(Hh.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Ke,this._messageListeners=new W,this._mouseOverMessage=!1,this._editor=e,this._visible=Hh.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(mi(Zh(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Zh(e)){const n=this._messageListeners.add(xf(e,{actionHandler:(s,r)=>{this.closeMessage(),hR(this._openerService,s,r.isTrusted)}}));this._messageWidget.value=new Rp(this._editor,t,n.element)}else this._messageWidget.value=new Rp(this._editor,t,e);this._messageListeners.add(Ve.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&uR(If(),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(re(this._messageWidget.value.getDomNode(),Pe.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(re(this._messageWidget.value.getDomNode(),Pe.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new I(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Rp.fadeOut(this._messageWidget.value))}},Hh=Bs,Bs.ID="editor.contrib.messageController",Bs.MESSAGE_VISIBLE=new ie("messageVisible",!1,m(1333,"Whether the editor is currently showing an inline message")),Bs);qt=Hh=zT([Tw(1,pe),Tw(2,Xr)],qt);const jT=Mt.bindToContribution(qt.get);K(new jT({id:"leaveEditorMessage",precondition:qt.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let Rp=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};ae(qt.ID,qt,4);var VS=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jd=function(o,e){return function(t,i){e(t,i,o)}};class BS{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const Tg=class Tg extends BS{constructor(){super(Oe.Empty.append("text","plain")),this.id=Tg.id,this.dropMimeTypes=[Nt.text],this.pasteMimeTypes=[Nt.text]}async getEdit(e,t){const i=e.get(Nt.text);if(!i||e.has(Nt.uriList))return;const n=await i.asString();return{handledMimeType:Nt.text,title:m(965,"Insert Plain Text"),insertText:n,kind:this.kind}}};Tg.id="text";let Hr=Tg;class b1 extends BS{constructor(){super(Oe.Empty.append("uri","path","absolute")),this.dropMimeTypes=[Nt.uriList],this.pasteMimeTypes=[Nt.uriList]}async getEdit(e,t){const i=await S1(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===mt.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?m(966,"Insert Uris"):m(967,"Insert Uri"):r=i.length>1?m(968,"Insert Paths"):m(969,"Insert Path"),{handledMimeType:Nt.uriList,insertText:s,title:r,kind:this.kind}}}let du=class extends BS{constructor(e){super(Oe.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[Nt.uriList],this.pasteMimeTypes=[Nt.uriList]}async getEdit(e,t){const i=await S1(e);if(!i.length||t.isCancellationRequested)return;const n=_o(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?gR(r.uri,s):void 0}));if(n.length)return{handledMimeType:Nt.uriList,insertText:n.join(" "),title:i.length>1?m(970,"Insert Relative Paths"):m(971,"Insert Relative Path"),kind:this.kind}}};du=VS([Jd(0,so)],du);class qT{constructor(){this.kind=new Oe("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Nt.text}]}async provideDocumentPasteEdits(e,t,i,n,s){if(n.triggerKind!==wm.PasteAs&&!n.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:m(972,"Insert HTML"),kind:this.kind}]}}}async function S1(o){const e=o.get(Nt.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of $x.parse(t))try{i.push({uri:Le.parse(n),originalText:n})}catch{}return i}const Bo={scheme:"*",hasAccessToAllModels:!0};let Wm=class extends A{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(Bo,new Hr)),this._register(e.documentDropEditProvider.register(Bo,new b1)),this._register(e.documentDropEditProvider.register(Bo,new du(t)))}};Wm=VS([Jd(0,G),Jd(1,so)],Wm);let Hm=class extends A{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(Bo,new Hr)),this._register(e.documentPasteEditProvider.register(Bo,new b1)),this._register(e.documentPasteEditProvider.register(Bo,new du(t))),this._register(e.documentPasteEditProvider.register(Bo,new qT))}};Hm=VS([Jd(0,G),Jd(1,so)],Hm);const xi=class xi{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=xi._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(xi.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(xi.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(xi.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(xi.isVariableCharacter(i)||xi.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof xi._table[i]>"u"&&!xi.isDigitCharacter(i)&&!xi.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};xi._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let Vm=xi;class Pl{constructor(){this._children=[]}appendChild(e){return e instanceof Rt&&this._children[this._children.length-1]instanceof Rt?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function r(a,l){for(const d of a)d.parent=l,r(d.children,d)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof Kc)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Rt extends Pl{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Rt(this.value)}}class C1 extends Pl{}class fi extends C1{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Ol?this._children[0]:void 0}clone(){const e=new fi(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Ol extends Pl{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Rt&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Ol;return this.options.forEach(e.appendChild,e),e}}class US extends Pl{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof Ki&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Ki){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new US;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Ki extends Pl{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":this.shorthandName==="kebabcase"?e?this._toKebabCase(e):"":this.shorthandName==="snakecase"?e?this._toSnakeCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toKebabCase(e){if(!e.match(/[\p{L}0-9]+/gu))return e;if(!e.match(/[\p{L}0-9]/u))return e.trim().toLowerCase().replace(/^_+|_+$/g,"").replace(/[\s_]+/g,"-");const i=e.trim().replace(/^_+|_+$/g,""),n=i.match(new RegExp("\\p{Lu}{2,}(?=\\p{Lu}\\p{Ll}+[0-9]*|[\\s_-]|$)|\\p{Lu}?\\p{Ll}+[0-9]*|\\p{Lu}(?=\\p{Lu}\\p{Ll})|\\p{Lu}(?=[\\s_-]|$)|[0-9]+","gu"));return n?n.map(s=>s.toLowerCase()).join("-"):i.split(/[\s_-]+/).filter(s=>s.length>0).map(s=>s.toLowerCase()).join("-")}_toPascalCase(e){const t=e.match(/[\p{L}0-9]+/gu);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[\p{L}0-9]+/gu);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toSnakeCase(e){return e.replace(new RegExp("(\\p{Ll})(\\p{Lu})","gu"),"$1_$2").replace(/[\s\-]+/g,"_").toLowerCase()}clone(){return new Ki(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Vr extends C1{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Rt(t)],!0):!1}clone(){const e=new Vr(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Pw(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class Kc extends Pl{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof fi&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return Pw([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof fi&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Vr&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new Kc;return e._children=this.children.map(t=>t.clone()),e}walk(e){Pw(this.children,e)}}class Br{constructor(){this._scanner=new Vm,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new Kc;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(l=>(l instanceof fi&&(l.isFinalTabstop?n.set(0,void 0):!n.has(l.index)&&l.children.length>0?n.set(l.index,l.children):s.push(l)),!0));const r=(l,d)=>{const c=n.get(l.index);if(!c)return;const h=new fi(l.index);h.transform=l.transform;for(const g of c){const u=g.clone();h.appendChild(u),u instanceof fi&&n.has(u.index)&&!d.has(u.index)&&(d.add(u.index),r(u,d),d.delete(u.index))}t.replace(l,[h])},a=new Set;for(const l of s)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new fi(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Rt(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new fi(Number(t)):new Vr(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new fi(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new Rt("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new Ol;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(r),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Rt(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new Vr(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new Rt("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new US;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new Rt(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Ki(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Ki(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Ki(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new Ki(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new Ki(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const r=this._until(4);if(r)return e.appendChild(new Ki(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new Ki(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Rt(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function w1(o,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new zx(o,{range:i,text:typeof t.insertText=="string"?Br.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function y1(o){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of o)for(const a of r.yieldTo??[])for(const l of o)if(l!==r&&e(a,l)){let d=t.get(r);d||(d=[],t.set(r,d)),d.push(l)}if(!t.size)return Array.from(o);const i=new Set,n=[];function s(r){if(!r.length)return[];const a=r[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return s(r.slice(1));let l=[];const d=t.get(a);return d&&(n.push(a),l=s(d),n.pop()),i.add(a),[...l,a,...s(r.slice(1))]}return s(Array.from(o))}function Np(o,e){return e&&(o.stack||o.stacktrace)?m(33,"{0}: {1}",Mw(o),Ow(o.stack)||Ow(o.stacktrace)):Mw(o)}function Ow(o){return Array.isArray(o)?o.join(`
|
|
2
2
|
`):o}function Mw(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?m(34,"A system error occurred ({0})",o.message):o.message||m(35,"An unknown error occurred. Please consult the log for more details.")}function cu(o=null,e=!1){if(!o)return m(36,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=_o(o),i=cu(t[0],e);return t.length>1?m(37,"{0} ({1} errors in total)",i,t.length):i}if(jx(o))return o;if(o.detail){const t=o.detail;if(t.error)return Np(t.error,e);if(t.exception)return Np(t.exception,e)}return o.stack?Np(o,e):o.message?o.message:m(38,"An unknown error occurred. Please consult the log for more details.")}var $S=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hs=function(o,e){return function(t,i){e(t,i,o)}},Bm;const I1="acceptSelectedCodeAction",x1="previewSelectedCodeAction";class KT{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??e.label??""}disposeTemplate(e){}}class GT{get templateId(){return"separator"}renderTemplate(e){e.classList.add("separator");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.label??""}disposeTemplate(e){}}let Um=class{get templateId(){return"action"}constructor(e,t,i,n,s,r,a,l,d){this._supportsPreview=e,this._onRemoveItem=t,this._onShowSubmenu=i,this._hasAnySubmenuActions=n,this._groupTitleByIndex=s,this._linkHandler=r,this._hideDefaultKeybindingTooltip=a,this._keybindingService=l,this._openerService=d}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=document.createElement("span");n.className="action-item-badge",e.append(n);const s=document.createElement("span");s.className="description",e.append(s);const r=document.createElement("span");r.className="group-title",e.append(r);const a=document.createElement("span");a.className="detail",e.append(a);const l=new Oc(e,Mc),d=document.createElement("div");d.className="action-list-item-toolbar",e.append(d);const c=document.createElement("div");c.className="action-list-submenu-indicator",e.append(c);const h=new W;return{container:e,icon:t,text:i,detail:a,badge:n,description:s,groupTitle:r,keybinding:l,toolbar:d,submenuIndicator:c,elementDisposables:h}}renderElement(e,t,i){if(i.elementDisposables.clear(),e.group?.icon?(i.icon.className=ce.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=ye(e.group.icon.color.id))):(i.icon.className=ce.asClassName(U.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;if(pR(!e.hideIcon,i.icon),e.isSectionToggle){const l=e.group?.icon===U.chevronDown;i.container.setAttribute("aria-expanded",String(l))}else i.container.removeAttribute("aria-expanded");if(i.previousClassName&&i.container.classList.remove(i.previousClassName),i.container.classList.toggle("action-list-custom",!!e.className),e.className&&i.container.classList.add(e.className),i.previousClassName=e.className,i.text.textContent=fn(e.label),e.badge?(i.badge.textContent=e.badge,i.badge.style.display=""):(i.badge.textContent="",i.badge.style.display="none"),e.keybinding)i.description.textContent=e.keybinding.getLabel(),i.description.style.display="inline",i.description.style.letterSpacing="0.5px";else if(e.description){if(pi(i.description),typeof e.description=="string")i.description.textContent=fn(e.description);else{const l=xf(e.description,{actionHandler:d=>{const c=Le.parse(d);this._linkHandler?this._linkHandler(c,e):this._openerService.open(c,{allowCommands:!0})}});i.elementDisposables.add(l),i.description.appendChild(l.element)}i.description.style.display="inline"}else i.description.textContent="",i.description.style.display="none";const n=this._groupTitleByIndex.get(t);n?(i.groupTitle.textContent=n,i.groupTitle.style.display=""):(i.groupTitle.textContent="",i.groupTitle.style.display="none"),e.detail?(i.detail.textContent=fn(e.detail),i.detail.style.display=""):(i.detail.textContent="",i.detail.style.display="none");const s=this._keybindingService.lookupKeybinding(I1)?.getLabel(),r=this._keybindingService.lookupKeybinding(x1)?.getLabel();i.container.classList.toggle("option-disabled",!!e.disabled),e.hover!==void 0?i.container.title="":e.tooltip?i.container.title=e.tooltip:e.disabled?i.container.title=e.label:this._hideDefaultKeybindingTooltip?i.container.title="":s&&r?this._supportsPreview&&e.canPreview?i.container.title=m(1705,"{0} to Apply, {1} to Preview",s,r):i.container.title=m(1706,"{0} to Apply",s):i.container.title="",pi(i.toolbar);const a=[...e.toolbarActions??[]];if(e.onRemove&&a.push(mR({id:"actionList.remove",label:m(1707,"Remove"),class:ce.asClassName(U.close),run:async()=>{await e.onRemove(),this._onRemoveItem?.(e)}})),i.container.classList.toggle("has-toolbar",a.length>0),a.length>0){const l=new oo(i.toolbar);i.elementDisposables.add(l),l.push(a,{icon:!0,label:!1})}e.submenuActions?.length&&!e.hover?.content?(i.submenuIndicator.className="action-list-submenu-indicator has-submenu "+ce.asClassName(U.chevronRight),i.submenuIndicator.style.display="",i.submenuIndicator.style.visibility="",i.elementDisposables.add(re(i.submenuIndicator,Pe.CLICK,l=>{l.stopPropagation(),this._onShowSubmenu?.(e)}))):this._hasAnySubmenuActions?(i.submenuIndicator.className="action-list-submenu-indicator",i.submenuIndicator.style.display="",i.submenuIndicator.style.visibility="hidden"):(i.submenuIndicator.className="action-list-submenu-indicator",i.submenuIndicator.style.display="none")}disposeTemplate(e){e.keybinding.dispose(),e.elementDisposables.dispose()}};Um=$S([Hs(7,Te),Hs(8,Xr)],Um);class ZT extends UIEvent{constructor(){super("acceptSelectedAction")}}class Aw extends UIEvent{constructor(){super("previewSelectedAction")}}function XT(o){if(o.kind==="action")return o.label}let $m=Bm=class extends A{constructor(e,t,i,n,s,r,a,l,d){if(super(),this._supportsPreview=t,this._delegate=n,this._options=r,this._keybindingService=a,this._openerService=l,this._instantiationService=d,this._headerLineHeight=24,this._separatorLineHeight=8,this.cts=this._register(new Je),this._submenuDisposables=this._register(new W),this._collapsedSections=new Set,this._filterText="",this._suppressHover=!1,this._hasLaidOut=!1,this._filterCts=this._register(new Ke),this._groupTitleByIndex=new Map,this._onDidRequestLayout=this._register(new Y),this.onDidRequestLayout=this._onDidRequestLayout.event,this.domNode=document.createElement("div"),this.domNode.classList.add("actionList"),this._options?.inlineDescription&&this.domNode.classList.add("inline-description"),this._options?.className){const u=this._options.className.split(/\s+/).filter(f=>f.length>0);u.length>0&&this.domNode.classList.add(...u)}if(this._actionLineHeight=24,this._submenuContainer=document.createElement("div"),this._submenuContainer.className="action-list-submenu-panel action-widget",this._submenuContainer.style.display="none",this._submenuContainer.tabIndex=-1,this.domNode.append(this._submenuContainer),this._register(re(this._submenuContainer,"mouseenter",()=>{this._cancelSubmenuHide()})),this._register(re(this._submenuContainer,"mouseleave",()=>{this._scheduleSubmenuHide()})),this._register(ke(()=>{this._cancelSubmenuHide(),this._cancelSubmenuShow()})),this._options?.collapsedByDefault)for(const u of this._options.collapsedByDefault)this._collapsedSections.add(u);const c={getHeight:u=>this._getItemHeight(u),getTemplateId:u=>u.kind},g=(this._options?.reserveSubmenuSpace??!0)&&i.some(u=>!!u.submenuActions?.length&&!u.hover?.content);if(this._list=this._register(new tS(e,this.domNode,c,[new Um(this._supportsPreview,u=>this._removeItem(u),u=>this._showSubmenuForItem(u),g,this._groupTitleByIndex,this._options?.linkHandler,this._options?.hideDefaultKeybindingTooltip??!1,this._keybindingService,this._openerService),new KT,new GT],{keyboardSupport:!1,typeNavigationEnabled:!this._options?.showFilter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:XT},accessibilityProvider:{getAriaLabel:u=>{if(u.kind==="action"){let f=u.label?fn(u?.label):"";if(u.detail&&(f=f+", "+fn(u.detail)),u.ariaDescription)f=f+", "+fn(u.ariaDescription);else if(u.description){const p=typeof u.description=="string"?u.description:u.description.value;f=f+", "+fn(p)}if(u.hover?.content&&!u.ariaDescription&&!u.description){const p=u.hover.content,_=typeof p=="string"?p:Zh(p)?p.value:Es(p)?p.textContent??void 0:void 0;_&&(!u.detail||fn(u.detail)!==fn(_))&&(f=f+", "+fn(_))}return u.group?.title&&(f=f+", "+u.group.title),u.disabled&&(f=m(1708,"{0}, Disabled Reason: {1}",f,u.disabled)),u.submenuActions?.length&&(f=m(1709,"{0}, use right arrow to access options",f)),f}return null},getWidgetAriaLabel:()=>m(1710,"Action Widget"),getRole:u=>{switch(u.kind){case"action":return"option";case"separator":return"separator";default:return"separator"}},getWidgetRole:()=>"listbox",...s}})),this._list.style(_R),this._register(this._list.onMouseClick(u=>this.onListClick(u))),this._register(this._list.onMouseOver(u=>this.onListHover(u))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(u=>this.onListSelection(u))),this._allMenuItems=[...i],this._options?.showFilter||this._options?.secondaryHeading){this._filterContainer=document.createElement("div"),this._filterContainer.className="action-list-filter";const u=z(this._filterContainer,B(".action-list-filter-row"));if(this._options?.showFilter){this._filterInput=document.createElement("input"),this._filterInput.type="text",this._filterInput.className="action-list-filter-input",this._filterInput.placeholder=this._options?.filterPlaceholder??m(1711,"Search..."),this._filterInput.setAttribute("aria-label",m(1712,"Filter items")),u.appendChild(this._filterInput);const f=this._options?.filterActions??[];if(f.length>0){const p=z(u,B(".action-list-filter-actions"));this._register(new oo(p)).push(f,{icon:!0,label:!1})}this._register(re(this._filterInput,"input",()=>{this._filterText=this._filterInput.value,this._applyOrUpdateFilter()}))}if(this._options?.secondaryHeading){const f=z(u,B(".action-list-filter-label"));f.textContent=this._options.secondaryHeading}}if(this._options?.footerText&&(this._footerContainer=document.createElement("div"),this._footerContainer.className="action-list-footer",this._footerContainer.textContent=this._options.footerText),this._options?.headerText){if(this._headerContainer=document.createElement("div"),this._headerContainer.className="action-list-header",this._options.headerIcon){const f=z(this._headerContainer,B("span.action-list-header-icon"));f.classList.add(...ce.asClassNameArray(this._options.headerIcon)),f.setAttribute("aria-hidden","true")}const u=z(this._headerContainer,B("span.action-list-header-text"));u.textContent=this._options.headerText}this._applyFilter(),this._list.length&&this._focusCheckedOrFirst(),this._register(re(this.domNode,"keydown",u=>{if(u.key==="ArrowRight"){const f=this._list.getFocus();if(f.length>0){const p=this._list.element(f[0]);if(p?.submenuActions?.length){Vn.stop(u,!0);const _=this._getRowElement(f[0]);_&&(this._showSubmenuForElement(p,_),this._currentSubmenuWidget?.focus())}}}})),this._filterInput&&this._register(re(this.domNode,"keydown",u=>{this._filterInput&&!od(this._filterInput)&&u.key.length===1&&u.key!==" "&&!u.ctrlKey&&!u.metaKey&&!u.altKey&&(this._filterInput.focus(),this._filterInput.value=u.key,this._filterText=u.key,this._applyOrUpdateFilter(),u.preventDefault(),u.stopPropagation())}))}_toggleSection(e){this._collapsedSections.has(e)?this._collapsedSections.delete(e):this._collapsedSections.add(e),this._options?.onDidToggleSection?.(e,this._collapsedSections.has(e)),this._applyFilter()}_applyOrUpdateFilter(){if(!this._delegate.onFilter){this._applyFilter();return}const e=this._filterText;this._filterCts.value?.cancel();const t=new Je;this._filterCts.value=t,this._delegate.onFilter(e,t.token).then(i=>{t.token.isCancellationRequested||(this._allMenuItems=[...i],this._applyFilter(!0))}).catch(()=>{})}_applyFilter(e=!1,t=!0){const i=e?"":this._filterText.toLowerCase(),n=!e&&i.length>0,s=[],r=this._list.getFocus();let a;if(r.length>0&&(a=this._list.element(r[0])),n){let u,f=[],p=!1;const _=()=>{u&&p&&s.push(u),s.push(...f),u=void 0,f=[],p=!1},v=S=>{const y=(S.label??"").toLowerCase(),x=typeof S.description=="string"?S.description:S.description?.value??"";return y.includes(i)||x.toLowerCase().includes(i)};for(const S of this._allMenuItems)if(S.kind!=="header"){if(S.kind==="separator"){_(),u=S.label?S:void 0;continue}if(S.showAlways){f.push(S);continue}S.isSectionToggle||v(S)&&(p=!0,f.push(S))}_()}else for(const u of this._allMenuItems){if(u.kind==="header"){s.push(u);continue}if(u.kind==="separator"){if(u.section&&this._collapsedSections.has(u.section))continue;s.push(u);continue}if(u.isSectionToggle&&u.section){const f=this._collapsedSections.has(u.section);s.push({...u,group:{...u.group,icon:f?U.chevronRight:U.chevronDown}});continue}u.section&&this._collapsedSections.has(u.section)||s.push(u)}const l=[];let d=!1;for(let u=0;u<s.length;u++)l[u]=d,s[u].kind==="action"&&(d=!0);const c=[];let h=!1;for(let u=s.length-1;u>=0;u--){if(s[u].kind==="action"){h=!0;continue}s[u].kind==="separator"&&(c[u]=h,h=!1)}for(let u=s.length-1;u>=0;u--){const f=s[u];if(f.kind!=="separator")continue;const p=c[u],_=!f.label&&!l[u];(!p||_)&&s.splice(u,1)}this._options?.showGroupTitleOnFirstItem&&this._recomputeGroupTitles(s);const g=this._filterInput&&od(this._filterInput);if(this._list.splice(0,this._list.length,s),t&&this._onDidRequestLayout.fire(),g)this._filterInput?.focus(),this._focusCheckedOrFirst();else if(this._hasLaidOut&&a){const u=a.item?.id;if(u){for(let f=0;f<this._list.length;f++)if(this._list.element(f).item?.id===u){this._list.setFocus([f]),this._list.reveal(f),this._list.domFocus();break}}}}get filterContainer(){return this._filterContainer}get footerContainer(){return this._footerContainer}get headerContainer(){return this._headerContainer}get filterInput(){return this._filterInput}focusCondition(e){return!e.disabled&&e.kind==="action"}focus(){if(this._filterInput&&this._options?.focusFilterOnOpen){this._filterInput.focus(),this._focusCheckedOrFirst();return}this._list.domFocus(),this._focusCheckedOrFirst()}clearFocus(){this._list.setFocus([])}getFocusedElement(){const e=this._list.getFocus();if(e.length>0)return this._list.element(e[0])}_focusCheckedOrFirst(){this._suppressHover=!0;try{for(let t=0;t<this._list.length;t++){const i=this._list.element(t);if(i.kind==="action"&&i.item?.checked){this._list.setFocus([t]),this._list.reveal(t);return}}this._list.focusFirst(void 0,this.focusCondition);const e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}finally{this._suppressHover=!1}}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._filterCts.value?.cancel(),this._filterCts.clear(),this._hideSubmenu()}clearFilter(){return this._filterInput&&this._filterText?(this._filterInput.value="",this._filterText="",this._applyOrUpdateFilter(),!0):!1}get hasDynamicHeight(){return this._options?.showFilter?!0:this._allMenuItems.some(e=>e.isSectionToggle)}get lineHeight(){return this._actionLineHeight}_getItemHeight(e){switch(e.kind){case"header":return this._headerLineHeight;case"separator":return e.label?this._actionLineHeight:this._separatorLineHeight;default:return e.detail?this._options?.detailItemHeight??48:this._actionLineHeight}}computeFullHeight(){let e=0;for(const t of this._allMenuItems)e+=this._getItemHeight(t);return e}computeListHeight(){const e=this._list.length;let t=0;for(let i=0;i<e;i++){const n=this._list.element(i);t+=this._getItemHeight(n)}return t}layout(e,t){this._hasLaidOut=!0,this._list.layout(e,t),this.domNode.style.height=`${e}px`,this._filterContainer&&this._filterContainer.parentElement&&this._filterContainer.parentElement.insertBefore(this._filterContainer,this.domNode)}computeMaxWidth(e){const t=this._list.length,i=Math.max(e,this._options?.minWidth??0),n=this._options?.maxWidth??Number.POSITIVE_INFINITY,s=Math.max(n,i),r=c=>Math.min(Math.max(c,i),s);let a=i;const l=this._allMenuItems.length;if(l>=50)return r(380);if(l>t){const c=[];for(let f=0;f<t;f++)c.push(this._list.element(f));const h=[...this._allMenuItems];this._list.splice(0,t,h);let g=0;for(const f of h)g+=this._getItemHeight(f);this._list.layout(g);const u=[];for(let f=0;f<h.length;f++){const p=this._getRowElement(f);if(p){p.style.width="auto";const _=p.getBoundingClientRect().width;p.style.width="",u.push(_+this._computeToolbarWidth(h[f]))}}return a=r(Math.max(...u)),this._list.splice(0,h.length,c),a}const d=[];for(let c=0;c<t;c++){const h=this._getRowElement(c);if(h){h.style.width="auto";const g=h.getBoundingClientRect().width;h.style.width="",d.push(g+this._computeToolbarWidth(this._list.element(c)))}}return r(Math.max(...d))}focusPrevious(){if(this._filterInput&&od(this._filterInput)){this._list.domFocus();const i=this._list.getFocus();if(i.length>0){this._list.focusPrevious(1,!1,void 0,this.focusCondition);const n=this._list.getFocus();n.length>0&&n[0]>=i[0]?this._filterInput.focus():n.length>0&&this._list.reveal(n[0])}else{this._list.focusLast(void 0,this.focusCondition);const n=this._list.getFocus();n.length>0&&this._list.reveal(n[0])}return}const e=this._list.getFocus();this._list.focusPrevious(1,!0,void 0,this.focusCondition);const t=this._list.getFocus();if(t.length>0){if(this._filterInput&&e.length>0&&t[0]>e[0]){this._list.setFocus([]),this._filterInput.focus();return}this._list.reveal(t[0])}}focusNext(){if(this._filterInput&&od(this._filterInput)){if(this._list.domFocus(),this._list.getFocus().length>0){this._list.focusNext(1,!1,void 0,this.focusCondition);const n=this._list.getFocus();n.length>0&&this._list.reveal(n[0])}else{this._list.focusFirst(void 0,this.focusCondition);const n=this._list.getFocus();n.length>0&&this._list.reveal(n[0])}return}const e=this._list.getFocus();this._list.focusNext(1,!0,void 0,this.focusCondition);const t=this._list.getFocus();if(t.length>0){if(this._filterInput&&e.length>0&&t[0]<e[0]){this._list.setFocus([]),this._filterInput.focus();return}this._list.reveal(t[0])}}collapseFocusedSection(){const e=this._getFocusedSection();e&&!this._collapsedSections.has(e)&&this._toggleSection(e)}expandFocusedSection(){const e=this._getFocusedSection();e&&this._collapsedSections.has(e)&&this._toggleSection(e)}toggleFocusedSection(){const e=this._list.getFocus();if(e.length===0)return!1;const t=this._list.element(e[0]);return t.isSectionToggle&&t.section?(this._toggleSection(t.section),!0):!1}_getFocusedSection(){const e=this._list.getFocus();if(e.length===0)return;const t=this._list.element(e[0]);return t.isSectionToggle&&t.section,t.section}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new Aw:new ZT;this._list.setSelection([i],s)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];if(t.isSectionToggle&&t.section){this._list.setSelection([]);const i=t.section;queueMicrotask(()=>{this._toggleSection(i)});return}if(vR(e.browserEvent)){const i=e.browserEvent.target;if(Es(i)&&(i.closest(".action-list-item-toolbar")||i.closest(".action-list-submenu-indicator"))){this._list.setSelection([]);return}}if(t.item&&this.focusCondition(t)){const i=e.browserEvent instanceof Aw;this._delegate.onSelect(t.item,i&&this._supportsPreview)}else this._list.setSelection([])}onFocus(){const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item),this._suppressHover||this._showHoverForElement(i,t)}_removeItem(e){const t=this._allMenuItems.indexOf(e);t>=0&&(this._allMenuItems.splice(t,1),this._applyFilter())}_recomputeGroupTitles(e){this._groupTitleByIndex.clear();const t=new Set;for(let i=0;i<e.length;i++){const n=e[i];n.kind==="action"&&n.group?.title&&!t.has(n.group.title)&&(t.add(n.group.title),this._groupTitleByIndex.set(i,n.group.title))}}_computeToolbarWidth(e){let t=e.toolbarActions?.length??0;return e.onRemove&&t++,t===0?0:t*22+6}_getRowElement(e){return this.domNode.ownerDocument.getElementById(this._list.getElementID(e))}_showHoverForElement(e,t){if(this._currentSubmenuElement===e)return;const i=!!e.hover?.content,n=!!e.submenuActions?.length;if(i||n){const s=this._getRowElement(t);s&&this._showSubmenuForElement(e,s);return}this._hideSubmenu()}_showSubmenuForItem(e){const t=this._list.indexOf(e);if(t>=0){const i=this._getRowElement(t);i&&this._showSubmenuForElement(e,i)}}_showSubmenuForElement(e,t){if(this._currentSubmenuElement===e)return;this._submenuDisposables.clear(),this._currentSubmenuElement=e,this._clearSubmenuContainer();let i;const n=e.hover?.content;if(n){if(Es(n))i=n,e.hover?.disposable&&this._register(e.hover.disposable);else{const w=typeof n=="string"?new It(n):n,D=this._options?.linkHandler,N=xf(w,{actionHandler:E=>{const M=Le.parse(E);D?D(M,e):this._openerService.open(M,{allowCommands:!0})}});this._submenuDisposables.add(N),i=N.element}i.classList.add("action-list-submenu-hover-header"),e.submenuActions?.length&&i.classList.add("has-submenu"),this._submenuContainer.appendChild(i)}const s=!!e.submenuActions?.length;this._submenuContainer.style.display="",this._submenuContainer.style.position="absolute",this._submenuContainer.removeAttribute("role");const r=t.getBoundingClientRect(),a=this.domNode.getBoundingClientRect(),l=Ht(this.domNode);let d=0,c=i?i.offsetWidth:0;if(s){const w=[],N=e.submenuActions.filter(H=>H instanceof Xh).filter(H=>H.actions.length>0);for(let H=0;H<N.length;H++){const Z=N[H];Z.label&&w.push({kind:"header",group:{title:Z.label},label:Z.label});for(let se=0;se<Z.actions.length;se++){const ve=Z.actions[se],oe=ve,be=oe.icon??ce.fromId(ve.checked?U.check.id:U.blank.id),Q=oe.hoverContent;w.push({item:ve,kind:"action",label:ve.label,description:ve.tooltip||void 0,group:{title:"",icon:be},hideIcon:!1,hover:Q?{content:Q}:{},onRemove:oe.onRemove})}H<N.length-1&&w.push({kind:"separator",label:""})}for(const H of e.submenuActions)if(!(H instanceof Xh)){const Z=H;w.push({item:H,kind:"action",label:H.label,description:H.tooltip||void 0,group:{title:""},hideIcon:!1,hover:{},onRemove:Z.onRemove})}const E={onHide:()=>{},onSelect:H=>{H.run();const Z=this._currentSubmenuElement?.item;this._hideSubmenu(),Z&&this._delegate.onSelect(Z),this.hide()}},M=this._submenuDisposables.add(this._instantiationService.createInstance(Bm,"submenu",!1,w,E,void 0,void 0));this._submenuContainer.appendChild(M.domNode),this._currentSubmenuWidget=M,M.clearFocus(),d=M.computeListHeight(),M.layout(d);const O=M.computeMaxWidth(0);c=Math.max(c,O),M.layout(d,c),M.domNode.style.width=`${c}px`,this._submenuDisposables.add(re(M.domNode,"keydown",H=>{if(H.key==="ArrowLeft"||H.key==="Escape")Vn.stop(H,!0),this._hideSubmenu(),this._list.domFocus();else if(H.key==="Enter"){Vn.stop(H,!0);const Z=M.getFocusedElement();if(Z?.item){Z.item.run();const se=this._currentSubmenuElement?.item;this._hideSubmenu(),se&&this._delegate.onSelect(se),this.hide()}}else H.key==="ArrowDown"?(Vn.stop(H,!0),M.focusNext()):H.key==="ArrowUp"&&(Vn.stop(H,!0),M.focusPrevious())}))}const g=l.innerWidth-r.right,u=a.left,f=c+10,p=4;g>=f||g>=u?this._submenuContainer.style.left=`${a.right-a.left+p}px`:this._submenuContainer.style.left=`${-f-p}px`;const _=i?i.offsetHeight:0,v=d+_,S=l.innerHeight,y=r.height;let x=r.top-a.top+(y-v)/2;const b=a.top+x+v;b>S&&(x-=b-S+8),a.top+x<0&&(x=-a.top),this._submenuContainer.style.top=`${x}px`}_hideSubmenu(){this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._submenuDisposables.clear(),this._currentSubmenuWidget=void 0,this._currentSubmenuElement=void 0,this._clearSubmenuContainer(),this._submenuContainer.style.display="none"}_clearSubmenuContainer(){this._submenuContainer.contains(If())&&this._list.domFocus(),pi(this._submenuContainer)}_scheduleSubmenuHide(){this._cancelSubmenuHide(),this._submenuHideTimeout=setTimeout(()=>{this._hideSubmenu()},300)}_cancelSubmenuHide(){this._submenuHideTimeout!==void 0&&(clearTimeout(this._submenuHideTimeout),this._submenuHideTimeout=void 0)}_scheduleSubmenuShow(e,t){this._cancelSubmenuShow(),this._submenuShowTimeout=setTimeout(()=>{this._submenuShowTimeout=void 0;const i=typeof t=="number"?this._getRowElement(t):null;i&&this._showSubmenuForElement(e,i)},500)}_cancelSubmenuShow(){this._submenuShowTimeout!==void 0&&(clearTimeout(this._submenuShowTimeout),this._submenuShowTimeout=void 0)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(Es(e.browserEvent.target)&&e.browserEvent.target.closest(".action-list-item-toolbar")!==null){t.submenuActions?.length||this._cancelSubmenuShow(),this._list.setFocus([]);return}const n=!!(t.submenuActions?.length||t.hover?.content);if(n&&(this._suppressHover=!0),this._list.setFocus(typeof e.index=="number"?[e.index]:[]),n&&(this._suppressHover=!1),n){this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow()):(this._hideSubmenu(),this._scheduleSubmenuShow(t,e.index));return}if(this._currentSubmenuElement===t?this._cancelSubmenuHide():(this._cancelSubmenuShow(),this._hideSubmenu()),this._delegate.onHover&&!t.disabled&&t.kind==="action"&&this._currentSubmenuElement!==t){const s=await this._delegate.onHover(t.item,this.cts.token),r=s?s.canPreview:void 0;r!==t.canPreview&&(t.canPreview=r,typeof e.index=="number"&&(this._list.splice(e.index,1,[t]),this._list.setFocus([e.index])))}}else t&&t.hover?.content&&typeof e.index=="number"&&(this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow()):(this._hideSubmenu(),this._scheduleSubmenuShow(t,e.index)))}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};$m=Bm=$S([Hs(6,Te),Hs(7,Xr),Hs(8,ee)],$m);let zm=class extends A{get domNode(){return this._widget.domNode}get filterContainer(){return this._widget.filterContainer}get footerContainer(){return this._widget.footerContainer}get headerContainer(){return this._widget.headerContainer}get filterInput(){return this._widget.filterInput}get anchorPosition(){if(this._showAbove!==void 0)return this._showAbove?1:0}constructor(e,t,i,n,s,r,a,l,d,c){super(),this._contextViewService=l,this._layoutService=d,this._lastMinWidth=0,this._hasLaidOut=!1,this._anchor=a,this._widget=this._register(c.createInstance($m,e,t,i,n,s,r)),this._register(this._widget.onDidRequestLayout(()=>{this._hasLaidOut&&(this.layout(this._lastMinWidth),this._contextViewService.layout())}))}focus(){this._widget.focus()}hide(e){this._widget.hide(e),this._contextViewService.hideContextView()}clearFilter(){return this._widget.clearFilter()}focusPrevious(){this._widget.focusPrevious()}focusNext(){this._widget.focusNext()}collapseFocusedSection(){this._widget.collapseFocusedSection()}expandFocusedSection(){this._widget.expandFocusedSection()}toggleFocusedSection(){return this._widget.toggleFocusedSection()}acceptSelected(e){this._widget.acceptSelected(e)}hasDynamicHeight(){return this._widget.hasDynamicHeight}computeActionWidgetVerticalChromeHeight(){const e=this.domNode.parentElement?.closest(".action-widget");if(!e)return 0;const t=Ht(e).getComputedStyle(e),i=n=>Number.parseFloat(n)||0;return i(t.paddingTop)+i(t.paddingBottom)+i(t.borderTopWidth)+i(t.borderBottomWidth)}computeHeight(){const e=this._widget.computeListHeight(),t=this._widget.filterContainer?36:0,i=this._widget.footerContainer?32:0,n=this._widget.headerContainer?this._widget.headerContainer.offsetHeight||36:0,s=t+i+n,r=Ht(this.domNode);let a;if(this.hasDynamicHeight()){const g=r.innerHeight,u=bR(this._anchor),f=u.top-r.pageYOffset,_=g-f-u.height-30,v=f;if(this._showAbove===void 0){const S=s+this._widget.computeFullHeight();this._showAbove=S>_&&v>_}a=Math.max(0,(this._showAbove?v:_)-this.computeActionWidgetVerticalChromeHeight())}else{const u=this._layoutService.getContainer(r).clientHeight,f=this.domNode.getBoundingClientRect().top;a=f>0?u-f-10:u*.7}const l=Math.floor(r.innerHeight*.6),d=this._widget.lineHeight,c=Math.min(Math.max(a,d*3+s),l);return Math.min(e+s,c)-s}layout(e){this._hasLaidOut=!0,this._lastMinWidth=e;const t=this.computeHeight();this._widget.layout(t);const i=this._widget.computeMaxWidth(e);return this._cachedMaxWidth=i,this._widget.layout(t,this._cachedMaxWidth),this._cachedMaxWidth}};zm=$S([Hs(7,Lf),Hs(8,fR),Hs(9,ee)],zm);function fn(o){return o.replace(/\r\n|\r|\n/g," ")}var YT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},kp=function(o,e){return function(t,i){e(t,i,o)}};V("actionBar.toggledBackground",iS,m(1713,"Background color for toggled action items in action bar."));const Vt={Visible:new ie("codeActionMenuVisible",!1,m(1714,"Whether the action widget list is visible")),FilterFocused:new ie("codeActionMenuFilterFocused",!1,m(1715,"Whether the action widget filter input is focused"))},Vi=Rn("actionWidgetService");let rn=class extends A{get isVisible(){return Vt.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Ke)}show(e,t,i,n,s,r,a,l,d){const c=Vt.Visible.bindTo(this._contextKeyService),h=this._instantiationService.createInstance(zm,e,t,i,n,l,d,s);this._contextViewService.showContextView({getAnchor:()=>s,render:g=>(c.set(!0),this._renderWidget(g,h,a??[])),onHide:g=>{c.reset(),this._onWidgetClosed(g)},get anchorPosition(){return h.anchorPosition}},r,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}collapseSection(){this._list?.value?.collapseFocusedSection()}expandSection(){this._list?.value?.expandFocusedSection()}toggleSection(){return this._list?.value?.toggleFocusedSection()??!1}clearFilter(){return this._list?.value?.clearFilter()??!1}hide(e){this._list.value?.hide(e),this._list.clear()}_renderWidget(e,t,i){const n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,this._list.value)this._list.value.headerContainer&&n.appendChild(this._list.value.headerContainer),this._list.value.filterContainer&&n.appendChild(this._list.value.filterContainer),n.appendChild(this._list.value.domNode),this._list.value.footerContainer&&n.appendChild(this._list.value.footerContainer);else throw new Error("List has no value");const s=new W,r=this._list.value.headerContainer;r&&s.add(wp(r,p=>p.preventDefault()));const a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(wp(l,p=>p.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),s.add(re(c,Pe.POINTER_MOVE,()=>c.remove())),s.add(wp(c,()=>c.remove()));let h=0;if(i.length){const p=this._createActionBar(".action-widget-action-bar",i);p&&(n.appendChild(p.getContainer().parentElement),s.add(p),h=p.getContainer().offsetWidth)}const g=this._list.value?.layout(h);n.style.width=`${g}px`,this._list.value?.focus();const u=Vt.FilterFocused.bindTo(this._contextKeyService);if(s.add({dispose:()=>u.reset()}),this._list.value?.filterInput){const p=this._list.value.filterInput;s.add(re(p,"focus",()=>u.set(!0))),s.add(re(p,"blur",()=>u.set(!1)))}const f=s.add(As(e));return s.add(f.onDidBlur(()=>{const p=If();p?.closest(".action-widget-hover")||p?.closest(".action-list-submenu-panel")||this.hide(!0)})),s}_createActionBar(e,t){if(!t.length)return;const i=B(e),n=new oo(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};rn=YT([kp(0,Lf),kp(1,pe),kp(2,ee)],rn);os(Vi,rn,1);const ds=1100;he(class extends tt{constructor(){super({id:"hideCodeActionWidget",title:L(1716,"Hide action widget"),precondition:Vt.Visible,keybinding:{weight:ds,primary:9,secondary:[1033]}})}run(o){o.get(Vi).hide(!0)}});he(class extends tt{constructor(){super({id:"clearFilterCodeActionWidget",title:L(1717,"Clear action widget filter"),precondition:T.and(Vt.Visible,Vt.FilterFocused),keybinding:{weight:ds+1,primary:9}})}run(o){const e=o.get(Vi);e instanceof rn&&(e.clearFilter()||e.hide(!0))}});he(class extends tt{constructor(){super({id:"selectPrevCodeAction",title:L(1718,"Select previous action"),precondition:Vt.Visible,keybinding:{weight:ds,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(Vi);e instanceof rn&&e.focusPrevious()}});he(class extends tt{constructor(){super({id:"selectNextCodeAction",title:L(1719,"Select next action"),precondition:Vt.Visible,keybinding:{weight:ds,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(Vi);e instanceof rn&&e.focusNext()}});he(class extends tt{constructor(){super({id:"collapseSectionCodeAction",title:L(1720,"Collapse section"),precondition:T.and(Vt.Visible,Vt.FilterFocused.negate()),keybinding:{weight:ds,primary:15}})}run(o){const e=o.get(Vi);e instanceof rn&&e.collapseSection()}});he(class extends tt{constructor(){super({id:"expandSectionCodeAction",title:L(1721,"Expand section"),precondition:T.and(Vt.Visible,Vt.FilterFocused.negate()),keybinding:{weight:ds,primary:17}})}run(o){const e=o.get(Vi);e instanceof rn&&e.expandSection()}});he(class extends tt{constructor(){super({id:"toggleSectionCodeAction",title:L(1722,"Toggle section"),precondition:T.and(Vt.Visible,Vt.FilterFocused.negate()),keybinding:{weight:ds,primary:10}})}run(o){const e=o.get(Vi);e instanceof rn&&(e.toggleSection()||e.acceptSelected())}});he(class extends tt{constructor(){super({id:I1,title:L(1723,"Accept selected action"),precondition:Vt.Visible,keybinding:{weight:ds,primary:3,secondary:[2137]}})}run(o){const e=o.get(Vi);e instanceof rn&&e.acceptSelected()}});he(class extends tt{constructor(){super({id:x1,title:L(1724,"Preview selected action"),precondition:Vt.Visible,keybinding:{weight:ds,primary:2051}})}run(o){const e=o.get(Vi);e instanceof rn&&e.acceptSelected(!0)}});var L1=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Fa=function(o,e){return function(t,i){e(t,i,o)}},jm,Go;let qm=(Go=class extends A{constructor(e,t,i,n,s,r,a,l,d,c,h){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this.additionalActions=l,this._keybindingService=c,this._actionWidgetService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(d),this.visibleContext.set(!0),this._register(ke(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(ke((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(g=>{this.dispose()})),this._register(Ve.runAndSubscribe(c.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){this.button.element.title=this._keybindingService.appendKeybinding(this.showCommand.label,this.showCommand.id)}create(){this.domNode=B(".post-edit-widget"),this.button=this._register(new SR(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(re(this.domNode,Pe.CLICK,()=>this.showSelector()))}getId(){return jm.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){const e=Tt(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show("postEditWidget",!1,this.edits.allEdits.map((i,n)=>({kind:"action",item:i,label:i.title,disabled:!1,canPreview:!1,group:{title:"",icon:ce.fromId(n===this.edits.activeEditIndex?U.check.id:U.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:i=>{this._actionWidgetService.hide(!1);const n=this.edits.allEdits.findIndex(s=>s===i);if(n!==this.edits.activeEditIndex)return this.onSelectNewEdit(n)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}},jm=Go,Go.baseId="editor.widget.postEditWidget",Go);qm=jm=L1([Fa(8,pe),Fa(9,Te),Fa(10,Vi)],qm);let hu=class extends A{constructor(e,t,i,n,s,r,a,l){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._getAdditionalActions=s,this._instantiationService=r,this._bulkEditService=a,this._notificationService=l,this._currentWidget=this._register(new Ke),this._register(Ve.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){if(!e.length||!this._editor.hasModel())return;const r=this._editor.getModel(),a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async v=>{const S=this._editor.getModel();S&&(await S.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,n,s))},d=(v,S)=>{rs(v)||(this._notificationService.error(S),i&&this.show(e[0],t,l))},c=new Tr(this._editor,3,void 0,s);let h;try{h=await CR(n(a,c.token),c.token)}catch(v){return d(v,m(976,`Error resolving edit '{0}':
|
|
3
3
|
{1}`,a.title,cu(v)))}finally{c.dispose()}if(s.isCancellationRequested)return;const g=w1(r.uri,e,h),u=e[0],f=r.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let p,_;try{p=await this._bulkEditService.apply(g,{editor:this._editor,token:s}),_=r.getDecorationRange(f[0])}catch(v){return d(v,m(977,`Error applying edit '{0}':
|
|
4
4
|
{1}`,a.title,cu(v)))}finally{r.deltaDecorations(f,[])}s.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(_??u,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(qm,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};hu=L1([Fa(5,ee),Fa(6,Ac),Fa(7,Lt)],hu);var JT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tn=function(o,e){return function(t,i){e(t,i,o)}},wi;const D1="editor.changePasteType",QT="editor.pasteAs.preferences",zS=new ie("pasteWidgetVisible",!1,m(956,"Whether the paste widget is showing")),Tp="application/vnd.code.copymetadata";var Zo;let is=(Zo=class extends A{static get(e){return e.getContribution(wi.ID)}constructor(e,t,i,n,s,r,a,l,d,c){super(),this._logService=i,this._bulkEditService=n,this._clipboardService=s,this._commandService=r,this._configService=a,this._languageFeaturesService=l,this._quickInputService=d,this._progressService=c,this._editor=e,this._register(e.onWillCopy(h=>this.handleCopy(h))),this._register(e.onWillCut(h=>this.handleCopy(h))),this._register(e.onWillPaste(h=>this.handlePaste(h))),this._pasteProgressManager=this._register(new lu("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(hu,"pasteIntoEditor",e,zS,{id:D1,label:m(957,"Show paste options...")},()=>wi._configureDefaultAction?[wi._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace("CopyPasteController.pasteAs"),this._editor.focus();try{this._logService.trace("Before calling editor.action.clipboardPasteAction"),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand("editor.action.clipboardPasteAction")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){if(this._logService.trace("CopyPasteController#handleCopy"),!this._editor.hasTextFocus()||(this._clipboardService.clearInternalState?.(),!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor._getViewModel(),n=this._editor.getSelections();if(!t||!i||!n?.length)return;const s={multicursorText:e.dataToCopy.multicursorText??null,pasteOnNewLine:e.dataToCopy.isFromEmptySelection,mode:null},r=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(h=>!!h.prepareDocumentPaste);if(!r.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:s});return}const a=new qx,l=r.flatMap(h=>h.copyMimeTypes??[]),d=nS();this.setCopyMetadata(e.clipboardData,{id:d,providerCopyMimeTypes:l,defaultPastePayload:s});const c=r.map(h=>({providerMimeTypes:h.copyMimeTypes,operation:dt(g=>h.prepareDocumentPaste(t,e.dataToCopy.sourceRanges,a,g).catch(u=>{console.error(u)}))}));wi._currentCopyOperation?.operations.forEach(h=>h.operation.cancel()),wi._currentCopyOperation={handle:d,operations:c}}async handlePaste(e){if(this._logService.trace("CopyPasteController#handlePaste for id : ",e.metadata?.id),!this._editor.hasTextFocus())return;const t=e.toExternalVSDataTransfer();if(!t)return;t.delete(Tp),qt.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const i=this._editor.getModel(),n=this._editor.getSelections();if(!n?.length||!i||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const s=this.fetchCopyMetadata(e);this._logService.trace("CopyPasteController#handlePaste with metadata : ",s?.id," and text.length : ",e.clipboardData.getData("text/plain").length);const r=Array.from(e.clipboardData.files).map(d=>d.type),a=[...e.clipboardData.types,...r,...s?.providerCopyMimeTypes??[],Nt.uriList],l=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter(d=>{const c=this._pasteAsActionContext?.preferred;return c&&!this.providerMatchesPreference(d,c)?!1:d.pasteMimeTypes?.some(h=>GC(h,a))});if(!l.length){this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(n,this._pasteAsActionContext.preferred),e.setHandled());return}e.setHandled(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,l,n,t,s):this.doPasteInline(l,n,t,s,e.browserEvent)}showPasteAsNoEditMessage(e,t){const i="only"in t?t.only.value:"preferences"in t?t.preferences.length?t.preferences.map(n=>n.value).join(", "):m(958,"empty"):t.providerId;qt.get(this._editor)?.showMessage(m(959,"No paste edits for '{0}' found",i),e[0].getStartPosition())}doPasteInline(e,t,i,n,s){this._logService.trace("CopyPasteController#doPasteInline");const r=this._editor;if(!r.hasModel())return;const a=new Tr(r,3,void 0),l=dt(async d=>{const c=this._editor;if(!c.hasModel())return;const h=c.getModel(),g=new W,u=g.add(new Je(d));g.add(a.token.onCancellationRequested(()=>u.cancel()));const f=u.token;try{if(await this.mergeInDataFromCopy(e,i,n,f),f.isCancellationRequested)return;const p=e.filter(S=>this.isSupportedPasteProvider(S,i));if(!p.length||p.length===1&&p[0]instanceof Hr)return this.applyDefaultPasteHandler(i,n,f,s);const _={triggerKind:wm.Automatic},v=await this.getPasteEdits(p,i,h,t,_,f);if(g.add(v),f.isCancellationRequested)return;if(v.edits.length===1&&v.edits[0].provider instanceof Hr)return this.applyDefaultPasteHandler(i,n,f,s);if(v.edits.length){const S=c.getOption(97).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(h,v.edits),allEdits:v.edits},S,async(y,x)=>{if(!y.provider.resolveDocumentPasteEdit)return y;const b=y.provider.resolveDocumentPasteEdit(y,x),w=new sS,D=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),m(960,"Resolving paste edit for '{0}'. Click to cancel",y.title),il(Promise.race([w.p,b]),x),{cancel:()=>w.cancel()},0);return D&&(y.insertText=D.insertText,y.additionalEdit=D.additionalEdit),y},f)}await this.applyDefaultPasteHandler(i,n,f,s)}finally{g.dispose(),this._currentPasteOperation===l&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),m(961,"Running paste handlers. Click to cancel and do basic paste"),l,{cancel:async()=>{l.cancel(),!a.token.isCancellationRequested&&await this.applyDefaultPasteHandler(i,n,a.token,s)}}).finally(()=>{a.dispose()}),this._currentPasteOperation=l}showPasteAsPick(e,t,i,n,s){this._logService.trace("CopyPasteController#showPasteAsPick");const r=dt(async a=>{const l=this._editor;if(!l.hasModel())return;const d=l.getModel(),c=new W,h=c.add(new Tr(l,3,void 0,a));try{if(await this.mergeInDataFromCopy(t,n,s,h.token),h.token.isCancellationRequested)return;let g=t.filter(v=>this.isSupportedPasteProvider(v,n,e));e&&(g=g.filter(v=>this.providerMatchesPreference(v,e)));const u={triggerKind:wm.PasteAs,only:e&&"only"in e?e.only:void 0};let f=c.add(await this.getPasteEdits(g,n,d,i,u,h.token));if(h.token.isCancellationRequested)return;if(e&&(f={edits:f.edits.filter(v=>"only"in e?e.only.contains(v.kind):"preferences"in e?e.preferences.some(S=>S.contains(v.kind)):e.providerId===v.provider.id),dispose:f.dispose}),!f.edits.length){e&&this.showPasteAsNoEditMessage(i,e);return}let p;if(e)p=f.edits.at(0);else{const v={id:"editor.pasteAs.default",label:m(962,"Configure default paste action"),edit:void 0},S=await this._quickInputService.pick([...f.edits.map(y=>({label:y.title,description:y.kind?.value,edit:y})),...wi._configureDefaultAction?[wR({type:"separator"}),{label:wi._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:m(963,"Select Paste Action")});if(S===v){wi._configureDefaultAction?.run();return}p=S?.edit}if(!p)return;const _=w1(d.uri,i,p);await this._bulkEditService.apply(_,{editor:this._editor})}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:m(964,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){this._logService.trace("CopyPasteController#setCopyMetadata new id : ",t.id),e.setData(Tp,JSON.stringify(t))}fetchCopyMetadata(e){this._logService.trace("CopyPasteController#fetchCopyMetadata");const t=e.clipboardData.getData(Tp);if(t)try{return JSON.parse(t)}catch{return}if(e.metadata)return{defaultPastePayload:{mode:e.metadata.mode,multicursorText:e.metadata.multicursorText??null,pasteOnNewLine:!!e.metadata.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i,n){if(this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ",i?.id),i?.id&&wi._currentCopyOperation?.handle===i.id){const s=wi._currentCopyOperation.operations.filter(a=>e.some(l=>l.pasteMimeTypes.some(d=>GC(d,a.providerMimeTypes)))).map(a=>a.operation),r=await Promise.all(s);if(n.isCancellationRequested)return;for(const a of r.reverse())if(a)for(const[l,d]of a)t.replace(l,d)}if(!t.has(Nt.uriList)){const s=await this._clipboardService.readResources();if(n.isCancellationRequested)return;s.length&&t.append(Nt.uriList,yR($x.create(s)))}}async getPasteEdits(e,t,i,n,s,r){const a=new W,l=await il(Promise.all(e.map(async c=>{try{const h=await c.provideDocumentPasteEdits?.(i,n,t,s,r);return h&&a.add(h),h?.edits?.map(g=>({...g,provider:c}))}catch(h){rs(h)||console.error(h);return}})),r),d=_o(l??[]).flat().filter(c=>!s.only||s.only.contains(c.kind));return{edits:y1(d),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const r=await(e.get(Nt.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:n,text:r,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ",t?.id),this._editor.trigger("keyboard","paste",a)}isSupportedPasteProvider(e,t,i){return e.pasteMimeTypes?.some(n=>t.matches(n))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return"only"in t?e.providedPasteEditKinds.some(i=>t.only.contains(i)):"preferences"in t?e.providedPasteEditKinds.some(i=>t.preferences.some(n=>n.contains(i))):e.id===t.providerId}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(QT,{resource:e.uri});for(const n of Array.isArray(i)?i:[]){const s=new Oe(n),r=t.findIndex(a=>s.contains(a.kind));if(r>=0)return r}return 0}},wi=Zo,Zo.ID="editor.contrib.copyPasteActionController",Zo);is=wi=JT([Tn(1,ee),Tn(2,Pt),Tn(3,Ac),Tn(4,li),Tn(5,it),Tn(6,Ie),Tn(7,G),Tn(8,Ai),Tn(9,IR)],is);const Ur="9_cutcopypaste",eP=Dl||document.queryCommandSupported("cut"),E1=Dl||document.queryCommandSupported("copy"),tP=typeof navigator.clipboard>"u"||Kx?document.queryCommandSupported("paste"):!0;function jS(o){return o.register(),o}const iP=eP?jS(new oS({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Dl?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:q.MenubarEditMenu,group:"2_ccp",title:m(849,"Cu&&t"),order:1},{menuId:q.EditorContext,group:Ur,title:m(850,"Cut"),when:C.writable,order:1},{menuId:q.CommandPalette,group:"",title:m(851,"Cut"),order:1},{menuId:q.SimpleEditorContext,group:Ur,title:m(852,"Cut"),when:C.writable,order:1}]})):void 0,nP=E1?jS(new oS({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Dl?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:q.MenubarEditMenu,group:"2_ccp",title:m(853,"&&Copy"),order:2},{menuId:q.EditorContext,group:Ur,title:m(854,"Copy"),order:2},{menuId:q.CommandPalette,group:"",title:m(855,"Copy"),order:1},{menuId:q.SimpleEditorContext,group:Ur,title:m(856,"Copy"),order:2}]})):void 0;Mi.appendMenuItem(q.MenubarEditMenu,{submenu:q.MenubarCopy,title:L(861,"Copy As"),group:"2_ccp",order:3});Mi.appendMenuItem(q.EditorContext,{submenu:q.EditorContextCopy,title:L(862,"Copy As"),group:Ur,order:3});Mi.appendMenuItem(q.EditorContext,{submenu:q.EditorContextShare,title:L(863,"Share"),group:"11_share",order:-1,when:T.and(T.notEquals("resourceScheme","output"),C.editorTextFocus)});Mi.appendMenuItem(q.ExplorerContext,{submenu:q.ExplorerContextShare,title:L(864,"Share"),group:"11_share",order:-1});const Pp=tP?jS(new oS({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Dl?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:q.MenubarEditMenu,group:"2_ccp",title:m(857,"&&Paste"),order:4},{menuId:q.EditorContext,group:Ur,title:m(858,"Paste"),when:C.writable,order:4},{menuId:q.CommandPalette,group:"",title:m(859,"Paste"),order:1},{menuId:q.SimpleEditorContext,group:Ur,title:m(860,"Paste"),when:C.writable,order:4}]})):void 0;class sP extends F{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:L(865,"Copy with Syntax Highlighting"),precondition:void 0,kbOpts:{kbExpr:C.textInputFocus,primary:0,weight:100}})}run(e,t){const i=e.get(Pt),n=e.get(li);i.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"),!(!t.hasModel()||!t.getOption(45)&&t.getSelection().isEmpty())&&(Jh.forceCopyWithSyntaxHighlighting=!0,t.focus(),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),Km(t,n),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),Jh.forceCopyWithSyntaxHighlighting=!1)}}function Km(o,e){if(Jh.electronBugWorkaroundCopyEventHasFired=!1,o.getContainerDomNode().ownerDocument.execCommand("copy"),Dl&&Jh.electronBugWorkaroundCopyEventHasFired===!1){const{dataToCopy:t}=ER(o._getViewModel(),void 0,Kx);e.writeText(t.text)}}function R1(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Pt),s=t.get(li);n.trace("registerExecCommandImpl (addImplementation code-editor for : ",e,")");const r=t.get(Ue).getFocusedCodeEditor();if(r&&r.hasTextFocus()&&r.hasModel()){const a=r.getOption(45),l=r.getSelection();return l&&l.isEmpty()&&!a||(r.getOption(170)&&e==="cut"?(Fw(r),n.trace("registerExecCommandImpl (before execCommand copy)"),Km(r,s),r.trigger(void 0,"cut",void 0),n.trace("registerExecCommandImpl (after execCommand copy)")):(Fw(r),n.trace("registerExecCommandImpl (before execCommand "+e+")"),e==="copy"?Km(r,s):r.getContainerDomNode().ownerDocument.execCommand(e),n.trace("registerExecCommandImpl (after execCommand "+e+")"))),!0}return!1}),o.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(Pt);return n.trace("registerExecCommandImpl (addImplementation generic-dom for : ",e,")"),n.trace("registerExecCommandImpl (before execCommand "+e+")"),DR().execCommand(e),n.trace("registerExecCommandImpl (after execCommand "+e+")"),!0}))}function Fw(o){if(o.getOption(170)){const t=Gx.get(o.getId());t&&t.handleWillCopy()}}R1(iP,"cut");R1(nP,"copy");Pp&&(Pp.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(Pt);t.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");const i=o.get(Ue),n=o.get(li),s=i.getFocusedCodeEditor();if(s&&s.hasModel()&&s.hasTextFocus()){if(s.getOption(170)){const l=Gx.get(s.getId());l&&l.handleWillPaste()}t.trace("registerExecCommandImpl (before triggerPaste)");const a=n.triggerPaste(Yh().vscodeWindowId);return a?(t.trace("registerExecCommandImpl (triggerPaste defined)"),a.then(async()=>(t.trace("registerExecCommandImpl (after triggerPaste)"),is.get(s)?.finishedPaste()??Promise.resolve()))):(t.trace("registerExecCommandImpl (triggerPaste undefined)"),xR?(t.trace("registerExecCommandImpl (Paste handling on web)"),(async()=>{const l=await n.readText();if(l!==""){const d=LR.INSTANCE.get(l);let c=!1,h=null,g=null;d&&(c=s.getOption(45)&&!!d.isFromEmptySelection,h=typeof d.multicursorText<"u"?d.multicursorText:null,g=d.mode),t.trace("registerExecCommandImpl (clipboardText.length : ",l.length," id : ",d?.id,")"),s.trigger("keyboard","paste",{text:l,pasteOnNewLine:c,multicursorText:h,mode:g})}})()):!0)}return!1}),Pp.addImplementation(0,"generic-dom",(o,e)=>(o.get(Pt).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"),o.get(li).triggerPaste(Yh().vscodeWindowId)??!1)));E1&&P(sP);const Re=new class{constructor(){this.QuickFix=new Oe("quickfix"),this.Refactor=new Oe("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new Oe("notebook"),this.Source=new Oe("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var Zt;(function(o){o.Refactor="refactor",o.RefactorPreview="refactor preview",o.Lightbulb="lightbulb",o.Default="other (default)",o.SourceAction="source action",o.QuickFix="quick fix action",o.FixAll="fix all",o.OrganizeImports="organize imports",o.AutoFix="auto fix",o.QuickFixHover="quick fix hover window",o.OnSave="save participants",o.ProblemsView="problems view"})(Zt||(Zt={}));function oP(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>N1(e,t,o.include))||!o.includeSourceActions&&Re.Source.contains(e))}function rP(o,e){const t=e.kind?new Oe(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>N1(t,i,o.include))||!o.includeSourceActions&&t&&Re.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function N1(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class vn{static fromUser(e,t){return!e||typeof e!="object"?new vn(t.kind,t.apply,!1):new vn(vn.getKindFromUser(e,t.kind),vn.getApplyFromUser(e,t.apply),vn.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 Oe(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class aP{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(i){Ze(i)}t&&(this.action.edit=t.edit)}return this}}const k1="editor.action.codeAction",Gf="editor.action.quickFix",qS="editor.action.autoFix",T1="editor.action.refactor",P1="editor.action.sourceAction",Gm="editor.action.organizeImports",Zm="editor.action.fixAll",lP=1e3;class wd extends A{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:ri(e.diagnostics)?ri(t.diagnostics)?wd.codeActionsPreferredComparator(e,t):-1:ri(t.diagnostics)?1:wd.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(wd.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Re.QuickFix.contains(new Oe(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 Ww={actions:[],documentation:void 0};async function Da(o,e,t,i,n,s){const r=i.filter||{},a={...r,excludes:[...r.excludes||[],Re.Notebook]},l={only:r.include?.value,trigger:i.type},d=new RR(e,s),c=i.type===2,h=dP(o,e,c?a:r),g=new W,u=h.map(async p=>{const _=setTimeout(()=>n.report(p),1250);try{const v=await p.provideCodeActions(e,t,l,d.token);if(d.token.isCancellationRequested)return v?.dispose(),Ww;v&&g.add(v);const S=(v?.actions||[]).filter(x=>x&&rP(r,x)),y=hP(p,S,r.include);return{actions:S.map(x=>new aP(x,p)),documentation:y}}catch(v){if(rs(v))throw v;return Ze(v),Ww}finally{clearTimeout(_)}}),f=o.onDidChange(()=>{const p=o.all(e);sn(p,h)||d.cancel()});try{const p=await Promise.all(u),_=p.map(y=>y.actions).flat(),v=[..._o(p.map(y=>y.documentation)),...cP(o,e,i,_)],S=new wd(_,v,g);return g.add(S),S}catch(p){throw g.dispose(),p}finally{f.dispose(),d.dispose()}}function dP(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>oP(t,new Oe(n))):!0)}function*cP(o,e,t,i){if(e&&i.length)for(const n of o.all(e))n._getAdditionalMenuItems&&(yield*n._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(s=>s.action)))}function hP(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Oe(n.kind),command:n.command}));if(t){let n;for(const s of i)s.kind.contains(t)&&(n?n.kind.contains(s.kind)&&(n=s):n=s);if(n)return n?.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Oe(n.kind)))return s.command}}var Ns;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions",o.FromAILightbulb="fromAILightbulb",o.FromProblemsHover="fromProblemsHover"})(Ns||(Ns={}));async function uP(o,e,t,i,n=de.None){const s=o.get(Ac),r=o.get(it),a=o.get(vo),l=o.get(Lt),d=o.get(rS);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),d.playSignal($d.codeActionTriggered),await e.resolve(n),!n.isCancellationRequested&&!(e.action.edit?.edits.length&&!(await s.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Ns.OnSave,showPreview:i?.preview,reason:Pr.codeAction({kind:e.action.kind,providerId:Zx.fromExtensionId(e.provider?.extensionId)})})).isApplied)){if(e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const h=gP(c);l.error(typeof h=="string"?h:m(866,"An unknown error occurred while applying the code action"))}setTimeout(()=>d.playSignal($d.codeActionApplied),lP)}}function gP(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}Ee.registerCommand("_executeCodeActionProvider",async function(o,e,t,i,n){if(!(e instanceof Le))throw Gn();const{codeActionProvider:s}=o.get(G),r=o.get(Yt).getModel(e);if(!r)throw Gn();const a=J.isISelection(t)?J.liftSelection(t):I.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Gn();const l=typeof i=="string"?new Oe(i):void 0,d=await Da(s,r,a,{type:1,triggerAction:Zt.Default,filter:{includeSourceActions:!0,include:l}},Un.None,de.None),c=[],h=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let g=0;g<h;g++)c.push(d.validActions[g].resolve(de.None));try{return await Promise.all(c),d.validActions.map(g=>g.action)}finally{setTimeout(()=>d.dispose(),100)}});var fP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pP=function(o,e){return function(t,i){e(t,i,o)}},Xm,Xo;let Ym=(Xo=class{constructor(e){this.keybindingService=e}getResolver(){const e=new aS(()=>this.keybindingService.getKeybindings().filter(t=>Xm.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Gm?i={kind:Re.SourceOrganizeImports.value}:t.command===Zm&&(i={kind:Re.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...vn.fromUser(i,{kind:Oe.None,apply:"never"})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Oe(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,s)=>n?n.kind.contains(s.kind)?s:n:s,void 0)}},Xm=Xo,Xo.codeActionCommands=[T1,k1,P1,Gm,Zm],Xo);Ym=Xm=fP([pP(0,Te)],Ym);V("symbolIcon.arrayForeground",nt,m(1547,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.booleanForeground",nt,m(1548,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m(1549,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.colorForeground",nt,m(1550,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.constantForeground",nt,m(1551,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1552,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m(1553,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1554,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m(1555,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1556,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.fileForeground",nt,m(1557,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.folderForeground",nt,m(1558,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1559,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1560,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.keyForeground",nt,m(1561,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.keywordForeground",nt,m(1562,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1563,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.moduleForeground",nt,m(1564,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.namespaceForeground",nt,m(1565,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.nullForeground",nt,m(1566,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.numberForeground",nt,m(1567,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.objectForeground",nt,m(1568,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.operatorForeground",nt,m(1569,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.packageForeground",nt,m(1570,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.propertyForeground",nt,m(1571,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.referenceForeground",nt,m(1572,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.snippetForeground",nt,m(1573,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.stringForeground",nt,m(1574,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.structForeground",nt,m(1575,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.textForeground",nt,m(1576,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.typeParameterForeground",nt,m(1577,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.unitForeground",nt,m(1578,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));V("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1579,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const O1=Object.freeze({kind:Oe.Empty,title:m(902,"More Actions...")}),mP=Object.freeze([{kind:Re.QuickFix,title:m(903,"Quick Fix")},{kind:Re.RefactorExtract,title:m(904,"Extract"),icon:U.wrench},{kind:Re.RefactorInline,title:m(905,"Inline"),icon:U.wrench},{kind:Re.RefactorRewrite,title:m(906,"Rewrite"),icon:U.wrench},{kind:Re.RefactorMove,title:m(907,"Move"),icon:U.wrench},{kind:Re.SurroundWith,title:m(908,"Surround With"),icon:U.surroundWith},{kind:Re.Source,title:m(909,"Source Action"),icon:U.symbolFile},O1]);function _P(o,e,t){if(!e)return o.map(s=>({kind:"action",item:s,group:O1,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!s.action.edit?.edits.length}));const i=mP.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Oe(s.action.kind):Oe.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(s);break}}const n=[];for(const s of i)if(s.actions.length){n.push({kind:"header",group:s.group});for(const r of s.actions){const a=s.group;n.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:U.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}const M1=new ie("supportedCodeAction",""),Hw="_typescript.applyFixAllCodeAction";class vP extends A{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new Fc),this.ignoreLightbulbOff=!1,this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>ro(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Zt.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const i=this._editor.getOption(73).enabled;if(!(i===rd.Off&&!this.ignoreLightbulbOff)){{if(i===rd.Off||i===rd.On)return t;if(i===rd.OnCode){if(!t.isEmpty())return t;const s=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),l=s.getLineContent(r);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===s.getLineMaxColumn(r)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var Fo;(function(o){o.Empty={type:0};class e{constructor(i,n,s){this.trigger=i,this.position=n,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(rs(r))return Jm;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Fo||(Fo={}));const Jm=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class bP extends A{constructor(e,t,i,n,s,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new Ke),this._state=Fo.Empty,this._onDidChangeState=this._register(new Y),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new Ke),this._disposed=!1,this._ignoreLightbulbOff=!1,this._supportedCodeActions=M1.bindTo(n),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Fo.Empty,!0))}_settingEnabledNearbyQuickfixes(){const e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Fo.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){const t=this._registry.all(e).flatMap(n=>n.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" "));const i=new vP(this._editor,this._markerService,n=>{if(!n){this.setState(Fo.Empty);return}const s=n.selection.getStartPosition(),r=dt(async d=>{if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===Zt.QuickFix||n.trigger.filter?.include?.contains(Re.QuickFix))){const h=await Da(this._registry,e,n.selection,n.trigger,Un.None,d);this.codeActionsDisposable.value=h;const g=[...h.allActions];if(d.isCancellationRequested)return h.dispose(),Jm;const u=h.validActions?.some(p=>p.action.kind&&Re.QuickFix.contains(new Oe(p.action.kind))&&!p.action.isAI),f=this._markerService.read({resource:e.uri});if(u){for(const p of h.validActions)p.action.command?.arguments?.some(_=>typeof _=="string"&&_.includes(Hw))&&(p.action.diagnostics=[...f.filter(_=>_.relatedInformation)]);return{validActions:h.validActions,allActions:g,documentation:h.documentation,hasAutoFix:h.hasAutoFix,hasAIFix:h.hasAIFix,allAIFixes:h.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=h}}}else if(!u&&f.length>0){const p=n.selection.getPosition();let _=p,v=Number.MAX_VALUE;const S=[...h.validActions];for(const x of f){const b=x.endColumn,w=x.endLineNumber,D=x.startLineNumber;if(w===p.lineNumber||D===p.lineNumber){_=new $(w,b);const N={type:n.trigger.type,triggerAction:n.trigger.triggerAction,filter:{include:n.trigger.filter?.include?n.trigger.filter?.include:Re.QuickFix},autoApply:n.trigger.autoApply,context:{notAvailableMessage:n.trigger.context?.notAvailableMessage||"",position:_}},E=new J(_.lineNumber,_.column,_.lineNumber,_.column),M=await Da(this._registry,e,E,N,Un.None,d);if(d.isCancellationRequested)return M.dispose(),Jm;if(M.validActions.length!==0){for(const O of M.validActions)O.action.command?.arguments?.some(H=>typeof H=="string"&&H.includes(Hw))&&(O.action.diagnostics=[...f.filter(H=>H.relatedInformation)]);h.allActions.length===0&&g.push(...M.allActions),Math.abs(p.column-b)<v?S.unshift(...M.validActions):S.push(...M.validActions)}v=Math.abs(p.column-b)}}const y=S.filter((x,b,w)=>w.findIndex(D=>D.action.title===x.action.title)===b);return y.sort((x,b)=>x.action.isPreferred&&!b.action.isPreferred?-1:!x.action.isPreferred&&b.action.isPreferred||x.action.isAI&&!b.action.isAI?1:!x.action.isAI&&b.action.isAI?-1:0),{validActions:y,allActions:g,documentation:h.documentation,hasAutoFix:h.hasAutoFix,hasAIFix:h.hasAIFix,allAIFixes:h.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=h}}}}if(n.trigger.type===1){const h=await Da(this._registry,e,n.selection,n.trigger,Un.None,d);return this.codeActionsDisposable.value=h,h}const c=await Da(this._registry,e,n.selection,n.trigger,Un.None,d);return this.codeActionsDisposable.value=c,c});n.trigger.type===1&&this._progressService?.showWhile(r,250);const a=new Fo.Triggered(n.trigger,s,r);let l=!1;this._state.type===1&&(l=this._state.trigger.type===1&&a.type===1&&a.trigger.type===2&&this._state.position!==a.position),l?setTimeout(()=>{this.setState(a)},500):this.setState(a)},void 0);i.ignoreLightbulbOff=this._ignoreLightbulbOff,this._codeActionOracle.value=i,this._codeActionOracle.value.trigger({type:2,triggerAction:Zt.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.dispose()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var SP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},CP=function(o,e){return function(t,i){e(t,i,o)}},fs;const A1=ze("gutter-lightbulb",U.lightBulb,m(910,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),F1=ze("gutter-lightbulb-auto-fix",U.lightbulbAutofix,m(911,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),W1=ze("gutter-lightbulb-sparkle",U.lightbulbSparkle,m(912,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),H1=ze("gutter-lightbulb-aifix-auto-fix",U.lightbulbSparkleAutofix,m(913,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),V1=ze("gutter-lightbulb-sparkle-filled",U.sparkleFilled,m(914,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var ji;(function(o){o.Hidden={type:0};class e{constructor(i,n,s,r){this.actions=i,this.trigger=n,this.editorPosition=s,this.widgetPosition=r,this.type=1}}o.Showing=e})(ji||(ji={}));function B1(o,e,t,i,n=!1){if(o.validActions.length<=0)return;let s,r=!1;o.allAIFixes?(s=n?V1:U.sparkleFilled,o.validActions.length===1&&(r=!0)):o.hasAutoFix?o.hasAIFix?s=n?H1:U.lightbulbSparkleAutofix:s=n?F1:U.lightbulbAutofix:o.hasAIFix?s=n?W1:U.lightbulbSparkle:s=n?A1:U.lightBulb;let a;return r?a=m(915,"Run: {0}",o.validActions[0].action.title):o.hasAutoFix&&t?a=m(916,"Show Code Actions. Preferred Quick Fix Available ({0})",t):!o.hasAutoFix&&i?a=m(917,"Show Code Actions ({0})",i):a=m(918,"Show Code Actions"),{actions:o,trigger:e,icon:s,autoRun:r,title:a,isGutter:n}}var qn;let Qd=(qn=class extends A{static _computeLightBulbInfo(e,t,i,n){if(e.type===1)return B1(e.actions,e.trigger,i,n,t)}constructor(e,t){super(),this._editor=e,this._keybindingService=t,this.onlyWithEmptySelection=!1,this._onClick=this._register(new Y),this.onClick=this._onClick.event,this._state=Ne(this,ji.Hidden),this._gutterState=Ne(this,ji.Hidden),this._combinedInfo=R(this,i=>{const n=this._gutterState.read(i);if(n.type===1)return fs._computeLightBulbInfo(n,!0,this._preferredKbLabel.read(i),this._quickFixKbLabel.read(i));const s=this._state.read(i);if(s.type===1)return fs._computeLightBulbInfo(s,!1,this._preferredKbLabel.read(i),this._quickFixKbLabel.read(i))}),this._iconClasses=[],this.lightbulbClasses=["codicon-"+A1.id,"codicon-"+H1.id,"codicon-"+F1.id,"codicon-"+W1.id,"codicon-"+V1.id],this._preferredKbLabel=Ne(this,void 0),this._quickFixKbLabel=Ne(this,void 0),this.gutterDecoration=fs.GUTTER_DECORATION,this._domNode=B("div.lightBulbWidget"),this._domNode.role="listbox",this._register(Xx.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel(),s=this._state.get();(s.type!==1||!n||s.editorPosition.lineNumber>=n.getLineCount())&&this.hide();const r=this._gutterState.get();(r.type!==1||!n||r.editorPosition.lineNumber>=n.getLineCount())&&this.gutterHide()})),this._register(NR(this._domNode,i=>{const n=this._state.get();if(n.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:r}=Tt(this._domNode),a=this._editor.getOption(75);let l=Math.floor(a/3);n.widgetPosition.position!==null&&n.widgetPosition.position.lineNumber<n.editorPosition.lineNumber&&(l+=a),this._onClick.fire({x:i.posx,y:s+r+l,actions:n.actions,trigger:n.trigger})})),this._register(re(this._domNode,"mouseenter",i=>{(i.buttons&1)===1&&this.hide()})),this._register(Ve.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(qS)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(Gf)?.getLabel()??void 0,void 0)})),this._register(le(i=>{const n=this._combinedInfo.read(i);this._updateLightBulbTitleAndIcon(n),this._updateGutterDecorationOptions(n)})),this._register(this._editor.onMouseDown(async i=>{if(!i.target.element||!this.lightbulbClasses.some(d=>i.target.element&&i.target.element.classList.contains(d)))return;const n=this._gutterState.get();if(n.type!==1)return;this._editor.focus();const{top:s,height:r}=Tt(i.target.element),a=this._editor.getOption(75);let l=Math.floor(a/3);n.widgetPosition.position!==null&&n.widgetPosition.position.lineNumber<n.editorPosition.lineNumber&&(l+=a),this._onClick.fire({x:i.event.posx,y:s+r+l,actions:n.actions,trigger:n.trigger})}))}dispose(){super.dispose(),this._editor.removeContentWidget(this),this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){const e=this._state.get();return e.type===1?e.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.gutterHide(),this.hide();if(this.onlyWithEmptySelection&&!this._editor.getSelection()?.isEmpty())return this.gutterHide(),this.hide();if(!this._editor.hasTextFocus())return this.gutterHide(),this.hide();if(this._editor.getOptions().get(73).enabled===rd.Off)return this.gutterHide(),this.hide();const r=this._editor.getModel();if(!r)return this.gutterHide(),this.hide();const{lineNumber:a,column:l}=r.validatePosition(i),d=r.getOptions().tabSize,c=this._editor.getOptions().get(59),h=r.getLineContent(a),g=lS(h,d),u=c.spaceWidth*g>22,f=b=>b>2&&this._editor.getTopForLineNumber(b)===this._editor.getTopForLineNumber(b-1),p=this._editor.getLineDecorations(a);let _=!1;if(p)for(const b of p){const w=b.options.glyphMarginClassName;if(w&&!this.lightbulbClasses.some(D=>w.includes(D))){_=!0;break}}let v=a,S=1;if(!u){const b=w=>{const D=r.getLineContent(w);return/^\s*$|^\s+/.test(D)||D.length<=S};if(a>1&&!f(a-1)){const w=r.getLineCount(),D=a===w,N=a>1&&b(a-1),E=!D&&b(a+1),M=b(a),O=!E&&!N;if(!E&&!N&&!_)return this._gutterState.set(new ji.Showing(e,t,i,{position:{lineNumber:v,column:S},preference:fs._posPref}),void 0),this.renderGutterLightbub(),this.hide();N||D||N&&!M?v-=1:(E||O&&M)&&(v+=1)}else if(a===1&&(a===r.getLineCount()||!b(a+1)&&!b(a)))if(this._gutterState.set(new ji.Showing(e,t,i,{position:{lineNumber:v,column:S},preference:fs._posPref}),void 0),_)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(a<r.getLineCount()&&!f(a+1))v+=1;else if(l*c.spaceWidth<22)return this.hide();S=/^\S\s*$/.test(r.getLineContent(v))?2:1}this._state.set(new ji.Showing(e,t,i,{position:{lineNumber:v,column:S},preference:fs._posPref}),void 0),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());const y=e.validActions,x=e.validActions[0].action.kind;if(y.length!==1||!x){this._editor.layoutContentWidget(this);return}this._editor.layoutContentWidget(this)}hide(){this._state.get()!==ji.Hidden&&(this._state.set(ji.Hidden,void 0),this._editor.layoutContentWidget(this))}gutterHide(){this._gutterState.get()!==ji.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this._gutterState.set(ji.Hidden,void 0))}_updateLightBulbTitleAndIcon(e){this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],!(!e||e.isGutter)&&(this._domNode.title=e.title,this._iconClasses=ce.asClassNameArray(e.icon),this._domNode.classList.add(...this._iconClasses))}_updateGutterDecorationOptions(e){!e||!e.isGutter||(this.gutterDecoration=te.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:ce.asClassName(e.icon),glyphMargin:{position:ym.Left},stickiness:1}))}renderGutterLightbub(){const e=this._editor.getSelection();e&&(this._gutterDecorationID===void 0?this._addGutterDecoration(e.startLineNumber):this._updateGutterDecoration(this._gutterDecorationID,e.startLineNumber))}_addGutterDecoration(e){this._editor.changeDecorations(t=>{this._gutterDecorationID=t.addDecoration(new I(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new I(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}},fs=qn,qn.GUTTER_DECORATION=te.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:ce.asClassName(U.lightBulb),glyphMargin:{position:ym.Left},stickiness:1}),qn.ID="editor.contrib.lightbulbWidget",qn._posPref=[0],qn);Qd=fs=SP([CP(1,Te)],Qd);var wP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ui=function(o,e){return function(t,i){e(t,i,o)}},Sa;const yP="quickfix-edit-highlight";var Us;let $r=(Us=class extends A{static get(e){return e.getContribution(Sa.ID)}constructor(e,t,i,n,s,r,a,l,d,c,h,g){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._progressService=h,this._keybindingService=g,this._activeCodeActions=this._register(new Ke),this._showDisabled=!1,this._disposed=!1,this._onlyLightBulbWithEmptySelection=!1,this._lightBulbInfoObs=Ne(this,void 0),this._preferredKbLabel=Ne(this,void 0),this._quickFixKbLabel=Ne(this,void 0),this._editor=e,this._model=this._register(new bP(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._register(Ve.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(qS)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(Gf)?.getLabel()??void 0,void 0)})),this._lightBulbWidget=new aS(()=>{const u=this._editor.getContribution(Qd.ID);return u&&(this._register(u.onClick(f=>this.showCodeActionsFromLightbulb(f.actions,f))),u.onlyWithEmptySelection=this._onlyLightBulbWithEmptySelection),u}),this._resolver=n.createInstance(Ym),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],n=i.action.command;n&&n.id==="inlineChat.start"&&n.arguments&&n.arguments.length>=1&&n.arguments[0]&&(n.arguments[0]={...n.arguments[0],autoSend:!1}),await this.applyCodeAction(i,!1,!1,Ns.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){if(!this._editor.hasModel())return;qt.get(this._editor)?.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,i,n){const s=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(uP,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Zt.QuickFix,filter:{}}),s.done()}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==1){this.hideLightBulbWidget(),this._lightBulbInfoObs.set(void 0,void 0);return}let t;try{t=await e.actions}catch(n){we(n);return}if(!(this._disposed||this._editor.getSelection()?.startLineNumber!==e.position.lineNumber))if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),this._lightBulbInfoObs.set(B1(t,e.trigger,this._preferredKbLabel.get(),this._quickFixKbLabel.get()),void 0),e.trigger.type===1){if(e.trigger.filter?.include){const s=this.tryGetValidActionToApply(e.trigger,t);if(s){try{this.hideLightBulbWidget(),await this.applyCodeAction(s,!1,!1,Ns.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const r=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(r&&r.action.disabled){qt.get(this._editor)?.showMessage(r.action.disabled,e.trigger.context.position),t.dispose();return}}}const n=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!n&&!t.validActions.length)){qt.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:n,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=$.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(d,c)=>{this.applyCodeAction(d,!0,!!c,i.fromLightbulb?Ns.FromAILightbulb:Ns.FromCodeActions),this._actionWidgetService.hide(!1),n.clear()},onHide:d=>{this._editor?.focus(),n.clear()},onHover:async(d,c)=>{if(c.isCancellationRequested)return;let h=!1;const g=d.action.kind;if(g){const u=new Oe(g);h=[Re.RefactorExtract,Re.RefactorInline,Re.RefactorRewrite,Re.RefactorMove,Re.Source].some(p=>p.contains(u))}return{canPreview:h||!!d.action.edit?.edits.length}},onFocus:d=>{if(d&&d.action){const c=d.action.ranges,h=d.action.diagnostics;if(n.clear(),c&&c.length>0){const g=h&&h?.length>1?h.map(u=>({range:u,options:Sa.DECORATION})):c.map(u=>({range:u,options:Sa.DECORATION}));n.set(g)}else if(h&&h.length>0){const g=h.map(f=>({range:f,options:Sa.DECORATION}));n.set(g);const u=h[0];if(u.startLineNumber&&u.startColumn){const f=this._editor.getModel()?.getWordAtPosition({lineNumber:u.startLineNumber,column:u.startColumn})?.word;ao(m(899,"Context: {0} at line {1} and column {2}.",f,u.startLineNumber,u.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,_P(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Tt(this._editor.getDomNode()),n=i.left+t.left,s=i.top+t.top+t.height;return{x:n,y:s}}_shouldShowHeaders(){const e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(s=>({id:s.id,label:s.title,tooltip:s.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(s.id,...s.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:m(900,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:m(901,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}},Sa=Us,Us.ID="editor.contrib.codeActionController",Us.DECORATION=te.register({description:"quickfix-highlight",className:yP}),Us);$r=Sa=wP([Ui(1,Df),Ui(2,pe),Ui(3,ee),Ui(4,G),Ui(5,nl),Ui(6,it),Ui(7,Ie),Ui(8,Vi),Ui(9,ee),Ui(10,nl),Ui(11,Te)],$r);Tc((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(kR));const i=o.getColor(Yx);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${zd(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function Gc(o){return T.regex(M1.keys()[0],new RegExp("(\\s|^)"+jd(o.value)+"\\b"))}const KS={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:m(867,"Kind of the code action to run.")},apply:{type:"string",description:m(868,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[m(869,"Always apply the first returned code action."),m(870,"Apply the first returned code action if it is the only one."),m(871,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:m(872,"Controls if only preferred code actions should be returned.")}}};function Qr(o,e,t,i,n=Zt.Default){o.hasModel()&&$r.get(o)?.manualTriggerAtCurrentPosition(e,n,t,i)}class IP extends vi{constructor(){super({id:Gf,title:L(889,"Quick Fix..."),precondition:T.and(C.writable,C.hasCodeActionsProvider),icon:U.lightBulb,f1:!0,keybinding:{when:C.textInputFocus,primary:2137,weight:100},menu:{id:q.InlineChatEditorAffordance,group:"1_quickfix",order:0,when:T.and(C.writable,C.hasCodeActionsProvider)}})}runEditorCommand(e,t){return Qr(t,m(873,"No code actions available"),void 0,void 0,Zt.QuickFix)}}class xP extends Mt{constructor(){super({id:k1,precondition:T.and(C.writable,C.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:KS}]}})}runEditorCommand(e,t,i){const n=vn.fromUser(i,{kind:Oe.Empty,apply:"ifSingle"});return Qr(t,typeof i?.kind=="string"?n.preferred?m(874,"No preferred code actions for '{0}' available",i.kind):m(875,"No code actions for '{0}' available",i.kind):n.preferred?m(876,"No preferred code actions available"):m(877,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class LP extends F{constructor(){super({id:T1,label:L(890,"Refactor..."),precondition:T.and(C.writable,C.hasCodeActionsProvider),kbOpts:{kbExpr:C.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:T.and(C.writable,Gc(Re.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:KS}]}})}run(e,t,i){const n=vn.fromUser(i,{kind:Re.Refactor,apply:"never"});return Qr(t,typeof i?.kind=="string"?n.preferred?m(878,"No preferred refactorings for '{0}' available",i.kind):m(879,"No refactorings for '{0}' available",i.kind):n.preferred?m(880,"No preferred refactorings available"):m(881,"No refactorings available"),{include:Re.Refactor.contains(n.kind)?n.kind:Oe.None,onlyIncludePreferredActions:n.preferred},n.apply,Zt.Refactor)}}class DP extends F{constructor(){super({id:P1,label:L(891,"Source Action..."),precondition:T.and(C.writable,C.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:T.and(C.writable,Gc(Re.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:KS}]}})}run(e,t,i){const n=vn.fromUser(i,{kind:Re.Source,apply:"never"});return Qr(t,typeof i?.kind=="string"?n.preferred?m(882,"No preferred source actions for '{0}' available",i.kind):m(883,"No source actions for '{0}' available",i.kind):n.preferred?m(884,"No preferred source actions available"):m(885,"No source actions available"),{include:Re.Source.contains(n.kind)?n.kind:Oe.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,Zt.SourceAction)}}class EP extends F{constructor(){super({id:Gm,label:L(892,"Organize Imports"),precondition:T.and(C.writable,Gc(Re.SourceOrganizeImports)),kbOpts:{kbExpr:C.textInputFocus,primary:1581,weight:100},metadata:{description:L(893,"Organize imports in the current file. Also called 'Optimize Imports' by some tools")}})}run(e,t){return Qr(t,m(886,"No organize imports action available"),{include:Re.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Zt.OrganizeImports)}}class RP extends F{constructor(){super({id:Zm,label:L(894,"Fix All"),precondition:T.and(C.writable,Gc(Re.SourceFixAll))})}run(e,t){return Qr(t,m(887,"No fix all action available"),{include:Re.SourceFixAll,includeSourceActions:!0},"ifSingle",Zt.FixAll)}}class NP extends F{constructor(){super({id:qS,label:L(895,"Auto Fix..."),precondition:T.and(C.writable,Gc(Re.QuickFix)),kbOpts:{kbExpr:C.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Qr(t,m(888,"No auto fixes available"),{include:Re.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Zt.AutoFix)}}ae($r.ID,$r,3);ae(Qd.ID,Qd,4);he(IP);P(LP);P(DP);P(EP);P(NP);P(RP);K(new xP);Nn.as(Ef.Configuration).registerConfiguration({...dS,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:6,description:m(896,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});Nn.as(Ef.Configuration).registerConfiguration({...dS,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:6,description:m(897,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});Nn.as(Ef.Configuration).registerConfiguration({...dS,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:6,markdownDescription:m(898,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});const Pg=class Pg{constructor(){this.lenses=[]}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){cS(e)&&(this._store??=new W,this._store.add(e));for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}};Pg.Empty=new Pg;let cl=Pg;async function U1(o,e,t){const i=o.ordered(e),n=new Map,s=new cl,r=i.map(async(a,l)=>{n.set(a,l);try{const d=await Promise.resolve(a.provideCodeLenses(e,t));d&&s.add(d,a)}catch(d){Ze(d)}});return await Promise.all(r),t.isCancellationRequested?(s.dispose(),cl.Empty):(s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:n.get(a.provider)<n.get(l.provider)?-1:n.get(a.provider)>n.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),s)}Ee.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;Ce(Le.isUri(t)),Ce(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(G),s=o.get(Yt).getModel(t);if(!s)throw Gn();const r=[],a=new W;return U1(n,s,de.None).then(l=>{a.add(l);const d=[];for(const c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(s,c.symbol,de.None)).then(h=>r.push(h||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var kP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},TP=function(o,e){return function(t,i){e(t,i,o)}};const $1=Rn("ICodeLensCache");class Vw{constructor(e,t){this.lineCount=e,this.data=t}}let Qm=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Wc(20,.75);const t="codelens/cache";TR(Th,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n);const s=Ve.filter(e.onWillSaveState,r=>r.reason===hS.SHUTDOWN);Ve.once(s)(r=>{e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>({range:r.symbol.range,command:r.symbol.command&&{id:"",title:r.symbol.command?.title}})),n=new cl;n.add({lenses:i},this._fakeProvider);const s=new Vw(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const s of i.data.lenses)n.add(s.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],s=[];for(const a of n.lines)s.push({range:new I(a,1,a,11)});const r=new cl;r.add({lenses:s},this._fakeProvider),this._cache.set(i,new Vw(n.lineCount,r))}}catch{}}};Qm=kP([TP(0,Wi)],Qm);os($1,Qm,1);class PP{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}const Vd=class Vd{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${Vd._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let s=0;s<e.length;s++){const r=e[s];if(r&&(n=!0,r.command)){const a=PR(r.command.title.trim());if(r.command.id){const l=`c${Vd._idPool++}`;i.push(B("a",{id:l,title:r.command.tooltip,role:"button"},...a)),this._commands.set(l,r.command)}else i.push(B("span",{title:r.command.tooltip},...a));s+1<e.length&&i.push(B("span",void 0," | "))}}n?(Qh(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Qh(this._domNode,B("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}};Vd._idPool=0;let e_=Vd;class Op{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,n=t.length;i<n;i++)this._addDecorationsCallbacks[i](t[i])}}const Bw=te.register({collapseOnReplaceEdit:!0,description:"codelens"});class Uw{constructor(e,t,i,n,s,r){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a;const l=[];this._data.forEach((d,c)=>{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:Bw},h=>this._decorationIds[c]=h),a?a=I.plusRange(a,d.symbol.range):a=I.lift(d.symbol.range)}),this._viewZone=new PP(a.startLineNumber-1,s,r),this._viewZoneId=n.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new e_(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&I.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:Bw},s=>this._decorationIds[n]=s)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:n}=this._data[t];n.command=i.command||n.command}}}getCommand(e){return this._contentWidget?.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 OP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ql=function(o,e){return function(t,i){e(t,i,o)}},Ua;let ec=(Ua=class{constructor(e,t,i,n,s,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=r,this._disposables=new W,this._localToDispose=new W,this._lenses=[],this._oldCodeLensModels=new W,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new et(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(59)||a.hasChanged(25)||a.hasChanged(24))&&this._updateLensStyle(),a.hasChanged(23)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._resolveCodeLensesScheduler.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61));let t=this._editor.getOption(25);return(!t||t<5)&&(t=this._editor.getOption(61)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(24),n=this._editor.getOption(59),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",uS.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(23)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&no(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new et(()=>{const n=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=dt(s=>U1(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const r=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=r,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},we)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(ke(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{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 Op;r.forEach(d=>{d.dispose(l,s),this._lenses.splice(this._lenses.indexOf(d),1)}),l.commit(n)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(ke(()=>{if(this._editor.getModel()){const n=sl.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if(s?.tagName==="SPAN"&&(s=s.parentElement),s?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new Op;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=sl.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new Op;let c=0,h=0;for(;h<i.length&&c<this._lenses.length;){const g=i[h][0].symbol.range.startLineNumber,u=this._lenses[c].getLineNumber();u<g?(this._lenses[c].dispose(d,l),this._lenses.splice(c,1)):u===g?(this._lenses[c].updateCodeLensSymbols(i[h],d),h++,c++):(this._lenses.splice(c,0,new Uw(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++,h++)}for(;c<this._lenses.length;)this._lenses[c].dispose(d,l),this._lenses.splice(c,1);for(;h<i.length;)this._lenses.push(new Uw(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;d.commit(a)})}),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(r=>{const a=r.computeIfNecessary(e);a&&(t.push(a),i.push(r))}),t.length===0){this._oldCodeLensModels.clear();return}const n=Date.now(),s=dt(r=>{const a=t.map((l,d)=>{const c=new Array(l.length),h=l.map((g,u)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(e,g.symbol,r)).then(f=>{c[u]=f},Ze):(c[u]=g.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!r.isCancellationRequested&&!i[d].isDisposed()&&i[d].updateCommands(c)})});return Promise.all(a)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const r=this._resolveCodeLensesDebounce.update(e,Date.now()-n);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{we(r),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},Ua.ID="css.editor.codeLens",Ua);ec=OP([ql(1,G),ql(2,Hi),ql(3,it),ql(4,Lt),ql(5,$1)],ec);ae(ec.ID,ec,1);P(class extends F{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:C.hasCodeLensProvider,label:L(920,"Show CodeLens Commands for Current Line")})}async run(e,t){if(!t.hasModel())return;const i=e.get(Ai),n=e.get(it),s=e.get(Lt),r=t.getSelection().positionLineNumber,a=t.getContribution(ec.ID);if(!a)return;const l=await a.getModel();if(!l)return;const d=[];for(const g of l.lenses)g.symbol.command&&g.symbol.range.startLineNumber===r&&d.push({label:g.symbol.command.title,command:g.symbol.command});if(d.length===0)return;const c=await i.pick(d,{canPickMany:!1,placeHolder:m(919,"Select a command")});if(!c)return;let h=c.command;if(l.isDisposed){const u=(await a.getModel())?.lenses.find(f=>f.symbol.range.startLineNumber===r&&f.symbol.command?.title===h.title);if(!u||!u.symbol.command)return;h=u.symbol.command}try{await n.executeCommand(h.id,...h.arguments||[])}catch(g){s.error(g)}}});class Mp{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class ld{constructor(e,t,i,n,s,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}class zr{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(const e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}}const ea=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};var z1=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},t_=function(o,e){return function(t,i){e(t,i,o)}};let tc=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,s=t.color,r=new fe(new ol(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),s.alpha)),a=fe.Format.CSS.formatRGB(r),l=fe.Format.CSS.formatHSL(r),d=fe.Format.CSS.formatHexA(r,!0),c=[];return c.push({label:a,textEdit:{range:n,text:a}}),c.push({label:l,textEdit:{range:n,text:l}}),c.push({label:d,textEdit:{range:n,text:d}}),c}};tc=z1([t_(0,as)],tc);let i_=class extends A{constructor(e,t){super(),this._register(e.colorProvider.register("*",new tc(t)))}};i_=z1([t_(0,G),t_(1,as)],i_);async function j1(o,e,t,i="auto"){return GS(new MP,o,e,t,i)}function q1(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class MP{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({colorInfo:r,provider:e});return Array.isArray(s)}}class AP{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)}}class FP{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const s=await e.provideColorPresentations(t,this.colorInfo,de.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)}}async function GS(o,e,t,i,n){let s=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const c=l[d];if(n!=="always"&&c instanceof tc)r=c;else try{await o.compute(c,t,i,a)&&(s=!0)}catch(h){Ze(h)}}return s?a:r&&n!=="never"?(await o.compute(r,t,i,a),a):[]}function K1(o,e){const{colorProvider:t}=o.get(G),i=o.get(Yt).getModel(e);if(!i)throw Gn();const n=o.get(Ie).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,defaultColorDecoratorsEnablement:n}}var WP=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ap=function(o,e){return function(t,i){e(t,i,o)}},n_;const G1=Object.create({});var $s;let hl=($s=class extends A{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new W),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new HP),this._colorDecorationClassRefs=this._register(new W),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new Jx(this._editor)),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:n_.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(s=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167);const a=r!==this._isColorDecoratorsEnabled||s.hasChanged(27),l=s.hasChanged(167);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Fc,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=dt(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new _i(!1),n=await j1(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){we(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:te.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,s)=>this._colorDatas.set(n,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(27);for(let s=0;s<e.length&&t.length<i;s++){const{red:r,green:a,blue:l,alpha:d}=e[s].colorInfo.color,c=new ol(Math.round(r*255),Math.round(a*255),Math.round(l*255),d),h=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,g=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:h}));t.push({range:{startLineNumber:e[s].colorInfo.range.startLineNumber,startColumn:e[s].colorInfo.range.startColumn,endLineNumber:e[s].colorInfo.range.endLineNumber,endColumn:e[s].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:Ux,inlineClassName:`${g.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:G1}}})}const n=i<e.length?i:!1;this._decoratorLimitReporter.update(e.length,n),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(I.fromPositions(e,e)).filter(n=>this._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},n_=$s,$s.ID="editor.contrib.colorDetector",$s.RECOMPUTE_TIME=1e3,$s);hl=n_=WP([Ap(1,Ie),Ap(2,G),Ap(3,Hi)],hl);class HP extends A{constructor(){super(...arguments),this._onDidChange=this._register(new Y),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}const Z1="editor.action.showHover",VP="editor.action.showDefinitionPreviewHover",BP="editor.action.hideHover",UP="editor.action.scrollUpHover",$P="editor.action.scrollDownHover",zP="editor.action.scrollLeftHover",jP="editor.action.scrollRightHover",qP="editor.action.pageUpHover",KP="editor.action.pageDownHover",GP="editor.action.goToTopHover",ZP="editor.action.goToBottomHover",Zf="editor.action.increaseHoverVerbosityLevel",XP=m(1145,"Increase Hover Verbosity Level"),Xf="editor.action.decreaseHoverVerbosityLevel",YP=m(1146,"Decrease Hover Verbosity Level"),s_="editor.action.hideLongLineWarningHover",ul="editor.action.inlineSuggest.commit",Yf="editor.action.inlineSuggest.commitAlternativeAction",X1="editor.action.inlineSuggest.showPrevious",Y1="editor.action.inlineSuggest.showNext",J1="editor.action.inlineSuggest.jump",Q1="editor.action.inlineSuggest.hide",o_="editor.action.inlineSuggest.toggleShowCollapsed",$w="editor.action.inlineSuggest.renameSymbol";var ZS=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ni=function(o,e){return function(t,i){e(t,i,o)}},Vh;let r_=class extends A{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=xt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar==="always"),this.sessionPosition=void 0,this.position=R(this,n=>{const s=this.model.read(n)?.primaryGhostText.read(n);if(!this.alwaysShowToolbar.read(n)||!s||s.parts.length===0)return this.sessionPosition=void 0,null;const r=s.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==s.lineNumber&&(this.sessionPosition=void 0);const a=new $(s.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(Vc((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=R(d=>{const c=d.store.add(this.instantiationService.createInstance(gl.hot.read(d),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(c),d.store.add(ke(()=>e.removeContentWidget(c))),d.store.add(le(h=>{this.position.read(h)&&r.lastTriggerKind.read(h)!==ni.Explicit&&r.triggerExplicitly()})),c}),l=So(this,(d,c)=>!!this.position.read(d)||!!c);s.add(le(d=>{l.read(d)&&a.read(d)}))}))}};r_=ZS([Ni(2,ee)],r_);const JP=ze("inline-suggestion-hints-next",U.chevronRight,m(1250,"Icon for show next parameter hint.")),QP=ze("inline-suggestion-hints-previous",U.chevronLeft,m(1251,"Icon for show previous parameter hint."));var bn;let gl=(bn=class extends A{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new rl(e,t,i,!0,()=>this._commandService.executeCommand(e));return n.tooltip=this.keybindingService.appendKeybinding(t,e,this._contextKeyService),n}constructor(e,t,i,n,s,r,a,l,d,c,h,g,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=r,this._warning=a,this._relayout=l,this._commandService=d,this.keybindingService=h,this._contextKeyService=g,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${Vh.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=R(f=>{const p=this._warning.read(f);return p?typeof p.message=="string"?p.message:f.store.add(xf(p.message)).element:void 0}),this._warningMessageNode=j.div({class:"warningMessage",style:{maxWidth:400,margin:4,marginBottom:4,display:R(f=>this._warning.read(f)?"block":"none")}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=qd("div.inlineSuggestionsHints",{className:this.withBorder?"monaco-hover monaco-hover-content":""},[this._warningMessageNode.element,qd("div@toolBar")]),this.previousAction=this._register(this.createCommandAction(X1,m(1252,"Previous"),ce.asClassName(QP))),this.availableSuggestionCountAction=this._register(new rl("inlineSuggestionHints.availableSuggestionCount","",void 0,!1)),this.nextAction=this._register(this.createCommandAction(Y1,m(1253,"Next"),ce.asClassName(JP))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(q.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new et(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new et(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(le(f=>{this._warningMessageContentNode.read(f),this._warningMessageNode.readEffect(f),this._relayout()})),this.toolBar=this._register(c.createInstance(a_,this.nodes.toolBar,q.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:f=>f.startsWith("primary")},actionViewItemProvider:(f,p)=>{if(f instanceof Or)return c.createInstance(tO,f,void 0);if(f===this.availableSuggestionCountAction){const _=new eO(void 0,f,{label:!0,icon:!1});return _.setClass("availableSuggestionCount"),_}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(f=>{Vh._dropDownVisible=f})),this._register(le(f=>{this._position.read(f),this.editor.layoutContentWidget(this)})),this._register(le(f=>{const p=this._suggestionCount.read(f),_=this._currentSuggestionIdx.read(f);p!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${_+1}/${p}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),p!==void 0&&p>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(le(f=>{const _=this._extraCommands.read(f).map(v=>({class:void 0,id:v.command.id,enabled:!0,tooltip:v.command.tooltip||"",label:v.command.title,run:()=>this._commandService.executeCommand(v.command.id,...v.command.arguments??[])}));for(const[v,S]of this.inlineCompletionsActionsMenus.getActions())for(const y of S)y instanceof Or&&_.push(y);_.length>0&&_.unshift(new Kd),this.toolBar.setAdditionalSecondaryActions(_)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},Vh=bn,bn.hot=gS(bn),bn._dropDownVisible=!1,bn.id=0,bn);gl=Vh=ZS([Ni(8,it),Ni(9,ee),Ni(10,Te),Ni(11,pe),Ni(12,bo)],gl);class eO extends Im{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}class tO extends fS{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){const t=qd("div.keybinding").root;this._register(new Oc(t,Mc,{disableTitle:!0,...Qx})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}}let a_=class extends OR{constructor(e,t,i,n,s,r,a,l,d){super(e,{resetMenu:t,...i},n,s,r,a,l,d),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const{primary:e,secondary:t}=eL(this.menu.getActions(this.options2?.menuOptions),this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions);t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),e.push(...this.additionalPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){sn(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){sn(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};a_=ZS([Ni(3,bo),Ni(4,pe),Ni(5,Hc),Ni(6,Te),Ni(7,it),Ni(8,vo)],a_);function Jf(o,e,t){const i=Tt(o);return!(e<i.left+3||e>i.left+i.width-3||t<i.top+3||t>i.top+i.height-3)}function eD(o,e,t){return o==="on"?!0:o==="off"?!1:XS(e,t.event)}function XS(o,e){return o==="altKey"?e.ctrlKey||e.metaKey:e.altKey}class iO{constructor(e,t,i,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=i,this.options=n}}class tD extends A{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new Y),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new Fp(i=>this._triggerAsyncComputation(i),0)),this._syncComputationScheduler=this._register(new Fp(i=>this._triggerSyncComputation(i),0)),this._loadingMessageScheduler=this._register(new Fp(i=>this._triggerLoadingMessage(i),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=MR(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(const t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0,e)}catch(t){we(t)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){this._state===3&&this._setState(4,e)}_fireResult(e){if(this._state===1||this._state===2)return;const t=this._state===0,i=this._state===4;this._onResult.fire(new iO(this._result.slice(0),t,i,e))}start(e,t){if(e===0)this._state===0&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}}class Fp extends A{constructor(e,t){super(),this._scheduler=this._register(new et(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}}class YS{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new Y,this._onDidResize=new Y,this._sashListener=new W,this._size=new xe(0,0),this._minSize=new xe(0,0),this._maxSize=new xe(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new ya(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new ya(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new ya(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:ZC.North}),this._southSash=new ya(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:ZC.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(Ve.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(Ve.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Ve.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Ve.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(r,t));const a=new xe(t,e);xe.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 nO=30,sO=24;class oO extends A{constructor(e,t=new xe(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new YS),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=xe.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new xe(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?$.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Tt(t).top+i.top-nO}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=Tt(t),s=Bc(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-sO}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),s=Math.min(Math.max(n,i),e),r=Math.min(e,s);let a;return this._editor.getOption(69).above?a=r<=n?1:2:a=r<=i?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}var rO=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},oh=function(o,e){return function(t,i){e(t,i,o)}},yi;const zw=30;var zs;let l_=(zs=class extends oO{get isVisibleFromKeyboard(){return this._renderedHover?.source===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,s){const r=e.getOption(75)+8,a=150,l=new xe(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new tL(!0)),this._onDidResize=this._register(new Y),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new Y),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new Y),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=l,this._hoverVisibleKey=C.hoverVisible.bindTo(t),this._hoverFocusedKey=C.hoverFocused.bindTo(t),z(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._resizableNode.domNode.className="monaco-resizable-hover",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(59)&&this._updateFont()}));const d=this._register(As(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(c=>{this._onDidScroll.fire(c)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return yi.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return yi._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return yi._applyDimensions(i,e,t)}_setScrollableElementDimensions(e,t){const i=this._hover.scrollbar.getDomNode();return yi._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){yi._applyMaxDimensions(this._hover.contentsDomNode,e,t),yi._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),yi._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none"),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new xe(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){yi._lastDimensions=new xe(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){const e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let i=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{i+=n.clientHeight}),Math.min(e,i)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidth<t?Bc(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth}isMouseGettingCloser(e,t){if(!this._renderedHover)return!1;if(this._renderedHover.initialMousePosX===void 0||this._renderedHover.initialMousePosY===void 0)return this._renderedHover.initialMousePosX=e,this._renderedHover.initialMousePosY=t,!1;const i=Tt(this.getDomNode());this._renderedHover.closestMouseDistance===void 0&&(this._renderedHover.closestMouseDistance=jw(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,i.left,i.top,i.width,i.height));const n=jw(e,t,i.left,i.top,i.width,i.height);return n>this._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,n),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(59),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(s=>this._editor.applyFontInfo(s))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,yi._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,yi._lastDimensions.width);this._resizableNode.maxSize=new xe(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=Ia(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const s=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&AR(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");s&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+s)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new xe(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto"),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new xe(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new xe(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.contentsDomNode;let t=Ia(e),i=Ei(e)+2;if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=Ia(e),i=Ei(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const n=Ia(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(n,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-zw})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+zw})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}},yi=zs,zs.ID="editor.contrib.resizableContentHoverWidget",zs._lastDimensions=new xe(0,0),zs);l_=yi=rO([oh(1,pe),oh(2,Ie),oh(3,Co),oh(4,Te)],l_);function jw(o,e,t,i,n,s){const r=t+n/2,a=i+s/2,l=Math.max(Math.abs(o-r)-n/2,0),d=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+d*d)}class uu{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:s;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e,t){const i=e.anchor;if(!this._editor.hasModel()||!i)return yn.EMPTY;const n=uu._getLineDecorations(this._editor,i);return yn.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(i,n,e.source,t):yn.EMPTY))}computeSync(e){if(!this._editor.hasModel())return[];const t=e.anchor,i=uu._getLineDecorations(this._editor,t);let n=[];for(const s of this._participants)n=n.concat(s.computeSync(t,i,e.source));return _o(n)}}class iD{constructor(e,t,i){this.hoverParts=e,this.isComplete=t,this.options=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new aO(this,t,this.isComplete,this.options)}}class aO extends iD{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}var lO=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qw=function(o,e){return function(t,i){e(t,i,o)}};const Kw=B;let gu=class extends A{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=Kw("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=z(this.hoverElement,Kw("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(FR.render(this.actionsElement,e,i));return this._register(this._hoverService.setupManagedHover(iL("element"),n.actionContainer,n.actionRenderedLabel)),this.actions.push(n),n}append(e){const t=z(this.actionsElement,e);return this._hasContent=!0,t}};gu=lO([qw(0,Te),qw(1,bi)],gu);const St=class St{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 i of t){const n=i.options;if(n===St._FIND_MATCH_DECORATION||n===St._FIND_MATCH_NO_OVERVIEW_DECORATION||n===St._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let n=0,s=this._decorations.length;n<s;n++){const r=this._editor.getModel().getDecorationRange(this._decorations[n]);if(e.equalsRange(r)){t=this._decorations[n],i=n+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(n=>{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,St._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,St._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.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 I(s.startLineNumber,s.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(s,St._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=St._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){n=St._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),d=this._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/d));let h=e[0].range.startLineNumber,g=e[0].range.endLineNumber;for(let u=1,f=e.length;u<f;u++){const p=e[u].range;g+c>=p.startLineNumber?p.endLineNumber>g&&(g=p.endLineNumber):(s.push({range:new I(h,1,g,1),options:St._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=p.startLineNumber,g=p.endLineNumber)}s.push({range:new I(h,1,g,1),options:St._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:n};this._decorations=i.deltaDecorations(this._decorations,r),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,s),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>i.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,St._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumber<e.lineNumber)return n;if(!(n.endColumn>e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;t<i;t++){const n=this._decorations[t],s=this._editor.getModel().getDecorationRange(n);if(!(!s||s.startLineNumber<e.lineNumber)){if(s.startLineNumber>e.lineNumber)return s;if(!(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}};St._CURRENT_FIND_MATCH_DECORATION=te.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",inlineClassName:"currentFindMatchInline",showIfCollapsed:!0,overviewRuler:{color:Xe(yp),position:wn.Center},minimap:{color:Xe(XC),position:1}}),St._FIND_MATCH_DECORATION=te.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",inlineClassName:"findMatchInline",showIfCollapsed:!0,overviewRuler:{color:Xe(yp),position:wn.Center},minimap:{color:Xe(XC),position:1}}),St._FIND_MATCH_NO_OVERVIEW_DECORATION=te.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0}),St._FIND_MATCH_ONLY_OVERVIEW_DECORATION=te.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:Xe(yp),position:wn.Center}}),St._RANGE_HIGHLIGHT_DECORATION=te.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0}),St._FIND_SCOPE_DECORATION=te.register({description:"find-scope",className:"findScope",isWholeLine:!0});let d_=St;class dO{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const i=[];for(let r=0;r<this._ranges.length;r++)i.push({range:this._ranges[r],text:this._replaceStrings[r]});i.sort((r,a)=>I.compareRangesUsingStarts(r.range,a.range));const n=[];let s=i[0];for(let r=1;r<i.length;r++)s.range.endLineNumber===i[r].range.startLineNumber&&s.range.endColumn===i[r].range.startColumn?(s.range=s.range.plusRange(i[r].range),s.text=s.text+i[r].text):(n.push(s),s=i[r]);n.push(s);for(const r of n)t.addEditOperation(r.range,r.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function nD(o,e){if(o&&o[0]!==""){const t=Gw(o,e,"-"),i=Gw(o,e,"_");return t&&!i?Zw(o,e,"-"):!t&&i?Zw(o,e,"_"):o[0].toUpperCase()===o[0]?e.toUpperCase():o[0].toLowerCase()===o[0]?e.toLowerCase():WR(o[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):o[0][0].toUpperCase()!==o[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function Gw(o,e,t){return o[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&o[0].split(t).length===e.split(t).length}function Zw(o,e,t){const i=e.split(t),n=o[0].split(t);let s="";return i.forEach((r,a)=>{s+=nD([n[a]],r)+t}),s.slice(0,-1)}class Xw{constructor(e){this.staticValue=e,this.kind=0}}class cO{constructor(e){this.pieces=e,this.kind=1}}class fl{static fromStaticValue(e){return new fl([jo.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new Xw(""):e.length===1&&e[0].staticValue!==null?this._state=new Xw(e[0].staticValue):this._state=new cO(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?nD(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,s=this._state.pieces.length;n<s;n++){const r=this._state.pieces[n];if(r.staticValue!==null){i+=r.staticValue;continue}let a=fl._substitute(r.matchIndex,e);if(r.caseOps!==null&&r.caseOps.length>0){const l=[],d=r.caseOps.length;let c=0;for(let h=0,g=a.length;h<g;h++){if(c>=d){l.push(a.slice(h));break}switch(r.caseOps[c]){case"U":l.push(a[h].toUpperCase());break;case"u":l.push(a[h].toUpperCase()),c++;break;case"L":l.push(a[h].toLowerCase());break;case"l":l.push(a[h].toLowerCase()),c++;break;default:l.push(a[h])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class jo{static staticValue(e){return new jo(e,-1,null)}static caseOps(e,t){return new jo(null,e,t)}constructor(e,t,i){this.staticValue=e,this.matchIndex=t,!i||i.length===0?this.caseOps=null:this.caseOps=i.slice(0)}}class hO{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,i){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=jo.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=jo.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=jo.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new fl(this._result)}}function uO(o){if(!o||o.length===0)return new fl(null);const e=[],t=new hO(o);for(let i=0,n=o.length;i<n;i++){const s=o.charCodeAt(i);if(s===92){if(i++,i>=n)break;const r=o.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(`
|