@reformer/builder 1.0.0 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +108 -8
  2. package/bin/reformer-builder.d.mts +36 -0
  3. package/bin/reformer-builder.mjs +112 -15
  4. package/dist/assets/App-EWxVyd71.js +1148 -0
  5. package/dist/assets/BootError-8gklkOEj.js +1 -0
  6. package/dist/assets/CodeEditor-152n3d6e.js +2 -0
  7. package/dist/assets/RawJsonEditor-CkDLPhsI.js +1 -0
  8. package/dist/assets/boot-CGsYMAQp.js +2 -0
  9. package/dist/assets/{freemarker2-Dc63E2SW.js → freemarker2-BQAfMb99.js} +2 -2
  10. package/dist/assets/handlebars-Brdeuzw5.js +1 -0
  11. package/dist/assets/html-BjYaOi8p.js +1 -0
  12. package/dist/assets/index-4oDdZ-Yj.js +3 -0
  13. package/dist/assets/index-BLGbxQaR.js +104 -0
  14. package/dist/assets/index-BLqONGUt.js +68 -0
  15. package/dist/assets/index-BgGwGI4q.js +4709 -0
  16. package/dist/assets/index-CFDCSwb2.js +1 -0
  17. package/dist/assets/index-CSZOipZ8.js +10 -0
  18. package/dist/assets/index-Crsub4wy.js +5028 -0
  19. package/dist/assets/index-DIgOR-JL.css +1 -0
  20. package/dist/assets/index-DzAasWzr.css +1 -0
  21. package/dist/assets/index-Uhx9KLCG.js +11 -0
  22. package/dist/assets/javascript-CTKhG5-q.js +1 -0
  23. package/dist/assets/{jsonMode-CemXzEMj.js → jsonMode-D3mpWOQQ.js} +3 -3
  24. package/dist/assets/liquid-CSjp0MaB.js +1 -0
  25. package/dist/assets/load-DQmdgTkV.js +11 -0
  26. package/dist/assets/mdx-Bc5quPBk.js +1 -0
  27. package/dist/assets/{monaco-setup-wGOKhcUo.js → monaco-setup-BytXwQeQ.js} +34 -34
  28. package/dist/assets/python-DuAl67Eo.js +1 -0
  29. package/dist/assets/razor-BbXkrvwj.js +1 -0
  30. package/dist/assets/reformer-ui-kit-11-DNMUPUyd.js +1 -0
  31. package/dist/assets/reformer-ui-kit-1LAJcT8b.js +1 -0
  32. package/dist/assets/typescript-0wJoIq5V.js +1 -0
  33. package/dist/assets/typescript-Bjd-gS8c.js +433 -0
  34. package/dist/assets/useFormField-BLbvmpme-4e6SCAMU.js +1 -0
  35. package/dist/assets/xml-bMgZPd2t.js +1 -0
  36. package/dist/assets/yaml-yApvoFdI.js +1 -0
  37. package/dist/index.html +2 -2
  38. package/package.json +9 -2
  39. package/runtime-config.schema.json +82 -0
  40. package/dist/assets/CodeEditor-C27y3JNW.js +0 -2
  41. package/dist/assets/RawJsonEditor-BS5r3i2P.js +0 -1
  42. package/dist/assets/handlebars-CN4ggFMI.js +0 -1
  43. package/dist/assets/html-BJ_0FZ4N.js +0 -1
  44. package/dist/assets/index-BVjlK0OP.js +0 -817
  45. package/dist/assets/index-DYDLCcUp.css +0 -1
  46. package/dist/assets/javascript-ChLWbrPC.js +0 -1
  47. package/dist/assets/liquid-DT0mZNaG.js +0 -1
  48. package/dist/assets/mdx-D1JAVlmB.js +0 -1
  49. package/dist/assets/python-D3Fng_k0.js +0 -1
  50. package/dist/assets/razor-BXCxNJBR.js +0 -1
  51. package/dist/assets/typescript-BtZpkOs3.js +0 -1
  52. package/dist/assets/xml-CeLodlPg.js +0 -1
  53. package/dist/assets/yaml-DSrp7EaV.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,E as vi,d as C,r as he,e as Mi,f as m,h as dR,i as Ee,R as ie,S as J,j as It,k as mi,m as pe,n as ae,o as P,p as F,K as Ge,q as V,s as A,t as et,u as I,v as te,O as wn,w as Xe,P as $,x as Tc,y as cR,z as Cp,B as Pc,G as Ux,$ as B,T as ce,H as re,J as Pe,L as ee,N as Ke,Q as no,U as W,V as Zh,W as xf,X as hR,Y as Ve,Z as uR,_ as Xr,a0 as Mt,a1 as K,a2 as so,a3 as G,a4 as Nt,a5 as _o,a6 as gR,a7 as $x,a8 as Le,a9 as mt,aa as wm,ab as zx,ac as jx,ad as Te,ae as Lf,af as fR,ag as Oc,ah as Mc,ai as ye,aj as pR,ak as pi,al as mR,am as oo,an as Je,ao as Y,ap as ke,aq as tS,ar as Es,as as _R,at as z,au as Vn,av as od,aw as vR,ax as Ht,ay as Xh,az as bR,aA as iS,aB as Rn,aC as os,aD as wp,aE as As,aF as SR,aG as Tt,aH as Ac,aI as Lt,aJ as Tr,aK as CR,aL as rs,aM as nS,aN as dt,aO as qx,aP as GC,aQ as sS,aR as il,aS as wR,aT as yR,aU as Pt,aV as li,aW as it,aX as Ai,aY as IR,aZ as Dl,a_ as Kx,a$ as oS,b0 as Gx,b1 as Yh,b2 as xR,b3 as LR,b4 as DR,b5 as Jh,b6 as ER,b7 as Ze,b8 as Gn,b9 as Yt,ba as de,bb as Un,bc as RR,bd as sn,be as ri,bf as vo,bg as rS,bh as $d,bi as Pr,bj as Zx,bk as aS,bl as nt,bm as Fc,bn as ro,bo as rd,bp as ze,bq as ym,br as Ne,bs as R,bt as Xx,bu as NR,bv as le,bw as lS,bx as we,by as Df,bz as nl,bA as kR,bB as Yx,bC as zd,bD as ao,bE as jd,bF as Nn,bG as Ef,bH as dS,bI as cS,bJ as Ce,bK as Wi,bL as Wc,bM as TR,bN as Th,bO as hS,bP as PR,bQ as Qh,bR as uS,bS as sl,bT as Hi,bU as as,bV as fe,bW as ol,bX as Jx,bY as _i,bZ as gS,b_ as rl,b$ as j,c0 as qd,c1 as Or,c2 as Kd,c3 as bo,c4 as Im,c5 as fS,c6 as Qx,c7 as OR,c8 as eL,c9 as Hc,ca as xt,cb as Vc,cc as ni,cd as So,ce as MR,cf as xe,cg as ya,ch as ZC,ci as Bc,cj as tL,ck as Ia,cl as AR,cm as Ei,cn as Co,co as yn,cp as bi,cq as FR,cr as iL,cs as XC,ct as yp,cu as WR,cv as kt,cw as nL,cx as HR,cy as sL,cz as Uc,cA as VR,cB as oL,cC as di,cD as BR,cE as lo,cF as pS,cG as UR,cH as YC,cI as JC,cJ as $R,cK as xa,cL as rL,cM as zR,cN as jR,cO as Ln,cP as qR,cQ as KR,cR as Yn,cS as aL,cT as lL,cU as $t,cV as wo,cW as Gd,cX as dL,cY as gi,cZ as Mr,c_ as Ar,c$ as GR,d0 as ZR,d1 as XR,d2 as cL,d3 as Ph,d4 as xm,d5 as YR,d6 as yt,d7 as mS,d8 as hL,d9 as st,da as Rf,db as _S,dc as vS,dd as JR,de as QR,df as QC,dg as e0,dh as $c,di as Lm,dj as Fr,dk as We,dl as co,dm as t0,dn as ki,dp as si,dq as ew,dr as El,ds as Jn,dt as on,du as i0,dv as ci,dw as al,dx as Nf,dy as uL,dz as n0,dA as s0,dB as bS,dC as o0,dD as Zd,dE as r0,dF as tw,dG as a0,dH as eu,dI as gL,dJ as iw,dK as l0,dL as d0,dM as c0,dN as SS,dO as fL,dP as pL,dQ as mL,dR as _L,dS as h0,dT as Fs,dU as u0,dV as vL,dW as bL,dX as g0,dY as kf,dZ as f0,d_ as SL,d$ as $e,e0 as CS,e1 as p0,e2 as Ao,e3 as nw,e4 as m0,e5 as _0,e6 as v0,e7 as b0,e8 as S0,e9 as C0,ea as at,eb as Tf,ec as CL,ed as Rl,ee as Dm,ef as w0,eg as y0,eh as Em,ei as I0,ej as x0,ek as L0,el as D0,em as E0,en as R0,eo as Pf,ep as Of,eq as wL,er as yL,es as N0,et as Ye,eu as sw,ev as k0,ew as Nl,ex as T0,ey as ad,ez as wS,eA as ow,eB as Xd,eC as tu,eD as P0,eE as O0,eF as IL,eG as M0,eH as A0,eI as F0,eJ as rw,eK as xL,eL as _t,eM as ih,eN as W0,eO as yS,eP as H0,eQ as V0,eR as B0,eS as U0,eT as $0,eU as iu,eV as z0,eW as Qn,eX as Sd,eY as Ct,eZ as Cd,e_ as ll,e$ as nh,f0 as LL,f1 as Ip,f2 as DL,f3 as EL,f4 as j0,f5 as q0,f6 as Oh,f7 as RL,f8 as K0,f9 as G0,fa as Z0,fb as IS,fc as X0,fd as Ma,fe as xp,ff as Y0,fg as J0,fh as Q0,fi as aw,fj as lw,fk as dw,fl as eN,fm as tN,fn as $n,fo as en,fp as iN,fq as xs,fr as nN,fs as NL,ft as Ae,fu as dl,fv as In,fw as kL,fx as sN,fy as oN,fz as rN,fA as Rm,fB as Mf,fC as aN,fD as lN,fE as ai,fF as es,fG as TL,fH as xS,fI as Be,fJ as dN,fK as Mh,fL as LS,fM as cN,fN as hN,fO as uN,fP as gN,fQ as Ul,fR as cw,fS as fN,fT as DS,fU as pN,fV as mN,fW as _N,fX as Zn,fY as ES,fZ as vN,f_ as Rs,f$ as bN,g0 as SN,g1 as RS,g2 as CN,g3 as wN,g4 as hw,g5 as NS,g6 as Nm,g7 as yN,g8 as IN,g9 as xn,ga as PL,gb as OL,gc as xN,gd as ML,ge as AL,gf as LN,gg as DN,gh as EN,gi as uw,gj as gw,gk as RN,gl as NN,gm as kN,gn as Aa,go as TN,gp as PN,gq as ON,gr as kS,gs as MN,gt as AN,gu as FN,gv as nu,gw as WN,gx as HN,gy as fw,gz as pn,gA as pw,gB as Qe,gC as _e,gD as mw,gE as TS,gF as Ah,gG as VN,gH as BN,gI as Af,gJ as FL,gK as WL,gL as UN,gM as $N,gN as zN,gO as jN,gP as qN,gQ as km,gR as KN,gS as GN,gT as ZN,gU as XN,gV as HL,gW as YN,gX as su,gY as ls,gZ as VL,g_ as JN,g$ as BL,h0 as QN,h1 as _w,h2 as vw,h3 as Tm,h4 as Lp,h5 as ek,h6 as tk,h7 as ik,h8 as kl,h9 as UL,ha as nk,hb as ou,hc as $L,hd as sk,he as zL,hf as jL,hg as qL,hh as ok,hi as Pi,hj as rk,hk as Vo,hl as La,hm as sh,hn as KL,ho as GL,hp as Fh,hq as PS,hr as zn,hs as ak,ht as bw,hu as lk,hv as ZL,hw as XL,hx as dk,hy as OS,hz as ck,hA as Sw,hB as hk,hC as Ff,hD as uk,hE as gk,hF as fk,hG as Wf,hH as Hf,hI as Vf,hJ as Bf,hK as YL,hL as pk,hM as mk,hN as _k,hO as vk,hP as JL,hQ as MS,hR as QL,hS as bk,hT as Cw,hU as ww,hV as yw,hW as Sk,hX as Ck,hY as wk,hZ as Iw,h_ as yk,h$ as Ik,i0 as zc,i1 as xk,i2 as Lk,i3 as e1,i4 as $l,i5 as Dk,i6 as Ek,i7 as Wh,i8 as Rk,i9 as xw,ia as Nk,ib as kk,ic as Tk,id as AS,ie as FS,ig as Pk,ih as Ok,ii as Mk,ij as Ak,ik as t1,il as Uf,im as Fk,io as ru,ip as Ws,iq as Wk,ir as Hk,is as Vk,it as WS,iu as i1,iv as Lw,iw as Dw,ix as Bk,iy as Uk,iz as Ew,iA as Dp,iB as $k,iC as zk,iD as jk,iE as Ep,iF as n1,iG as s1,iH as o1,iI as r1,iJ as ts,iK as a1,iL as HS,iM as Rw,iN as qk,iO as l1,iP as Kk,iQ as Gk,iR as $f,iS as Yr,iT as zf,iU as jc,iV as Zk,iW as jf,iX as Xk,iY as Nw,iZ as Yk,i_ as d1,i$ as zl,j0 as Jk,j1 as Qk,j2 as eT,j3 as tT,j4 as Tl,j5 as iT,j6 as c1,j7 as h1,j8 as nT,j9 as qf,ja as Pm,jb as sT,jc as oT,jd as rT,je as Om,jf as aT,jg as lT,jh as dT,ji as cT,jj as hT,jk as uT,jl as gT,jm as fT,jn as u1,jo as pT,jp as mT,jq as _T,jr as kw,js as vT,jt as bT,ju as Ri,jv as g1,l as pt,jw as f1,jx as jl}from"./monaco-setup-wGOKhcUo.js";import"./index-BVjlK0OP.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,E as vi,d as C,r as he,e as Mi,f as m,h as dR,i as Ee,R as ie,S as J,j as It,k as mi,m as pe,n as ae,o as P,p as F,K as Ge,q as V,s as A,t as et,u as I,v as te,O as wn,w as Xe,P as $,x as Tc,y as cR,z as Cp,B as Pc,G as Ux,$ as B,T as ce,H as re,J as Pe,L as ee,N as Ke,Q as no,U as W,V as Zh,W as xf,X as hR,Y as Ve,Z as uR,_ as Xr,a0 as Mt,a1 as K,a2 as so,a3 as G,a4 as Nt,a5 as _o,a6 as gR,a7 as $x,a8 as Le,a9 as mt,aa as wm,ab as zx,ac as jx,ad as Te,ae as Lf,af as fR,ag as Oc,ah as Mc,ai as ye,aj as pR,ak as pi,al as mR,am as oo,an as Je,ao as Y,ap as ke,aq as tS,ar as Es,as as _R,at as z,au as Vn,av as od,aw as vR,ax as Ht,ay as Xh,az as bR,aA as iS,aB as Rn,aC as os,aD as wp,aE as As,aF as SR,aG as Tt,aH as Ac,aI as Lt,aJ as Tr,aK as CR,aL as rs,aM as nS,aN as dt,aO as qx,aP as GC,aQ as sS,aR as il,aS as wR,aT as yR,aU as Pt,aV as li,aW as it,aX as Ai,aY as IR,aZ as Dl,a_ as Kx,a$ as oS,b0 as Gx,b1 as Yh,b2 as xR,b3 as LR,b4 as DR,b5 as Jh,b6 as ER,b7 as Ze,b8 as Gn,b9 as Yt,ba as de,bb as Un,bc as RR,bd as sn,be as ri,bf as vo,bg as rS,bh as $d,bi as Pr,bj as Zx,bk as aS,bl as nt,bm as Fc,bn as ro,bo as rd,bp as ze,bq as ym,br as Ne,bs as R,bt as Xx,bu as NR,bv as le,bw as lS,bx as we,by as Df,bz as nl,bA as kR,bB as Yx,bC as zd,bD as ao,bE as jd,bF as Nn,bG as Ef,bH as dS,bI as cS,bJ as Ce,bK as Wi,bL as Wc,bM as TR,bN as Th,bO as hS,bP as PR,bQ as Qh,bR as uS,bS as sl,bT as Hi,bU as as,bV as fe,bW as ol,bX as Jx,bY as _i,bZ as gS,b_ as rl,b$ as j,c0 as qd,c1 as Or,c2 as Kd,c3 as bo,c4 as Im,c5 as fS,c6 as Qx,c7 as OR,c8 as eL,c9 as Hc,ca as xt,cb as Vc,cc as ni,cd as So,ce as MR,cf as xe,cg as ya,ch as ZC,ci as Bc,cj as tL,ck as Ia,cl as AR,cm as Ei,cn as Co,co as yn,cp as bi,cq as FR,cr as iL,cs as XC,ct as yp,cu as WR,cv as kt,cw as nL,cx as HR,cy as sL,cz as Uc,cA as VR,cB as oL,cC as di,cD as BR,cE as lo,cF as pS,cG as UR,cH as YC,cI as JC,cJ as $R,cK as xa,cL as rL,cM as zR,cN as jR,cO as Ln,cP as qR,cQ as KR,cR as Yn,cS as aL,cT as lL,cU as $t,cV as wo,cW as Gd,cX as dL,cY as gi,cZ as Mr,c_ as Ar,c$ as GR,d0 as ZR,d1 as XR,d2 as cL,d3 as Ph,d4 as xm,d5 as YR,d6 as yt,d7 as mS,d8 as hL,d9 as st,da as Rf,db as _S,dc as vS,dd as JR,de as QR,df as QC,dg as e0,dh as $c,di as Lm,dj as Fr,dk as We,dl as co,dm as t0,dn as ki,dp as si,dq as ew,dr as El,ds as Jn,dt as on,du as i0,dv as ci,dw as al,dx as Nf,dy as uL,dz as n0,dA as s0,dB as bS,dC as o0,dD as Zd,dE as r0,dF as tw,dG as a0,dH as eu,dI as gL,dJ as iw,dK as l0,dL as d0,dM as c0,dN as SS,dO as fL,dP as pL,dQ as mL,dR as _L,dS as h0,dT as Fs,dU as u0,dV as vL,dW as bL,dX as g0,dY as kf,dZ as f0,d_ as SL,d$ as $e,e0 as CS,e1 as p0,e2 as Ao,e3 as nw,e4 as m0,e5 as _0,e6 as v0,e7 as b0,e8 as S0,e9 as C0,ea as at,eb as Tf,ec as CL,ed as Rl,ee as Dm,ef as w0,eg as y0,eh as Em,ei as I0,ej as x0,ek as L0,el as D0,em as E0,en as R0,eo as Pf,ep as Of,eq as wL,er as yL,es as N0,et as Ye,eu as sw,ev as k0,ew as Nl,ex as T0,ey as ad,ez as wS,eA as ow,eB as Xd,eC as tu,eD as P0,eE as O0,eF as IL,eG as M0,eH as A0,eI as F0,eJ as rw,eK as xL,eL as _t,eM as ih,eN as W0,eO as yS,eP as H0,eQ as V0,eR as B0,eS as U0,eT as $0,eU as iu,eV as z0,eW as Qn,eX as Sd,eY as Ct,eZ as Cd,e_ as ll,e$ as nh,f0 as LL,f1 as Ip,f2 as DL,f3 as EL,f4 as j0,f5 as q0,f6 as Oh,f7 as RL,f8 as K0,f9 as G0,fa as Z0,fb as IS,fc as X0,fd as Ma,fe as xp,ff as Y0,fg as J0,fh as Q0,fi as aw,fj as lw,fk as dw,fl as eN,fm as tN,fn as $n,fo as en,fp as iN,fq as xs,fr as nN,fs as NL,ft as Ae,fu as dl,fv as In,fw as kL,fx as sN,fy as oN,fz as rN,fA as Rm,fB as Mf,fC as aN,fD as lN,fE as ai,fF as es,fG as TL,fH as xS,fI as Be,fJ as dN,fK as Mh,fL as LS,fM as cN,fN as hN,fO as uN,fP as gN,fQ as Ul,fR as cw,fS as fN,fT as DS,fU as pN,fV as mN,fW as _N,fX as Zn,fY as ES,fZ as vN,f_ as Rs,f$ as bN,g0 as SN,g1 as RS,g2 as CN,g3 as wN,g4 as hw,g5 as NS,g6 as Nm,g7 as yN,g8 as IN,g9 as xn,ga as PL,gb as OL,gc as xN,gd as ML,ge as AL,gf as LN,gg as DN,gh as EN,gi as uw,gj as gw,gk as RN,gl as NN,gm as kN,gn as Aa,go as TN,gp as PN,gq as ON,gr as kS,gs as MN,gt as AN,gu as FN,gv as nu,gw as WN,gx as HN,gy as fw,gz as pn,gA as pw,gB as Qe,gC as _e,gD as mw,gE as TS,gF as Ah,gG as VN,gH as BN,gI as Af,gJ as FL,gK as WL,gL as UN,gM as $N,gN as zN,gO as jN,gP as qN,gQ as km,gR as KN,gS as GN,gT as ZN,gU as XN,gV as HL,gW as YN,gX as su,gY as ls,gZ as VL,g_ as JN,g$ as BL,h0 as QN,h1 as _w,h2 as vw,h3 as Tm,h4 as Lp,h5 as ek,h6 as tk,h7 as ik,h8 as kl,h9 as UL,ha as nk,hb as ou,hc as $L,hd as sk,he as zL,hf as jL,hg as qL,hh as ok,hi as Pi,hj as rk,hk as Vo,hl as La,hm as sh,hn as KL,ho as GL,hp as Fh,hq as PS,hr as zn,hs as ak,ht as bw,hu as lk,hv as ZL,hw as XL,hx as dk,hy as OS,hz as ck,hA as Sw,hB as hk,hC as Ff,hD as uk,hE as gk,hF as fk,hG as Wf,hH as Hf,hI as Vf,hJ as Bf,hK as YL,hL as pk,hM as mk,hN as _k,hO as vk,hP as JL,hQ as MS,hR as QL,hS as bk,hT as Cw,hU as ww,hV as yw,hW as Sk,hX as Ck,hY as wk,hZ as Iw,h_ as yk,h$ as Ik,i0 as zc,i1 as xk,i2 as Lk,i3 as e1,i4 as $l,i5 as Dk,i6 as Ek,i7 as Wh,i8 as Rk,i9 as xw,ia as Nk,ib as kk,ic as Tk,id as AS,ie as FS,ig as Pk,ih as Ok,ii as Mk,ij as Ak,ik as t1,il as Uf,im as Fk,io as ru,ip as Ws,iq as Wk,ir as Hk,is as Vk,it as WS,iu as i1,iv as Lw,iw as Dw,ix as Bk,iy as Uk,iz as Ew,iA as Dp,iB as $k,iC as zk,iD as jk,iE as Ep,iF as n1,iG as s1,iH as o1,iI as r1,iJ as ts,iK as a1,iL as HS,iM as Rw,iN as qk,iO as l1,iP as Kk,iQ as Gk,iR as $f,iS as Yr,iT as zf,iU as jc,iV as Zk,iW as jf,iX as Xk,iY as Nw,iZ as Yk,i_ as d1,i$ as zl,j0 as Jk,j1 as Qk,j2 as eT,j3 as tT,j4 as Tl,j5 as iT,j6 as c1,j7 as h1,j8 as nT,j9 as qf,ja as Pm,jb as sT,jc as oT,jd as rT,je as Om,jf as aT,jg as lT,jh as dT,ji as cT,jj as hT,jk as uT,jl as gT,jm as fT,jn as u1,jo as pT,jp as mT,jq as _T,jr as kw,js as vT,jt as bT,ju as Ri,jv as g1,l as pt,jw as f1,jx as jl}from"./monaco-setup-BytXwQeQ.js";import"./index-CSZOipZ8.js";import"./App-EWxVyd71.js";import"./reformer-ui-kit-1LAJcT8b.js";import"./index-BLqONGUt.js";import"./useFormField-BLbvmpme-4e6SCAMU.js";import"./index-CFDCSwb2.js";import"./load-DQmdgTkV.js";import"./boot-CGsYMAQp.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(`
@@ -61,10 +61,10 @@ ${l}
61
61
  `)}};Ib=FC([Ad(1,wo)],Ib);function xb(o){return`U+${o.toString(16).padStart(4,"0")}`}function fm(o){let e=`\`${xb(o)}\``;return a1.isInvisibleCharacter(o)||(e+=` "${`${b4(o)}`}"`),e}function b4(o){return o===96?"`` ` ``":"`"+String.fromCodePoint(o)+"`"}function BE(o,e){return r1.computeUnicodeHighlightReason(o,e)}const ff=class ff{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=te.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};ff.instance=new ff;let fg=ff;class S4 extends F{constructor(){super({id:Zr.ID,label:L(1604,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=m(1596,"Disable Highlight In Comments")}async run(e,t){const i=e.get(Ie);i&&this.runAction(i)}async runAction(e){await e.updateValue(ts.includeComments,!1,2)}}class C4 extends F{constructor(){super({id:Zr.ID,label:L(1605,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=m(1597,"Disable Highlight In Strings")}async run(e,t){const i=e.get(Ie);i&&this.runAction(i)}async runAction(e){await e.updateValue(ts.includeStrings,!1,2)}}const pf=class pf extends tt{constructor(){super({id:pf.ID,title:L(1606,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1598,"Disable Ambiguous Highlight")}async run(e,t){const i=e.get(Ie);i&&this.runAction(i)}async runAction(e){await e.updateValue(ts.ambiguousCharacters,!1,2)}};pf.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let Zr=pf;const mf=class mf extends tt{constructor(){super({id:mf.ID,title:L(1607,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1599,"Disable Invisible Highlight")}async run(e,t){const i=e.get(Ie);i&&this.runAction(i)}async runAction(e){await e.updateValue(ts.invisibleCharacters,!1,2)}};mf.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let xc=mf;const _f=class _f extends tt{constructor(){super({id:_f.ID,title:L(1608,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1600,"Disable Non ASCII Highlight")}async run(e,t){const i=e.get(Ie);i&&this.runAction(i)}async runAction(e){await e.updateValue(ts.nonBasicASCII,!1,2)}};_f.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let Lc=_f;const vf=class vf extends tt{constructor(){super({id:vf.ID,title:L(1609,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:n,inString:s,inComment:r}=t,a=String.fromCodePoint(i),l=e.get(Ai),d=e.get(Ie);function c(f){return a1.isInvisibleCharacter(f)?m(1601,"Exclude {0} (invisible character) from being highlighted",xb(f)):m(1602,"Exclude {0} from being highlighted",`${xb(f)} "${a}"`)}const h=[];if(n.kind===0)for(const f of n.notAmbiguousInLocales)h.push({label:m(1603,'Allow unicode characters that are more common in the language "{0}".',f),run:async()=>{y4(d,[f])}});if(h.push({label:c(i),run:()=>w4(d,[i])}),r){const f=new S4;h.push({label:f.label,run:async()=>f.runAction(d)})}else if(s){const f=new C4;h.push({label:f.label,run:async()=>f.runAction(d)})}function g(f){return typeof f.desc.title=="string"?f.desc.title:f.desc.title.value}if(n.kind===0){const f=new Zr;h.push({label:g(f),run:async()=>f.runAction(d)})}else if(n.kind===1){const f=new xc;h.push({label:g(f),run:async()=>f.runAction(d)})}else if(n.kind===2){const f=new Lc;h.push({label:g(f),run:async()=>f.runAction(d)})}else I4(n);const u=await l.pick(h,{title:VE});u&&await u.run()}};vf.ID="editor.action.unicodeHighlight.showExcludeOptions";let pg=vf;async function w4(o,e){const t=o.getValue(ts.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await o.updateValue(ts.allowedCharacters,i,2)}async function y4(o,e){const t=o.inspect(ts.allowedLocales).user?.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const n of e)i[n]=!0;await o.updateValue(ts.allowedLocales,i,2)}function I4(o){throw new Error(`Unexpected value: ${o}`)}he(Zr);he(xc);he(Lc);he(pg);ae(Ic.ID,Ic,1);ea.register(Ib);var x4=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},EI=function(o,e){return function(t,i){e(t,i,o)}};const UE="ignoreUnusualLineTerminators";function L4(o,e,t){o.setModelProperty(e.uri,UE,t)}function D4(o,e){return o.getModelProperty(e.uri,UE)}var Qa;let mg=(Qa=class extends A{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||D4(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:m(1610,"Unusual Line Terminators"),message:m(1611,"Detected unusual line terminators"),detail:m(1612,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",on(e.uri)),primaryButton:m(1613,"&&Remove Unusual Line Terminators"),cancelButton:m(1614,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){L4(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},Qa.ID="editor.contrib.unusualLineTerminatorsDetector",Qa);mg=x4([EI(1,HS),EI(2,Ue)],mg);ae(mg.ID,mg,1);var E4=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},R4=function(o,e){return function(t,i){e(t,i,o)}};class RI{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){if(e.isDisposed())return;const n=[],s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return s?e.findMatches(s.word,!0,!1,!0,Rw,!1).map(a=>({range:a.range,kind:ru.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){if(e.isDisposed())return;const s=new Jn,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(s);for(const a of[e,...i]){if(a.isDisposed())continue;const d=a.findMatches(r.word,!0,!1,!0,Rw,!1).map(c=>({range:c.range,kind:ru.Text}));d&&s.set(a.uri,d)}return s}}let Lb=class extends A{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new RI)),this._register(e.multiDocumentHighlightProvider.register("*",new RI))}};Lb=E4([R4(0,G)],Lb);var $E=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},_n=function(o,e){return function(t,i){e(t,i,o)}},Me,Db;const WC=new ie("hasWordHighlights",!1);function zE(o,e,t,i){const n=o.ordered(e);return FS(n.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,i)).then(void 0,Ze)),s=>s!=null).then(s=>{if(s){const r=new Jn;return r.set(e.uri,s),r}return new Jn})}function N4(o,e,t,i,n){const s=o.ordered(e);return FS(s.map(r=>()=>{const a=n.filter(l=>Kk(l)).filter(l=>Gk(r.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(r.provideMultiDocumentHighlights(e,t,a,i)).then(void 0,Ze)}),r=>r!=null)}class jE{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=dt(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new I(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class k4 extends jE{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return zE(this._providers,e,t.getPosition(),n).then(s=>s||new Jn)}}class T4 extends jE{constructor(e,t,i,n,s){super(e,t,i),this._providers=n,this._otherModels=s}_compute(e,t,i,n){return N4(this._providers,e,t.getPosition(),n,this._otherModels).then(s=>s||new Jn)}}function P4(o,e,t,i){return new k4(e,t,i,o)}function O4(o,e,t,i,n){return new T4(e,t,i,o,n)}$t("_executeDocumentHighlights",async(o,e,t)=>{const i=o.get(G);return(await zE(i.documentHighlightProvider,e,t,de.None))?.get(e.uri)});var io;let Eb=(io=class{constructor(e,t,i,n,s,r,a,l){this.toUnhook=new W,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Jn,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new lo(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this.textModelService=s,this.configurationService=a,this.logService=l,this._hasWordHighlights=WC.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(d=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(d)}).catch(we)})),this.toUnhook.add(e.onDidFocusEditorText(d=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}).catch(we))})),this.toUnhook.add(e.onDidChangeModelContent(d=>{qk(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(d=>{!d.newModelUrl&&d.oldModelUrl?this._stopSingular():Me.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(d=>{const c=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==c)switch(this.occurrencesHighlightEnablement=c,c){case"off":this._stopAll();break;case"singleFile":this._stopAll(Me.query?.modelInfo?.modelURI);break;case"multiFile":Me.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",c);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(d=>{if(d.affectsConfiguration("editor.occurrencesHighlightDelay")){const c=a.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==c&&(this.occurrencesHighlightDelay=c)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{const d=this.codeEditorService.getFocusedCodeEditor();d?d.getModel()?.uri.scheme===mt.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==mt.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,Me.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}).catch(we))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(I.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);mi(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);mi(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=Me.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),Me.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||ro(n.getModel().uri,e))continue;const s=Me.storedDecorationIDs.get(n.getModel().uri);if(!s)continue;n.removeDecorations(s),i.push(n.getModel().uri);const r=po.get(n);r?.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)Me.storedDecorationIDs.delete(n)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==mt.vscodeNotebookCell&&Me.query?.modelInfo?.modelURI.scheme!==mt.vscodeNotebookCell?(Me.query=null,this._run()):Me.query?.modelInfo&&(Me.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(e.source!=="api"&&e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===mt.vscodeNotebookCell){const s=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===mt.vscodeNotebookCell&&s.push(l)}return s}const i=[],n=this.codeEditorService.listCodeEditors();for(const s of n){if(!l1(s))continue;const r=s.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const s of n){const r=s.getModel();r&&r!==e&&i.push(r)}return i}async _run(e,t){if(this.editor.hasTextFocus()){const n=this.editor.getSelection();if(!n||n.startLineNumber!==n.endLineNumber){Me.query=null,this._stopAll();return}const s=n.startColumn,r=n.endColumn,a=this._getWord();if(!a||a.startColumn>s||a.endColumn<r){Me.query=null,this._stopAll();return}Me.query={modelInfo:{modelURI:this.model.uri,selection:n}}}else if(!Me.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),ro(this.editor.getModel().uri,Me.query.modelInfo?.modelURI)){if(!e){const a=this.decorations.getRanges();for(const l of a)if(l.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);const n=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const s=this.getOtherModelsToHighlight(this.editor.getModel());if(!Me.query||!Me.query.modelInfo)return;const r=await this.textModelService.createModelReference(Me.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(r.object.textEditorModel,Me.query.modelInfo.selection,s),this.workerRequest?.result.then(a=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},we)}catch(a){this.logService.error("Unexpected error during occurrence request. Log: ",a)}finally{r.dispose()}}else if(this.model.uri.scheme===mt.vscodeNotebookCell){const n=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!Me.query||!Me.query.modelInfo)return;const s=await this.textModelService.createModelReference(Me.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(s.object.textEditorModel,Me.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(r=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=r||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},we)}catch(r){this.logService.error("Unexpected error during occurrence request. Log: ",r)}finally{s.dispose()}}}computeWithModel(e,t,i){return i.length?O4(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):P4(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=new Date().getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const t of e){const i=po.get(t);if(!i)continue;const n=[],s=t.getModel()?.uri;if(s&&this.workerRequestValue.has(s)){const r=Me.storedDecorationIDs.get(s),a=this.workerRequestValue.get(s);if(a)for(const d of a)d.range&&n.push({range:d.range,options:f3(d.kind)});let l=[];t.changeDecorations(d=>{l=d.deltaDecorations(r??[],n)}),Me.storedDecorationIDs=Me.storedDecorationIDs.set(s,l),n.length>0&&(i.wordHighlighter?.decorations.set(n),i.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}},Me=io,io.storedDecorationIDs=new Jn,io.query=null,io);Eb=Me=$E([_n(4,ci),_n(5,Ue),_n(6,Ie),_n(7,Pt)],Eb);var Er;let po=(Er=class extends A{static get(e){return e.getContribution(Db.ID)}constructor(e,t,i,n,s,r,a){super(),this._wordHighlighter=null;const l=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==mt.accessibleView&&(this._wordHighlighter=new Eb(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,s,n,r,a))};this._register(e.onDidChangeModel(d=>{this._wordHighlighter&&(!d.newModelUrl&&d.oldModelUrl?.scheme!==mt.vscodeNotebookCell&&this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),this._wordHighlighter=null),l()})),l()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},Db=Er,Er.ID="editor.contrib.wordHighlighter",Er);po=Db=$E([_n(1,pe),_n(2,G),_n(3,Ue),_n(4,ci),_n(5,Ie),_n(6,Pt)],po);class qE extends F{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=po.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class M4 extends qE{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:L(1624,"Go to Next Symbol Highlight"),precondition:WC,kbOpts:{kbExpr:C.editorTextFocus,primary:65,weight:100}})}}class A4 extends qE{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:L(1625,"Go to Previous Symbol Highlight"),precondition:WC,kbOpts:{kbExpr:C.editorTextFocus,primary:1089,weight:100}})}}class F4 extends F{constructor(){super({id:"editor.action.wordHighlight.trigger",label:L(1626,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:C.editorTextFocus,primary:0,weight:100}})}run(e,t){const i=po.get(t);i&&i.restoreViewState(!0)}}ae(po.ID,po,0);P(M4);P(A4);P(F4);Rl(Lb);class vp extends Mt{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Yr(t.getOption(148),t.getOption(147)),s=t.getModel(),r=t.getSelections(),a=r.length>1,l=r.map(d=>{const c=new $(d.positionLineNumber,d.positionColumn),h=this._move(n,s,c,this._wordNavigationType,a);return this._moveTo(d,h,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(d=>Zk.fromModelSelection(d))),l.length===1){const d=new $(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(d,0)}}_moveTo(e,t,i){return i?new J(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new J(t.lineNumber,t.column,t.lineNumber,t.column)}}class xo extends vp{_move(e,t,i,n,s){return jc.moveWordLeft(e,t,i,n,s)}}class Lo extends vp{_move(e,t,i,n,s){return jc.moveWordRight(e,t,i,n)}}class W4 extends xo{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class H4 extends xo{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class V4 extends xo{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:T.and(C.textInputFocus,T.and(zc,$f)?.negate()),primary:2063,mac:{primary:527},weight:100}})}}class B4 extends xo{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class U4 extends xo{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class $4 extends xo{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:T.and(C.textInputFocus,T.and(zc,$f)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class z4 extends xo{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,s){return super._move(Yr(zf.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class j4 extends xo{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(Yr(zf.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class q4 extends Lo{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class K4 extends Lo{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:T.and(C.textInputFocus,T.and(zc,$f)?.negate()),primary:2065,mac:{primary:529},weight:100}})}}class G4 extends Lo{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Z4 extends Lo{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class X4 extends Lo{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:T.and(C.textInputFocus,T.and(zc,$f)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Y4 extends Lo{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class J4 extends Lo{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,s){return super._move(Yr(zf.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class Q4 extends Lo{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(Yr(zf.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class bp extends Mt{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e?.get(st);if(!t.hasModel()||!n)return;const s=Yr(t.getOption(148),t.getOption(147)),r=t.getModel(),a=t.getSelections(),l=t.getOption(10),d=t.getOption(15),c=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),g=a.map(u=>{const f=this._delete({wordSeparators:s,model:r,selection:u,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:l,autoClosingQuotes:d,autoClosingPairs:c,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Pc(f,"")});t.pushUndoStop(),t.executeCommands(this.id,g),t.pushUndoStop()}}class HC extends bp{_delete(e,t){const i=jc.deleteWordLeft(e,t);return i||new I(1,1,1,1)}}class VC extends bp{_delete(e,t){const i=jc.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new I(n,s,n,s)}}class eU extends HC{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:C.writable})}}class tU extends HC{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:C.writable})}}class iU extends HC{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:C.writable,kbOpts:{kbExpr:C.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class nU extends VC{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:C.writable})}}class sU extends VC{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:C.writable})}}class oU extends VC{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:C.writable,kbOpts:{kbExpr:C.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class rU extends F{constructor(){super({id:"deleteInsideWord",precondition:C.writable,label:L(1628,"Delete Word"),metadata:{description:L(1629,"Delete the word at the cursor"),args:[{name:"args",schema:{type:"object",properties:{onlyWord:{type:"boolean",default:!1,description:m(1627,"Delete only the word and leave surrounding whitespace")}}}}]}})}run(e,t,i){if(!t.hasModel())return;const n=!!(i&&typeof i=="object"&&i.onlyWord),s=Yr(t.getOption(148),t.getOption(147)),r=t.getModel(),l=t.getSelections().map(d=>{const c=jc.deleteInsideWord(s,r,d,n);return new Pc(c,"")});t.pushUndoStop(),t.executeCommands(this.id,l),t.pushUndoStop()}}K(new W4);K(new H4);K(new V4);K(new B4);K(new U4);K(new $4);K(new q4);K(new K4);K(new G4);K(new Z4);K(new X4);K(new Y4);K(new z4);K(new j4);K(new J4);K(new Q4);K(new eU);K(new tU);K(new iU);K(new nU);K(new sU);K(new oU);P(rU);class aU extends bp{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:C.writable,kbOpts:{kbExpr:C.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=jf.deleteWordPartLeft(e);return i||new I(1,1,1,1)}}class lU extends bp{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:C.writable,kbOpts:{kbExpr:C.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=jf.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new I(n,s,n,s)}}class KE extends vp{_move(e,t,i,n,s){return jf.moveWordPartLeft(e,t,i,s)}}class dU extends KE{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:C.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Ee.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class cU extends KE{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:C.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Ee.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class GE extends vp{_move(e,t,i,n,s){return jf.moveWordPartRight(e,t,i)}}class hU extends GE{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:C.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class uU extends GE{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:C.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}K(new aU);K(new lU);K(new dU);K(new cU);K(new hU);K(new uU);const qC=class qC extends A{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=qt.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(this.editor.isSimpleWidget?t=new It(m(1427,"Cannot edit in read-only input")):t=new It(m(1428,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};qC.ID="editor.contrib.readOnlyMessageController";let _g=qC;ae(_g.ID,_g,2);var gU=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)}};let Rb=class extends A{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Ne(this,void 0);const n=ou("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=ou("_textModel.onDidChangeContent",Ve.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Vc(async(r,a)=>{n.read(r),s.read(r);const l=a.add(new Xk),d=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(d,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(s=>e.contains(s.range.startLineNumber)&&!e.contains(s.range.endLineNumber));return n.sort(Nw(Mr(s=>s.range.endLineNumber-s.range.startLineNumber,Ar))),n.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber}))}getAt(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(s=>new Qe(s.range.startLineNumber,s.range.endLineNumber).contains(e));return n.length===0?[]:(n.sort(Nw(Mr(s=>s.range.endLineNumber-s.range.startLineNumber,Ar))),n.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber})))}};Rb=gU([NI(1,G),NI(2,Qc)],Rb);QL.setBreadcrumbsSourceFactory((o,e)=>e.createInstance(Rb,o));var ZE=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},Ba=function(o,e){return function(t,i){e(t,i,o)}},el;let vg=(el=class extends A{constructor(e,t,i,n){super();const s=this._register(We(e)),r=R(l=>s.model.read(l)?.uri),a=this._register(t.createInstance(Nb,q.EditorContent,e.contextKeyService,r));this._register(le(l=>{a.hasActions.read(l)&&l.store.add(s.createOverlayWidget({allowEditorOverflow:!1,domNode:a.element,minContentWidthInPx:_e(0),position:_e({preference:1})}))}))}},el.ID="editor.contrib.floatingToolbar",el);vg=ZE([Ba(1,ee),Ba(2,Te),Ba(3,bo)],vg);let Nb=class extends A{constructor(e,t,i,n,s,r){super();const a=this._register(r.createMenu(e,t)),l=xt(this,a.onDidChange,()=>a.getActions()),d=R(c=>{const h=l.read(c),{primary:g}=eL(h,()=>!0);return g.filter(u=>u.id!==Kd.ID)});this.hasActions=R(c=>d.read(c).length>0),this.element=qd("div.floating-menu-overlay-widget").root,this._register(ke(()=>this.element.remove())),this._register(le(c=>{const h=d.read(c),g=h.length>0,u=g?h[0].id:void 0,f=h.length===1;if(this.element.classList.toggle("single-button",f),this.element.style.height=f?"28px":"26px",!g)return;const p=n.createInstance(Yk,this.element,e,{actionViewItemProvider:(_,v)=>{if(_ instanceof Or)return n.createInstance(class extends fS{render(S){super.render(S),_.id===u&&this.element?.classList.add("primary")}updateLabel(){const S=s.lookupKeybinding(_.id),y=S?S.getLabel():void 0;this.options.label&&this.label&&(this.label.textContent=y?`${this._commandAction.label} (${y})`:this._commandAction.label)}},_,{...v,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});c.store.add(p),c.store.add(le(_=>{const v=i.read(_);p.context=v}))}))}};Nb=ZE([Ba(3,ee),Ba(4,Te),Ba(5,bo)],Nb);ae(vg.ID,vg,1);const KC=class KC extends A{constructor(e){super(),this.editor=e,this.widget=null,Em&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new kb(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};KC.ID="editor.contrib.iPadShowKeyboard";let bg=KC;const bf=class bf extends A{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(re(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(re(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return bf.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};bf.ID="editor.contrib.ShowKeyboardWidget";let kb=bf;ae(bg.ID,bg,3);var fU=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},kI=function(o,e){return function(t,i){e(t,i,o)}},Tb,Rr;let Dc=(Rr=class extends A{static get(e){return e.getContribution(Tb.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(Tf.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new Pb(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},Tb=Rr,Rr.ID="editor.contrib.inspectTokens",Rr);Dc=Tb=fU([kI(1,d1),kI(2,ls)],Dc);class pU extends F{constructor(){super({id:"editor.action.inspectTokens",label:tT.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){Dc.get(t)?.launch()}}function mU(o){let e="";for(let t=0,i=o.length;t<i;t++){const n=o.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function _U(o,e){const t=Tf.get(e);if(t)return t;const i=o.encodeLanguageId(e);return{getInitialState:()=>eT,tokenize:(n,s,r)=>Qk(e,r),tokenizeEncoded:(n,s,r)=>Jk(i,r)}}const Sf=class Sf extends A{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=_U(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return Sf._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const d=t.tokens1[l];if(e.column-1>=d.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const s=this._model.getLineContent(e.lineNumber);let r="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,d=i+1<t.tokens1.length?t.tokens1[i+1].offset:s.length;r=s.substring(l,d)}Qh(this._domNode,B("h2.tm-token",void 0,mU(r),B("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),z(this._domNode,B("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;z(this._domNode,B("table.tm-metadata-table",void 0,B("tbody",void 0,B("tr",void 0,B("td.tm-metadata-key",void 0,"language"),B("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),B("tr",void 0,B("td.tm-metadata-key",void 0,"token type"),B("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),B("tr",void 0,B("td.tm-metadata-key",void 0,"font style"),B("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),B("tr",void 0,B("td.tm-metadata-key",void 0,"foreground"),B("td.tm-metadata-value",void 0,`${a?fe.Format.CSS.formatHex(a.foreground):"-?-"}`)),B("tr",void 0,B("td.tm-metadata-key",void 0,"background"),B("td.tm-metadata-value",void 0,`${a?fe.Format.CSS.formatHex(a.background):"-?-"}`))))),z(this._domNode,B("hr.tokens-inspect-separator")),i<t.tokens1.length&&z(this._domNode,B("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=Tf.getColorMap(),i=zl.getLanguageId(e),n=zl.getTokenType(e),s=zl.getFontStyle(e),r=zl.getForeground(e),a=zl.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:s,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};Sf._ID="editor.contrib.inspectTokensWidget";let Pb=Sf;ae(Dc.ID,Dc,4);P(pU);var vU=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},pm=function(o,e){return function(t,i){e(t,i,o)}},bd,Nr;let Ob=(Nr=class{constructor(e,t,i){this.quickInputService=e,this.keybindingService=t,this.contextKeyService=i,this.registry=Nn.as(Tl.Quickaccess)}provide(e){const t=new W;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(bd.PREFIX.length),this.contextKeyService);n?.prefix&&n.prefix!==bd.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==bd.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders(this.contextKeyService).sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:m(1811,"{0}, {1}",n,t.description),description:t.description}})}},bd=Nr,Nr.PREFIX="?",Nr);Ob=bd=vU([pm(0,Ai),pm(1,Te),pm(2,pe)],Ob);Nn.as(Tl.Quickaccess).registerQuickAccessProvider({ctor:Ob,prefix:"",helpEntries:[{description:iT.helpQuickAccessActionLabel}]});class XE{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const n=new W;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=n.add(new Ke);return s.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{s.value=void 0,s.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new W,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const r={editor:s},a=c1(s);if(a){let l=s.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=s.saveViewState()??void 0})),r.restoreViewState=()=>{l&&s===this.activeTextEditorControl&&s.restoreViewState(l)},n.add(h1(t.onCancellationRequested)(()=>r.restoreViewState?.()))}n.add(ke(()=>this.clearDecorations(s))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=this.getModel(e);if(i){const n=i.getLineContent(t.range.startLineNumber);ao(m(1381,"Line {0}, column {1}: {2}",t.range.startLineNumber,t.range.startColumn,n))}}getModel(e){return l1(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const s=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Xe(wL),position:wn.Full}}}],[r,a]=i.deltaDecorations(n,s);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const Is=class Is extends XE{constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(Is.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(e){this.storageService.store(Is.ZERO_BASED_OFFSET_STORAGE_KEY,e,-1,0)}provideWithoutTextEditor(e){const t=m(1382,"Open a text editor first to go to a line or an offset.");return e.items=[{label:t}],e.ariaLabel=t,A.None}provideWithTextEditor(e,t,i){const n=e.editor,s=new W;t.ariaLabel=m(1383,"Go to line. Type a line number, optionally followed by colon and column number."),s.add(t.onDidAccept(d=>{const[c]=t.selectedItems;if(c){if(!c.lineNumber)return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:d.inBackground}),d.inBackground||t.hide()}}));const r={iconClass:ce.asClassName(U.indexZero),tooltip:m(1384,"Toggle Zero-Based Offset"),location:nT.Input,toggle:{checked:this.useZeroBasedOffset}},a=()=>{const d=t.value.trim().substring(Is.GO_TO_LINE_PREFIX.length),{inOffsetMode:c,lineNumber:h,column:g,label:u}=this.parsePosition(n,d);if(t.buttons=c?[r]:[],t.items=[{lineNumber:h,column:g,label:u,ariaLabel:h?m(1385,"Go to line {0}, column {1}. Press Enter to navigate.",h,g||1):u}],!h){this.clearDecorations(n);return}const f=this.toRange(h,g);n.revealRangeInCenter(f,0),this.addDecorations(n,f)};s.add(t.onDidTriggerButton(d=>{d===r&&(this.useZeroBasedOffset=d.toggle?.checked??!this.useZeroBasedOffset,a())})),a(),s.add(t.onDidChangeValue(()=>a()));const l=c1(n);return l&&l.getOptions().get(76).renderType===2&&(l.updateOptions({lineNumbers:"on"}),s.add(ke(()=>l.updateOptions({lineNumbers:"relative"})))),s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=this.getModel(e);if(!i)return{label:m(1386,"Open a text editor first to go to a line or an offset.")};if(t.startsWith(":")){let n=parseInt(t.substring(1),10);const s=i.getValueLength();if(isNaN(n))return{inOffsetMode:!0,label:this.useZeroBasedOffset?m(1387,"Type a character position to go to (from 0 to {0}).",s-1):m(1388,"Type a character position to go to (from 1 to {0}).",s)};{const r=n<0;this.useZeroBasedOffset||(n-=Math.sign(n)),r&&(n+=s);const a=i.getPositionAt(n),l=Ah.visibleColumnFromColumn(i.getLineContent(a.lineNumber),a.column,i.getOptions().tabSize)+1;return{...a,inOffsetMode:!0,label:m(1389,"Press 'Enter' to go to line {0} at column {1}.",a.lineNumber,l)}}}else{const n=t.split(/,|:|#/),s=i.getLineCount();let r=parseInt(n[0]?.trim(),10);if(n.length<1||isNaN(r))return{label:m(1390,"Type a line number to go to (from 1 to {0}).",s)};r=r>=0?r:s+1+r,r=Math.min(Math.max(1,r),s);const a=i.getOptions().tabSize,l=i.getLineContent(r),d=Ah.visibleColumnFromColumn(l,i.getLineMaxColumn(r),a)+1;let c=parseInt(n[1]?.trim(),10);if(n.length<2||isNaN(c))return{lineNumber:r,column:1,label:n.length<2?m(1391,"Press 'Enter' to go to line {0} or enter colon : to add a column number.",r):m(1392,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",r,d)};c=c>=0?c:d+c,c=Math.min(Math.max(1,c),d);const h=Ah.columnFromVisibleColumn(l,c-1,a);return{lineNumber:r,column:h,label:m(1393,"Press 'Enter' to go to line {0} at column {1}.",r,c)}}}};Is.GO_TO_LINE_PREFIX=":",Is.GO_TO_OFFSET_PREFIX="::",Is.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset";let Mb=Is;var bU=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},TI=function(o,e){return function(t,i){e(t,i,o)}};let mo=class extends Mb{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=Ve.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};mo=bU([TI(0,Ue),TI(1,Wi)],mo);var kr;let YE=(kr=class extends F{constructor(){super({id:kr.ID,label:qf.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:C.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Ai).quickAccess.show(mo.GO_TO_LINE_PREFIX)}},kr.ID="editor.action.gotoLine",kr);P(YE);Nn.as(Tl.Quickaccess).registerQuickAccessProvider({ctor:mo,prefix:mo.GO_TO_LINE_PREFIX,helpEntries:[{description:qf.gotoLineActionLabel,commandId:YE.ID}]});const Cf=class Cf extends F{constructor(){super({id:Cf.ID,label:qf.gotoOffsetActionLabel,alias:"Go to Offset...",precondition:void 0})}run(e){e.get(Ai).quickAccess.show(mo.GO_TO_OFFSET_PREFIX)}};Cf.ID="editor.action.gotoOffset";let Sg=Cf;P(Sg);Nn.as(Tl.Quickaccess).registerQuickAccessProvider({ctor:mo,prefix:mo.GO_TO_OFFSET_PREFIX,helpEntries:[{description:qf.gotoOffsetActionLabel,commandId:Sg.ID}]});const JE=[void 0,[]];function mm(o,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?SU(o,n.values,t,i):QE(o,e,t,i)}function SU(o,e,t,i){let n=0;const s=[];for(const r of e){const[a,l]=QE(o,r,t,i);if(typeof a!="number")return JE;n+=a,s.push(...l)}return[n,CU(s)]}function QE(o,e,t,i){const n=WL(e.normalized,e.normalizedLowercase,t,o,o.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],Nf(n)]:JE}function CU(o){const e=o.sort((n,s)=>n.start-s.start),t=[];let i;for(const n of e)!i||!wU(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function wU(o,e){return!(o.end<e.start||e.end<o.start)}function PI(o){return o.startsWith('"')&&o.endsWith('"')}const eR=" ";function Ab(o){typeof o!="string"&&(o="");const e=o.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=OI(o),s=t.indexOf(Pm)>=0,r=PI(o);let a;const l=o.split(eR);if(l.length>1)for(const d of l){const c=PI(d),{pathNormalized:h,normalized:g,normalizedLowercase:u}=OI(d);g&&(a||(a=[]),a.push({original:d,originalLowercase:d.toLowerCase(),pathNormalized:h,normalized:g,normalizedLowercase:u,expectContiguousMatch:c}))}return{original:o,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:s,expectContiguousMatch:r}}function OI(o){let e;IS?e=o.replace(/\//g,Pm):e=o.replace(/\\/g,Pm);const t=e.replace(/[\*\u2026\s"]/g,"").replace(new RegExp("(?<=.)#$"),"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function MI(o){return Array.isArray(o)?Ab(o.map(e=>e.original).join(eR)):Ab(o.original)}var yU=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},AI=function(o,e){return function(t,i){e(t,i,o)}},Gh,Ji;let qo=(Ji=class extends XE{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,m(1394,"To go to a symbol, first open a text editor with symbol information.")),A.None}provideWithTextEditor(e,t,i,n){const s=e.editor,r=this.getModel(s);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):A.None}doProvideWithoutEditorSymbols(e,t,i,n){const s=new W;return this.provideLabelPick(i,m(1395,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,s)||n.isCancellationRequested||s.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),s}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new sS,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(ke(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,s){const r=e.editor,a=new W;a.add(i.onDidAccept(h=>{const[g]=i.selectedItems;if(g&&g.range){if(i.keyMods.shift&&g.attach){g.attach(i.keyMods,h);return}this.gotoLocation(e,{range:g.range.selection,keyMods:i.keyMods,preserveFocus:h.inBackground}),s?.handleAccept?.(g,h.inBackground),h.inBackground||i.hide()}})),a.add(i.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n),d=a.add(new Ke),c=async h=>{d?.value?.cancel(),i.busy=!1,d.value=new Je,i.busy=!0;try{const g=Ab(i.value.substr(Gh.PREFIX.length).trim()),u=await this.doGetSymbolPicks(l,g,void 0,d.value.token,t);if(n.isCancellationRequested)return;if(u.length>0){if(i.items=u,h&&g.original.length===0){const f=rT(u,p=>!!(p.type!=="separator"&&p.range&&I.containsPosition(p.range.decoration,h)));f&&(i.activeItems=[f])}}else g.original.length>0?this.provideLabelPick(i,m(1396,"No matching editor symbols")):this.provideLabelPick(i,m(1397,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>c(void 0))),c(r.getSelection()?.getPosition()),a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;h&&h.range&&(r.revealRangeInCenter(h.range.selection,0),this.addDecorations(r,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,s){const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(Gh.SCOPE_PREFIX)===0,l=a?1:0;let d,c;t.values&&t.values.length>1?(d=MI(t.values[0]),c=MI(t.values.slice(1))):d=t;let h;const g=this.options?.openSideBySideDirection?.();g&&(h=[{iconClass:g==="right"?ce.asClassName(U.splitHorizontal):ce.asClassName(U.splitVertical),tooltip:g==="right"?m(1398,"Open to the Side"):m(1399,"Open to the Bottom")}]);const u=[];for(let _=0;_<r.length;_++){const v=r[_],S=sT(v.name),y=`$(${JL.toIcon(v.kind).id}) ${S}`,x=y.length-S.length;let b=v.containerName;i?.extraContainerLabel&&(b?b=`${i.extraContainerLabel} • ${b}`:b=i.extraContainerLabel);let w,D,N,E;if(t.original.length>l){let O=!1;if(d!==t&&([w,D]=mm(y,{...t,values:void 0},l,x),typeof w=="number"&&(O=!0)),typeof w!="number"&&([w,D]=mm(y,d,l,x),typeof w!="number"))continue;if(!O&&c){if(b&&c.original.length>0&&([N,E]=mm(b,c)),typeof N!="number")continue;typeof w=="number"&&(w+=N)}}const M=v.tags&&v.tags.indexOf(1)>=0;u.push({index:_,kind:v.kind,score:w,label:y,ariaLabel:oT(v.name,v.kind),description:b,highlights:M?void 0:{label:D,description:E},range:{selection:I.collapseToStart(v.selectionRange),decoration:v.range},uri:s.uri,symbolName:S,strikethrough:M,buttons:h})}const f=u.sort((_,v)=>a?this.compareByKindAndScore(_,v):this.compareByScore(_,v));let p=[];if(a){let y=function(){v&&typeof _=="number"&&S>0&&(v.label=pS(vm[_]||_m,S))},_,v,S=0;for(const x of f)_!==x.kind?(y(),_=x.kind,S=1,v={type:"separator"},p.push(v)):S++,p.push(x);y()}else f.length>0&&(p=[{label:m(1400,"symbols ({0})",u.length),type:"separator"},...f]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=vm[e.kind]||_m,n=vm[t.kind]||_m,s=i.localeCompare(n);return s===0?this.compareByScore(e,t):s}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},Gh=Ji,Ji.PREFIX="@",Ji.SCOPE_PREFIX=":",Ji.PREFIX_BY_CATEGORY=`${Ji.PREFIX}${Ji.SCOPE_PREFIX}`,Ji);qo=Gh=yU([AI(0,G),AI(1,Qc)],qo);const _m=m(1401,"properties ({0})"),vm={5:m(1402,"methods ({0})"),11:m(1403,"functions ({0})"),8:m(1404,"constructors ({0})"),12:m(1405,"variables ({0})"),4:m(1406,"classes ({0})"),22:m(1407,"structs ({0})"),23:m(1408,"events ({0})"),24:m(1409,"operators ({0})"),10:m(1410,"interfaces ({0})"),2:m(1411,"namespaces ({0})"),3:m(1412,"packages ({0})"),25:m(1413,"type parameters ({0})"),1:m(1414,"modules ({0})"),6:m(1415,"properties ({0})"),9:m(1416,"enumerations ({0})"),21:m(1417,"enumeration members ({0})"),14:m(1418,"strings ({0})"),0:m(1419,"files ({0})"),17:m(1420,"arrays ({0})"),15:m(1421,"numbers ({0})"),16:m(1422,"booleans ({0})"),18:m(1423,"objects ({0})"),19:m(1424,"keys ({0})"),7:m(1425,"fields ({0})"),13:m(1426,"constants ({0})")};var IU=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},bm=function(o,e){return function(t,i){e(t,i,o)}};let Fb=class extends qo{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=Ve.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};Fb=IU([bm(0,Ue),bm(1,G),bm(2,Qc)],Fb);const wf=class wf extends F{constructor(){super({id:wf.ID,label:Om.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:C.hasDocumentSymbolProvider,kbOpts:{kbExpr:C.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Ai).quickAccess.show(qo.PREFIX,{itemActivation:aT.NONE})}};wf.ID="editor.action.quickOutline";let Cg=wf;P(Cg);Nn.as(Tl.Quickaccess).registerQuickAccessProvider({ctor:Fb,prefix:qo.PREFIX,helpEntries:[{description:Om.quickOutlineActionLabel,prefix:qo.PREFIX,commandId:Cg.ID},{description:Om.quickOutlineByCategoryActionLabel,prefix:qo.PREFIX_BY_CATEGORY}]});function xU(o){const e=new Map;for(const t of o)e.set(t,(e.get(t)??0)+1);return e}class Fd{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,s=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const d=this.computeSimilarityScore(l,i,n);d>0&&s.push({key:r,score:d})}}return s}static termFrequencies(e){return xU(Fd.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const s of n)s.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(s)&&(yield t(s))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const s=Fd.termFrequencies(n);for(const r of s.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,tf:s})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const s=this.chunkOccurrences.get(n);if(typeof s=="number"){const r=s-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[s,r]of Object.entries(t)){const a=e.tf.get(s);if(!a)continue;let l=i.get(s);typeof l!="number"&&(l=this.computeIdf(s),i.set(s,l));const d=a*l;n+=d*r}return n}computeEmbedding(e){const t=Fd.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const s=this.computeIdf(i);s>0&&(t[i]=n*s)}return t}}function LU(o){const e=o.slice(0);e.sort((i,n)=>n.score-i.score);const t=e[0]?.score??0;if(t>0)for(const i of e)i.score/=t;return e}var Ms;(function(o){o[o.NO_ACTION=0]="NO_ACTION",o[o.CLOSE_PICKER=1]="CLOSE_PICKER",o[o.REFRESH_PICKER=2]="REFRESH_PICKER",o[o.REMOVE_ITEM=3]="REMOVE_ITEM"})(Ms||(Ms={}));function Sm(o){return Array.isArray(o.items)}function FI(o){const e=o;return!!e.picks&&e.additionalPicks instanceof Promise}class DU extends A{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const n=new W;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const r=n.add(new Ke),a=async()=>{s?.dispose(!0),e.busy=!1;const d=r.value=new W;s=d.add(new Je(t));const c=s.token;let h=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(h=h.trim());const g=this._getPicks(h,d,c,i),u=(p,_)=>{let v,S;if(Sm(p)?(v=p.items,S=p.active):v=p,v.length===0){if(_)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(dT(this.options.noResultsPick)?v=[this.options.noResultsPick(h)]:v=[this.options.noResultsPick])}return e.items=v,S&&(e.activeItems=[S]),!0},f=async p=>{let _=!1,v=!1;await Promise.all([(async()=>{typeof p.mergeDelay=="number"&&(await Ff(p.mergeDelay),c.isCancellationRequested)||v||(_=u(p.picks,!0))})(),(async()=>{e.busy=!0;try{const S=await p.additionalPicks;if(c.isCancellationRequested)return;let y,x;Sm(p.picks)?(y=p.picks.items,x=p.picks.active):y=p.picks;let b,w;if(Sm(S)?(b=S.items,w=S.active):b=S,b.length>0||!_){let D;if(!x&&!w){const N=e.activeItems[0];N&&y.indexOf(N)!==-1&&(D=N)}u({items:[...y,...b],active:x||w||D})}}finally{c.isCancellationRequested||(e.busy=!1),v=!0}})()])};if(g!==null)if(FI(g))await f(g);else if(!(g instanceof Promise))u(g);else{e.busy=!0;try{const p=await g;if(c.isCancellationRequested)return;FI(p)?await f(p):u(p)}finally{c.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(d=>{if(i?.handleAccept){d.inBackground||e.hide(),i.handleAccept?.(e.activeItems[0],d.inBackground);return}const[c]=e.selectedItems;if(typeof c?.accept=="function"){if(lT(e.keyMods)&&!!c.attach){c.attach(e.keyMods,d);return}d.inBackground||e.hide(),c.accept(e.keyMods,d)}}));const l=async(d,c)=>{if(typeof c.trigger!="function")return;const h=c.buttons?.indexOf(d)??-1;if(h>=0){const g=c.trigger(h,e.keyMods),u=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(u){case Ms.NO_ACTION:break;case Ms.CLOSE_PICKER:e.hide();break;case Ms.REFRESH_PICKER:a();break;case Ms.REMOVE_ITEM:{const f=e.items.indexOf(c);if(f!==-1){const p=e.items.slice(),_=p.splice(f,1),v=e.activeItems.filter(y=>y!==_[0]),S=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=p,v&&(e.activeItems=v),e.keepScrollPosition=S}break}}}};return n.add(e.onDidTriggerItemButton(({button:d,item:c})=>l(d,c))),n.add(e.onDidTriggerSeparatorButton(({button:d,separator:c})=>l(d,c))),n}}var tR=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},Ds=function(o,e){return function(t,i){e(t,i,o)}},Mo,He,Cn;let Wb=(Cn=class extends DU{constructor(e,t,i,n,s,r){super(Mo.PREFIX,e),this.keybindingService=i,this.commandService=n,this.telemetryService=s,this.dialogService=r,this.commandsHistory=this._register(t.createInstance(Hb)),this.options=e}async _getPicks(e,t,i,n){const s=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=h1(()=>{const u=new Fd;u.updateDocuments(s.map(p=>({key:p.commandId,textChunks:[this.getTfIdfChunk(p)]})));const f=u.calculateScores(e,i);return LU(f).filter(p=>p.score>Mo.TFIDF_THRESHOLD).slice(0,Mo.TFIDF_MAX_RESULTS)}),a=[];for(const u of s){const f=Mo.WORD_FILTER(e,u.label)??void 0;let p;if(u.commandAlias&&(p=Mo.WORD_FILTER(e,u.commandAlias)??void 0),f||p)u.highlights={label:f,detail:this.options.showAlias?p:void 0},a.push(u);else if(e===u.commandId)a.push(u);else if(e.length>=3){const _=r();if(i.isCancellationRequested)return[];const v=_.find(S=>S.key===u.commandId);v&&(u.tfIdfScore=v.score,a.push(u))}}const l=new Map;for(const u of a){const f=l.get(u.label);f?(u.description=u.commandId,f.description=f.commandId):l.set(u.label,u)}a.sort((u,f)=>{if(u.tfIdfScore&&f.tfIdfScore)return u.tfIdfScore===f.tfIdfScore?u.label.localeCompare(f.label):f.tfIdfScore-u.tfIdfScore;if(u.tfIdfScore)return 1;if(f.tfIdfScore)return-1;const p=this.commandsHistory.peek(u.commandId),_=this.commandsHistory.peek(f.commandId);if(p&&_)return p>_?-1:1;if(p)return-1;if(_)return 1;if(this.options.suggestedCommandIds){const y=this.options.suggestedCommandIds.has(u.commandId),x=this.options.suggestedCommandIds.has(f.commandId);if(y&&x)return 0;if(y)return-1;if(x)return 1}const v=u.commandCategory===pb.Developer.value,S=f.commandCategory===pb.Developer.value;return v&&!S?1:!v&&S?-1:u.label.localeCompare(f.label)});const d=[];let c=!1,h=!0,g=!!this.options.suggestedCommandIds;for(let u=0;u<a.length;u++){const f=a[u],p=!!this.commandsHistory.peek(f.commandId);u===0&&p&&(d.push({type:"separator",label:m(1803,"recently used")}),c=!0),h&&f.tfIdfScore!==void 0&&(d.push({type:"separator",label:m(1804,"similar commands")}),h=!1),g&&f.tfIdfScore===void 0&&!p&&this.options.suggestedCommandIds?.has(f.commandId)&&(d.push({type:"separator",label:m(1805,"commonly used")}),c=!0,g=!1),c&&f.tfIdfScore===void 0&&!p&&!this.options.suggestedCommandIds?.has(f.commandId)&&(d.push({type:"separator",label:m(1806,"other commands")}),c=!1),d.push(this.toCommandPick(f,n,p))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{const u=await this.getAdditionalCommandPicks(s,a,e,i);if(i.isCancellationRequested)return[];const f=u.map(p=>this.toCommandPick(p,n));return h&&f[0]?.type!=="separator"&&f.unshift({type:"separator",label:m(1807,"similar commands")}),f})()}:d}toCommandPick(e,t,i=!1){if(e.type==="separator")return e;const n=e.tooltip??e.commandDescription?.value,s=this.keybindingService.lookupKeybinding(e.commandId),r=s?m(1808,"{0}, {1}",e.label,s.getAriaLabel()):e.label,a=e.buttons||[],l=i?[...a,{iconClass:ce.asClassName(U.close),tooltip:m(1809,"Remove from Recently Used")}]:e.buttons;return{...e,tooltip:n,ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:s,buttons:l,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:t?.from??"quick open"});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(d){rs(d)||this.dialogService.error(m(1810,"Command '{0}' resulted in an error",e.label),cu(d))}},trigger:i?(d,c)=>{const h=a.length;return d===h?(this.commandsHistory.remove(e.commandId),Ms.REMOVE_ITEM):e.trigger?e.trigger(d,c):Ms.NO_ACTION}:e.trigger}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},Mo=Cn,Cn.PREFIX=">",Cn.TFIDF_THRESHOLD=.5,Cn.TFIDF_MAX_RESULTS=5,Cn.WORD_FILTER=cT(uT,hT),Cn);Wb=Mo=tR([Ds(1,ee),Ds(2,Te),Ds(3,it),Ds(4,vo),Ds(5,HS)],Wb);var Qi;let Hb=(Qi=class extends A{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===hS.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=He.getConfiguredCommandHistoryLength(this.configurationService),He.cache&&He.cache.limit!==this.configuredCommandsHistoryLength&&(He.cache.limit=this.configuredCommandsHistoryLength,He.hasChanges=!0))}load(){const e=this.storageService.get(He.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=He.cache=new Wc(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((s,r)=>s.value-r.value),n.forEach(s=>i.set(s.key,s.value))}He.counter=this.storageService.getNumber(He.PREF_KEY_COUNTER,0,He.counter)}push(e){He.cache&&(He.cache.set(e,He.counter++),He.hasChanges=!0)}peek(e){return He.cache?.peek(e)}remove(e){He.cache&&(He.cache.delete(e),He.hasChanges=!0)}saveState(){if(!He.cache||!He.hasChanges)return;const e={usesLRU:!0,entries:[]};He.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(He.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(He.PREF_KEY_COUNTER,He.counter,0,0),He.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:He.DEFAULT_COMMANDS_HISTORY_LENGTH}},He=Qi,Qi.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Qi.PREF_KEY_CACHE="commandPalette.mru.cache",Qi.PREF_KEY_COUNTER="commandPalette.mru.counter",Qi.counter=1,Qi.hasChanges=!1,Qi);Hb=He=tR([Ds(0,Wi),Ds(1,Ie),Ds(2,Pt)],Hb);class EU extends Wb{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let n;i.metadata?.description&&(gT(i.metadata.description)?n=i.metadata.description:n={original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:n,label:fT(i.label)||i.id})}return t}}var RU=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},ma=function(o,e){return function(t,i){e(t,i,o)}};let Ec=class extends EU{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,s,r){super({showAlias:!1},e,i,n,s,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};Ec=RU([ma(0,ee),ma(1,Ue),ma(2,Te),ma(3,it),ma(4,vo),ma(5,HS)],Ec);const yf=class yf extends F{constructor(){super({id:yf.ID,label:u1.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:C.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ai).quickAccess.show(Ec.PREFIX)}};yf.ID="editor.action.quickCommand";let wg=yf;P(wg);Nn.as(Tl.Quickaccess).registerQuickAccessProvider({ctor:Ec,prefix:Ec.PREFIX,helpEntries:[{description:u1.quickCommandHelp,commandId:wg.ID}]});var NU=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},_a=function(o,e){return function(t,i){e(t,i,o)}};let Vb=class extends jr{constructor(e,t,i,n,s,r,a){super(!0,e,t,i,n,s,r,a)}};Vb=NU([_a(1,pe),_a(2,Ue),_a(3,Lt),_a(4,ee),_a(5,Wi),_a(6,Ie)],Vb);ae(jr.ID,Vb,4);class kU extends F{constructor(){super({id:"editor.action.toggleHighContrast",label:pT.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(d1),n=i.getColorTheme();zd(n.type)?(i.setTheme(this._originalThemeName||(kw(n.type)?mT:_T)),this._originalThemeName=null):(i.setTheme(kw(n.type)?vT:bT),this._originalThemeName=n.themeName)}}P(kU);function TU(o,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(o,e)}catch(i){console.error(i);return}try{return globalThis.trustedTypes?.createPolicy(o,e)}catch(i){console.error(i);return}}let yg;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?yg=globalThis.workerttPolicy:yg=TU("defaultWorkerFactory",{createScriptURL:o=>o});function PU(o){const e=o.label,t=globalThis.MonacoEnvironment;if(t){if(typeof t.getWorker=="function")return t.getWorker("workerMain.js",e);if(typeof t.getWorkerUrl=="function"){const i=t.getWorkerUrl("workerMain.js",e);return new Worker(yg?yg.createScriptURL(i):i,{name:e,type:"module"})}}if(o.createWorker)return o.createWorker();throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function OU(o){const e=Promise.resolve(PU({label:o.label??"monaco-editor-worker",moduleId:o.moduleId,createWorker:o.createWorker})).then(t=>(t.postMessage("ignore"),t.postMessage(o.createData),t));return Ri.createWebWorker({worker:e,host:o.host,keepIdleModels:o.keepIdleModels})}const MU=120*1e3;class AU{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>MU&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=OU({moduleId:"vs/language/json/jsonWorker",createWorker:()=>new Worker(new URL("/assets/json.worker-C5PEkLU0.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(i=>{t=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>t)}}var WI;(function(o){function e(t){return typeof t=="string"}o.is=e})(WI||(WI={}));var Bb;(function(o){function e(t){return typeof t=="string"}o.is=e})(Bb||(Bb={}));var HI;(function(o){o.MIN_VALUE=-2147483648,o.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&o.MIN_VALUE<=t&&t<=o.MAX_VALUE}o.is=e})(HI||(HI={}));var Ig;(function(o){o.MIN_VALUE=0,o.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&o.MIN_VALUE<=t&&t<=o.MAX_VALUE}o.is=e})(Ig||(Ig={}));var Zi;(function(o){function e(i,n){return i===Number.MAX_VALUE&&(i=Ig.MAX_VALUE),n===Number.MAX_VALUE&&(n=Ig.MAX_VALUE),{line:i,character:n}}o.create=e;function t(i){let n=i;return k.objectLiteral(n)&&k.uinteger(n.line)&&k.uinteger(n.character)}o.is=t})(Zi||(Zi={}));var ht;(function(o){function e(i,n,s,r){if(k.uinteger(i)&&k.uinteger(n)&&k.uinteger(s)&&k.uinteger(r))return{start:Zi.create(i,n),end:Zi.create(s,r)};if(Zi.is(i)&&Zi.is(n))return{start:i,end:n};throw new Error(`Range#create called with invalid arguments[${i}, ${n}, ${s}, ${r}]`)}o.create=e;function t(i){let n=i;return k.objectLiteral(n)&&Zi.is(n.start)&&Zi.is(n.end)}o.is=t})(ht||(ht={}));var xg;(function(o){function e(i,n){return{uri:i,range:n}}o.create=e;function t(i){let n=i;return k.objectLiteral(n)&&ht.is(n.range)&&(k.string(n.uri)||k.undefined(n.uri))}o.is=t})(xg||(xg={}));var VI;(function(o){function e(i,n,s,r){return{targetUri:i,targetRange:n,targetSelectionRange:s,originSelectionRange:r}}o.create=e;function t(i){let n=i;return k.objectLiteral(n)&&ht.is(n.targetRange)&&k.string(n.targetUri)&&ht.is(n.targetSelectionRange)&&(ht.is(n.originSelectionRange)||k.undefined(n.originSelectionRange))}o.is=t})(VI||(VI={}));var Ub;(function(o){function e(i,n,s,r){return{red:i,green:n,blue:s,alpha:r}}o.create=e;function t(i){const n=i;return k.objectLiteral(n)&&k.numberRange(n.red,0,1)&&k.numberRange(n.green,0,1)&&k.numberRange(n.blue,0,1)&&k.numberRange(n.alpha,0,1)}o.is=t})(Ub||(Ub={}));var BI;(function(o){function e(i,n){return{range:i,color:n}}o.create=e;function t(i){const n=i;return k.objectLiteral(n)&&ht.is(n.range)&&Ub.is(n.color)}o.is=t})(BI||(BI={}));var UI;(function(o){function e(i,n,s){return{label:i,textEdit:n,additionalTextEdits:s}}o.create=e;function t(i){const n=i;return k.objectLiteral(n)&&k.string(n.label)&&(k.undefined(n.textEdit)||xl.is(n))&&(k.undefined(n.additionalTextEdits)||k.typedArray(n.additionalTextEdits,xl.is))}o.is=t})(UI||(UI={}));var Wd;(function(o){o.Comment="comment",o.Imports="imports",o.Region="region"})(Wd||(Wd={}));var $I;(function(o){function e(i,n,s,r,a,l){const d={startLine:i,endLine:n};return k.defined(s)&&(d.startCharacter=s),k.defined(r)&&(d.endCharacter=r),k.defined(a)&&(d.kind=a),k.defined(l)&&(d.collapsedText=l),d}o.create=e;function t(i){const n=i;return k.objectLiteral(n)&&k.uinteger(n.startLine)&&k.uinteger(n.startLine)&&(k.undefined(n.startCharacter)||k.uinteger(n.startCharacter))&&(k.undefined(n.endCharacter)||k.uinteger(n.endCharacter))&&(k.undefined(n.kind)||k.string(n.kind))}o.is=t})($I||($I={}));var $b;(function(o){function e(i,n){return{location:i,message:n}}o.create=e;function t(i){let n=i;return k.defined(n)&&xg.is(n.location)&&k.string(n.message)}o.is=t})($b||($b={}));var ka;(function(o){o.Error=1,o.Warning=2,o.Information=3,o.Hint=4})(ka||(ka={}));var zI;(function(o){o.Unnecessary=1,o.Deprecated=2})(zI||(zI={}));var jI;(function(o){function e(t){const i=t;return k.objectLiteral(i)&&k.string(i.href)}o.is=e})(jI||(jI={}));var Lg;(function(o){function e(i,n,s,r,a,l){let d={range:i,message:n};return k.defined(s)&&(d.severity=s),k.defined(r)&&(d.code=r),k.defined(a)&&(d.source=a),k.defined(l)&&(d.relatedInformation=l),d}o.create=e;function t(i){var n;let s=i;return k.defined(s)&&ht.is(s.range)&&k.string(s.message)&&(k.number(s.severity)||k.undefined(s.severity))&&(k.integer(s.code)||k.string(s.code)||k.undefined(s.code))&&(k.undefined(s.codeDescription)||k.string((n=s.codeDescription)===null||n===void 0?void 0:n.href))&&(k.string(s.source)||k.undefined(s.source))&&(k.undefined(s.relatedInformation)||k.typedArray(s.relatedInformation,$b.is))}o.is=t})(Lg||(Lg={}));var Il;(function(o){function e(i,n,...s){let r={title:i,command:n};return k.defined(s)&&s.length>0&&(r.arguments=s),r}o.create=e;function t(i){let n=i;return k.defined(n)&&k.string(n.title)&&k.string(n.command)}o.is=t})(Il||(Il={}));var xl;(function(o){function e(s,r){return{range:s,newText:r}}o.replace=e;function t(s,r){return{range:{start:s,end:s},newText:r}}o.insert=t;function i(s){return{range:s,newText:""}}o.del=i;function n(s){const r=s;return k.objectLiteral(r)&&k.string(r.newText)&&ht.is(r.range)}o.is=n})(xl||(xl={}));var zb;(function(o){function e(i,n,s){const r={label:i};return n!==void 0&&(r.needsConfirmation=n),s!==void 0&&(r.description=s),r}o.create=e;function t(i){const n=i;return k.objectLiteral(n)&&k.string(n.label)&&(k.boolean(n.needsConfirmation)||n.needsConfirmation===void 0)&&(k.string(n.description)||n.description===void 0)}o.is=t})(zb||(zb={}));var Ll;(function(o){function e(t){const i=t;return k.string(i)}o.is=e})(Ll||(Ll={}));var qI;(function(o){function e(s,r,a){return{range:s,newText:r,annotationId:a}}o.replace=e;function t(s,r,a){return{range:{start:s,end:s},newText:r,annotationId:a}}o.insert=t;function i(s,r){return{range:s,newText:"",annotationId:r}}o.del=i;function n(s){const r=s;return xl.is(r)&&(zb.is(r.annotationId)||Ll.is(r.annotationId))}o.is=n})(qI||(qI={}));var jb;(function(o){function e(i,n){return{textDocument:i,edits:n}}o.create=e;function t(i){let n=i;return k.defined(n)&&Xb.is(n.textDocument)&&Array.isArray(n.edits)}o.is=t})(jb||(jb={}));var qb;(function(o){function e(i,n,s){let r={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(r.options=n),s!==void 0&&(r.annotationId=s),r}o.create=e;function t(i){let n=i;return n&&n.kind==="create"&&k.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||k.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||k.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||Ll.is(n.annotationId))}o.is=t})(qb||(qb={}));var Kb;(function(o){function e(i,n,s,r){let a={kind:"rename",oldUri:i,newUri:n};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),r!==void 0&&(a.annotationId=r),a}o.create=e;function t(i){let n=i;return n&&n.kind==="rename"&&k.string(n.oldUri)&&k.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||k.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||k.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||Ll.is(n.annotationId))}o.is=t})(Kb||(Kb={}));var Gb;(function(o){function e(i,n,s){let r={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(r.options=n),s!==void 0&&(r.annotationId=s),r}o.create=e;function t(i){let n=i;return n&&n.kind==="delete"&&k.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||k.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||k.boolean(n.options.ignoreIfNotExists)))&&(n.annotationId===void 0||Ll.is(n.annotationId))}o.is=t})(Gb||(Gb={}));var Zb;(function(o){function e(t){let i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(n=>k.string(n.kind)?qb.is(n)||Kb.is(n)||Gb.is(n):jb.is(n)))}o.is=e})(Zb||(Zb={}));var KI;(function(o){function e(i){return{uri:i}}o.create=e;function t(i){let n=i;return k.defined(n)&&k.string(n.uri)}o.is=t})(KI||(KI={}));var GI;(function(o){function e(i,n){return{uri:i,version:n}}o.create=e;function t(i){let n=i;return k.defined(n)&&k.string(n.uri)&&k.integer(n.version)}o.is=t})(GI||(GI={}));var Xb;(function(o){function e(i,n){return{uri:i,version:n}}o.create=e;function t(i){let n=i;return k.defined(n)&&k.string(n.uri)&&(n.version===null||k.integer(n.version))}o.is=t})(Xb||(Xb={}));var ZI;(function(o){function e(i,n,s,r){return{uri:i,languageId:n,version:s,text:r}}o.create=e;function t(i){let n=i;return k.defined(n)&&k.string(n.uri)&&k.string(n.languageId)&&k.integer(n.version)&&k.string(n.text)}o.is=t})(ZI||(ZI={}));var Yb;(function(o){o.PlainText="plaintext",o.Markdown="markdown";function e(t){const i=t;return i===o.PlainText||i===o.Markdown}o.is=e})(Yb||(Yb={}));var Rc;(function(o){function e(t){const i=t;return k.objectLiteral(t)&&Yb.is(i.kind)&&k.string(i.value)}o.is=e})(Rc||(Rc={}));var gt;(function(o){o.Text=1,o.Method=2,o.Function=3,o.Constructor=4,o.Field=5,o.Variable=6,o.Class=7,o.Interface=8,o.Module=9,o.Property=10,o.Unit=11,o.Value=12,o.Enum=13,o.Keyword=14,o.Snippet=15,o.Color=16,o.File=17,o.Reference=18,o.Folder=19,o.EnumMember=20,o.Constant=21,o.Struct=22,o.Event=23,o.Operator=24,o.TypeParameter=25})(gt||(gt={}));var Jb;(function(o){o.PlainText=1,o.Snippet=2})(Jb||(Jb={}));var XI;(function(o){o.Deprecated=1})(XI||(XI={}));var YI;(function(o){function e(i,n,s){return{newText:i,insert:n,replace:s}}o.create=e;function t(i){const n=i;return n&&k.string(n.newText)&&ht.is(n.insert)&&ht.is(n.replace)}o.is=t})(YI||(YI={}));var JI;(function(o){o.asIs=1,o.adjustIndentation=2})(JI||(JI={}));var QI;(function(o){function e(t){const i=t;return i&&(k.string(i.detail)||i.detail===void 0)&&(k.string(i.description)||i.description===void 0)}o.is=e})(QI||(QI={}));var ex;(function(o){function e(t){return{label:t}}o.create=e})(ex||(ex={}));var tx;(function(o){function e(t,i){return{items:t||[],isIncomplete:!!i}}o.create=e})(tx||(tx={}));var Dg;(function(o){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}o.fromPlainText=e;function t(i){const n=i;return k.string(n)||k.objectLiteral(n)&&k.string(n.language)&&k.string(n.value)}o.is=t})(Dg||(Dg={}));var ix;(function(o){function e(t){let i=t;return!!i&&k.objectLiteral(i)&&(Rc.is(i.contents)||Dg.is(i.contents)||k.typedArray(i.contents,Dg.is))&&(t.range===void 0||ht.is(t.range))}o.is=e})(ix||(ix={}));var nx;(function(o){function e(t,i){return i?{label:t,documentation:i}:{label:t}}o.create=e})(nx||(nx={}));var sx;(function(o){function e(t,i,...n){let s={label:t};return k.defined(i)&&(s.documentation=i),k.defined(n)?s.parameters=n:s.parameters=[],s}o.create=e})(sx||(sx={}));var Hd;(function(o){o.Text=1,o.Read=2,o.Write=3})(Hd||(Hd={}));var ox;(function(o){function e(t,i){let n={range:t};return k.number(i)&&(n.kind=i),n}o.create=e})(ox||(ox={}));var ft;(function(o){o.File=1,o.Module=2,o.Namespace=3,o.Package=4,o.Class=5,o.Method=6,o.Property=7,o.Field=8,o.Constructor=9,o.Enum=10,o.Interface=11,o.Function=12,o.Variable=13,o.Constant=14,o.String=15,o.Number=16,o.Boolean=17,o.Array=18,o.Object=19,o.Key=20,o.Null=21,o.EnumMember=22,o.Struct=23,o.Event=24,o.Operator=25,o.TypeParameter=26})(ft||(ft={}));var rx;(function(o){o.Deprecated=1})(rx||(rx={}));var ax;(function(o){function e(t,i,n,s,r){let a={name:t,kind:i,location:{uri:s,range:n}};return r&&(a.containerName=r),a}o.create=e})(ax||(ax={}));var lx;(function(o){function e(t,i,n,s){return s!==void 0?{name:t,kind:i,location:{uri:n,range:s}}:{name:t,kind:i,location:{uri:n}}}o.create=e})(lx||(lx={}));var dx;(function(o){function e(i,n,s,r,a,l){let d={name:i,detail:n,kind:s,range:r,selectionRange:a};return l!==void 0&&(d.children=l),d}o.create=e;function t(i){let n=i;return n&&k.string(n.name)&&k.number(n.kind)&&ht.is(n.range)&&ht.is(n.selectionRange)&&(n.detail===void 0||k.string(n.detail))&&(n.deprecated===void 0||k.boolean(n.deprecated))&&(n.children===void 0||Array.isArray(n.children))&&(n.tags===void 0||Array.isArray(n.tags))}o.is=t})(dx||(dx={}));var cx;(function(o){o.Empty="",o.QuickFix="quickfix",o.Refactor="refactor",o.RefactorExtract="refactor.extract",o.RefactorInline="refactor.inline",o.RefactorRewrite="refactor.rewrite",o.Source="source",o.SourceOrganizeImports="source.organizeImports",o.SourceFixAll="source.fixAll"})(cx||(cx={}));var Eg;(function(o){o.Invoked=1,o.Automatic=2})(Eg||(Eg={}));var hx;(function(o){function e(i,n,s){let r={diagnostics:i};return n!=null&&(r.only=n),s!=null&&(r.triggerKind=s),r}o.create=e;function t(i){let n=i;return k.defined(n)&&k.typedArray(n.diagnostics,Lg.is)&&(n.only===void 0||k.typedArray(n.only,k.string))&&(n.triggerKind===void 0||n.triggerKind===Eg.Invoked||n.triggerKind===Eg.Automatic)}o.is=t})(hx||(hx={}));var ux;(function(o){function e(i,n,s){let r={title:i},a=!0;return typeof n=="string"?(a=!1,r.kind=n):Il.is(n)?r.command=n:r.edit=n,a&&s!==void 0&&(r.kind=s),r}o.create=e;function t(i){let n=i;return n&&k.string(n.title)&&(n.diagnostics===void 0||k.typedArray(n.diagnostics,Lg.is))&&(n.kind===void 0||k.string(n.kind))&&(n.edit!==void 0||n.command!==void 0)&&(n.command===void 0||Il.is(n.command))&&(n.isPreferred===void 0||k.boolean(n.isPreferred))&&(n.edit===void 0||Zb.is(n.edit))}o.is=t})(ux||(ux={}));var gx;(function(o){function e(i,n){let s={range:i};return k.defined(n)&&(s.data=n),s}o.create=e;function t(i){let n=i;return k.defined(n)&&ht.is(n.range)&&(k.undefined(n.command)||Il.is(n.command))}o.is=t})(gx||(gx={}));var fx;(function(o){function e(i,n){return{tabSize:i,insertSpaces:n}}o.create=e;function t(i){let n=i;return k.defined(n)&&k.uinteger(n.tabSize)&&k.boolean(n.insertSpaces)}o.is=t})(fx||(fx={}));var px;(function(o){function e(i,n,s){return{range:i,target:n,data:s}}o.create=e;function t(i){let n=i;return k.defined(n)&&ht.is(n.range)&&(k.undefined(n.target)||k.string(n.target))}o.is=t})(px||(px={}));var mx;(function(o){function e(i,n){return{range:i,parent:n}}o.create=e;function t(i){let n=i;return k.objectLiteral(n)&&ht.is(n.range)&&(n.parent===void 0||o.is(n.parent))}o.is=t})(mx||(mx={}));var _x;(function(o){o.namespace="namespace",o.type="type",o.class="class",o.enum="enum",o.interface="interface",o.struct="struct",o.typeParameter="typeParameter",o.parameter="parameter",o.variable="variable",o.property="property",o.enumMember="enumMember",o.event="event",o.function="function",o.method="method",o.macro="macro",o.keyword="keyword",o.modifier="modifier",o.comment="comment",o.string="string",o.number="number",o.regexp="regexp",o.operator="operator",o.decorator="decorator"})(_x||(_x={}));var vx;(function(o){o.declaration="declaration",o.definition="definition",o.readonly="readonly",o.static="static",o.deprecated="deprecated",o.abstract="abstract",o.async="async",o.modification="modification",o.documentation="documentation",o.defaultLibrary="defaultLibrary"})(vx||(vx={}));var bx;(function(o){function e(t){const i=t;return k.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}o.is=e})(bx||(bx={}));var Sx;(function(o){function e(i,n){return{range:i,text:n}}o.create=e;function t(i){const n=i;return n!=null&&ht.is(n.range)&&k.string(n.text)}o.is=t})(Sx||(Sx={}));var Cx;(function(o){function e(i,n,s){return{range:i,variableName:n,caseSensitiveLookup:s}}o.create=e;function t(i){const n=i;return n!=null&&ht.is(n.range)&&k.boolean(n.caseSensitiveLookup)&&(k.string(n.variableName)||n.variableName===void 0)}o.is=t})(Cx||(Cx={}));var wx;(function(o){function e(i,n){return{range:i,expression:n}}o.create=e;function t(i){const n=i;return n!=null&&ht.is(n.range)&&(k.string(n.expression)||n.expression===void 0)}o.is=t})(wx||(wx={}));var yx;(function(o){function e(i,n){return{frameId:i,stoppedLocation:n}}o.create=e;function t(i){const n=i;return k.defined(n)&&ht.is(i.stoppedLocation)}o.is=t})(yx||(yx={}));var Qb;(function(o){o.Type=1,o.Parameter=2;function e(t){return t===1||t===2}o.is=e})(Qb||(Qb={}));var eS;(function(o){function e(i){return{value:i}}o.create=e;function t(i){const n=i;return k.objectLiteral(n)&&(n.tooltip===void 0||k.string(n.tooltip)||Rc.is(n.tooltip))&&(n.location===void 0||xg.is(n.location))&&(n.command===void 0||Il.is(n.command))}o.is=t})(eS||(eS={}));var Ix;(function(o){function e(i,n,s){const r={position:i,label:n};return s!==void 0&&(r.kind=s),r}o.create=e;function t(i){const n=i;return k.objectLiteral(n)&&Zi.is(n.position)&&(k.string(n.label)||k.typedArray(n.label,eS.is))&&(n.kind===void 0||Qb.is(n.kind))&&n.textEdits===void 0||k.typedArray(n.textEdits,xl.is)&&(n.tooltip===void 0||k.string(n.tooltip)||Rc.is(n.tooltip))&&(n.paddingLeft===void 0||k.boolean(n.paddingLeft))&&(n.paddingRight===void 0||k.boolean(n.paddingRight))}o.is=t})(Ix||(Ix={}));var xx;(function(o){function e(t){return{kind:"snippet",value:t}}o.createSnippet=e})(xx||(xx={}));var Lx;(function(o){function e(t,i,n,s){return{insertText:t,filterText:i,range:n,command:s}}o.create=e})(Lx||(Lx={}));var Dx;(function(o){function e(t){return{items:t}}o.create=e})(Dx||(Dx={}));var Ex;(function(o){o.Invoked=0,o.Automatic=1})(Ex||(Ex={}));var Rx;(function(o){function e(t,i){return{range:t,text:i}}o.create=e})(Rx||(Rx={}));var Nx;(function(o){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}o.create=e})(Nx||(Nx={}));var kx;(function(o){function e(t){const i=t;return k.objectLiteral(i)&&Bb.is(i.uri)&&k.string(i.name)}o.is=e})(kx||(kx={}));var Tx;(function(o){function e(s,r,a,l){return new FU(s,r,a,l)}o.create=e;function t(s){let r=s;return!!(k.defined(r)&&k.string(r.uri)&&(k.undefined(r.languageId)||k.string(r.languageId))&&k.uinteger(r.lineCount)&&k.func(r.getText)&&k.func(r.positionAt)&&k.func(r.offsetAt))}o.is=t;function i(s,r){let a=s.getText(),l=n(r,(c,h)=>{let g=c.range.start.line-h.range.start.line;return g===0?c.range.start.character-h.range.start.character:g}),d=a.length;for(let c=l.length-1;c>=0;c--){let h=l[c],g=s.offsetAt(h.range.start),u=s.offsetAt(h.range.end);if(u<=d)a=a.substring(0,g)+h.newText+a.substring(u,a.length);else throw new Error("Overlapping edit");d=g}return a}o.applyEdits=i;function n(s,r){if(s.length<=1)return s;const a=s.length/2|0,l=s.slice(0,a),d=s.slice(a);n(l,r),n(d,r);let c=0,h=0,g=0;for(;c<l.length&&h<d.length;)r(l[c],d[h])<=0?s[g++]=l[c++]:s[g++]=d[h++];for(;c<l.length;)s[g++]=l[c++];for(;h<d.length;)s[g++]=d[h++];return s}})(Tx||(Tx={}));class FU{constructor(e,t,i,n){this._uri=e,this._languageId=t,this._version=i,this._content=n,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,i=!0;for(let n=0;n<t.length;n++){i&&(e.push(n),i=!1);let s=t.charAt(n);i=s==="\r"||s===`
62
62
  `,s==="\r"&&n+1<t.length&&t.charAt(n+1)===`
63
63
  `&&n++}i&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return Zi.create(0,e);for(;i<n;){let r=Math.floor((i+n)/2);t[r]>e?n=r:i=r+1}let s=i-1;return Zi.create(s,e-t[s])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,n),i)}get lineCount(){return this.getLineOffsets().length}}var k;(function(o){const e=Object.prototype.toString;function t(u){return typeof u<"u"}o.defined=t;function i(u){return typeof u>"u"}o.undefined=i;function n(u){return u===!0||u===!1}o.boolean=n;function s(u){return e.call(u)==="[object String]"}o.string=s;function r(u){return e.call(u)==="[object Number]"}o.number=r;function a(u,f,p){return e.call(u)==="[object Number]"&&f<=u&&u<=p}o.numberRange=a;function l(u){return e.call(u)==="[object Number]"&&-2147483648<=u&&u<=2147483647}o.integer=l;function d(u){return e.call(u)==="[object Number]"&&0<=u&&u<=2147483647}o.uinteger=d;function c(u){return e.call(u)==="[object Function]"}o.func=c;function h(u){return u!==null&&typeof u=="object"}o.objectLiteral=h;function g(u,f){return Array.isArray(u)&&u.every(f)}o.typedArray=g})(k||(k={}));class WU{constructor(e,t,i){this._languageId=e,this._worker=t,this._disposables=[],this._listener=Object.create(null);const n=r=>{let a=r.getLanguageId();if(a!==this._languageId)return;let l;this._listener[r.uri.toString()]=r.onDidChangeContent(()=>{window.clearTimeout(l),l=window.setTimeout(()=>this._doValidate(r.uri,a),500)}),this._doValidate(r.uri,a)},s=r=>{Ri.setModelMarkers(r,this._languageId,[]);let a=r.uri.toString(),l=this._listener[a];l&&(l.dispose(),delete this._listener[a])};this._disposables.push(Ri.onDidCreateModel(n)),this._disposables.push(Ri.onWillDisposeModel(s)),this._disposables.push(Ri.onDidChangeModelLanguage(r=>{s(r.model),n(r.model)})),this._disposables.push(i(r=>{Ri.getModels().forEach(a=>{a.getLanguageId()===this._languageId&&(s(a),n(a))})})),this._disposables.push({dispose:()=>{Ri.getModels().forEach(s);for(let r in this._listener)this._listener[r].dispose()}}),Ri.getModels().forEach(n)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,t){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const n=i.map(r=>VU(e,r));let s=Ri.getModel(e);s&&s.getLanguageId()===t&&Ri.setModelMarkers(s,t,n)}).then(void 0,i=>{console.error(i)})}}function HU(o){switch(o){case ka.Error:return jl.Error;case ka.Warning:return jl.Warning;case ka.Information:return jl.Info;case ka.Hint:return jl.Hint;default:return jl.Info}}function VU(o,e){let t=typeof e.code=="number"?String(e.code):e.code;return{severity:HU(e.severity),startLineNumber:e.range.start.line+1,startColumn:e.range.start.character+1,endLineNumber:e.range.end.line+1,endColumn:e.range.end.character+1,message:e.message,code:t,source:e.source}}class BU{constructor(e,t){this._worker=e,this._triggerCharacters=t}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,t,i,n){const s=e.uri;return this._worker(s).then(r=>r.doComplete(s.toString(),sa(t))).then(r=>{if(!r)return;const a=e.getWordUntilPosition(t),l=new g1(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn),d=r.items.map(c=>{const h={label:c.label,insertText:c.insertText||c.label,sortText:c.sortText,filterText:c.filterText,documentation:c.documentation,detail:c.detail,command:zU(c.command),range:l,kind:$U(c.kind)};return c.textEdit&&(UU(c.textEdit)?h.range={insert:Gt(c.textEdit.insert),replace:Gt(c.textEdit.replace)}:h.range=Gt(c.textEdit.range),h.insertText=c.textEdit.newText),c.additionalTextEdits&&(h.additionalTextEdits=c.additionalTextEdits.map(Nc)),c.insertTextFormat===Jb.Snippet&&(h.insertTextRules=pt.CompletionItemInsertTextRule.InsertAsSnippet),h});return{isIncomplete:r.isIncomplete,suggestions:d}})}}function sa(o){if(o)return{character:o.column-1,line:o.lineNumber-1}}function iR(o){if(o)return{start:{line:o.startLineNumber-1,character:o.startColumn-1},end:{line:o.endLineNumber-1,character:o.endColumn-1}}}function Gt(o){if(o)return new g1(o.start.line+1,o.start.character+1,o.end.line+1,o.end.character+1)}function UU(o){return typeof o.insert<"u"&&typeof o.replace<"u"}function $U(o){const e=pt.CompletionItemKind;switch(o){case gt.Text:return e.Text;case gt.Method:return e.Method;case gt.Function:return e.Function;case gt.Constructor:return e.Constructor;case gt.Field:return e.Field;case gt.Variable:return e.Variable;case gt.Class:return e.Class;case gt.Interface:return e.Interface;case gt.Module:return e.Module;case gt.Property:return e.Property;case gt.Unit:return e.Unit;case gt.Value:return e.Value;case gt.Enum:return e.Enum;case gt.Keyword:return e.Keyword;case gt.Snippet:return e.Snippet;case gt.Color:return e.Color;case gt.File:return e.File;case gt.Reference:return e.Reference}return e.Property}function Nc(o){if(o)return{range:Gt(o.range),text:o.newText}}function zU(o){return o&&o.command==="editor.action.triggerSuggest"?{id:o.command,title:o.title,arguments:o.arguments}:void 0}class jU{constructor(e){this._worker=e}provideHover(e,t,i){let n=e.uri;return this._worker(n).then(s=>s.doHover(n.toString(),sa(t))).then(s=>{if(s)return{range:Gt(s.range),contents:KU(s.contents)}})}}function qU(o){return o&&typeof o=="object"&&typeof o.kind=="string"}function Px(o){return typeof o=="string"?{value:o}:qU(o)?o.kind==="plaintext"?{value:o.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:o.value}:{value:"```"+o.language+`
64
- `+o.value+"\n```\n"}}function KU(o){if(o)return Array.isArray(o)?o.map(Px):[Px(o)]}class pz{constructor(e){this._worker=e}provideDocumentHighlights(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.findDocumentHighlights(n.toString(),sa(t))).then(s=>{if(s)return s.map(r=>({range:Gt(r.range),kind:GU(r.kind)}))})}}function GU(o){switch(o){case Hd.Read:return pt.DocumentHighlightKind.Read;case Hd.Write:return pt.DocumentHighlightKind.Write;case Hd.Text:return pt.DocumentHighlightKind.Text}return pt.DocumentHighlightKind.Text}class mz{constructor(e){this._worker=e}provideDefinition(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.findDefinition(n.toString(),sa(t))).then(s=>{if(s)return[nR(s)]})}}function nR(o){return{uri:f1.parse(o.uri),range:Gt(o.range)}}class _z{constructor(e){this._worker=e}provideReferences(e,t,i,n){const s=e.uri;return this._worker(s).then(r=>r.findReferences(s.toString(),sa(t))).then(r=>{if(r)return r.map(nR)})}}class vz{constructor(e){this._worker=e}provideRenameEdits(e,t,i,n){const s=e.uri;return this._worker(s).then(r=>r.doRename(s.toString(),sa(t),i)).then(r=>ZU(r))}}function ZU(o){if(!o||!o.changes)return;let e=[];for(let t in o.changes){const i=f1.parse(t);for(let n of o.changes[t])e.push({resource:i,versionId:void 0,textEdit:{range:Gt(n.range),text:n.newText}})}return{edits:e}}class XU{constructor(e){this._worker=e}provideDocumentSymbols(e,t){const i=e.uri;return this._worker(i).then(n=>n.findDocumentSymbols(i.toString())).then(n=>{if(n)return n.map(s=>YU(s)?sR(s):{name:s.name,detail:"",containerName:s.containerName,kind:oR(s.kind),range:Gt(s.location.range),selectionRange:Gt(s.location.range),tags:[]})})}}function YU(o){return"children"in o}function sR(o){return{name:o.name,detail:o.detail??"",kind:oR(o.kind),range:Gt(o.range),selectionRange:Gt(o.selectionRange),tags:o.tags??[],children:(o.children??[]).map(e=>sR(e))}}function oR(o){let e=pt.SymbolKind;switch(o){case ft.File:return e.File;case ft.Module:return e.Module;case ft.Namespace:return e.Namespace;case ft.Package:return e.Package;case ft.Class:return e.Class;case ft.Method:return e.Method;case ft.Property:return e.Property;case ft.Field:return e.Field;case ft.Constructor:return e.Constructor;case ft.Enum:return e.Enum;case ft.Interface:return e.Interface;case ft.Function:return e.Function;case ft.Variable:return e.Variable;case ft.Constant:return e.Constant;case ft.String:return e.String;case ft.Number:return e.Number;case ft.Boolean:return e.Boolean;case ft.Array:return e.Array}return e.Function}class bz{constructor(e){this._worker=e}provideLinks(e,t){const i=e.uri;return this._worker(i).then(n=>n.findDocumentLinks(i.toString())).then(n=>{if(n)return{links:n.map(s=>({range:Gt(s.range),url:s.target}))}})}}class JU{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.format(n.toString(),null,rR(t)).then(r=>{if(!(!r||r.length===0))return r.map(Nc)}))}}class QU{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,t,i,n){const s=e.uri;return this._worker(s).then(r=>r.format(s.toString(),iR(t),rR(i)).then(a=>{if(!(!a||a.length===0))return a.map(Nc)}))}}function rR(o){return{tabSize:o.tabSize,insertSpaces:o.insertSpaces}}class e5{constructor(e){this._worker=e}provideDocumentColors(e,t){const i=e.uri;return this._worker(i).then(n=>n.findDocumentColors(i.toString())).then(n=>{if(n)return n.map(s=>({color:s.color,range:Gt(s.range)}))})}provideColorPresentations(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.getColorPresentations(n.toString(),t.color,iR(t.range))).then(s=>{if(s)return s.map(r=>{let a={label:r.label};return r.textEdit&&(a.textEdit=Nc(r.textEdit)),r.additionalTextEdits&&(a.additionalTextEdits=r.additionalTextEdits.map(Nc)),a})})}}class t5{constructor(e){this._worker=e}provideFoldingRanges(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.getFoldingRanges(n.toString(),t)).then(s=>{if(s)return s.map(r=>{const a={start:r.startLine+1,end:r.endLine+1};return typeof r.kind<"u"&&(a.kind=i5(r.kind)),a})})}}function i5(o){switch(o){case Wd.Comment:return pt.FoldingRangeKind.Comment;case Wd.Imports:return pt.FoldingRangeKind.Imports;case Wd.Region:return pt.FoldingRangeKind.Region}}class n5{constructor(e){this._worker=e}provideSelectionRanges(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.getSelectionRanges(n.toString(),t.map(sa))).then(s=>{if(s)return s.map(r=>{const a=[];for(;r;)a.push({range:Gt(r.range)}),r=r.parent;return a})})}}function s5(o,e=!1){const t=o.length;let i=0,n="",s=0,r=16,a=0,l=0,d=0,c=0,h=0;function g(y,x){let b=0,w=0;for(;b<y;){let D=o.charCodeAt(i);if(D>=48&&D<=57)w=w*16+D-48;else if(D>=65&&D<=70)w=w*16+D-65+10;else if(D>=97&&D<=102)w=w*16+D-97+10;else break;i++,b++}return b<y&&(w=-1),w}function u(y){i=y,n="",s=0,r=16,h=0}function f(){let y=i;if(o.charCodeAt(i)===48)i++;else for(i++;i<o.length&&va(o.charCodeAt(i));)i++;if(i<o.length&&o.charCodeAt(i)===46)if(i++,i<o.length&&va(o.charCodeAt(i)))for(i++;i<o.length&&va(o.charCodeAt(i));)i++;else return h=3,o.substring(y,i);let x=i;if(i<o.length&&(o.charCodeAt(i)===69||o.charCodeAt(i)===101))if(i++,(i<o.length&&o.charCodeAt(i)===43||o.charCodeAt(i)===45)&&i++,i<o.length&&va(o.charCodeAt(i))){for(i++;i<o.length&&va(o.charCodeAt(i));)i++;x=i}else h=3;return o.substring(y,x)}function p(){let y="",x=i;for(;;){if(i>=t){y+=o.substring(x,i),h=2;break}const b=o.charCodeAt(i);if(b===34){y+=o.substring(x,i),i++;break}if(b===92){if(y+=o.substring(x,i),i++,i>=t){h=2;break}switch(o.charCodeAt(i++)){case 34:y+='"';break;case 92:y+="\\";break;case 47:y+="/";break;case 98:y+="\b";break;case 102:y+="\f";break;case 110:y+=`
64
+ `+o.value+"\n```\n"}}function KU(o){if(o)return Array.isArray(o)?o.map(Px):[Px(o)]}class wz{constructor(e){this._worker=e}provideDocumentHighlights(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.findDocumentHighlights(n.toString(),sa(t))).then(s=>{if(s)return s.map(r=>({range:Gt(r.range),kind:GU(r.kind)}))})}}function GU(o){switch(o){case Hd.Read:return pt.DocumentHighlightKind.Read;case Hd.Write:return pt.DocumentHighlightKind.Write;case Hd.Text:return pt.DocumentHighlightKind.Text}return pt.DocumentHighlightKind.Text}class yz{constructor(e){this._worker=e}provideDefinition(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.findDefinition(n.toString(),sa(t))).then(s=>{if(s)return[nR(s)]})}}function nR(o){return{uri:f1.parse(o.uri),range:Gt(o.range)}}class Iz{constructor(e){this._worker=e}provideReferences(e,t,i,n){const s=e.uri;return this._worker(s).then(r=>r.findReferences(s.toString(),sa(t))).then(r=>{if(r)return r.map(nR)})}}class xz{constructor(e){this._worker=e}provideRenameEdits(e,t,i,n){const s=e.uri;return this._worker(s).then(r=>r.doRename(s.toString(),sa(t),i)).then(r=>ZU(r))}}function ZU(o){if(!o||!o.changes)return;let e=[];for(let t in o.changes){const i=f1.parse(t);for(let n of o.changes[t])e.push({resource:i,versionId:void 0,textEdit:{range:Gt(n.range),text:n.newText}})}return{edits:e}}class XU{constructor(e){this._worker=e}provideDocumentSymbols(e,t){const i=e.uri;return this._worker(i).then(n=>n.findDocumentSymbols(i.toString())).then(n=>{if(n)return n.map(s=>YU(s)?sR(s):{name:s.name,detail:"",containerName:s.containerName,kind:oR(s.kind),range:Gt(s.location.range),selectionRange:Gt(s.location.range),tags:[]})})}}function YU(o){return"children"in o}function sR(o){return{name:o.name,detail:o.detail??"",kind:oR(o.kind),range:Gt(o.range),selectionRange:Gt(o.selectionRange),tags:o.tags??[],children:(o.children??[]).map(e=>sR(e))}}function oR(o){let e=pt.SymbolKind;switch(o){case ft.File:return e.File;case ft.Module:return e.Module;case ft.Namespace:return e.Namespace;case ft.Package:return e.Package;case ft.Class:return e.Class;case ft.Method:return e.Method;case ft.Property:return e.Property;case ft.Field:return e.Field;case ft.Constructor:return e.Constructor;case ft.Enum:return e.Enum;case ft.Interface:return e.Interface;case ft.Function:return e.Function;case ft.Variable:return e.Variable;case ft.Constant:return e.Constant;case ft.String:return e.String;case ft.Number:return e.Number;case ft.Boolean:return e.Boolean;case ft.Array:return e.Array}return e.Function}class Lz{constructor(e){this._worker=e}provideLinks(e,t){const i=e.uri;return this._worker(i).then(n=>n.findDocumentLinks(i.toString())).then(n=>{if(n)return{links:n.map(s=>({range:Gt(s.range),url:s.target}))}})}}class JU{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.format(n.toString(),null,rR(t)).then(r=>{if(!(!r||r.length===0))return r.map(Nc)}))}}class QU{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,t,i,n){const s=e.uri;return this._worker(s).then(r=>r.format(s.toString(),iR(t),rR(i)).then(a=>{if(!(!a||a.length===0))return a.map(Nc)}))}}function rR(o){return{tabSize:o.tabSize,insertSpaces:o.insertSpaces}}class e5{constructor(e){this._worker=e}provideDocumentColors(e,t){const i=e.uri;return this._worker(i).then(n=>n.findDocumentColors(i.toString())).then(n=>{if(n)return n.map(s=>({color:s.color,range:Gt(s.range)}))})}provideColorPresentations(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.getColorPresentations(n.toString(),t.color,iR(t.range))).then(s=>{if(s)return s.map(r=>{let a={label:r.label};return r.textEdit&&(a.textEdit=Nc(r.textEdit)),r.additionalTextEdits&&(a.additionalTextEdits=r.additionalTextEdits.map(Nc)),a})})}}class t5{constructor(e){this._worker=e}provideFoldingRanges(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.getFoldingRanges(n.toString(),t)).then(s=>{if(s)return s.map(r=>{const a={start:r.startLine+1,end:r.endLine+1};return typeof r.kind<"u"&&(a.kind=i5(r.kind)),a})})}}function i5(o){switch(o){case Wd.Comment:return pt.FoldingRangeKind.Comment;case Wd.Imports:return pt.FoldingRangeKind.Imports;case Wd.Region:return pt.FoldingRangeKind.Region}}class n5{constructor(e){this._worker=e}provideSelectionRanges(e,t,i){const n=e.uri;return this._worker(n).then(s=>s.getSelectionRanges(n.toString(),t.map(sa))).then(s=>{if(s)return s.map(r=>{const a=[];for(;r;)a.push({range:Gt(r.range)}),r=r.parent;return a})})}}function s5(o,e=!1){const t=o.length;let i=0,n="",s=0,r=16,a=0,l=0,d=0,c=0,h=0;function g(y,x){let b=0,w=0;for(;b<y;){let D=o.charCodeAt(i);if(D>=48&&D<=57)w=w*16+D-48;else if(D>=65&&D<=70)w=w*16+D-65+10;else if(D>=97&&D<=102)w=w*16+D-97+10;else break;i++,b++}return b<y&&(w=-1),w}function u(y){i=y,n="",s=0,r=16,h=0}function f(){let y=i;if(o.charCodeAt(i)===48)i++;else for(i++;i<o.length&&va(o.charCodeAt(i));)i++;if(i<o.length&&o.charCodeAt(i)===46)if(i++,i<o.length&&va(o.charCodeAt(i)))for(i++;i<o.length&&va(o.charCodeAt(i));)i++;else return h=3,o.substring(y,i);let x=i;if(i<o.length&&(o.charCodeAt(i)===69||o.charCodeAt(i)===101))if(i++,(i<o.length&&o.charCodeAt(i)===43||o.charCodeAt(i)===45)&&i++,i<o.length&&va(o.charCodeAt(i))){for(i++;i<o.length&&va(o.charCodeAt(i));)i++;x=i}else h=3;return o.substring(y,x)}function p(){let y="",x=i;for(;;){if(i>=t){y+=o.substring(x,i),h=2;break}const b=o.charCodeAt(i);if(b===34){y+=o.substring(x,i),i++;break}if(b===92){if(y+=o.substring(x,i),i++,i>=t){h=2;break}switch(o.charCodeAt(i++)){case 34:y+='"';break;case 92:y+="\\";break;case 47:y+="/";break;case 98:y+="\b";break;case 102:y+="\f";break;case 110:y+=`
65
65
  `;break;case 114:y+="\r";break;case 116:y+=" ";break;case 117:const D=g(4);D>=0?y+=String.fromCharCode(D):h=4;break;default:h=5}x=i;continue}if(b>=0&&b<=31)if(sd(b)){y+=o.substring(x,i),h=2;break}else h=6;i++}return y}function _(){if(n="",h=0,s=i,l=a,c=d,i>=t)return s=t,r=17;let y=o.charCodeAt(i);if(Cm(y)){do i++,n+=String.fromCharCode(y),y=o.charCodeAt(i);while(Cm(y));return r=15}if(sd(y))return i++,n+=String.fromCharCode(y),y===13&&o.charCodeAt(i)===10&&(i++,n+=`
66
66
  `),a++,d=i,r=14;switch(y){case 123:return i++,r=1;case 125:return i++,r=2;case 91:return i++,r=3;case 93:return i++,r=4;case 58:return i++,r=6;case 44:return i++,r=5;case 34:return i++,n=p(),r=10;case 47:const x=i-1;if(o.charCodeAt(i+1)===47){for(i+=2;i<t&&!sd(o.charCodeAt(i));)i++;return n=o.substring(x,i),r=12}if(o.charCodeAt(i+1)===42){i+=2;const b=t-1;let w=!1;for(;i<b;){const D=o.charCodeAt(i);if(D===42&&o.charCodeAt(i+1)===47){i+=2,w=!0;break}i++,sd(D)&&(D===13&&o.charCodeAt(i)===10&&i++,a++,d=i)}return w||(i++,h=1),n=o.substring(x,i),r=13}return n+=String.fromCharCode(y),i++,r=16;case 45:if(n+=String.fromCharCode(y),i++,i===t||!va(o.charCodeAt(i)))return r=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return n+=f(),r=11;default:for(;i<t&&v(y);)i++,y=o.charCodeAt(i);if(s!==i){switch(n=o.substring(s,i),n){case"true":return r=8;case"false":return r=9;case"null":return r=7}return r=16}return n+=String.fromCharCode(y),i++,r=16}}function v(y){if(Cm(y)||sd(y))return!1;switch(y){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function S(){let y;do y=_();while(y>=12&&y<=15);return y}return{setPosition:u,getPosition:()=>i,scan:e?S:_,getToken:()=>r,getTokenValue:()=>n,getTokenOffset:()=>s,getTokenLength:()=>i-s,getTokenStartLine:()=>l,getTokenStartCharacter:()=>s-c,getTokenError:()=>h}}function Cm(o){return o===32||o===9}function sd(o){return o===10||o===13}function va(o){return o>=48&&o<=57}var Ox;(function(o){o[o.lineFeed=10]="lineFeed",o[o.carriageReturn=13]="carriageReturn",o[o.space=32]="space",o[o._0=48]="_0",o[o._1=49]="_1",o[o._2=50]="_2",o[o._3=51]="_3",o[o._4=52]="_4",o[o._5=53]="_5",o[o._6=54]="_6",o[o._7=55]="_7",o[o._8=56]="_8",o[o._9=57]="_9",o[o.a=97]="a",o[o.b=98]="b",o[o.c=99]="c",o[o.d=100]="d",o[o.e=101]="e",o[o.f=102]="f",o[o.g=103]="g",o[o.h=104]="h",o[o.i=105]="i",o[o.j=106]="j",o[o.k=107]="k",o[o.l=108]="l",o[o.m=109]="m",o[o.n=110]="n",o[o.o=111]="o",o[o.p=112]="p",o[o.q=113]="q",o[o.r=114]="r",o[o.s=115]="s",o[o.t=116]="t",o[o.u=117]="u",o[o.v=118]="v",o[o.w=119]="w",o[o.x=120]="x",o[o.y=121]="y",o[o.z=122]="z",o[o.A=65]="A",o[o.B=66]="B",o[o.C=67]="C",o[o.D=68]="D",o[o.E=69]="E",o[o.F=70]="F",o[o.G=71]="G",o[o.H=72]="H",o[o.I=73]="I",o[o.J=74]="J",o[o.K=75]="K",o[o.L=76]="L",o[o.M=77]="M",o[o.N=78]="N",o[o.O=79]="O",o[o.P=80]="P",o[o.Q=81]="Q",o[o.R=82]="R",o[o.S=83]="S",o[o.T=84]="T",o[o.U=85]="U",o[o.V=86]="V",o[o.W=87]="W",o[o.X=88]="X",o[o.Y=89]="Y",o[o.Z=90]="Z",o[o.asterisk=42]="asterisk",o[o.backslash=92]="backslash",o[o.closeBrace=125]="closeBrace",o[o.closeBracket=93]="closeBracket",o[o.colon=58]="colon",o[o.comma=44]="comma",o[o.dot=46]="dot",o[o.doubleQuote=34]="doubleQuote",o[o.minus=45]="minus",o[o.openBrace=123]="openBrace",o[o.openBracket=91]="openBracket",o[o.plus=43]="plus",o[o.slash=47]="slash",o[o.formFeed=12]="formFeed",o[o.tab=9]="tab"})(Ox||(Ox={}));new Array(20).fill(0).map((o,e)=>" ".repeat(e));const ba=200;new Array(ba).fill(0).map((o,e)=>`
67
67
  `+" ".repeat(e)),new Array(ba).fill(0).map((o,e)=>"\r"+" ".repeat(e)),new Array(ba).fill(0).map((o,e)=>`\r
68
68
  `+" ".repeat(e)),new Array(ba).fill(0).map((o,e)=>`
69
69
  `+" ".repeat(e)),new Array(ba).fill(0).map((o,e)=>"\r"+" ".repeat(e)),new Array(ba).fill(0).map((o,e)=>`\r
70
- `+" ".repeat(e));var Mx;(function(o){o.DEFAULT={allowTrailingComma:!1}})(Mx||(Mx={}));const o5=s5;var Ax;(function(o){o[o.None=0]="None",o[o.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",o[o.UnexpectedEndOfString=2]="UnexpectedEndOfString",o[o.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",o[o.InvalidUnicode=4]="InvalidUnicode",o[o.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",o[o.InvalidCharacter=6]="InvalidCharacter"})(Ax||(Ax={}));var Fx;(function(o){o[o.OpenBraceToken=1]="OpenBraceToken",o[o.CloseBraceToken=2]="CloseBraceToken",o[o.OpenBracketToken=3]="OpenBracketToken",o[o.CloseBracketToken=4]="CloseBracketToken",o[o.CommaToken=5]="CommaToken",o[o.ColonToken=6]="ColonToken",o[o.NullKeyword=7]="NullKeyword",o[o.TrueKeyword=8]="TrueKeyword",o[o.FalseKeyword=9]="FalseKeyword",o[o.StringLiteral=10]="StringLiteral",o[o.NumericLiteral=11]="NumericLiteral",o[o.LineCommentTrivia=12]="LineCommentTrivia",o[o.BlockCommentTrivia=13]="BlockCommentTrivia",o[o.LineBreakTrivia=14]="LineBreakTrivia",o[o.Trivia=15]="Trivia",o[o.Unknown=16]="Unknown",o[o.EOF=17]="EOF"})(Fx||(Fx={}));var Wx;(function(o){o[o.InvalidSymbol=1]="InvalidSymbol",o[o.InvalidNumberFormat=2]="InvalidNumberFormat",o[o.PropertyNameExpected=3]="PropertyNameExpected",o[o.ValueExpected=4]="ValueExpected",o[o.ColonExpected=5]="ColonExpected",o[o.CommaExpected=6]="CommaExpected",o[o.CloseBraceExpected=7]="CloseBraceExpected",o[o.CloseBracketExpected=8]="CloseBracketExpected",o[o.EndOfFileExpected=9]="EndOfFileExpected",o[o.InvalidCommentToken=10]="InvalidCommentToken",o[o.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",o[o.UnexpectedEndOfString=12]="UnexpectedEndOfString",o[o.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",o[o.InvalidUnicode=14]="InvalidUnicode",o[o.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",o[o.InvalidCharacter=16]="InvalidCharacter"})(Wx||(Wx={}));function r5(o){return{getInitialState:()=>new kc(null,null,!1,null),tokenize:(e,t)=>m5(o,e,t)}}const Hx="delimiter.bracket.json",Vx="delimiter.array.json",a5="delimiter.colon.json",l5="delimiter.comma.json",d5="keyword.json",c5="keyword.json",h5="string.value.json",u5="number.json",g5="string.key.json",f5="comment.block.json",p5="comment.line.json";class zo{constructor(e,t){this.parent=e,this.type=t}static pop(e){return e?e.parent:null}static push(e,t){return new zo(e,t)}static equals(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;for(;e&&t;){if(e===t)return!0;if(e.type!==t.type)return!1;e=e.parent,t=t.parent}return!0}}class kc{constructor(e,t,i,n){this._state=e,this.scanError=t,this.lastWasColon=i,this.parents=n}clone(){return new kc(this._state,this.scanError,this.lastWasColon,this.parents)}equals(e){return e===this?!0:!e||!(e instanceof kc)?!1:this.scanError===e.scanError&&this.lastWasColon===e.lastWasColon&&zo.equals(this.parents,e.parents)}getStateData(){return this._state}setStateData(e){this._state=e}}function m5(o,e,t,i=0){let n=0,s=!1;switch(t.scanError){case 2:e='"'+e,n=1;break;case 1:e="/*"+e,n=2;break}const r=o5(e);let a=t.lastWasColon,l=t.parents;const d={tokens:[],endState:t.clone()};for(;;){let c=i+r.getPosition(),h="";const g=r.scan();if(g===17)break;if(c===i+r.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+e.substr(r.getPosition(),3));switch(s&&(c-=n),s=n>0,g){case 1:l=zo.push(l,0),h=Hx,a=!1;break;case 2:l=zo.pop(l),h=Hx,a=!1;break;case 3:l=zo.push(l,1),h=Vx,a=!1;break;case 4:l=zo.pop(l),h=Vx,a=!1;break;case 6:h=a5,a=!0;break;case 5:h=l5,a=!1;break;case 8:case 9:h=d5,a=!1;break;case 7:h=c5,a=!1;break;case 10:const f=(l?l.type:0)===1;h=a||f?h5:g5,a=!1;break;case 11:h=u5,a=!1;break}switch(g){case 12:h=p5;break;case 13:h=f5;break}d.endState=new kc(t.getStateData(),r.getTokenError(),a,l),d.tokens.push({startIndex:c,scopes:h})}return d}let Ii;function Sz(){return new Promise((o,e)=>{if(!Ii)return e("JSON not registered!");o(Ii)})}class _5 extends WU{constructor(e,t,i){super(e,t,i.onDidChange),this._disposables.push(Ri.onWillDisposeModel(n=>{this._resetSchema(n.uri)})),this._disposables.push(Ri.onDidChangeModelLanguage(n=>{this._resetSchema(n.model.uri)}))}_resetSchema(e){this._worker().then(t=>{t.resetSchema(e.toString())})}}function Cz(o){const e=[],t=[],i=new AU(o);e.push(i),Ii=(...r)=>i.getLanguageServiceWorker(...r);function n(){const{languageId:r,modeConfiguration:a}=o;aR(t),a.documentFormattingEdits&&t.push(pt.registerDocumentFormattingEditProvider(r,new JU(Ii))),a.documentRangeFormattingEdits&&t.push(pt.registerDocumentRangeFormattingEditProvider(r,new QU(Ii))),a.completionItems&&t.push(pt.registerCompletionItemProvider(r,new BU(Ii,[" ",":",'"']))),a.hovers&&t.push(pt.registerHoverProvider(r,new jU(Ii))),a.documentSymbols&&t.push(pt.registerDocumentSymbolProvider(r,new XU(Ii))),a.tokens&&t.push(pt.setTokensProvider(r,r5(!0))),a.colors&&t.push(pt.registerColorProvider(r,new e5(Ii))),a.foldingRanges&&t.push(pt.registerFoldingRangeProvider(r,new t5(Ii))),a.diagnostics&&t.push(new _5(r,Ii,o)),a.selectionRanges&&t.push(pt.registerSelectionRangeProvider(r,new n5(Ii)))}n(),e.push(pt.setLanguageConfiguration(o.languageId,v5));let s=o.modeConfiguration;return o.onDidChange(r=>{r.modeConfiguration!==s&&(s=r.modeConfiguration,n())}),e.push(Bx(t)),Bx(e)}function Bx(o){return{dispose:()=>aR(o)}}function aR(o){for(;o.length;)o.pop().dispose()}const v5={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}]};export{BU as CompletionAdapter,mz as DefinitionAdapter,WU as DiagnosticsAdapter,e5 as DocumentColorAdapter,JU as DocumentFormattingEditProvider,pz as DocumentHighlightAdapter,bz as DocumentLinkAdapter,QU as DocumentRangeFormattingEditProvider,XU as DocumentSymbolAdapter,t5 as FoldingRangeAdapter,jU as HoverAdapter,_z as ReferenceAdapter,vz as RenameAdapter,n5 as SelectionRangeAdapter,AU as WorkerManager,sa as fromPosition,iR as fromRange,Sz as getWorker,Cz as setupMode,Gt as toRange,Nc as toTextEdit};
70
+ `+" ".repeat(e));var Mx;(function(o){o.DEFAULT={allowTrailingComma:!1}})(Mx||(Mx={}));const o5=s5;var Ax;(function(o){o[o.None=0]="None",o[o.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",o[o.UnexpectedEndOfString=2]="UnexpectedEndOfString",o[o.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",o[o.InvalidUnicode=4]="InvalidUnicode",o[o.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",o[o.InvalidCharacter=6]="InvalidCharacter"})(Ax||(Ax={}));var Fx;(function(o){o[o.OpenBraceToken=1]="OpenBraceToken",o[o.CloseBraceToken=2]="CloseBraceToken",o[o.OpenBracketToken=3]="OpenBracketToken",o[o.CloseBracketToken=4]="CloseBracketToken",o[o.CommaToken=5]="CommaToken",o[o.ColonToken=6]="ColonToken",o[o.NullKeyword=7]="NullKeyword",o[o.TrueKeyword=8]="TrueKeyword",o[o.FalseKeyword=9]="FalseKeyword",o[o.StringLiteral=10]="StringLiteral",o[o.NumericLiteral=11]="NumericLiteral",o[o.LineCommentTrivia=12]="LineCommentTrivia",o[o.BlockCommentTrivia=13]="BlockCommentTrivia",o[o.LineBreakTrivia=14]="LineBreakTrivia",o[o.Trivia=15]="Trivia",o[o.Unknown=16]="Unknown",o[o.EOF=17]="EOF"})(Fx||(Fx={}));var Wx;(function(o){o[o.InvalidSymbol=1]="InvalidSymbol",o[o.InvalidNumberFormat=2]="InvalidNumberFormat",o[o.PropertyNameExpected=3]="PropertyNameExpected",o[o.ValueExpected=4]="ValueExpected",o[o.ColonExpected=5]="ColonExpected",o[o.CommaExpected=6]="CommaExpected",o[o.CloseBraceExpected=7]="CloseBraceExpected",o[o.CloseBracketExpected=8]="CloseBracketExpected",o[o.EndOfFileExpected=9]="EndOfFileExpected",o[o.InvalidCommentToken=10]="InvalidCommentToken",o[o.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",o[o.UnexpectedEndOfString=12]="UnexpectedEndOfString",o[o.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",o[o.InvalidUnicode=14]="InvalidUnicode",o[o.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",o[o.InvalidCharacter=16]="InvalidCharacter"})(Wx||(Wx={}));function r5(o){return{getInitialState:()=>new kc(null,null,!1,null),tokenize:(e,t)=>m5(o,e,t)}}const Hx="delimiter.bracket.json",Vx="delimiter.array.json",a5="delimiter.colon.json",l5="delimiter.comma.json",d5="keyword.json",c5="keyword.json",h5="string.value.json",u5="number.json",g5="string.key.json",f5="comment.block.json",p5="comment.line.json";class zo{constructor(e,t){this.parent=e,this.type=t}static pop(e){return e?e.parent:null}static push(e,t){return new zo(e,t)}static equals(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;for(;e&&t;){if(e===t)return!0;if(e.type!==t.type)return!1;e=e.parent,t=t.parent}return!0}}class kc{constructor(e,t,i,n){this._state=e,this.scanError=t,this.lastWasColon=i,this.parents=n}clone(){return new kc(this._state,this.scanError,this.lastWasColon,this.parents)}equals(e){return e===this?!0:!e||!(e instanceof kc)?!1:this.scanError===e.scanError&&this.lastWasColon===e.lastWasColon&&zo.equals(this.parents,e.parents)}getStateData(){return this._state}setStateData(e){this._state=e}}function m5(o,e,t,i=0){let n=0,s=!1;switch(t.scanError){case 2:e='"'+e,n=1;break;case 1:e="/*"+e,n=2;break}const r=o5(e);let a=t.lastWasColon,l=t.parents;const d={tokens:[],endState:t.clone()};for(;;){let c=i+r.getPosition(),h="";const g=r.scan();if(g===17)break;if(c===i+r.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+e.substr(r.getPosition(),3));switch(s&&(c-=n),s=n>0,g){case 1:l=zo.push(l,0),h=Hx,a=!1;break;case 2:l=zo.pop(l),h=Hx,a=!1;break;case 3:l=zo.push(l,1),h=Vx,a=!1;break;case 4:l=zo.pop(l),h=Vx,a=!1;break;case 6:h=a5,a=!0;break;case 5:h=l5,a=!1;break;case 8:case 9:h=d5,a=!1;break;case 7:h=c5,a=!1;break;case 10:const f=(l?l.type:0)===1;h=a||f?h5:g5,a=!1;break;case 11:h=u5,a=!1;break}switch(g){case 12:h=p5;break;case 13:h=f5;break}d.endState=new kc(t.getStateData(),r.getTokenError(),a,l),d.tokens.push({startIndex:c,scopes:h})}return d}let Ii;function Dz(){return new Promise((o,e)=>{if(!Ii)return e("JSON not registered!");o(Ii)})}class _5 extends WU{constructor(e,t,i){super(e,t,i.onDidChange),this._disposables.push(Ri.onWillDisposeModel(n=>{this._resetSchema(n.uri)})),this._disposables.push(Ri.onDidChangeModelLanguage(n=>{this._resetSchema(n.model.uri)}))}_resetSchema(e){this._worker().then(t=>{t.resetSchema(e.toString())})}}function Ez(o){const e=[],t=[],i=new AU(o);e.push(i),Ii=(...r)=>i.getLanguageServiceWorker(...r);function n(){const{languageId:r,modeConfiguration:a}=o;aR(t),a.documentFormattingEdits&&t.push(pt.registerDocumentFormattingEditProvider(r,new JU(Ii))),a.documentRangeFormattingEdits&&t.push(pt.registerDocumentRangeFormattingEditProvider(r,new QU(Ii))),a.completionItems&&t.push(pt.registerCompletionItemProvider(r,new BU(Ii,[" ",":",'"']))),a.hovers&&t.push(pt.registerHoverProvider(r,new jU(Ii))),a.documentSymbols&&t.push(pt.registerDocumentSymbolProvider(r,new XU(Ii))),a.tokens&&t.push(pt.setTokensProvider(r,r5(!0))),a.colors&&t.push(pt.registerColorProvider(r,new e5(Ii))),a.foldingRanges&&t.push(pt.registerFoldingRangeProvider(r,new t5(Ii))),a.diagnostics&&t.push(new _5(r,Ii,o)),a.selectionRanges&&t.push(pt.registerSelectionRangeProvider(r,new n5(Ii)))}n(),e.push(pt.setLanguageConfiguration(o.languageId,v5));let s=o.modeConfiguration;return o.onDidChange(r=>{r.modeConfiguration!==s&&(s=r.modeConfiguration,n())}),e.push(Bx(t)),Bx(e)}function Bx(o){return{dispose:()=>aR(o)}}function aR(o){for(;o.length;)o.pop().dispose()}const v5={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}]};export{BU as CompletionAdapter,yz as DefinitionAdapter,WU as DiagnosticsAdapter,e5 as DocumentColorAdapter,JU as DocumentFormattingEditProvider,wz as DocumentHighlightAdapter,Lz as DocumentLinkAdapter,QU as DocumentRangeFormattingEditProvider,XU as DocumentSymbolAdapter,t5 as FoldingRangeAdapter,jU as HoverAdapter,Iz as ReferenceAdapter,xz as RenameAdapter,n5 as SelectionRangeAdapter,AU as WorkerManager,sa as fromPosition,iR as fromRange,Dz as getWorker,Ez as setupMode,Gt as toRange,Nc as toTextEdit};