offsite 0.0.49 → 0.0.50

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.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-6NYS9HqW.js","assets/editor.api-4LH2ijIL.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/preload-helper-BLdHbfdN.js","assets/editor-DjpsE8to.css","assets/handlebars-DOeNnhTE.js","assets/html-BwGTVsqZ.js","assets/javascript-Dj-Vzbp-.js","assets/typescript-CfCJo9p3.js","assets/liquid-DDSU3ltH.js","assets/mdx-YllfWysm.js","assets/python-Bsfjs4Fs.js","assets/razor-3MUz77_n.js","assets/typescript-fNZ3iur6.js","assets/xml-S-oLW5B5.js","assets/yaml-DlmqY7sN.js","assets/zoomable-image-DzvW3FEl.js","assets/zoomable-image-HHk3X4rG.js","assets/utils-KVq36YOZ.js","assets/button-Dhs1rqob.js","assets/tooltip-CGSEdyeY.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{a as t,c as n,n as r,r as i,s as a,t as o}from"./utils-KVq36YOZ.js";import{$n as s,An as c,Bn as l,Cn as u,Ct as d,Dn as f,En as p,Fn as m,Gn as h,Hn as g,In as _,Jn as v,Jt as y,Kn as b,Ln as ee,Mn as te,Nn as ne,On as re,Pn as ie,Qt as ae,Rn as oe,Tn as se,Un as ce,Vn as le,Wn as ue,Xt as de,Yt as fe,Zt as pe,_ as me,an as he,cn as ge,dn as _e,er as ve,fn as ye,gn as be,h as xe,hn as Se,in as Ce,jn as we,kn as Te,l as Ee,ln as De,on as Oe,p as ke,pn as Ae,qn as je,sn as Me,un as Ne,wn as Pe,zn as Fe}from"./accounts-CUAR3WyJ.js";import{t as Ie,x as Le}from"./button-Dhs1rqob.js";import{c as Re,l as ze}from"./tooltip-CGSEdyeY.js";import{C as Be,c as Ve,r as He,s as Ue,t as We}from"./dialog-Bnoy9Qj1.js";import{t as x}from"./preload-helper-BLdHbfdN.js";import{_ as Ge,f as Ke,g as qe,h as Je,m as Ye,v as Xe}from"./dist-BrDshb6Z.js";import{$ as Ze,$a as Qe,$c as $e,$d as et,$i as tt,$l as nt,$n as rt,$o as it,$r as at,$s as ot,$t as st,$u as ct,A as lt,Aa as ut,Ac as dt,Ad as S,Ai as ft,Al as pt,An as mt,Ao as ht,Ar as gt,As as _t,At as vt,Au as yt,B as bt,Ba as xt,Bc as C,Bd as St,Bi as Ct,Bl as wt,Bn as Tt,Bo as Et,Br as Dt,Bs as Ot,Bt as kt,Bu as w,C as At,Ca as jt,Cc as Mt,Cd as Nt,Ci as Pt,Cl as Ft,Cn as It,Co as Lt,Cr as Rt,Cs as zt,Ct as Bt,Cu as Vt,D as Ht,Da as Ut,Dc as Wt,Dd as Gt,Di as Kt,Dl as qt,Dn as Jt,Do as Yt,Dr as Xt,Ds as Zt,Dt as Qt,Du as $t,E as en,Ea as tn,Ec as nn,Ed as rn,Ei as an,El as on,En as sn,Eo as cn,Er as ln,Es as un,Et as dn,Eu as fn,F as pn,Fa as mn,Fc as hn,Fd as gn,Fi as _n,Fl as vn,Fn as yn,Fo as bn,Fr as xn,Fs as Sn,Ft as Cn,Fu as wn,G as Tn,Ga as En,Gc as Dn,Gd as On,Gi as kn,Gl as An,Gn as jn,Go as Mn,Gr as Nn,Gs as Pn,Gt as Fn,Gu as In,H as Ln,Ha as Rn,Hc as zn,Hd as Bn,Hi as Vn,Hl as Hn,Hn as Un,Ho as Wn,Hr as Gn,Hs as T,Ht as Kn,Hu as qn,Ia as Jn,Ic as Yn,Id as Xn,Ii as Zn,Il as Qn,In as $n,Io as er,Ir as tr,Is as nr,It as rr,Iu as ir,J as ar,Ja as or,Jc as sr,Jd as cr,Ji as lr,Jl as ur,Jn as dr,Jo as fr,Jr as pr,Js as mr,Jt as hr,Ju as E,K as gr,Ka as _r,Kc as vr,Kd as yr,Ki as br,Kl as xr,Kn as Sr,Ko as Cr,Kr as D,Ks as wr,Kt as Tr,Ku as Er,L as Dr,La as Or,Lc as kr,Ld as Ar,Li as jr,Ll as Mr,Ln as Nr,Lo as Pr,Lr as Fr,Ls as Ir,Lt as Lr,Lu as Rr,M as zr,Ma as Br,Mc as Vr,Md as Hr,Mi as Ur,Ml as Wr,Mn as Gr,Mo as Kr,Mr as qr,Ms as Jr,Mt as Yr,Mu as Xr,N as Zr,Na as Qr,Nc as $r,Nd as ei,Ni as ti,Nl as ni,Nn as ri,No as ii,Nr as ai,Ns as O,Nt as oi,Nu as si,O as ci,Oa as li,Oc as ui,Od as di,Oi as fi,Ol as pi,On as mi,Oo as hi,Or as gi,Os as _i,Ot as vi,Ou as yi,P as bi,Pa as xi,Pc as Si,Pd as Ci,Pi as wi,Pl as Ti,Pn as Ei,Po as Di,Pr as Oi,Ps as ki,Pt as Ai,Pu as ji,Q as Mi,Qa as Ni,Qc as Pi,Qd as Fi,Qi as Ii,Ql as Li,Qn as Ri,Qo as zi,Qr as Bi,Qs as Vi,Qt as Hi,Qu as Ui,R as Wi,Ra as k,Rc as Gi,Rd as Ki,Ri as qi,Rl as Ji,Rn as Yi,Ro as Xi,Rr as Zi,Rs as Qi,Rt as $i,Ru as A,S as ea,Sa as ta,Sc as na,Sd as ra,Si as ia,Sl as aa,Sn as oa,So as sa,Sr as ca,Ss as la,St as ua,Su as da,T as fa,Ta as pa,Tc as ma,Td as ha,Ti as ga,Tl as _a,Tn as va,To as ya,Tr as ba,Ts as xa,Tt as Sa,Tu as Ca,U as wa,Ua as Ta,Uc as Ea,Ud as Da,Ui as Oa,Ul as ka,Un as Aa,Uo as ja,Ur as Ma,Us as Na,Ut as Pa,Uu as Fa,V as Ia,Va as La,Vc as Ra,Vd as za,Vi as Ba,Vl as Va,Vn as Ha,Vo as Ua,Vr as Wa,Vs as Ga,Vt as Ka,Vu as j,W as qa,Wa as Ja,Wc as Ya,Wd as Xa,Wi as Za,Wl as Qa,Wn as $a,Wo as eo,Wr as to,Ws as M,Wt as no,Wu as ro,X as io,Xa as ao,Xc as oo,Xd as so,Xi as co,Xl as lo,Xn as uo,Xo as fo,Xr as po,Xs as mo,Xt as ho,Xu as go,Y as _o,Ya as vo,Yc as yo,Yd as bo,Yi as xo,Yl as So,Yn as Co,Yo as wo,Yr as To,Ys as Eo,Yt as Do,Yu as Oo,Z as ko,Za as Ao,Zc as jo,Zd as Mo,Zi as No,Zl as Po,Zn as Fo,Zo as Io,Zr as Lo,Zs as Ro,Zt as zo,Zu as Bo,_ as Vo,_a as Ho,_c as Uo,_d as Wo,_f as Go,_i as Ko,_l as qo,_n as Jo,_o as Yo,_r as Xo,_s as Zo,_t as Qo,_u as $o,a as es,aa as ts,ac as N,ad as P,af as ns,ai as rs,al as is,an as as,ao as os,ar as ss,as as cs,at as ls,au as us,b as ds,ba as fs,bc as ps,bd as ms,bi as hs,bl as gs,bn as _s,bo as vs,br as ys,bs,bt as xs,bu as Ss,c as Cs,ca as ws,cc as Ts,cd as Es,cf as Ds,ci as Os,cl as ks,cn as As,co as js,cr as F,cs as Ms,ct as Ns,cu as Ps,d as Fs,da as Is,dc as Ls,dd as I,df as Rs,di as zs,dl as Bs,dn as Vs,do as Hs,dr as Us,ds as Ws,dt as Gs,du as Ks,ea as qs,ec as Js,ef as Ys,ei as Xs,el as Zs,en as Qs,eo as $s,er as ec,es as tc,et as nc,eu as rc,f as ic,fa as ac,fc as oc,fd as sc,ff as cc,fi as lc,fl as uc,fn as dc,fo as fc,fr as pc,fs as mc,ft as hc,fu as gc,g as _c,ga as vc,gc as yc,gd as bc,gf as xc,gi as Sc,gl as Cc,gn as wc,go as Tc,gr as Ec,gs as Dc,gt as Oc,gu as kc,h as Ac,ha as jc,hc as L,hd as Mc,hf as Nc,hi as Pc,hl as Fc,hn as Ic,ho as Lc,hr as Rc,hs as zc,ht as Bc,hu as Vc,i as Hc,ia as Uc,ic as Wc,id as Gc,if as Kc,ii as qc,il as Jc,in as Yc,io as Xc,ir as Zc,is as Qc,it as $c,iu as el,j as tl,ja as nl,jc as rl,jd as R,ji as il,jl as al,jn as ol,jo as sl,jr as cl,js as ll,jt as ul,ju as dl,k as fl,ka as pl,kc as ml,kd as hl,ki as gl,kl as _l,kn as vl,ko as yl,kr as bl,ks as xl,kt as Sl,ku as Cl,l as wl,la as Tl,lc as El,ld as Dl,lf as Ol,li as kl,ll as Al,ln as jl,lo as z,lr as Ml,ls as Nl,lt as Pl,lu as Fl,m as Il,ma as Ll,mc as Rl,md as zl,mf as Bl,mi as Vl,ml as Hl,mn as Ul,mo as Wl,mr as Gl,ms as Kl,mt as ql,mu as Jl,n as Yl,na as Xl,nc as Zl,nd as Ql,nf as $l,ni as eu,nl as tu,nn as nu,no as ru,nr as iu,ns as au,nt as ou,nu as su,o as cu,oa as lu,oc as uu,od as du,of as fu,oi as pu,ol as mu,on as hu,oo as gu,or as _u,os as B,ot as vu,ou as yu,p as bu,pa as xu,pc as Su,pd as Cu,pf as wu,pi as Tu,pl as V,pn as Eu,po as Du,pr as Ou,ps as ku,pt as Au,pu as ju,q as Mu,qa as Nu,qc as Pu,qd as Fu,qi as Iu,ql as Lu,qn as Ru,qo as zu,qr as Bu,qs as H,qt as Vu,qu as Hu,r as Uu,ra as Wu,rc as Gu,rd as Ku,rf as qu,ri as Ju,rl as Yu,rn as Xu,ro as Zu,rr as Qu,rs as $u,rt as ed,ru as td,s as nd,sa as rd,sc as id,sd as ad,sf as od,si as sd,sl as cd,sn as ld,so as ud,sr as dd,ss as U,st as fd,su as pd,t as md,ta as hd,tc as W,td as gd,tf as _d,ti as vd,tl as yd,tn as bd,to as xd,tr as Sd,ts as G,tt as Cd,tu as wd,u as Td,ua as Ed,uc as Dd,ud as K,uf as Od,ui as kd,ul as Ad,un as jd,uo as Md,ur as Nd,us as Pd,ut as Fd,uu as Id,v as Ld,va as Rd,vc as q,vd as zd,vf as Bd,vi as Vd,vl as Hd,vn as Ud,vo as Wd,vr as Gd,vs as Kd,vt as qd,vu as Jd,w as Yd,wa as Xd,wc as Zd,wd as Qd,wi as $d,wl as ef,wn as tf,wo as nf,wr as rf,ws as af,wt as of,wu as sf,x as cf,xa as lf,xc as uf,xd as df,xi as ff,xl as pf,xn as mf,xo as hf,xr as gf,xs as _f,xt as vf,xu as yf,y as bf,ya as xf,yc as Sf,yd as Cf,yi as wf,yl as Tf,yn as Ef,yo as Df,yr as Of,ys as kf,yt as Af,yu as jf,z as Mf,za as Nf,zc as Pf,zd as Ff,zi as If,zl as Lf,zn as Rf,zo as zf,zr as Bf,zs as Vf,zt as Hf,zu as J}from"./editor.api-4LH2ijIL.js";var Uf=[[`path`,{d:`M17.4776 9.01106C17.485 9.01102 17.4925 9.01101 17.5 9.01101C19.9853 9.01101 22 11.0294 22 13.5193C22 15.8398 20.25 17.7508 18 18M17.4776 9.01106C17.4924 8.84606 17.5 8.67896 17.5 8.51009C17.5 5.46695 15.0376 3 12 3C9.12324 3 6.76233 5.21267 6.52042 8.03192M17.4776 9.01106C17.3753 10.1476 16.9286 11.1846 16.2428 12.0165M6.52042 8.03192C3.98398 8.27373 2 10.4139 2 13.0183C2 15.4417 3.71776 17.4632 6 17.9273M6.52042 8.03192C6.67826 8.01687 6.83823 8.00917 7 8.00917C8.12582 8.00917 9.16474 8.38194 10.0005 9.01101`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 21L12 13M12 21C11.2998 21 9.99153 19.0057 9.5 18.5M12 21C12.7002 21 14.0085 19.0057 14.5 18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Wf=[[`path`,{d:`M4 12.0005L4 14.5446C4 17.7896 4 19.4122 4.88607 20.5111C5.06508 20.7331 5.26731 20.9354 5.48933 21.1144C6.58831 22.0005 8.21082 22.0005 11.4558 22.0005C12.1614 22.0005 12.5141 22.0005 12.8372 21.8865C12.9044 21.8627 12.9702 21.8355 13.0345 21.8047C13.3436 21.6569 13.593 21.4075 14.0919 20.9086L18.8284 16.172C19.4065 15.594 19.6955 15.3049 19.8478 14.9374C20 14.5699 20 14.1611 20 13.3436V10.0005C20 6.22922 20 4.34361 18.8284 3.17203C17.7693 2.11287 16.1265 2.01125 13.0345 2.0015M13 21.5005V21.0005C13 18.172 13 16.7578 13.8787 15.8791C14.7574 15.0005 16.1716 15.0005 19 15.0005H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 5.99954H4M8 1.99954V9.99954`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Gf=[[`path`,{d:`M20 14V10.6569C20 9.83935 20 9.4306 19.8478 9.06306C19.6955 8.69552 19.4065 8.40649 18.8284 7.82843L14.0919 3.09188C13.593 2.593 13.3436 2.34355 13.0345 2.19575C12.9702 2.165 12.9044 2.13772 12.8372 2.11401C12.5141 2 12.1614 2 11.4558 2C8.21082 2 6.58831 2 5.48933 2.88607C5.26731 3.06508 5.06508 3.26731 4.88607 3.48933C4 4.58831 4 6.21082 4 9.45584V14C4 17.7712 4 19.6569 5.17157 20.8284C6.34315 22 8.22876 22 12 22M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M17 22C17.6068 21.4102 20 19.8403 20 19C20 18.1597 17.6068 16.5898 17 16M19 19H12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Kf=[[`path`,{d:`M13 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 13V21M22 17H14`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],qf=[[`path`,{d:`M2 13C2.06427 12.3499 2.20951 11.9124 2.53777 11.5858C3.12654 11 4.07416 11 5.9694 11H18.0306C19.9258 11 20.8735 11 21.4622 11.5858C21.7905 11.9124 21.9357 12.3499 22 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Jf=[[`path`,{d:`M12 8H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 12H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 20H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12 16H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M3 4V11C3 12.8692 3 13.8038 3.40192 14.5C3.66523 14.9561 4.04394 15.3348 4.5 15.5981C5.19615 16 6.13077 16 8 16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M8 8H7C6.07003 8 5.60504 8 5.22354 7.89778C4.18827 7.62038 3.37962 6.81173 3.10222 5.77646C3 5.39496 3 4.92997 3 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],Yf=[[`path`,{d:`M2 11.4C2 10.2417 2.24173 10 3.4 10H20.6C21.7583 10 22 10.2417 22 11.4V12.6C22 13.7583 21.7583 14 20.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2 19.4C2 18.2417 2.24173 18 3.4 18H20.6C21.7583 18 22 18.2417 22 19.4V20.6C22 21.7583 21.7583 22 20.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],Xf=[[`path`,{d:`M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Zf=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.38886 15.1629C9.89331 15.5 10.5955 15.5 12 15.5C13.4045 15.5 14.1067 15.5 14.6111 15.1629C14.8295 15.017 15.017 14.8295 15.1629 14.6111C15.5 14.1067 15.5 13.4045 15.5 12C15.5 10.5955 15.5 9.89331 15.1629 9.38886C15.017 9.17048 14.8295 8.98298 14.6111 8.83706C14.1067 8.5 13.4045 8.5 12 8.5C10.5955 8.5 9.89331 8.5 9.38886 8.83706C9.17048 8.98298 8.98298 9.17048 8.83706 9.38886C8.5 9.89331 8.5 10.5955 8.5 12C8.5 13.4045 8.5 14.1067 8.83706 14.6111C8.98298 14.8295 9.17048 15.017 9.38886 15.1629Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Qf=[[`circle`,{cx:`1.5`,cy:`1.5`,r:`1.5`,transform:`matrix(1 0 0 -1 16 8.00024)`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2.77423 11.1439C1.77108 12.2643 1.7495 13.9546 2.67016 15.1437C4.49711 17.5033 6.49674 19.5029 8.85633 21.3298C10.0454 22.2505 11.7357 22.2289 12.8561 21.2258C15.8979 18.5022 18.6835 15.6559 21.3719 12.5279C21.6377 12.2187 21.8039 11.8397 21.8412 11.4336C22.0062 9.63798 22.3452 4.46467 20.9403 3.05974C19.5353 1.65481 14.362 1.99377 12.5664 2.15876C12.1603 2.19608 11.7813 2.36233 11.472 2.62811C8.34412 5.31646 5.49781 8.10211 2.77423 11.1439Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M7.00002 14.0002L10 17.0002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],$f=[[`path`,{d:`M3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C8.79275 3 5.97733 4.67765 4.38341 7.20327M3.29339 3.00076L3.46556 5.05452C3.58958 6.53384 3.65159 7.27349 4.13359 7.68914C4.61559 8.10479 5.32673 8.03185 6.74899 7.88595L8.79339 7.67625`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Y=e(n(),1),X=a();function ep(){let e=me(e=>e.errors);return e.length===0?null:(0,X.jsxs)(`div`,{role:`alert`,className:`bg-popover text-popover-foreground absolute right-3 bottom-9 z-20 flex w-96 max-w-[calc(100%-1.5rem)] items-start gap-2 rounded-md border p-3 text-[13px] shadow-lg`,children:[(0,X.jsx)(Le,{icon:v,className:`text-destructive mt-0.5 size-4 shrink-0`}),(0,X.jsx)(`p`,{className:`min-w-0 flex-1 break-words whitespace-pre-wrap`,children:e.at(-1)}),(0,X.jsx)(`button`,{type:`button`,title:`Dismiss`,"aria-label":`Dismiss`,className:`hover:bg-accent grid size-5 shrink-0 cursor-pointer place-items-center rounded-sm`,onClick:Ee,children:(0,X.jsx)(Le,{icon:Be,className:`size-3.5`})})]})}function tp(e,t){let n=localStorage.getItem(`editorWindow ${e} ${t}`);return n===null?{tabs:[],active:null,expanded:[],settings:{view:`explorer`,sidebar:!0,width:300,tree:!0,sort:`path`,messages:{},graph:!0,graphHeight:240,inline:!1,whitespace:!0,collapse:!1,smartCommit:!0}}:JSON.parse(n)}function np(e,t,n){localStorage.setItem(`editorWindow ${e} ${t}`,JSON.stringify(n))}function rp(e){let t=(0,Y.useRef)(!1),n=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{let t=e.initial.lastIndexOf(`.`);n.current?.focus(),n.current?.setSelectionRange(0,t>0?t:e.initial.length)},[e.initial]),(0,X.jsx)(`input`,{ref:n,"aria-label":`Name`,defaultValue:e.initial,className:`border-primary bg-background text-foreground h-5 min-w-0 flex-1 border px-1 text-[13px] outline-none`,onKeyDown:n=>{n.key===`Enter`&&(t.current=!0,e.onCommit(n.currentTarget.value)),n.key===`Escape`&&(t.current=!0,e.onCancel())},onBlur:n=>{t.current||(t.current=!0,e.onCommit(n.currentTarget.value))}})}function ip(e){let[t,n]=(0,Y.useState)(null),[r,a]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(0),[l,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)({path:``,folder:!0}),[p,h]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null),b=(0,Y.useRef)(null),ee=Ae();(0,Y.useEffect)(()=>{let t=!0;return ve(e.machine,`files.entries`,{projectId:e.projectId}).then(e=>{t&&(n(e),a(null))},e=>{t&&a(i(e))}),()=>{t=!1}},[e.machine,e.projectId,s]);let te=(0,Y.useMemo)(()=>ap(t?.files??[],t?.folders??[]),[t]),ne=l??e.active,re=l??(e.active===null?``:op(e.active));function ie(t,n){let r=t===``?[]:t.split(`/`);e.onExpanded([...new Set([...e.expanded,...r.map((e,t)=>r.slice(0,t+1).join(`/`))])]),h({kind:`create`,parent:t,folder:n})}async function oe(t){if(p===null)return;h(null);let n=t.trim();if(n!==``)try{if(p.kind===`create`){let t=p.parent===``?n:`${p.parent}/${n}`;await ve(e.machine,`files.create`,{projectId:e.projectId,path:t,folder:p.folder}),p.folder&&e.onExpanded(e=>[...e,t]),p.folder||e.onOpen(t)}if(p.kind===`rename`&&n!==sp(p.path)){let t=op(p.path),r=t===``?n:`${t}/${n}`;await ve(e.machine,`files.rename`,{projectId:e.projectId,path:p.path,to:r}),e.onRenamed(p.path,r)}c(e=>e+1)}catch(e){xe(e)}}async function se(t){try{await ve(e.machine,`files.delete`,{projectId:e.projectId,path:t.path}),e.onDeleted(t.path),c(e=>e+1)}catch(e){xe(e)}}function le(e,t,n){return(0,X.jsxs)(`div`,{className:`flex h-[22px] items-center gap-1.5 pr-2`,style:{paddingLeft:8+e*12},children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),t&&(0,X.jsx)(Le,{icon:qf,className:`text-muted-foreground size-4 shrink-0`}),!t&&(0,X.jsx)(Ve,{path:n}),(0,X.jsx)(rp,{initial:n,onCommit:e=>void oe(e),onCancel:()=>h(null)})]},`input`)}function ue(t,n,r,i){return p?.kind===`rename`&&p.path===t?le(n,r,sp(t)):(0,X.jsxs)(`button`,{type:`button`,"data-path":t,"data-folder":r,className:o(`text-sidebar-foreground hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] w-full cursor-pointer items-center gap-1.5 pr-2 text-left text-[13px] outline-none focus-visible:ring-1 focus-visible:ring-inset`,t===ne&&`bg-sidebar-row-active`),style:{paddingLeft:8+n*12},onClick:()=>{r?(u(t),e.onExpanded(i?e.expanded.filter(e=>e!==t):[...e.expanded,t])):(u(null),e.onOpen(t))},children:[Array.from({length:n},(e,t)=>(0,X.jsx)(`span`,{"aria-hidden":!0,className:`border-sidebar-border pointer-events-none absolute inset-y-0 border-l opacity-0 transition-opacity group-hover/tree:opacity-100`,style:{left:16+t*12}},t)),r&&(0,X.jsx)(Le,{icon:ce,"aria-hidden":!0,className:o(`text-muted-foreground size-4 shrink-0 transition-transform`,i&&`rotate-90`)}),!r&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),r&&(0,X.jsx)(Le,{icon:i?Fe:qf,className:`text-muted-foreground size-4 shrink-0`}),!r&&(0,X.jsx)(Ve,{path:t}),(0,X.jsx)(`span`,{className:`truncate`,children:sp(t)})]},t)}function me(t,n,r){return[p?.kind===`create`&&p.parent===n&&le(r,p.folder,``),...[...t.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(t=>{let i=n===``?t[0]:`${n}/${t[0]}`,a=e.expanded.includes(i);return(0,X.jsxs)(`div`,{children:[ue(i,r,!0,a),a&&me(t[1],i,r+1)]},`dir:${i}`)}),...[...t.files].sort((e,t)=>e.localeCompare(t)).map(e=>ue(e,r,!1,!1))]}return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`New File…`,"aria-label":`New File`,onClick:()=>ie(re,!1),children:(0,X.jsx)(Le,{icon:Wf,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`New Folder…`,"aria-label":`New Folder`,onClick:()=>ie(re,!0),children:(0,X.jsx)(Le,{icon:Kf,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Refresh Explorer`,"aria-label":`Refresh Explorer`,onClick:()=>c(s+1),children:(0,X.jsx)(Le,{icon:m,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Collapse Folders in Explorer`,"aria-label":`Collapse Folders in Explorer`,onClick:()=>e.onExpanded([]),children:(0,X.jsx)(Le,{icon:g,className:`size-4`})})]}),(0,X.jsxs)(y,{children:[(0,X.jsx)(ae,{asChild:!0,children:(0,X.jsxs)(`div`,{className:`group/tree min-h-0 flex-1 overflow-y-auto pb-6`,onContextMenu:e=>{let t=e.target instanceof Element?e.target.closest(`[data-path]`):null;f(t===null?{path:``,folder:!0}:{path:t.dataset.path??``,folder:t.dataset.folder===`true`})},children:[r!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:r}),r===null&&t===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),r===null&&t!==null&&me(te,``,0)]})}),(0,X.jsxs)(fe,{className:`min-w-48`,onCloseAutoFocus:e=>{b.current!==null&&(e.preventDefault(),b.current(),b.current=null)},children:[(0,X.jsx)(de,{onSelect:()=>{b.current=()=>ie(d.folder?d.path:op(d.path),!1)},children:`New File…`}),(0,X.jsx)(de,{onSelect:()=>{b.current=()=>ie(d.folder?d.path:op(d.path),!0)},children:`New Folder…`}),(0,X.jsx)(pe,{}),(0,X.jsx)(de,{onSelect:()=>void ee.copy(d.path===``?e.root:`${e.root}/${d.path}`),children:`Copy Path`}),d.path!==``&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(de,{onSelect:()=>void ee.copy(d.path),children:`Copy Relative Path`}),(0,X.jsx)(pe,{}),(0,X.jsx)(de,{onSelect:()=>{b.current=()=>h({kind:`rename`,path:d.path,folder:d.folder})},children:`Rename…`}),(0,X.jsx)(de,{variant:`destructive`,onSelect:()=>{b.current=()=>v(d)},children:`Delete`})]})]})]}),(0,X.jsx)(Ce,{open:_!==null,onOpenChange:e=>{e||v(null)},children:(0,X.jsxs)(Me,{children:[(0,X.jsxs)(Ne,{children:[(0,X.jsx)(_e,{children:`Delete '${_===null?``:sp(_.path)}'?`}),(0,X.jsx)(ge,{children:_?.folder===!0?`This folder and everything in it will be permanently deleted.`:`This file will be permanently deleted.`})]}),(0,X.jsxs)(De,{children:[(0,X.jsx)(Oe,{children:`Cancel`}),(0,X.jsx)(he,{variant:`destructive`,onClick:()=>{_!==null&&se(_)},children:`Delete`})]})]})})]})}function ap(e,t){let n={folders:new Map,files:[]};function r(e){let t=n;for(let n of e){let e=t.folders.get(n)??{folders:new Map,files:[]};t.folders.set(n,e),t=e}return t}for(let e of t)r(e.split(`/`));for(let t of e)r(t.split(`/`).slice(0,-1)).files.push(t);return n}function op(e){return e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``}function sp(e){return e.slice(e.lastIndexOf(`/`)+1)}function cp(e){return(0,X.jsx)(`div`,{role:`tablist`,className:`flex h-full min-w-0 flex-1 [scrollbar-width:thin] overflow-x-auto`,children:e.tabs.map(t=>{let n=t.id===e.active,r=e.dirty.includes(t.id);return(0,X.jsxs)(`div`,{role:`tab`,tabIndex:0,"aria-selected":n,title:t.path,className:o(`group/tab border-sidebar-border relative flex shrink-0 cursor-pointer items-center gap-1.5 border-r pr-1.5 pl-3 text-[13px] outline-none select-none`,n&&`bg-background text-foreground`,!n&&`text-muted-foreground hover:bg-background/50`),onClick:()=>e.onSelect(t.id),onAuxClick:n=>{n.button===1&&e.onClose(t.id)},onKeyDown:n=>{n.key===`Enter`&&e.onSelect(t.id)},children:[n&&(0,X.jsx)(`span`,{className:`bg-primary absolute inset-x-0 top-0 h-px`}),(0,X.jsx)(Ve,{path:t.path}),(0,X.jsx)(`span`,{className:`max-w-48 truncate`,children:t.label}),e.tabs.some(e=>e!==t&&e.label===t.label)&&(0,X.jsx)(`span`,{className:`text-muted-foreground max-w-40 truncate text-xs`,children:op(t.path)}),(0,X.jsxs)(`button`,{type:`button`,title:`Close`,"aria-label":`Close ${t.label}`,className:o(`group/close hover:bg-accent flex size-5 cursor-pointer items-center justify-center rounded opacity-0 group-hover/tab:opacity-100 focus-visible:opacity-100`,(n||r)&&`opacity-100`),onClick:n=>{n.stopPropagation(),e.onClose(t.id)},children:[r&&(0,X.jsx)(`span`,{className:`bg-foreground size-2 rounded-full group-hover/close:hidden`}),(0,X.jsx)(Le,{icon:Be,className:o(`size-3.5`,r&&`hidden group-hover/close:block`)})]})]},t.id)})})}var lp=class e{_ruleStack;constructor(e){this._ruleStack=e}get ruleStack(){return this._ruleStack}clone(){return new e(this._ruleStack)}equals(t){return!(!t||!(t instanceof e)||t!==this||t._ruleStack!==this._ruleStack)}};function up(e){if(Array.isArray(e)&&(e=e[0]),e)return e=(e.charCodeAt(0)===35?e.slice(1):e).toLowerCase(),(e.length===3||e.length===4)&&(e=e.split(``).map(e=>e+e).join(``)),e}var dp=/[\s,]+/;function fp(e){let t=`rules`in e?e.rules:void 0;if(!t){t=[];let n=e.settings||e.tokenColors;for(let{scope:e,settings:{foreground:r,background:i,fontStyle:a}={}}of n){if(!r&&!i&&!a)continue;let n=Array.isArray(e)?e:e?[e]:[],o=_p(a),s=up(r),c=up(i);t.push(...n.map(e=>({token:e,foreground:s,background:c,fontStyle:o})))}}let n=Object.fromEntries(Object.entries(e.colors||{}).map(([e,t])=>[e,`#${up(t)}`]));return{base:e.type===`light`?`vs`:`vs-dark`,inherit:!1,colors:n,rules:t}}function pp(e,t,n={}){let r=new Map,i=e.getLoadedThemes();for(let n of i){let i=fp(e.getTheme(n));r.set(n,i),t.editor.defineTheme(n,i)}let a=[],o=new Map,s=t.editor.setTheme.bind(t.editor);t.editor.setTheme=t=>{let n=e.setTheme(t),i=r.get(t);a.length=n.colorMap.length;for(let e=0;e<n.colorMap.length;e++)a[e]=n.colorMap[e];o.clear(),i?.rules.forEach(e=>{let t=up(e.foreground);if(!t)return;let n=vp(t,_p(e.fontStyle));o.has(n)||o.set(n,e.token)}),s(t)};let c=t.editor.create;t.editor.create=(e,n,r)=>(n?.theme&&t.editor.setTheme(n.theme),c(e,n,r)),t.editor.setTheme(i[0]);function l(e,t){let n=vp(e,mp(t));return o.get(n)}let{tokenizeMaxLineLength:u=2e4,tokenizeTimeLimit:d=500}=n,f=new Set(t.languages.getLanguages().map(e=>e.id));for(let n of e.getLoadedLanguages())f.has(n)&&t.languages.setTokensProvider(n,{getInitialState(){return new lp(qe)},tokenize(t,r){if(t.length>=u)return{endState:r,tokens:[{startIndex:0,scopes:``}]};let i=e.getLanguage(n).tokenizeLine2(t,r.ruleStack,d);i.stoppedEarly&&console.warn(`Time limit reached when tokenizing line: ${t.substring(0,100)}`);let o=i.tokens.length/2,s=[];for(let e=0;e<o;e++){let t=i.tokens[2*e],n=i.tokens[2*e+1],r=Ye.getForeground(n),o=up(a[r]||``),c=Ye.getFontStyle(n),u=o&&l(o,c)||``;s.push({startIndex:t,scopes:u})}return{endState:new lp(i.ruleStack),tokens:s}}})}function mp(e){if(e<=Je.None)return``;let t=[];return e&Je.Italic&&t.push(`italic`),e&Je.Bold&&t.push(`bold`),e&Je.Underline&&t.push(`underline`),e&Je.Strikethrough&&t.push(`strikethrough`),t.join(` `)}var hp=[`italic`,`bold`,`underline`,`strikethrough`],gp={"line-through":`strikethrough`};function _p(e){if(!e)return``;let t=new Set(e.split(dp).map(e=>e.trim().toLowerCase()).map(e=>gp[e]||e).filter(Boolean));return hp.filter(e=>t.has(e)).join(` `)}function vp(e,t){return t?`${e}|${t}`:e}var yp={},bp={},xp=class e{static getOrCreate(t){return bp[t]||(bp[t]=new e(t)),bp[t]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,yp[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Z(e){let t=e.id;yp[t]=e,Hc.register(e);let n=xp.getOrCreate(t);Hc.registerTokensProviderFactory(t,{create:async()=>(await n.load()).language}),Hc.onLanguageEncountered(t,async()=>{let e=await n.load();Hc.setLanguageConfiguration(t,e.conf)})}Z({id:`abap`,extensions:[`.abap`],aliases:[`abap`,`ABAP`],loader:()=>x(()=>import(`./abap-08VXUWAP.js`),[])}),Z({id:`apex`,extensions:[`.cls`],aliases:[`Apex`,`apex`],mimetypes:[`text/x-apex-source`,`text/x-apex`],loader:()=>x(()=>import(`./apex-BWPQTe0t.js`),[])}),Z({id:`azcli`,extensions:[`.azcli`],aliases:[`Azure CLI`,`azcli`],loader:()=>x(()=>import(`./azcli-Bc_sGQ0U.js`),[])}),Z({id:`bat`,extensions:[`.bat`,`.cmd`],aliases:[`Batch`,`bat`],loader:()=>x(()=>import(`./bat-i0X4ZdIN.js`),[])}),Z({id:`bicep`,extensions:[`.bicep`],aliases:[`Bicep`],loader:()=>x(()=>import(`./bicep-B5-_aFwp.js`),[])}),Z({id:`cameligo`,extensions:[`.mligo`],aliases:[`Cameligo`],loader:()=>x(()=>import(`./cameligo-DMUM7wLl.js`),[])}),Z({id:`clojure`,extensions:[`.clj`,`.cljs`,`.cljc`,`.edn`],aliases:[`clojure`,`Clojure`],loader:()=>x(()=>import(`./clojure-Cm7r79vr.js`),[])}),Z({id:`coffeescript`,extensions:[`.coffee`],aliases:[`CoffeeScript`,`coffeescript`,`coffee`],mimetypes:[`text/x-coffeescript`,`text/coffeescript`],loader:()=>x(()=>import(`./coffee-Ba7i2nA0.js`),[])}),Z({id:`c`,extensions:[`.c`,`.h`],aliases:[`C`,`c`],loader:()=>x(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`cpp`,extensions:[`.cpp`,`.cc`,`.cxx`,`.hpp`,`.hh`,`.hxx`],aliases:[`C++`,`Cpp`,`cpp`],loader:()=>x(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`csharp`,extensions:[`.cs`,`.csx`,`.cake`],aliases:[`C#`,`csharp`],loader:()=>x(()=>import(`./csharp-BKxtCVv1.js`),[])}),Z({id:`csp`,extensions:[`.csp`],aliases:[`CSP`,`csp`],loader:()=>x(()=>import(`./csp-bTuwJoIa.js`),[])}),Z({id:`css`,extensions:[`.css`],aliases:[`CSS`,`css`],mimetypes:[`text/css`],loader:()=>x(()=>import(`./css-DIMkf-bt.js`),[])}),Z({id:`cypher`,extensions:[`.cypher`,`.cyp`],aliases:[`Cypher`,`OpenCypher`],loader:()=>x(()=>import(`./cypher-CVaqCwHa.js`),[])}),Z({id:`dart`,extensions:[`.dart`],aliases:[`Dart`,`dart`],mimetypes:[`text/x-dart-source`,`text/x-dart`],loader:()=>x(()=>import(`./dart-onAF5SnQ.js`),[])}),Z({id:`dockerfile`,extensions:[`.dockerfile`],filenames:[`Dockerfile`],aliases:[`Dockerfile`],loader:()=>x(()=>import(`./dockerfile-DZFCIeNp.js`),[])}),Z({id:`ecl`,extensions:[`.ecl`],aliases:[`ECL`,`Ecl`,`ecl`],loader:()=>x(()=>import(`./ecl-D05T4iGw.js`),[])}),Z({id:`elixir`,extensions:[`.ex`,`.exs`],aliases:[`Elixir`,`elixir`,`ex`],loader:()=>x(()=>import(`./elixir-6RTg0lbw.js`),[])}),Z({id:`flow9`,extensions:[`.flow`],aliases:[`Flow9`,`Flow`,`flow9`,`flow`],loader:()=>x(()=>import(`./flow9-C5_-GSwl.js`),[])}),Z({id:`fsharp`,extensions:[`.fs`,`.fsi`,`.ml`,`.mli`,`.fsx`,`.fsscript`],aliases:[`F#`,`FSharp`,`fsharp`],loader:()=>x(()=>import(`./fsharp-C8Ef5oNN.js`),[])}),Z({id:`freemarker2`,extensions:[`.ftl`,`.ftlh`,`.ftlx`],aliases:[`FreeMarker2`,`Apache FreeMarker2`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-dollar`,aliases:[`FreeMarker2 (Angle/Dollar)`,`Apache FreeMarker2 (Angle/Dollar)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAngleInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-dollar`,aliases:[`FreeMarker2 (Bracket/Dollar)`,`Apache FreeMarker2 (Bracket/Dollar)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagBracketInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-bracket`,aliases:[`FreeMarker2 (Angle/Bracket)`,`Apache FreeMarker2 (Angle/Bracket)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAngleInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-bracket`,aliases:[`FreeMarker2 (Bracket/Bracket)`,`Apache FreeMarker2 (Bracket/Bracket)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagBracketInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-dollar`,aliases:[`FreeMarker2 (Auto/Dollar)`,`Apache FreeMarker2 (Auto/Dollar)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-bracket`,aliases:[`FreeMarker2 (Auto/Bracket)`,`Apache FreeMarker2 (Auto/Bracket)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAutoInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`go`,extensions:[`.go`],aliases:[`Go`],loader:()=>x(()=>import(`./go-C-y9NEjX.js`),[])}),Z({id:`graphql`,extensions:[`.graphql`,`.gql`],aliases:[`GraphQL`,`graphql`,`gql`],mimetypes:[`application/graphql`],loader:()=>x(()=>import(`./graphql-fmXr3nnJ.js`),[])}),Z({id:`handlebars`,extensions:[`.handlebars`,`.hbs`],aliases:[`Handlebars`,`handlebars`,`hbs`],mimetypes:[`text/x-handlebars-template`],loader:()=>x(()=>import(`./handlebars-DOeNnhTE.js`),__vite__mapDeps([5,1,2,3,4]))}),Z({id:`hcl`,extensions:[`.tf`,`.tfvars`,`.hcl`],aliases:[`Terraform`,`tf`,`HCL`,`hcl`],loader:()=>x(()=>import(`./hcl-CpzslTdj.js`),[])}),Z({id:`html`,extensions:[`.html`,`.htm`,`.shtml`,`.xhtml`,`.mdoc`,`.jsp`,`.asp`,`.aspx`,`.jshtm`],aliases:[`HTML`,`htm`,`html`,`xhtml`],mimetypes:[`text/html`,`text/x-jshtm`,`text/template`,`text/ng-template`],loader:()=>x(()=>import(`./html-BwGTVsqZ.js`),__vite__mapDeps([6,1,2,3,4]))}),Z({id:`ini`,extensions:[`.ini`,`.properties`,`.gitconfig`],filenames:[`config`,`.gitattributes`,`.gitconfig`,`.editorconfig`],aliases:[`Ini`,`ini`],loader:()=>x(()=>import(`./ini-sBoK_t0W.js`),[])}),Z({id:`java`,extensions:[`.java`,`.jav`],aliases:[`Java`,`java`],mimetypes:[`text/x-java-source`,`text/x-java`],loader:()=>x(()=>import(`./java-BEtHBSE6.js`),[])}),Z({id:`javascript`,extensions:[`.js`,`.es6`,`.jsx`,`.mjs`,`.cjs`],firstLine:`^#!.*\\bnode`,filenames:[`jakefile`],aliases:[`JavaScript`,`javascript`,`js`],mimetypes:[`text/javascript`],loader:()=>x(()=>import(`./javascript-Dj-Vzbp-.js`),__vite__mapDeps([7,8,1,2,3,4]))}),Z({id:`julia`,extensions:[`.jl`],aliases:[`julia`,`Julia`],loader:()=>x(()=>import(`./julia-Bri6UV-V.js`),[])}),Z({id:`kotlin`,extensions:[`.kt`,`.kts`],aliases:[`Kotlin`,`kotlin`],mimetypes:[`text/x-kotlin-source`,`text/x-kotlin`],loader:()=>x(()=>import(`./kotlin-BOotOW0E.js`),[])}),Z({id:`less`,extensions:[`.less`],aliases:[`Less`,`less`],mimetypes:[`text/x-less`,`text/less`],loader:()=>x(()=>import(`./less-B9JPFI3C.js`),[])}),Z({id:`lexon`,extensions:[`.lex`],aliases:[`Lexon`],loader:()=>x(()=>import(`./lexon-CfSJPG6W.js`),[])}),Z({id:`lua`,extensions:[`.lua`],aliases:[`Lua`,`lua`],loader:()=>x(()=>import(`./lua-CsQS60Ue.js`),[])}),Z({id:`liquid`,extensions:[`.liquid`,`.html.liquid`],aliases:[`Liquid`,`liquid`],mimetypes:[`application/liquid`],loader:()=>x(()=>import(`./liquid-DDSU3ltH.js`),__vite__mapDeps([9,1,2,3,4]))}),Z({id:`m3`,extensions:[`.m3`,`.i3`,`.mg`,`.ig`],aliases:[`Modula-3`,`Modula3`,`modula3`,`m3`],loader:()=>x(()=>import(`./m3-D-oSqn_W.js`),[])}),Z({id:`markdown`,extensions:[`.md`,`.markdown`,`.mdown`,`.mkdn`,`.mkd`,`.mdwn`,`.mdtxt`,`.mdtext`],aliases:[`Markdown`,`markdown`],loader:()=>x(()=>import(`./markdown-Cimd5fb3.js`),[])}),Z({id:`mdx`,extensions:[`.mdx`],aliases:[`MDX`,`mdx`],loader:()=>x(()=>import(`./mdx-YllfWysm.js`),__vite__mapDeps([10,1,2,3,4]))}),Z({id:`mips`,extensions:[`.s`],aliases:[`MIPS`,`MIPS-V`],mimetypes:[`text/x-mips`,`text/mips`,`text/plaintext`],loader:()=>x(()=>import(`./mips-CIPQ_RoX.js`),[])}),Z({id:`msdax`,extensions:[`.dax`,`.msdax`],aliases:[`DAX`,`MSDAX`],loader:()=>x(()=>import(`./msdax-DauUninz.js`),[])}),Z({id:`mysql`,extensions:[],aliases:[`MySQL`,`mysql`],loader:()=>x(()=>import(`./mysql-SOo6toE5.js`),[])}),Z({id:`objective-c`,extensions:[`.m`],aliases:[`Objective-C`],loader:()=>x(()=>import(`./objective-c-FvmIjYaQ.js`),[])}),Z({id:`pascal`,extensions:[`.pas`,`.p`,`.pp`],aliases:[`Pascal`,`pas`],mimetypes:[`text/x-pascal-source`,`text/x-pascal`],loader:()=>x(()=>import(`./pascal-DrH0SRf2.js`),[])}),Z({id:`pascaligo`,extensions:[`.ligo`],aliases:[`Pascaligo`,`ligo`],loader:()=>x(()=>import(`./pascaligo-D-ptJ9y-.js`),[])}),Z({id:`perl`,extensions:[`.pl`,`.pm`],aliases:[`Perl`,`pl`],loader:()=>x(()=>import(`./perl-oz_6vUea.js`),[])}),Z({id:`pgsql`,extensions:[],aliases:[`PostgreSQL`,`postgres`,`pg`,`postgre`],loader:()=>x(()=>import(`./pgsql-DTj74zXo.js`),[])}),Z({id:`php`,extensions:[`.php`,`.php4`,`.php5`,`.phtml`,`.ctp`],aliases:[`PHP`,`php`],mimetypes:[`application/x-php`],loader:()=>x(()=>import(`./php-nr791fC2.js`),[])}),Z({id:`pla`,extensions:[`.pla`],loader:()=>x(()=>import(`./pla-CopQ2nXW.js`),[])}),Z({id:`postiats`,extensions:[`.dats`,`.sats`,`.hats`],aliases:[`ATS`,`ATS/Postiats`],loader:()=>x(()=>import(`./postiats-43DmfD33.js`),[])}),Z({id:`powerquery`,extensions:[`.pq`,`.pqm`],aliases:[`PQ`,`M`,`Power Query`,`Power Query M`],loader:()=>x(()=>import(`./powerquery-D3hlyOfw.js`),[])}),Z({id:`powershell`,extensions:[`.ps1`,`.psm1`,`.psd1`],aliases:[`PowerShell`,`powershell`,`ps`,`ps1`],loader:()=>x(()=>import(`./powershell-DmHpPYUd.js`),[])}),Z({id:`proto`,extensions:[`.proto`],aliases:[`protobuf`,`Protocol Buffers`],loader:()=>x(()=>import(`./protobuf-C531GsRP.js`),[])}),Z({id:`pug`,extensions:[`.jade`,`.pug`],aliases:[`Pug`,`Jade`,`jade`],loader:()=>x(()=>import(`./pug-Z5eAx3Zn.js`),[])}),Z({id:`python`,extensions:[`.py`,`.rpy`,`.pyw`,`.cpy`,`.gyp`,`.gypi`],aliases:[`Python`,`py`],firstLine:`^#!/.*\\bpython[0-9.-]*\\b`,loader:()=>x(()=>import(`./python-Bsfjs4Fs.js`),__vite__mapDeps([11,1,2,3,4]))}),Z({id:`qsharp`,extensions:[`.qs`],aliases:[`Q#`,`qsharp`],loader:()=>x(()=>import(`./qsharp-DkqhCAOL.js`),[])}),Z({id:`r`,extensions:[`.r`,`.rhistory`,`.rmd`,`.rprofile`,`.rt`],aliases:[`R`,`r`],loader:()=>x(()=>import(`./r-BwWrilGY.js`),[])}),Z({id:`razor`,extensions:[`.cshtml`],aliases:[`Razor`,`razor`],mimetypes:[`text/x-cshtml`],loader:()=>x(()=>import(`./razor-3MUz77_n.js`),__vite__mapDeps([12,1,2,3,4]))}),Z({id:`redis`,extensions:[`.redis`],aliases:[`redis`],loader:()=>x(()=>import(`./redis-ClamHrr6.js`),[])}),Z({id:`redshift`,extensions:[],aliases:[`Redshift`,`redshift`],loader:()=>x(()=>import(`./redshift-DT7zqm-g.js`),[])}),Z({id:`restructuredtext`,extensions:[`.rst`],aliases:[`reStructuredText`,`restructuredtext`],loader:()=>x(()=>import(`./restructuredtext-BYgofb2h.js`),[])}),Z({id:`ruby`,extensions:[`.rb`,`.rbx`,`.rjs`,`.gemspec`,`.pp`],filenames:[`rakefile`,`Gemfile`],aliases:[`Ruby`,`rb`],loader:()=>x(()=>import(`./ruby-DezsRK8O.js`),[])}),Z({id:`rust`,extensions:[`.rs`,`.rlib`],aliases:[`Rust`,`rust`],loader:()=>x(()=>import(`./rust-DdL9SqIa.js`),[])}),Z({id:`sb`,extensions:[`.sb`],aliases:[`Small Basic`,`sb`],loader:()=>x(()=>import(`./sb-CcwsVR0C.js`),[])}),Z({id:`scala`,extensions:[`.scala`,`.sc`,`.sbt`],aliases:[`Scala`,`scala`,`SBT`,`Sbt`,`sbt`,`Dotty`,`dotty`],mimetypes:[`text/x-scala-source`,`text/x-scala`,`text/x-sbt`,`text/x-dotty`],loader:()=>x(()=>import(`./scala-DHpiXF5c.js`),[])}),Z({id:`scheme`,extensions:[`.scm`,`.ss`,`.sch`,`.rkt`],aliases:[`scheme`,`Scheme`],loader:()=>x(()=>import(`./scheme-BeGwcela.js`),[])}),Z({id:`scss`,extensions:[`.scss`],aliases:[`Sass`,`sass`,`scss`],mimetypes:[`text/x-scss`,`text/scss`],loader:()=>x(()=>import(`./scss-gp-XZpBa.js`),[])}),Z({id:`shell`,extensions:[`.sh`,`.bash`],aliases:[`Shell`,`sh`],loader:()=>x(()=>import(`./shell-CC2rA5mh.js`),[])}),Z({id:`sol`,extensions:[`.sol`],aliases:[`sol`,`solidity`,`Solidity`],loader:()=>x(()=>import(`./solidity-BEEn4gHE.js`),[])}),Z({id:`aes`,extensions:[`.aes`],aliases:[`aes`,`sophia`,`Sophia`],loader:()=>x(()=>import(`./sophia-CRfGWb83.js`),[])}),Z({id:`sparql`,extensions:[`.rq`],aliases:[`sparql`,`SPARQL`],loader:()=>x(()=>import(`./sparql-D_Lu-MrJ.js`),[])}),Z({id:`sql`,extensions:[`.sql`],aliases:[`SQL`],loader:()=>x(()=>import(`./sql-NEE52Syq.js`),[])}),Z({id:`st`,extensions:[`.st`,`.iecst`,`.iecplc`,`.lc3lib`,`.TcPOU`,`.TcDUT`,`.TcGVL`,`.TcIO`],aliases:[`StructuredText`,`scl`,`stl`],loader:()=>x(()=>import(`./st-DbInun42.js`),[])}),Z({id:`swift`,aliases:[`Swift`,`swift`],extensions:[`.swift`],mimetypes:[`text/swift`],loader:()=>x(()=>import(`./swift-Bxkupp3x.js`),[])}),Z({id:`systemverilog`,extensions:[`.sv`,`.svh`],aliases:[`SV`,`sv`,`SystemVerilog`,`systemverilog`],loader:()=>x(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`verilog`,extensions:[`.v`,`.vh`],aliases:[`V`,`v`,`Verilog`,`verilog`],loader:()=>x(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`tcl`,extensions:[`.tcl`],aliases:[`tcl`,`Tcl`,`tcltk`,`TclTk`,`tcl/tk`,`Tcl/Tk`],loader:()=>x(()=>import(`./tcl-DISqw1ZD.js`),[])}),Z({id:`twig`,extensions:[`.twig`],aliases:[`Twig`,`twig`],mimetypes:[`text/x-twig`],loader:()=>x(()=>import(`./twig-De2hgUGE.js`),[])}),Z({id:`typescript`,extensions:[`.ts`,`.tsx`,`.cts`,`.mts`],aliases:[`TypeScript`,`ts`,`typescript`],mimetypes:[`text/typescript`],loader:()=>x(()=>import(`./typescript-fNZ3iur6.js`),__vite__mapDeps([13,8,1,2,3,4]))}),Z({id:`typespec`,extensions:[`.tsp`],aliases:[`TypeSpec`],loader:()=>x(()=>import(`./typespec-B8J7ngcE.js`),[])}),Z({id:`vb`,extensions:[`.vb`],aliases:[`Visual Basic`,`vb`],loader:()=>x(()=>import(`./vb-DV3o63ZY.js`),[])}),Z({id:`wgsl`,extensions:[`.wgsl`],aliases:[`WebGPU Shading Language`,`WGSL`,`wgsl`],loader:()=>x(()=>import(`./wgsl-DpFanUEy.js`),[])}),Z({id:`xml`,extensions:[`.xml`,`.xsd`,`.dtd`,`.ascx`,`.csproj`,`.config`,`.props`,`.targets`,`.wxi`,`.wxl`,`.wxs`,`.xaml`,`.svg`,`.svgz`,`.opf`,`.xslt`,`.xsl`],firstLine:`(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)`,aliases:[`XML`,`xml`],mimetypes:[`text/xml`,`application/xml`,`application/xaml+xml`,`application/xml-dtd`],loader:()=>x(()=>import(`./xml-S-oLW5B5.js`),__vite__mapDeps([14,1,2,3,4]))}),Z({id:`yaml`,extensions:[`.yaml`,`.yml`],aliases:[`YAML`,`yaml`,`YML`,`yml`],mimetypes:[`application/x-yaml`,`text/x-yaml`],loader:()=>x(()=>import(`./yaml-DlmqY7sN.js`),__vite__mapDeps([15,1,2,3,4]))});var Sp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Cp=function(e,t){return function(n,r){t(n,r,e)}},wp,Tp=new M(`selectionAnchorSet`,!1),Ep=class{static{wp=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(wp.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Tp.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){let 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 Ei().appendText(S(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),vo(S(850,`Anchor set at {0}:{1}`,e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){let t=this.editor.getPosition();this.editor.setSelection(J.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){let e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Ep=wp=Sp([Cp(1,Na)],Ep);var Dp=class extends G{constructor(){super({id:`editor.action.setSelectionAnchor`,label:R(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:Er(2089,2080),weight:100}})}async run(e,t){Ep.get(t)?.setSelectionAnchor()}},Op=class extends G{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:R(852,`Go to Selection Anchor`),precondition:Tp})}async run(e,t){Ep.get(t)?.goToSelectionAnchor()}},kp=class extends G{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:R(853,`Select from Anchor to Cursor`),precondition:Tp,kbOpts:{kbExpr:D.editorTextFocus,primary:Er(2089,2089),weight:100}})}async run(e,t){Ep.get(t)?.selectFromAnchorToCursor()}},Ap=class extends G{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:R(854,`Cancel Selection Anchor`),precondition:Tp,kbOpts:{kbExpr:D.editorTextFocus,primary:9,weight:100}})}async run(e,t){Ep.get(t)?.cancelSelectionAnchor()}};Ms(Ep.ID,Ep,4),B(Dp),B(Op),B(kp),B(Ap);var jp=k(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,S(855,`Overview ruler marker color for matching brackets.`)),Mp=class extends G{constructor(){super({id:`editor.action.jumpToBracket`,label:R(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:3165,weight:100}})}run(e,t){Ip.get(t)?.jumpToBracket()}},Np=class extends G{constructor(){super({id:`editor.action.selectToBracket`,label:R(858,`Select to Bracket`),precondition:void 0,metadata:{description:R(859,`Select the text inside and including the brackets or curly braces`),args:[{name:`args`,schema:{type:`object`,properties:{selectBrackets:{type:`boolean`,default:!0}}}}]}})}run(e,t,n){let r=!0;n&&n.selectBrackets===!1&&(r=!1),Ip.get(t)?.selectToBracket(r)}},Pp=class extends G{constructor(){super({id:`editor.action.removeBrackets`,label:R(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Ip.get(t)?.removeBrackets(this.id)}},Fp=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Ip=class e extends K{static{this.ID=`editor.contrib.bracketMatchingController`}static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Mr(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{this._matchBrackets!==`never`&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.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;let e=this._editor.getModel(),t=this._editor.getSelections().map(t=>{let n=t.getStartPosition(),r=e.bracketPairs.matchBracket(n),i=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?i=r[1].getStartPosition():r[1].containsPosition(n)&&(i=r[0].getStartPosition());else{let t=e.bracketPairs.findEnclosingBrackets(n);if(t)i=t[1].getStartPosition();else{let t=e.bracketPairs.findNextBracket(n);t&&t.range&&(i=t.range.getStartPosition())}}return i?new J(i.lineNumber,i.column,i.lineNumber,i.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;let t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{let i=r.getStartPosition(),a=t.bracketPairs.matchBracket(i);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(i),!a)){let e=t.bracketPairs.findNextBracket(i);e&&e.range&&(a=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let o=null,s=null;if(a){a.sort(w.compareRangesUsingStarts);let[t,n]=a;if(o=e?t.getStartPosition():t.getEndPosition(),s=e?n.getEndPosition():n.getStartPosition(),n.containsPosition(i)){let e=o;o=s,s=e}}o&&s&&n.push(new J(o.lineNumber,o.column,s.lineNumber,s.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(n=>{let r=n.getPosition(),i=t.bracketPairs.matchBracket(r);i||=t.bracketPairs.findEnclosingBrackets(r),i&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:i[0],text:``},{range:i[1],text:``}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=F.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:to(jp),position:Xi.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=F.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`})}_updateBrackets(){if(this._matchBrackets===`never`)return;this._recomputeBrackets();let e=[],t=0;for(let n of this._lastBracketsData){let r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getSelections();if(t.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let n=this._editor.getModel(),r=n.getVersionId(),i=[];this._lastVersionId===r&&(i=this._lastBracketsData);let a=[],o=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];n.isEmpty()&&(a[o++]=n.getStartPosition())}a.length>1&&a.sort(j.compare);let s=[],c=0,l=0,u=i.length;for(let t=0,r=a.length;t<r;t++){let r=a[t];for(;l<u&&i[l].position.isBefore(r);)l++;if(l<u&&i[l].position.equals(r))s[c++]=i[l];else{let t=n.bracketPairs.matchBracket(r,20),i=e._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!t&&this._matchBrackets===`always`&&(t=n.bracketPairs.findEnclosingBrackets(r,20),i=e._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),s[c++]=new Fp(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};Ms(Ip.ID,Ip,1),B(Np),B(Mp),B(Pp),Sn.appendMenuItem(O.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:S(856,`Go to &&Bracket`)},order:2}),Ma((e,t)=>{let n=e.getColor(Bf);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)}),B(class extends G{constructor(){super({id:`editor.action.transposeLetters`,label:R(863,`Transpose Letters`),precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let n=t.getModel(),r=[],i=t.getSelections();for(let e of i){if(!e.isEmpty())continue;let t=e.startLineNumber,i=e.startColumn,a=n.getLineMaxColumn(t);if(t===1&&(i===1||i===2&&a===2))continue;let o=i===a?e.getPosition():Ju.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=Ju.leftPosition(n,o),c=Ju.leftPosition(n,s),l=n.getValueInRange(w.fromPositions(c,s)),u=n.getValueInRange(w.fromPositions(s,o)),d=w.fromPositions(c,o);r.push(new qc(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Lp=class e{static{this.sep=`.`}static{this.None=new e(`@@none@@`)}static{this.Empty=new e(``)}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(t){return this.equals(t)||this.value===``||t.value.startsWith(this.value+e.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}},Rp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},zp=function(e,t){return function(n,r){t(n,r,e)}},Bp=F.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),Vp=class e extends K{static{this.baseId=`editor.widget.inlineProgressWidget`}constructor(e,t,n,r,i){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=N(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=N(`span.icon`);this.domNode.append(t),t.classList.add(...H.asClassNameArray(A.loading),`codicon-modifier-spin`);let n=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};n(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&n()})),this._register(L(this.domNode,El.CLICK,e=>{this.delegate.cancel()}))}getId(){return e.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)}},Hp=class extends K{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new sc),this._currentWidget=this._register(new sc),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,n,r,i){let a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=Va(()=>{let n=w.fromPositions(e);this._currentDecorations.set([{range:n,options:Bp}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Vp,this.id,this._editor,n,t,r))},i??this._showDelay);try{return await n}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Hp=Rp([zp(2,W)],Hp);var Up=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Wp=function(e,t){return function(n,r){t(n,r,e)}},Gp,Kp=class{static{Gp=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new M(`messageVisible`,!1,S(1353,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(Gp.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new sc,this._messageListeners=new I,this._mouseOverMessage=!1,this._editor=e,this._visible=Gp.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(vo(Nr(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Nr(e)){let n=this._messageListeners.add(vl(e,{actionHandler:(e,t)=>{this.closeMessage(),sn(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new Jp(this._editor,t,n.element)}else this._messageWidget.value=new Jp(this._editor,t,e);this._messageListeners.add(du.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&hn(uf(),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(L(this._messageWidget.value.getDomNode(),El.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(L(this._messageWidget.value.getDomNode(),El.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(n?n.containsPosition(e.target.position)||this.closeMessage():n=new w(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Jp.fadeOut(this._messageWidget.value))}};Kp=Gp=Up([Wp(1,Na),Wp(2,Jt)],Kp);var qp=$u.bindToContribution(Kp.get);U(new qp({id:`leaveEditorMessage`,precondition:Kp.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var Jp=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener(`animationend`,t)},n=setTimeout(t,110);return e.getDomNode().addEventListener(`animationend`,t),e.getDomNode().classList.add(`fadeOut`),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement(`div`),this._domNode.classList.add(`monaco-editor-overlaymessage`),this._domNode.style.marginLeft=`-6px`;let i=document.createElement(`div`);i.classList.add(`anchor`,`top`),this._domNode.appendChild(i);let a=document.createElement(`div`);typeof r==`string`?(a.classList.add(`message`),a.textContent=r):(r.classList.add(`message`),a.appendChild(r)),this._domNode.appendChild(a);let o=document.createElement(`div`);o.classList.add(`anchor`,`below`),this._domNode.appendChild(o),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)}};Ms(Kp.ID,Kp,4);var Yp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Xp=function(e,t){return function(n,r){t(n,r,e)}},Zp=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,n,r,i){let a=await this.getEdit(n,i);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,n,r){let i=await this.getEdit(n,r);if(i)return{edits:[{insertText:i.insertText,title:i.title,kind:i.kind,handledMimeType:i.handledMimeType,yieldTo:i.yieldTo}],dispose(){}}}},Qp=class e extends Zp{static{this.id=`text`}constructor(){super(Lp.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[wo.text],this.pasteMimeTypes=[wo.text]}async getEdit(e,t){let n=e.get(wo.text);if(!n||e.has(wo.uriList))return;let r=await n.asString();return{handledMimeType:wo.text,title:S(980,`Insert Plain Text`),insertText:r,kind:this.kind}}},$p=class extends Zp{constructor(){super(Lp.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[wo.uriList],this.pasteMimeTypes=[wo.uriList]}async getEdit(e,t){let n=await nm(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===al.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?S(981,`Insert Uris`):S(982,`Insert Uri`):n.length>1?S(983,`Insert Paths`):S(984,`Insert Path`),{handledMimeType:wo.uriList,insertText:i,title:a,kind:this.kind}}},em=class extends Zp{constructor(e){super(Lp.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[wo.uriList],this.pasteMimeTypes=[wo.uriList]}async getEdit(e,t){let n=await nm(e);if(!n.length||t.isCancellationRequested)return;let r=fu(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?un(t.uri,e):void 0}));if(r.length)return{handledMimeType:wo.uriList,insertText:r.join(` `),title:n.length>1?S(985,`Insert Relative Paths`):S(986,`Insert Relative Path`),kind:this.kind}}};em=Yp([Xp(0,vu)],em);var tm=class{constructor(){this.kind=new Lp(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:wo.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==da.PasteAs&&!r.only?.contains(this.kind))return;let a=await n.get(`text/html`)?.asString();if(a&&!i.isCancellationRequested)return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:S(987,`Insert HTML`),kind:this.kind}]}}};async function nm(e){let t=e.get(wo.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of Vl.parse(n))try{r.push({uri:qn.parse(e),originalText:e})}catch{}return r}var rm={scheme:`*`,hasAccessToAllModels:!0},im=class extends K{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(rm,new Qp)),this._register(e.documentDropEditProvider.register(rm,new $p)),this._register(e.documentDropEditProvider.register(rm,new em(t)))}};im=Yp([Xp(0,z),Xp(1,vu)],im);var am=class extends K{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(rm,new Qp)),this._register(e.documentPasteEditProvider.register(rm,new $p)),this._register(e.documentPasteEditProvider.register(rm,new em(t))),this._register(e.documentPasteEditProvider.register(rm,new tm))}};am=Yp([Xp(0,z),Xp(1,vu)],am);var om=class e{constructor(){this.value=``,this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}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};let t=this.pos,n=0,r=this.value.charCodeAt(t),i;if(i=e._table[r],typeof i==`number`)return this.pos+=1,{type:i,pos:t,len:1};if(e.isDigitCharacter(r)){i=8;do n+=1,r=this.value.charCodeAt(t+n);while(e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}if(e.isVariableCharacter(r)){i=9;do r=this.value.charCodeAt(t+ ++n);while(e.isVariableCharacter(r)||e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}i=10;do n+=1,r=this.value.charCodeAt(t+n);while(!isNaN(r)&&e._table[r]===void 0&&!e.isDigitCharacter(r)&&!e.isVariableCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}},sm=class{constructor(){this._children=[]}appendChild(e){return e instanceof cm&&this._children[this._children.length-1]instanceof cm?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:n}=e,r=n.children.indexOf(e),i=n.children.slice(0);i.splice(r,1,...t),n._children=i,(function e(t,n){for(let r of t)r.parent=n,e(r.children,r)})(t,n)}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 gm)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},cm=class e extends sm{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},lm=class extends sm{},um=class e extends lm{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:+(e.index>t.index)}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof dm?this._children[0]:void 0}clone(){let t=new e(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},dm=class e extends sm{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof cm&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let t=new e;return this.options.forEach(t.appendChild,t),t}},fm=class e extends sm{constructor(){super(...arguments),this.regexp=RegExp(``)}resolve(e){let t=this,n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(e=>e instanceof pm&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof pm){let r=e[n.index]||``;r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return``}clone(){let t=new e;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?`i`:``)+(this.regexp.global?`g`:``)),t._children=this.children.map(e=>e.clone()),t}},pm=class e extends sm{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}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,`-`);let t=e.trim().replace(/^_+|_+$/g,``),n=t.match(/\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(e=>e.toLowerCase()).join(`-`):t.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).join(`-`)}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(e=>e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((e,t)=>t===0?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,`$1_$2`).replace(/[\s\-]+/g,`_`).toLowerCase()}clone(){return new e(this.index,this.shorthandName,this.ifValue,this.elseValue)}},mm=class e extends lm{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 cm(t)],!0)}clone(){let t=new e(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}};function hm(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var gm=class e extends sm{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof um&&(e.push(n),t=!t||t.index<n.index?n:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){let{all:e}=this.placeholderInfo;return e}offset(e){let t=0,n=!1;return this.walk(r=>r===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return hm([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof um&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof mm&&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(){let t=new e;return t._children=this.children.map(e=>e.clone()),t}walk(e){hm(this.children,e)}},_m=class{constructor(){this._scanner=new om,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,n){let r=new gm;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){let n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let r=new Map,i=[];t.walk(e=>(e instanceof um&&(e.isFinalTabstop?r.set(0,void 0):!r.has(e.index)&&e.children.length>0?r.set(e.index,e.children):i.push(e)),!0));let a=(e,n)=>{let i=r.get(e.index);if(!i)return;let o=new um(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof um&&r.has(t.index)&&!n.has(t.index)&&(n.add(t.index),a(t,n),n.delete(t.index))}t.replace(e,[o])},o=new Set;for(let e of i)a(e,o);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(e=>e.index===0)||e.appendChild(new um(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){let t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){let e=this._scanner.next();if(e.type!==0&&e.type!==4&&e.type!==5)return!1}this._token=this._scanner.next()}let n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,`$1`);return this._token=this._scanner.next(),n}_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 cm(t)),!0):!1}_parseTabstopOrVariableName(e){let t,n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new um(Number(t)):new mm(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);let r=new um(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new cm("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new dm;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(t),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseChoiceElement(e){let t=this._token,n=[];for(;this._token.type!==2&&this._token.type!==7;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;n.push(e)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new cm(n.join(``))),!0)}_parseComplexVariable(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);let r=new mm(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new cm("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseTransform(e){let t=new fm,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,n+=e;else if(this._token.type!==14)n+=this._accept(void 0,!0);else return!1}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new cm(e));else if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);)if(this._token.type!==14)r+=this._accept(void 0,!0);else return!1;try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);let r=this._accept(8,!0);if(!r)return this._backTo(t),!1;if(!n||this._accept(4))return e.appendChild(new pm(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let n=this._accept(9,!0);return!n||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new pm(Number(r),n)),!0)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new pm(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new pm(Number(r),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let n=this._until(4);if(n)return e.appendChild(new pm(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new pm(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14&&(e.appendChild(new cm(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function vm(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new $c(e,{range:t,text:typeof n.insertText==`string`?_m.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function ym(e){function t(e,t){return`mimeType`in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}let n=new Map;for(let r of e)for(let i of r.yieldTo??[])for(let a of e)if(a!==r&&t(i,a)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(a)}if(!n.size)return Array.from(e);let r=new Set,i=[];function a(e){if(!e.length)return[];let t=e[0];if(i.includes(t))return console.warn(`Yield to cycle detected`,t),e;if(r.has(t))return a(e.slice(1));let o=[],s=n.get(t);return s&&(i.push(t),o=a(s),i.pop()),r.add(t),[...o,t,...a(e.slice(1))]}return a(Array.from(e))}function bm(e,t){return t&&(e.stack||e.stacktrace)?S(33,`{0}: {1}`,Sm(e),xm(e.stack)||xm(e.stacktrace)):Sm(e)}function xm(e){return Array.isArray(e)?e.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-6NYS9HqW.js","assets/editor.api-4LH2ijIL.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/preload-helper-BLdHbfdN.js","assets/editor-DjpsE8to.css","assets/handlebars-DOeNnhTE.js","assets/html-BwGTVsqZ.js","assets/javascript-Dj-Vzbp-.js","assets/typescript-CfCJo9p3.js","assets/liquid-DDSU3ltH.js","assets/mdx-YllfWysm.js","assets/python-Bsfjs4Fs.js","assets/razor-3MUz77_n.js","assets/typescript-fNZ3iur6.js","assets/xml-S-oLW5B5.js","assets/yaml-DlmqY7sN.js","assets/zoomable-image-C5zI0AEw.js","assets/zoomable-image-CmK5g_2H.js","assets/utils-KVq36YOZ.js","assets/button-Dhs1rqob.js","assets/MinusSignIcon-DGIm2EHe.js","assets/tooltip-Pl1ZsI1C.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{a as t,c as n,n as r,r as i,s as a,t as o}from"./utils-KVq36YOZ.js";import{$n as s,An as c,Bn as l,Cn as u,Ct as d,Dn as f,En as p,Fn as m,Gn as h,Hn as g,In as _,Jn as v,Jt as y,Kn as b,Ln as ee,Mn as te,Nn as ne,On as re,Pn as ie,Qt as ae,Rn as oe,Tn as se,Un as ce,Vn as le,Wn as ue,Xt as de,Yt as fe,Zt as pe,_ as me,an as he,cn as ge,dn as _e,er as ve,fn as ye,gn as be,h as xe,hn as Se,in as Ce,jn as we,kn as Te,l as Ee,ln as De,on as Oe,p as ke,pn as Ae,qn as je,sn as Me,un as Ne,wn as Pe,zn as Fe}from"./accounts-CcxlY38a.js";import{t as Ie,x as Le}from"./button-Dhs1rqob.js";import{t as Re}from"./MinusSignIcon-DGIm2EHe.js";import{c as ze}from"./tooltip-Pl1ZsI1C.js";import{C as Be,c as Ve,r as He,s as Ue,t as We}from"./dialog-Bnoy9Qj1.js";import{t as x}from"./preload-helper-BLdHbfdN.js";import{_ as Ge,f as Ke,g as qe,h as Je,m as Ye,v as Xe}from"./dist-BrDshb6Z.js";import{$ as Ze,$a as Qe,$c as $e,$d as et,$i as tt,$l as nt,$n as rt,$o as it,$r as at,$s as ot,$t as st,$u as ct,A as lt,Aa as ut,Ac as dt,Ad as S,Ai as ft,Al as pt,An as mt,Ao as ht,Ar as gt,As as _t,At as vt,Au as yt,B as bt,Ba as xt,Bc as C,Bd as St,Bi as Ct,Bl as wt,Bn as Tt,Bo as Et,Br as Dt,Bs as Ot,Bt as kt,Bu as w,C as At,Ca as jt,Cc as Mt,Cd as Nt,Ci as Pt,Cl as Ft,Cn as It,Co as Lt,Cr as Rt,Cs as zt,Ct as Bt,Cu as Vt,D as Ht,Da as Ut,Dc as Wt,Dd as Gt,Di as Kt,Dl as qt,Dn as Jt,Do as Yt,Dr as Xt,Ds as Zt,Dt as Qt,Du as $t,E as en,Ea as tn,Ec as nn,Ed as rn,Ei as an,El as on,En as sn,Eo as cn,Er as ln,Es as un,Et as dn,Eu as fn,F as pn,Fa as mn,Fc as hn,Fd as gn,Fi as _n,Fl as vn,Fn as yn,Fo as bn,Fr as xn,Fs as Sn,Ft as Cn,Fu as wn,G as Tn,Ga as En,Gc as Dn,Gd as On,Gi as kn,Gl as An,Gn as jn,Go as Mn,Gr as Nn,Gs as Pn,Gt as Fn,Gu as In,H as Ln,Ha as Rn,Hc as zn,Hd as Bn,Hi as Vn,Hl as Hn,Hn as Un,Ho as Wn,Hr as Gn,Hs as T,Ht as Kn,Hu as qn,Ia as Jn,Ic as Yn,Id as Xn,Ii as Zn,Il as Qn,In as $n,Io as er,Ir as tr,Is as nr,It as rr,Iu as ir,J as ar,Ja as or,Jc as sr,Jd as cr,Ji as lr,Jl as ur,Jn as dr,Jo as fr,Jr as pr,Js as mr,Jt as hr,Ju as E,K as gr,Ka as _r,Kc as vr,Kd as yr,Ki as br,Kl as xr,Kn as Sr,Ko as Cr,Kr as D,Ks as wr,Kt as Tr,Ku as Er,L as Dr,La as Or,Lc as kr,Ld as Ar,Li as jr,Ll as Mr,Ln as Nr,Lo as Pr,Lr as Fr,Ls as Ir,Lt as Lr,Lu as Rr,M as zr,Ma as Br,Mc as Vr,Md as Hr,Mi as Ur,Ml as Wr,Mn as Gr,Mo as Kr,Mr as qr,Ms as Jr,Mt as Yr,Mu as Xr,N as Zr,Na as Qr,Nc as $r,Nd as ei,Ni as ti,Nl as ni,Nn as ri,No as ii,Nr as ai,Ns as O,Nt as oi,Nu as si,O as ci,Oa as li,Oc as ui,Od as di,Oi as fi,Ol as pi,On as mi,Oo as hi,Or as gi,Os as _i,Ot as vi,Ou as yi,P as bi,Pa as xi,Pc as Si,Pd as Ci,Pi as wi,Pl as Ti,Pn as Ei,Po as Di,Pr as Oi,Ps as ki,Pt as Ai,Pu as ji,Q as Mi,Qa as Ni,Qc as Pi,Qd as Fi,Qi as Ii,Ql as Li,Qn as Ri,Qo as zi,Qr as Bi,Qs as Vi,Qt as Hi,Qu as Ui,R as Wi,Ra as k,Rc as Gi,Rd as Ki,Ri as qi,Rl as Ji,Rn as Yi,Ro as Xi,Rr as Zi,Rs as Qi,Rt as $i,Ru as A,S as ea,Sa as ta,Sc as na,Sd as ra,Si as ia,Sl as aa,Sn as oa,So as sa,Sr as ca,Ss as la,St as ua,Su as da,T as fa,Ta as pa,Tc as ma,Td as ha,Ti as ga,Tl as _a,Tn as va,To as ya,Tr as ba,Ts as xa,Tt as Sa,Tu as Ca,U as wa,Ua as Ta,Uc as Ea,Ud as Da,Ui as Oa,Ul as ka,Un as Aa,Uo as ja,Ur as Ma,Us as Na,Ut as Pa,Uu as Fa,V as Ia,Va as La,Vc as Ra,Vd as za,Vi as Ba,Vl as Va,Vn as Ha,Vo as Ua,Vr as Wa,Vs as Ga,Vt as Ka,Vu as j,W as qa,Wa as Ja,Wc as Ya,Wd as Xa,Wi as Za,Wl as Qa,Wn as $a,Wo as eo,Wr as to,Ws as M,Wt as no,Wu as ro,X as io,Xa as ao,Xc as oo,Xd as so,Xi as co,Xl as lo,Xn as uo,Xo as fo,Xr as po,Xs as mo,Xt as ho,Xu as go,Y as _o,Ya as vo,Yc as yo,Yd as bo,Yi as xo,Yl as So,Yn as Co,Yo as wo,Yr as To,Ys as Eo,Yt as Do,Yu as Oo,Z as ko,Za as Ao,Zc as jo,Zd as Mo,Zi as No,Zl as Po,Zn as Fo,Zo as Io,Zr as Lo,Zs as Ro,Zt as zo,Zu as Bo,_ as Vo,_a as Ho,_c as Uo,_d as Wo,_f as Go,_i as Ko,_l as qo,_n as Jo,_o as Yo,_r as Xo,_s as Zo,_t as Qo,_u as $o,a as es,aa as ts,ac as N,ad as P,af as ns,ai as rs,al as is,an as as,ao as os,ar as ss,as as cs,at as ls,au as us,b as ds,ba as fs,bc as ps,bd as ms,bi as hs,bl as gs,bn as _s,bo as vs,br as ys,bs,bt as xs,bu as Ss,c as Cs,ca as ws,cc as Ts,cd as Es,cf as Ds,ci as Os,cl as ks,cn as As,co as js,cr as F,cs as Ms,ct as Ns,cu as Ps,d as Fs,da as Is,dc as Ls,dd as I,df as Rs,di as zs,dl as Bs,dn as Vs,do as Hs,dr as Us,ds as Ws,dt as Gs,du as Ks,ea as qs,ec as Js,ef as Ys,ei as Xs,el as Zs,en as Qs,eo as $s,er as ec,es as tc,et as nc,eu as rc,f as ic,fa as ac,fc as oc,fd as sc,ff as cc,fi as lc,fl as uc,fn as dc,fo as fc,fr as pc,fs as mc,ft as hc,fu as gc,g as _c,ga as vc,gc as yc,gd as bc,gf as xc,gi as Sc,gl as Cc,gn as wc,go as Tc,gr as Ec,gs as Dc,gt as Oc,gu as kc,h as Ac,ha as jc,hc as L,hd as Mc,hf as Nc,hi as Pc,hl as Fc,hn as Ic,ho as Lc,hr as Rc,hs as zc,ht as Bc,hu as Vc,i as Hc,ia as Uc,ic as Wc,id as Gc,if as Kc,ii as qc,il as Jc,in as Yc,io as Xc,ir as Zc,is as Qc,it as $c,iu as el,j as tl,ja as nl,jc as rl,jd as R,ji as il,jl as al,jn as ol,jo as sl,jr as cl,js as ll,jt as ul,ju as dl,k as fl,ka as pl,kc as ml,kd as hl,ki as gl,kl as _l,kn as vl,ko as yl,kr as bl,ks as xl,kt as Sl,ku as Cl,l as wl,la as Tl,lc as El,ld as Dl,lf as Ol,li as kl,ll as Al,ln as jl,lo as z,lr as Ml,ls as Nl,lt as Pl,lu as Fl,m as Il,ma as Ll,mc as Rl,md as zl,mf as Bl,mi as Vl,ml as Hl,mn as Ul,mo as Wl,mr as Gl,ms as Kl,mt as ql,mu as Jl,n as Yl,na as Xl,nc as Zl,nd as Ql,nf as $l,ni as eu,nl as tu,nn as nu,no as ru,nr as iu,ns as au,nt as ou,nu as su,o as cu,oa as lu,oc as uu,od as du,of as fu,oi as pu,ol as mu,on as hu,oo as gu,or as _u,os as B,ot as vu,ou as yu,p as bu,pa as xu,pc as Su,pd as Cu,pf as wu,pi as Tu,pl as V,pn as Eu,po as Du,pr as Ou,ps as ku,pt as Au,pu as ju,q as Mu,qa as Nu,qc as Pu,qd as Fu,qi as Iu,ql as Lu,qn as Ru,qo as zu,qr as Bu,qs as H,qt as Vu,qu as Hu,r as Uu,ra as Wu,rc as Gu,rd as Ku,rf as qu,ri as Ju,rl as Yu,rn as Xu,ro as Zu,rr as Qu,rs as $u,rt as ed,ru as td,s as nd,sa as rd,sc as id,sd as ad,sf as od,si as sd,sl as cd,sn as ld,so as ud,sr as dd,ss as U,st as fd,su as pd,t as md,ta as hd,tc as W,td as gd,tf as _d,ti as vd,tl as yd,tn as bd,to as xd,tr as Sd,ts as G,tt as Cd,tu as wd,u as Td,ua as Ed,uc as Dd,ud as K,uf as Od,ui as kd,ul as Ad,un as jd,uo as Md,ur as Nd,us as Pd,ut as Fd,uu as Id,v as Ld,va as Rd,vc as q,vd as zd,vf as Bd,vi as Vd,vl as Hd,vn as Ud,vo as Wd,vr as Gd,vs as Kd,vt as qd,vu as Jd,w as Yd,wa as Xd,wc as Zd,wd as Qd,wi as $d,wl as ef,wn as tf,wo as nf,wr as rf,ws as af,wt as of,wu as sf,x as cf,xa as lf,xc as uf,xd as df,xi as ff,xl as pf,xn as mf,xo as hf,xr as gf,xs as _f,xt as vf,xu as yf,y as bf,ya as xf,yc as Sf,yd as Cf,yi as wf,yl as Tf,yn as Ef,yo as Df,yr as Of,ys as kf,yt as Af,yu as jf,z as Mf,za as Nf,zc as Pf,zd as Ff,zi as If,zl as Lf,zn as Rf,zo as zf,zr as Bf,zs as Vf,zt as Hf,zu as J}from"./editor.api-4LH2ijIL.js";var Uf=[[`path`,{d:`M17.4776 9.01106C17.485 9.01102 17.4925 9.01101 17.5 9.01101C19.9853 9.01101 22 11.0294 22 13.5193C22 15.8398 20.25 17.7508 18 18M17.4776 9.01106C17.4924 8.84606 17.5 8.67896 17.5 8.51009C17.5 5.46695 15.0376 3 12 3C9.12324 3 6.76233 5.21267 6.52042 8.03192M17.4776 9.01106C17.3753 10.1476 16.9286 11.1846 16.2428 12.0165M6.52042 8.03192C3.98398 8.27373 2 10.4139 2 13.0183C2 15.4417 3.71776 17.4632 6 17.9273M6.52042 8.03192C6.67826 8.01687 6.83823 8.00917 7 8.00917C8.12582 8.00917 9.16474 8.38194 10.0005 9.01101`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 21L12 13M12 21C11.2998 21 9.99153 19.0057 9.5 18.5M12 21C12.7002 21 14.0085 19.0057 14.5 18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Wf=[[`path`,{d:`M4 12.0005L4 14.5446C4 17.7896 4 19.4122 4.88607 20.5111C5.06508 20.7331 5.26731 20.9354 5.48933 21.1144C6.58831 22.0005 8.21082 22.0005 11.4558 22.0005C12.1614 22.0005 12.5141 22.0005 12.8372 21.8865C12.9044 21.8627 12.9702 21.8355 13.0345 21.8047C13.3436 21.6569 13.593 21.4075 14.0919 20.9086L18.8284 16.172C19.4065 15.594 19.6955 15.3049 19.8478 14.9374C20 14.5699 20 14.1611 20 13.3436V10.0005C20 6.22922 20 4.34361 18.8284 3.17203C17.7693 2.11287 16.1265 2.01125 13.0345 2.0015M13 21.5005V21.0005C13 18.172 13 16.7578 13.8787 15.8791C14.7574 15.0005 16.1716 15.0005 19 15.0005H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 5.99954H4M8 1.99954V9.99954`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Gf=[[`path`,{d:`M20 14V10.6569C20 9.83935 20 9.4306 19.8478 9.06306C19.6955 8.69552 19.4065 8.40649 18.8284 7.82843L14.0919 3.09188C13.593 2.593 13.3436 2.34355 13.0345 2.19575C12.9702 2.165 12.9044 2.13772 12.8372 2.11401C12.5141 2 12.1614 2 11.4558 2C8.21082 2 6.58831 2 5.48933 2.88607C5.26731 3.06508 5.06508 3.26731 4.88607 3.48933C4 4.58831 4 6.21082 4 9.45584V14C4 17.7712 4 19.6569 5.17157 20.8284C6.34315 22 8.22876 22 12 22M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M17 22C17.6068 21.4102 20 19.8403 20 19C20 18.1597 17.6068 16.5898 17 16M19 19H12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Kf=[[`path`,{d:`M13 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 13V21M22 17H14`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],qf=[[`path`,{d:`M2 13C2.06427 12.3499 2.20951 11.9124 2.53777 11.5858C3.12654 11 4.07416 11 5.9694 11H18.0306C19.9258 11 20.8735 11 21.4622 11.5858C21.7905 11.9124 21.9357 12.3499 22 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Jf=[[`path`,{d:`M12 8H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 12H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 20H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12 16H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M3 4V11C3 12.8692 3 13.8038 3.40192 14.5C3.66523 14.9561 4.04394 15.3348 4.5 15.5981C5.19615 16 6.13077 16 8 16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M8 8H7C6.07003 8 5.60504 8 5.22354 7.89778C4.18827 7.62038 3.37962 6.81173 3.10222 5.77646C3 5.39496 3 4.92997 3 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],Yf=[[`path`,{d:`M2 11.4C2 10.2417 2.24173 10 3.4 10H20.6C21.7583 10 22 10.2417 22 11.4V12.6C22 13.7583 21.7583 14 20.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2 19.4C2 18.2417 2.24173 18 3.4 18H20.6C21.7583 18 22 18.2417 22 19.4V20.6C22 21.7583 21.7583 22 20.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],Xf=[[`path`,{d:`M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Zf=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.38886 15.1629C9.89331 15.5 10.5955 15.5 12 15.5C13.4045 15.5 14.1067 15.5 14.6111 15.1629C14.8295 15.017 15.017 14.8295 15.1629 14.6111C15.5 14.1067 15.5 13.4045 15.5 12C15.5 10.5955 15.5 9.89331 15.1629 9.38886C15.017 9.17048 14.8295 8.98298 14.6111 8.83706C14.1067 8.5 13.4045 8.5 12 8.5C10.5955 8.5 9.89331 8.5 9.38886 8.83706C9.17048 8.98298 8.98298 9.17048 8.83706 9.38886C8.5 9.89331 8.5 10.5955 8.5 12C8.5 13.4045 8.5 14.1067 8.83706 14.6111C8.98298 14.8295 9.17048 15.017 9.38886 15.1629Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Qf=[[`circle`,{cx:`1.5`,cy:`1.5`,r:`1.5`,transform:`matrix(1 0 0 -1 16 8.00024)`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2.77423 11.1439C1.77108 12.2643 1.7495 13.9546 2.67016 15.1437C4.49711 17.5033 6.49674 19.5029 8.85633 21.3298C10.0454 22.2505 11.7357 22.2289 12.8561 21.2258C15.8979 18.5022 18.6835 15.6559 21.3719 12.5279C21.6377 12.2187 21.8039 11.8397 21.8412 11.4336C22.0062 9.63798 22.3452 4.46467 20.9403 3.05974C19.5353 1.65481 14.362 1.99377 12.5664 2.15876C12.1603 2.19608 11.7813 2.36233 11.472 2.62811C8.34412 5.31646 5.49781 8.10211 2.77423 11.1439Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M7.00002 14.0002L10 17.0002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],$f=[[`path`,{d:`M3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C8.79275 3 5.97733 4.67765 4.38341 7.20327M3.29339 3.00076L3.46556 5.05452C3.58958 6.53384 3.65159 7.27349 4.13359 7.68914C4.61559 8.10479 5.32673 8.03185 6.74899 7.88595L8.79339 7.67625`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Y=e(n(),1),X=a();function ep(){let e=me(e=>e.errors);return e.length===0?null:(0,X.jsxs)(`div`,{role:`alert`,className:`bg-popover text-popover-foreground absolute right-3 bottom-9 z-20 flex w-96 max-w-[calc(100%-1.5rem)] items-start gap-2 rounded-md border p-3 text-[13px] shadow-lg`,children:[(0,X.jsx)(Le,{icon:v,className:`text-destructive mt-0.5 size-4 shrink-0`}),(0,X.jsx)(`p`,{className:`min-w-0 flex-1 break-words whitespace-pre-wrap`,children:e.at(-1)}),(0,X.jsx)(`button`,{type:`button`,title:`Dismiss`,"aria-label":`Dismiss`,className:`hover:bg-accent grid size-5 shrink-0 cursor-pointer place-items-center rounded-sm`,onClick:Ee,children:(0,X.jsx)(Le,{icon:Be,className:`size-3.5`})})]})}function tp(e,t){let n=localStorage.getItem(`editorWindow ${e} ${t}`);return n===null?{tabs:[],active:null,expanded:[],settings:{view:`explorer`,sidebar:!0,width:300,tree:!0,sort:`path`,messages:{},graph:!0,graphHeight:240,inline:!1,whitespace:!0,collapse:!1,smartCommit:!0}}:JSON.parse(n)}function np(e,t,n){localStorage.setItem(`editorWindow ${e} ${t}`,JSON.stringify(n))}function rp(e){let t=(0,Y.useRef)(!1),n=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{let t=e.initial.lastIndexOf(`.`);n.current?.focus(),n.current?.setSelectionRange(0,t>0?t:e.initial.length)},[e.initial]),(0,X.jsx)(`input`,{ref:n,"aria-label":`Name`,defaultValue:e.initial,className:`border-primary bg-background text-foreground h-5 min-w-0 flex-1 border px-1 text-[13px] outline-none`,onKeyDown:n=>{n.key===`Enter`&&(t.current=!0,e.onCommit(n.currentTarget.value)),n.key===`Escape`&&(t.current=!0,e.onCancel())},onBlur:n=>{t.current||(t.current=!0,e.onCommit(n.currentTarget.value))}})}function ip(e){let[t,n]=(0,Y.useState)(null),[r,a]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(0),[l,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)({path:``,folder:!0}),[p,h]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null),b=(0,Y.useRef)(null),ee=Ae();(0,Y.useEffect)(()=>{let t=!0;return ve(e.machine,`files.entries`,{projectId:e.projectId}).then(e=>{t&&(n(e),a(null))},e=>{t&&a(i(e))}),()=>{t=!1}},[e.machine,e.projectId,s]);let te=(0,Y.useMemo)(()=>ap(t?.files??[],t?.folders??[]),[t]),ne=l??e.active,re=l??(e.active===null?``:op(e.active));function ie(t,n){let r=t===``?[]:t.split(`/`);e.onExpanded([...new Set([...e.expanded,...r.map((e,t)=>r.slice(0,t+1).join(`/`))])]),h({kind:`create`,parent:t,folder:n})}async function oe(t){if(p===null)return;h(null);let n=t.trim();if(n!==``)try{if(p.kind===`create`){let t=p.parent===``?n:`${p.parent}/${n}`;await ve(e.machine,`files.create`,{projectId:e.projectId,path:t,folder:p.folder}),p.folder&&e.onExpanded(e=>[...e,t]),p.folder||e.onOpen(t)}if(p.kind===`rename`&&n!==sp(p.path)){let t=op(p.path),r=t===``?n:`${t}/${n}`;await ve(e.machine,`files.rename`,{projectId:e.projectId,path:p.path,to:r}),e.onRenamed(p.path,r)}c(e=>e+1)}catch(e){xe(e)}}async function se(t){try{await ve(e.machine,`files.delete`,{projectId:e.projectId,path:t.path}),e.onDeleted(t.path),c(e=>e+1)}catch(e){xe(e)}}function le(e,t,n){return(0,X.jsxs)(`div`,{className:`flex h-[22px] items-center gap-1.5 pr-2`,style:{paddingLeft:8+e*12},children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),t&&(0,X.jsx)(Le,{icon:qf,className:`text-muted-foreground size-4 shrink-0`}),!t&&(0,X.jsx)(Ve,{path:n}),(0,X.jsx)(rp,{initial:n,onCommit:e=>void oe(e),onCancel:()=>h(null)})]},`input`)}function ue(t,n,r,i){return p?.kind===`rename`&&p.path===t?le(n,r,sp(t)):(0,X.jsxs)(`button`,{type:`button`,"data-path":t,"data-folder":r,className:o(`text-sidebar-foreground hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] w-full cursor-pointer items-center gap-1.5 pr-2 text-left text-[13px] outline-none focus-visible:ring-1 focus-visible:ring-inset`,t===ne&&`bg-sidebar-row-active`),style:{paddingLeft:8+n*12},onClick:()=>{r?(u(t),e.onExpanded(i?e.expanded.filter(e=>e!==t):[...e.expanded,t])):(u(null),e.onOpen(t))},children:[Array.from({length:n},(e,t)=>(0,X.jsx)(`span`,{"aria-hidden":!0,className:`border-sidebar-border pointer-events-none absolute inset-y-0 border-l opacity-0 transition-opacity group-hover/tree:opacity-100`,style:{left:16+t*12}},t)),r&&(0,X.jsx)(Le,{icon:ce,"aria-hidden":!0,className:o(`text-muted-foreground size-4 shrink-0 transition-transform`,i&&`rotate-90`)}),!r&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),r&&(0,X.jsx)(Le,{icon:i?Fe:qf,className:`text-muted-foreground size-4 shrink-0`}),!r&&(0,X.jsx)(Ve,{path:t}),(0,X.jsx)(`span`,{className:`truncate`,children:sp(t)})]},t)}function me(t,n,r){return[p?.kind===`create`&&p.parent===n&&le(r,p.folder,``),...[...t.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(t=>{let i=n===``?t[0]:`${n}/${t[0]}`,a=e.expanded.includes(i);return(0,X.jsxs)(`div`,{children:[ue(i,r,!0,a),a&&me(t[1],i,r+1)]},`dir:${i}`)}),...[...t.files].sort((e,t)=>e.localeCompare(t)).map(e=>ue(e,r,!1,!1))]}return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`New File…`,"aria-label":`New File`,onClick:()=>ie(re,!1),children:(0,X.jsx)(Le,{icon:Wf,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`New Folder…`,"aria-label":`New Folder`,onClick:()=>ie(re,!0),children:(0,X.jsx)(Le,{icon:Kf,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Refresh Explorer`,"aria-label":`Refresh Explorer`,onClick:()=>c(s+1),children:(0,X.jsx)(Le,{icon:m,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Collapse Folders in Explorer`,"aria-label":`Collapse Folders in Explorer`,onClick:()=>e.onExpanded([]),children:(0,X.jsx)(Le,{icon:g,className:`size-4`})})]}),(0,X.jsxs)(y,{children:[(0,X.jsx)(ae,{asChild:!0,children:(0,X.jsxs)(`div`,{className:`group/tree min-h-0 flex-1 overflow-y-auto pb-6`,onContextMenu:e=>{let t=e.target instanceof Element?e.target.closest(`[data-path]`):null;f(t===null?{path:``,folder:!0}:{path:t.dataset.path??``,folder:t.dataset.folder===`true`})},children:[r!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:r}),r===null&&t===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),r===null&&t!==null&&me(te,``,0)]})}),(0,X.jsxs)(fe,{className:`min-w-48`,onCloseAutoFocus:e=>{b.current!==null&&(e.preventDefault(),b.current(),b.current=null)},children:[(0,X.jsx)(de,{onSelect:()=>{b.current=()=>ie(d.folder?d.path:op(d.path),!1)},children:`New File…`}),(0,X.jsx)(de,{onSelect:()=>{b.current=()=>ie(d.folder?d.path:op(d.path),!0)},children:`New Folder…`}),(0,X.jsx)(pe,{}),(0,X.jsx)(de,{onSelect:()=>void ee.copy(d.path===``?e.root:`${e.root}/${d.path}`),children:`Copy Path`}),d.path!==``&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(de,{onSelect:()=>void ee.copy(d.path),children:`Copy Relative Path`}),(0,X.jsx)(pe,{}),(0,X.jsx)(de,{onSelect:()=>{b.current=()=>h({kind:`rename`,path:d.path,folder:d.folder})},children:`Rename…`}),(0,X.jsx)(de,{variant:`destructive`,onSelect:()=>{b.current=()=>v(d)},children:`Delete`})]})]})]}),(0,X.jsx)(Ce,{open:_!==null,onOpenChange:e=>{e||v(null)},children:(0,X.jsxs)(Me,{children:[(0,X.jsxs)(Ne,{children:[(0,X.jsx)(_e,{children:`Delete '${_===null?``:sp(_.path)}'?`}),(0,X.jsx)(ge,{children:_?.folder===!0?`This folder and everything in it will be permanently deleted.`:`This file will be permanently deleted.`})]}),(0,X.jsxs)(De,{children:[(0,X.jsx)(Oe,{children:`Cancel`}),(0,X.jsx)(he,{variant:`destructive`,onClick:()=>{_!==null&&se(_)},children:`Delete`})]})]})})]})}function ap(e,t){let n={folders:new Map,files:[]};function r(e){let t=n;for(let n of e){let e=t.folders.get(n)??{folders:new Map,files:[]};t.folders.set(n,e),t=e}return t}for(let e of t)r(e.split(`/`));for(let t of e)r(t.split(`/`).slice(0,-1)).files.push(t);return n}function op(e){return e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``}function sp(e){return e.slice(e.lastIndexOf(`/`)+1)}function cp(e){return(0,X.jsx)(`div`,{role:`tablist`,className:`flex h-full min-w-0 flex-1 [scrollbar-width:thin] overflow-x-auto`,children:e.tabs.map(t=>{let n=t.id===e.active,r=e.dirty.includes(t.id);return(0,X.jsxs)(`div`,{role:`tab`,tabIndex:0,"aria-selected":n,title:t.path,className:o(`group/tab border-sidebar-border relative flex shrink-0 cursor-pointer items-center gap-1.5 border-r pr-1.5 pl-3 text-[13px] outline-none select-none`,n&&`bg-background text-foreground`,!n&&`text-muted-foreground hover:bg-background/50`),onClick:()=>e.onSelect(t.id),onAuxClick:n=>{n.button===1&&e.onClose(t.id)},onKeyDown:n=>{n.key===`Enter`&&e.onSelect(t.id)},children:[n&&(0,X.jsx)(`span`,{className:`bg-primary absolute inset-x-0 top-0 h-px`}),(0,X.jsx)(Ve,{path:t.path}),(0,X.jsx)(`span`,{className:`max-w-48 truncate`,children:t.label}),e.tabs.some(e=>e!==t&&e.label===t.label)&&(0,X.jsx)(`span`,{className:`text-muted-foreground max-w-40 truncate text-xs`,children:op(t.path)}),(0,X.jsxs)(`button`,{type:`button`,title:`Close`,"aria-label":`Close ${t.label}`,className:o(`group/close hover:bg-accent flex size-5 cursor-pointer items-center justify-center rounded opacity-0 group-hover/tab:opacity-100 focus-visible:opacity-100`,(n||r)&&`opacity-100`),onClick:n=>{n.stopPropagation(),e.onClose(t.id)},children:[r&&(0,X.jsx)(`span`,{className:`bg-foreground size-2 rounded-full group-hover/close:hidden`}),(0,X.jsx)(Le,{icon:Be,className:o(`size-3.5`,r&&`hidden group-hover/close:block`)})]})]},t.id)})})}var lp=class e{_ruleStack;constructor(e){this._ruleStack=e}get ruleStack(){return this._ruleStack}clone(){return new e(this._ruleStack)}equals(t){return!(!t||!(t instanceof e)||t!==this||t._ruleStack!==this._ruleStack)}};function up(e){if(Array.isArray(e)&&(e=e[0]),e)return e=(e.charCodeAt(0)===35?e.slice(1):e).toLowerCase(),(e.length===3||e.length===4)&&(e=e.split(``).map(e=>e+e).join(``)),e}var dp=/[\s,]+/;function fp(e){let t=`rules`in e?e.rules:void 0;if(!t){t=[];let n=e.settings||e.tokenColors;for(let{scope:e,settings:{foreground:r,background:i,fontStyle:a}={}}of n){if(!r&&!i&&!a)continue;let n=Array.isArray(e)?e:e?[e]:[],o=_p(a),s=up(r),c=up(i);t.push(...n.map(e=>({token:e,foreground:s,background:c,fontStyle:o})))}}let n=Object.fromEntries(Object.entries(e.colors||{}).map(([e,t])=>[e,`#${up(t)}`]));return{base:e.type===`light`?`vs`:`vs-dark`,inherit:!1,colors:n,rules:t}}function pp(e,t,n={}){let r=new Map,i=e.getLoadedThemes();for(let n of i){let i=fp(e.getTheme(n));r.set(n,i),t.editor.defineTheme(n,i)}let a=[],o=new Map,s=t.editor.setTheme.bind(t.editor);t.editor.setTheme=t=>{let n=e.setTheme(t),i=r.get(t);a.length=n.colorMap.length;for(let e=0;e<n.colorMap.length;e++)a[e]=n.colorMap[e];o.clear(),i?.rules.forEach(e=>{let t=up(e.foreground);if(!t)return;let n=vp(t,_p(e.fontStyle));o.has(n)||o.set(n,e.token)}),s(t)};let c=t.editor.create;t.editor.create=(e,n,r)=>(n?.theme&&t.editor.setTheme(n.theme),c(e,n,r)),t.editor.setTheme(i[0]);function l(e,t){let n=vp(e,mp(t));return o.get(n)}let{tokenizeMaxLineLength:u=2e4,tokenizeTimeLimit:d=500}=n,f=new Set(t.languages.getLanguages().map(e=>e.id));for(let n of e.getLoadedLanguages())f.has(n)&&t.languages.setTokensProvider(n,{getInitialState(){return new lp(qe)},tokenize(t,r){if(t.length>=u)return{endState:r,tokens:[{startIndex:0,scopes:``}]};let i=e.getLanguage(n).tokenizeLine2(t,r.ruleStack,d);i.stoppedEarly&&console.warn(`Time limit reached when tokenizing line: ${t.substring(0,100)}`);let o=i.tokens.length/2,s=[];for(let e=0;e<o;e++){let t=i.tokens[2*e],n=i.tokens[2*e+1],r=Ye.getForeground(n),o=up(a[r]||``),c=Ye.getFontStyle(n),u=o&&l(o,c)||``;s.push({startIndex:t,scopes:u})}return{endState:new lp(i.ruleStack),tokens:s}}})}function mp(e){if(e<=Je.None)return``;let t=[];return e&Je.Italic&&t.push(`italic`),e&Je.Bold&&t.push(`bold`),e&Je.Underline&&t.push(`underline`),e&Je.Strikethrough&&t.push(`strikethrough`),t.join(` `)}var hp=[`italic`,`bold`,`underline`,`strikethrough`],gp={"line-through":`strikethrough`};function _p(e){if(!e)return``;let t=new Set(e.split(dp).map(e=>e.trim().toLowerCase()).map(e=>gp[e]||e).filter(Boolean));return hp.filter(e=>t.has(e)).join(` `)}function vp(e,t){return t?`${e}|${t}`:e}var yp={},bp={},xp=class e{static getOrCreate(t){return bp[t]||(bp[t]=new e(t)),bp[t]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,yp[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Z(e){let t=e.id;yp[t]=e,Hc.register(e);let n=xp.getOrCreate(t);Hc.registerTokensProviderFactory(t,{create:async()=>(await n.load()).language}),Hc.onLanguageEncountered(t,async()=>{let e=await n.load();Hc.setLanguageConfiguration(t,e.conf)})}Z({id:`abap`,extensions:[`.abap`],aliases:[`abap`,`ABAP`],loader:()=>x(()=>import(`./abap-08VXUWAP.js`),[])}),Z({id:`apex`,extensions:[`.cls`],aliases:[`Apex`,`apex`],mimetypes:[`text/x-apex-source`,`text/x-apex`],loader:()=>x(()=>import(`./apex-BWPQTe0t.js`),[])}),Z({id:`azcli`,extensions:[`.azcli`],aliases:[`Azure CLI`,`azcli`],loader:()=>x(()=>import(`./azcli-Bc_sGQ0U.js`),[])}),Z({id:`bat`,extensions:[`.bat`,`.cmd`],aliases:[`Batch`,`bat`],loader:()=>x(()=>import(`./bat-i0X4ZdIN.js`),[])}),Z({id:`bicep`,extensions:[`.bicep`],aliases:[`Bicep`],loader:()=>x(()=>import(`./bicep-B5-_aFwp.js`),[])}),Z({id:`cameligo`,extensions:[`.mligo`],aliases:[`Cameligo`],loader:()=>x(()=>import(`./cameligo-DMUM7wLl.js`),[])}),Z({id:`clojure`,extensions:[`.clj`,`.cljs`,`.cljc`,`.edn`],aliases:[`clojure`,`Clojure`],loader:()=>x(()=>import(`./clojure-Cm7r79vr.js`),[])}),Z({id:`coffeescript`,extensions:[`.coffee`],aliases:[`CoffeeScript`,`coffeescript`,`coffee`],mimetypes:[`text/x-coffeescript`,`text/coffeescript`],loader:()=>x(()=>import(`./coffee-Ba7i2nA0.js`),[])}),Z({id:`c`,extensions:[`.c`,`.h`],aliases:[`C`,`c`],loader:()=>x(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`cpp`,extensions:[`.cpp`,`.cc`,`.cxx`,`.hpp`,`.hh`,`.hxx`],aliases:[`C++`,`Cpp`,`cpp`],loader:()=>x(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`csharp`,extensions:[`.cs`,`.csx`,`.cake`],aliases:[`C#`,`csharp`],loader:()=>x(()=>import(`./csharp-BKxtCVv1.js`),[])}),Z({id:`csp`,extensions:[`.csp`],aliases:[`CSP`,`csp`],loader:()=>x(()=>import(`./csp-bTuwJoIa.js`),[])}),Z({id:`css`,extensions:[`.css`],aliases:[`CSS`,`css`],mimetypes:[`text/css`],loader:()=>x(()=>import(`./css-DIMkf-bt.js`),[])}),Z({id:`cypher`,extensions:[`.cypher`,`.cyp`],aliases:[`Cypher`,`OpenCypher`],loader:()=>x(()=>import(`./cypher-CVaqCwHa.js`),[])}),Z({id:`dart`,extensions:[`.dart`],aliases:[`Dart`,`dart`],mimetypes:[`text/x-dart-source`,`text/x-dart`],loader:()=>x(()=>import(`./dart-onAF5SnQ.js`),[])}),Z({id:`dockerfile`,extensions:[`.dockerfile`],filenames:[`Dockerfile`],aliases:[`Dockerfile`],loader:()=>x(()=>import(`./dockerfile-DZFCIeNp.js`),[])}),Z({id:`ecl`,extensions:[`.ecl`],aliases:[`ECL`,`Ecl`,`ecl`],loader:()=>x(()=>import(`./ecl-D05T4iGw.js`),[])}),Z({id:`elixir`,extensions:[`.ex`,`.exs`],aliases:[`Elixir`,`elixir`,`ex`],loader:()=>x(()=>import(`./elixir-6RTg0lbw.js`),[])}),Z({id:`flow9`,extensions:[`.flow`],aliases:[`Flow9`,`Flow`,`flow9`,`flow`],loader:()=>x(()=>import(`./flow9-C5_-GSwl.js`),[])}),Z({id:`fsharp`,extensions:[`.fs`,`.fsi`,`.ml`,`.mli`,`.fsx`,`.fsscript`],aliases:[`F#`,`FSharp`,`fsharp`],loader:()=>x(()=>import(`./fsharp-C8Ef5oNN.js`),[])}),Z({id:`freemarker2`,extensions:[`.ftl`,`.ftlh`,`.ftlx`],aliases:[`FreeMarker2`,`Apache FreeMarker2`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-dollar`,aliases:[`FreeMarker2 (Angle/Dollar)`,`Apache FreeMarker2 (Angle/Dollar)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAngleInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-dollar`,aliases:[`FreeMarker2 (Bracket/Dollar)`,`Apache FreeMarker2 (Bracket/Dollar)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagBracketInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-bracket`,aliases:[`FreeMarker2 (Angle/Bracket)`,`Apache FreeMarker2 (Angle/Bracket)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAngleInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-bracket`,aliases:[`FreeMarker2 (Bracket/Bracket)`,`Apache FreeMarker2 (Bracket/Bracket)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagBracketInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-dollar`,aliases:[`FreeMarker2 (Auto/Dollar)`,`Apache FreeMarker2 (Auto/Dollar)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-bracket`,aliases:[`FreeMarker2 (Auto/Bracket)`,`Apache FreeMarker2 (Auto/Bracket)`],loader:()=>x(()=>import(`./freemarker2-6NYS9HqW.js`).then(e=>e.TagAutoInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`go`,extensions:[`.go`],aliases:[`Go`],loader:()=>x(()=>import(`./go-C-y9NEjX.js`),[])}),Z({id:`graphql`,extensions:[`.graphql`,`.gql`],aliases:[`GraphQL`,`graphql`,`gql`],mimetypes:[`application/graphql`],loader:()=>x(()=>import(`./graphql-fmXr3nnJ.js`),[])}),Z({id:`handlebars`,extensions:[`.handlebars`,`.hbs`],aliases:[`Handlebars`,`handlebars`,`hbs`],mimetypes:[`text/x-handlebars-template`],loader:()=>x(()=>import(`./handlebars-DOeNnhTE.js`),__vite__mapDeps([5,1,2,3,4]))}),Z({id:`hcl`,extensions:[`.tf`,`.tfvars`,`.hcl`],aliases:[`Terraform`,`tf`,`HCL`,`hcl`],loader:()=>x(()=>import(`./hcl-CpzslTdj.js`),[])}),Z({id:`html`,extensions:[`.html`,`.htm`,`.shtml`,`.xhtml`,`.mdoc`,`.jsp`,`.asp`,`.aspx`,`.jshtm`],aliases:[`HTML`,`htm`,`html`,`xhtml`],mimetypes:[`text/html`,`text/x-jshtm`,`text/template`,`text/ng-template`],loader:()=>x(()=>import(`./html-BwGTVsqZ.js`),__vite__mapDeps([6,1,2,3,4]))}),Z({id:`ini`,extensions:[`.ini`,`.properties`,`.gitconfig`],filenames:[`config`,`.gitattributes`,`.gitconfig`,`.editorconfig`],aliases:[`Ini`,`ini`],loader:()=>x(()=>import(`./ini-sBoK_t0W.js`),[])}),Z({id:`java`,extensions:[`.java`,`.jav`],aliases:[`Java`,`java`],mimetypes:[`text/x-java-source`,`text/x-java`],loader:()=>x(()=>import(`./java-BEtHBSE6.js`),[])}),Z({id:`javascript`,extensions:[`.js`,`.es6`,`.jsx`,`.mjs`,`.cjs`],firstLine:`^#!.*\\bnode`,filenames:[`jakefile`],aliases:[`JavaScript`,`javascript`,`js`],mimetypes:[`text/javascript`],loader:()=>x(()=>import(`./javascript-Dj-Vzbp-.js`),__vite__mapDeps([7,8,1,2,3,4]))}),Z({id:`julia`,extensions:[`.jl`],aliases:[`julia`,`Julia`],loader:()=>x(()=>import(`./julia-Bri6UV-V.js`),[])}),Z({id:`kotlin`,extensions:[`.kt`,`.kts`],aliases:[`Kotlin`,`kotlin`],mimetypes:[`text/x-kotlin-source`,`text/x-kotlin`],loader:()=>x(()=>import(`./kotlin-BOotOW0E.js`),[])}),Z({id:`less`,extensions:[`.less`],aliases:[`Less`,`less`],mimetypes:[`text/x-less`,`text/less`],loader:()=>x(()=>import(`./less-B9JPFI3C.js`),[])}),Z({id:`lexon`,extensions:[`.lex`],aliases:[`Lexon`],loader:()=>x(()=>import(`./lexon-CfSJPG6W.js`),[])}),Z({id:`lua`,extensions:[`.lua`],aliases:[`Lua`,`lua`],loader:()=>x(()=>import(`./lua-CsQS60Ue.js`),[])}),Z({id:`liquid`,extensions:[`.liquid`,`.html.liquid`],aliases:[`Liquid`,`liquid`],mimetypes:[`application/liquid`],loader:()=>x(()=>import(`./liquid-DDSU3ltH.js`),__vite__mapDeps([9,1,2,3,4]))}),Z({id:`m3`,extensions:[`.m3`,`.i3`,`.mg`,`.ig`],aliases:[`Modula-3`,`Modula3`,`modula3`,`m3`],loader:()=>x(()=>import(`./m3-D-oSqn_W.js`),[])}),Z({id:`markdown`,extensions:[`.md`,`.markdown`,`.mdown`,`.mkdn`,`.mkd`,`.mdwn`,`.mdtxt`,`.mdtext`],aliases:[`Markdown`,`markdown`],loader:()=>x(()=>import(`./markdown-Cimd5fb3.js`),[])}),Z({id:`mdx`,extensions:[`.mdx`],aliases:[`MDX`,`mdx`],loader:()=>x(()=>import(`./mdx-YllfWysm.js`),__vite__mapDeps([10,1,2,3,4]))}),Z({id:`mips`,extensions:[`.s`],aliases:[`MIPS`,`MIPS-V`],mimetypes:[`text/x-mips`,`text/mips`,`text/plaintext`],loader:()=>x(()=>import(`./mips-CIPQ_RoX.js`),[])}),Z({id:`msdax`,extensions:[`.dax`,`.msdax`],aliases:[`DAX`,`MSDAX`],loader:()=>x(()=>import(`./msdax-DauUninz.js`),[])}),Z({id:`mysql`,extensions:[],aliases:[`MySQL`,`mysql`],loader:()=>x(()=>import(`./mysql-SOo6toE5.js`),[])}),Z({id:`objective-c`,extensions:[`.m`],aliases:[`Objective-C`],loader:()=>x(()=>import(`./objective-c-FvmIjYaQ.js`),[])}),Z({id:`pascal`,extensions:[`.pas`,`.p`,`.pp`],aliases:[`Pascal`,`pas`],mimetypes:[`text/x-pascal-source`,`text/x-pascal`],loader:()=>x(()=>import(`./pascal-DrH0SRf2.js`),[])}),Z({id:`pascaligo`,extensions:[`.ligo`],aliases:[`Pascaligo`,`ligo`],loader:()=>x(()=>import(`./pascaligo-D-ptJ9y-.js`),[])}),Z({id:`perl`,extensions:[`.pl`,`.pm`],aliases:[`Perl`,`pl`],loader:()=>x(()=>import(`./perl-oz_6vUea.js`),[])}),Z({id:`pgsql`,extensions:[],aliases:[`PostgreSQL`,`postgres`,`pg`,`postgre`],loader:()=>x(()=>import(`./pgsql-DTj74zXo.js`),[])}),Z({id:`php`,extensions:[`.php`,`.php4`,`.php5`,`.phtml`,`.ctp`],aliases:[`PHP`,`php`],mimetypes:[`application/x-php`],loader:()=>x(()=>import(`./php-nr791fC2.js`),[])}),Z({id:`pla`,extensions:[`.pla`],loader:()=>x(()=>import(`./pla-CopQ2nXW.js`),[])}),Z({id:`postiats`,extensions:[`.dats`,`.sats`,`.hats`],aliases:[`ATS`,`ATS/Postiats`],loader:()=>x(()=>import(`./postiats-43DmfD33.js`),[])}),Z({id:`powerquery`,extensions:[`.pq`,`.pqm`],aliases:[`PQ`,`M`,`Power Query`,`Power Query M`],loader:()=>x(()=>import(`./powerquery-D3hlyOfw.js`),[])}),Z({id:`powershell`,extensions:[`.ps1`,`.psm1`,`.psd1`],aliases:[`PowerShell`,`powershell`,`ps`,`ps1`],loader:()=>x(()=>import(`./powershell-DmHpPYUd.js`),[])}),Z({id:`proto`,extensions:[`.proto`],aliases:[`protobuf`,`Protocol Buffers`],loader:()=>x(()=>import(`./protobuf-C531GsRP.js`),[])}),Z({id:`pug`,extensions:[`.jade`,`.pug`],aliases:[`Pug`,`Jade`,`jade`],loader:()=>x(()=>import(`./pug-Z5eAx3Zn.js`),[])}),Z({id:`python`,extensions:[`.py`,`.rpy`,`.pyw`,`.cpy`,`.gyp`,`.gypi`],aliases:[`Python`,`py`],firstLine:`^#!/.*\\bpython[0-9.-]*\\b`,loader:()=>x(()=>import(`./python-Bsfjs4Fs.js`),__vite__mapDeps([11,1,2,3,4]))}),Z({id:`qsharp`,extensions:[`.qs`],aliases:[`Q#`,`qsharp`],loader:()=>x(()=>import(`./qsharp-DkqhCAOL.js`),[])}),Z({id:`r`,extensions:[`.r`,`.rhistory`,`.rmd`,`.rprofile`,`.rt`],aliases:[`R`,`r`],loader:()=>x(()=>import(`./r-BwWrilGY.js`),[])}),Z({id:`razor`,extensions:[`.cshtml`],aliases:[`Razor`,`razor`],mimetypes:[`text/x-cshtml`],loader:()=>x(()=>import(`./razor-3MUz77_n.js`),__vite__mapDeps([12,1,2,3,4]))}),Z({id:`redis`,extensions:[`.redis`],aliases:[`redis`],loader:()=>x(()=>import(`./redis-ClamHrr6.js`),[])}),Z({id:`redshift`,extensions:[],aliases:[`Redshift`,`redshift`],loader:()=>x(()=>import(`./redshift-DT7zqm-g.js`),[])}),Z({id:`restructuredtext`,extensions:[`.rst`],aliases:[`reStructuredText`,`restructuredtext`],loader:()=>x(()=>import(`./restructuredtext-BYgofb2h.js`),[])}),Z({id:`ruby`,extensions:[`.rb`,`.rbx`,`.rjs`,`.gemspec`,`.pp`],filenames:[`rakefile`,`Gemfile`],aliases:[`Ruby`,`rb`],loader:()=>x(()=>import(`./ruby-DezsRK8O.js`),[])}),Z({id:`rust`,extensions:[`.rs`,`.rlib`],aliases:[`Rust`,`rust`],loader:()=>x(()=>import(`./rust-DdL9SqIa.js`),[])}),Z({id:`sb`,extensions:[`.sb`],aliases:[`Small Basic`,`sb`],loader:()=>x(()=>import(`./sb-CcwsVR0C.js`),[])}),Z({id:`scala`,extensions:[`.scala`,`.sc`,`.sbt`],aliases:[`Scala`,`scala`,`SBT`,`Sbt`,`sbt`,`Dotty`,`dotty`],mimetypes:[`text/x-scala-source`,`text/x-scala`,`text/x-sbt`,`text/x-dotty`],loader:()=>x(()=>import(`./scala-DHpiXF5c.js`),[])}),Z({id:`scheme`,extensions:[`.scm`,`.ss`,`.sch`,`.rkt`],aliases:[`scheme`,`Scheme`],loader:()=>x(()=>import(`./scheme-BeGwcela.js`),[])}),Z({id:`scss`,extensions:[`.scss`],aliases:[`Sass`,`sass`,`scss`],mimetypes:[`text/x-scss`,`text/scss`],loader:()=>x(()=>import(`./scss-gp-XZpBa.js`),[])}),Z({id:`shell`,extensions:[`.sh`,`.bash`],aliases:[`Shell`,`sh`],loader:()=>x(()=>import(`./shell-CC2rA5mh.js`),[])}),Z({id:`sol`,extensions:[`.sol`],aliases:[`sol`,`solidity`,`Solidity`],loader:()=>x(()=>import(`./solidity-BEEn4gHE.js`),[])}),Z({id:`aes`,extensions:[`.aes`],aliases:[`aes`,`sophia`,`Sophia`],loader:()=>x(()=>import(`./sophia-CRfGWb83.js`),[])}),Z({id:`sparql`,extensions:[`.rq`],aliases:[`sparql`,`SPARQL`],loader:()=>x(()=>import(`./sparql-D_Lu-MrJ.js`),[])}),Z({id:`sql`,extensions:[`.sql`],aliases:[`SQL`],loader:()=>x(()=>import(`./sql-NEE52Syq.js`),[])}),Z({id:`st`,extensions:[`.st`,`.iecst`,`.iecplc`,`.lc3lib`,`.TcPOU`,`.TcDUT`,`.TcGVL`,`.TcIO`],aliases:[`StructuredText`,`scl`,`stl`],loader:()=>x(()=>import(`./st-DbInun42.js`),[])}),Z({id:`swift`,aliases:[`Swift`,`swift`],extensions:[`.swift`],mimetypes:[`text/swift`],loader:()=>x(()=>import(`./swift-Bxkupp3x.js`),[])}),Z({id:`systemverilog`,extensions:[`.sv`,`.svh`],aliases:[`SV`,`sv`,`SystemVerilog`,`systemverilog`],loader:()=>x(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`verilog`,extensions:[`.v`,`.vh`],aliases:[`V`,`v`,`Verilog`,`verilog`],loader:()=>x(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`tcl`,extensions:[`.tcl`],aliases:[`tcl`,`Tcl`,`tcltk`,`TclTk`,`tcl/tk`,`Tcl/Tk`],loader:()=>x(()=>import(`./tcl-DISqw1ZD.js`),[])}),Z({id:`twig`,extensions:[`.twig`],aliases:[`Twig`,`twig`],mimetypes:[`text/x-twig`],loader:()=>x(()=>import(`./twig-De2hgUGE.js`),[])}),Z({id:`typescript`,extensions:[`.ts`,`.tsx`,`.cts`,`.mts`],aliases:[`TypeScript`,`ts`,`typescript`],mimetypes:[`text/typescript`],loader:()=>x(()=>import(`./typescript-fNZ3iur6.js`),__vite__mapDeps([13,8,1,2,3,4]))}),Z({id:`typespec`,extensions:[`.tsp`],aliases:[`TypeSpec`],loader:()=>x(()=>import(`./typespec-B8J7ngcE.js`),[])}),Z({id:`vb`,extensions:[`.vb`],aliases:[`Visual Basic`,`vb`],loader:()=>x(()=>import(`./vb-DV3o63ZY.js`),[])}),Z({id:`wgsl`,extensions:[`.wgsl`],aliases:[`WebGPU Shading Language`,`WGSL`,`wgsl`],loader:()=>x(()=>import(`./wgsl-DpFanUEy.js`),[])}),Z({id:`xml`,extensions:[`.xml`,`.xsd`,`.dtd`,`.ascx`,`.csproj`,`.config`,`.props`,`.targets`,`.wxi`,`.wxl`,`.wxs`,`.xaml`,`.svg`,`.svgz`,`.opf`,`.xslt`,`.xsl`],firstLine:`(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)`,aliases:[`XML`,`xml`],mimetypes:[`text/xml`,`application/xml`,`application/xaml+xml`,`application/xml-dtd`],loader:()=>x(()=>import(`./xml-S-oLW5B5.js`),__vite__mapDeps([14,1,2,3,4]))}),Z({id:`yaml`,extensions:[`.yaml`,`.yml`],aliases:[`YAML`,`yaml`,`YML`,`yml`],mimetypes:[`application/x-yaml`,`text/x-yaml`],loader:()=>x(()=>import(`./yaml-DlmqY7sN.js`),__vite__mapDeps([15,1,2,3,4]))});var Sp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Cp=function(e,t){return function(n,r){t(n,r,e)}},wp,Tp=new M(`selectionAnchorSet`,!1),Ep=class{static{wp=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(wp.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Tp.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){let 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 Ei().appendText(S(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),vo(S(850,`Anchor set at {0}:{1}`,e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){let t=this.editor.getPosition();this.editor.setSelection(J.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){let e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Ep=wp=Sp([Cp(1,Na)],Ep);var Dp=class extends G{constructor(){super({id:`editor.action.setSelectionAnchor`,label:R(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:Er(2089,2080),weight:100}})}async run(e,t){Ep.get(t)?.setSelectionAnchor()}},Op=class extends G{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:R(852,`Go to Selection Anchor`),precondition:Tp})}async run(e,t){Ep.get(t)?.goToSelectionAnchor()}},kp=class extends G{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:R(853,`Select from Anchor to Cursor`),precondition:Tp,kbOpts:{kbExpr:D.editorTextFocus,primary:Er(2089,2089),weight:100}})}async run(e,t){Ep.get(t)?.selectFromAnchorToCursor()}},Ap=class extends G{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:R(854,`Cancel Selection Anchor`),precondition:Tp,kbOpts:{kbExpr:D.editorTextFocus,primary:9,weight:100}})}async run(e,t){Ep.get(t)?.cancelSelectionAnchor()}};Ms(Ep.ID,Ep,4),B(Dp),B(Op),B(kp),B(Ap);var jp=k(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,S(855,`Overview ruler marker color for matching brackets.`)),Mp=class extends G{constructor(){super({id:`editor.action.jumpToBracket`,label:R(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:3165,weight:100}})}run(e,t){Ip.get(t)?.jumpToBracket()}},Np=class extends G{constructor(){super({id:`editor.action.selectToBracket`,label:R(858,`Select to Bracket`),precondition:void 0,metadata:{description:R(859,`Select the text inside and including the brackets or curly braces`),args:[{name:`args`,schema:{type:`object`,properties:{selectBrackets:{type:`boolean`,default:!0}}}}]}})}run(e,t,n){let r=!0;n&&n.selectBrackets===!1&&(r=!1),Ip.get(t)?.selectToBracket(r)}},Pp=class extends G{constructor(){super({id:`editor.action.removeBrackets`,label:R(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Ip.get(t)?.removeBrackets(this.id)}},Fp=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Ip=class e extends K{static{this.ID=`editor.contrib.bracketMatchingController`}static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Mr(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{this._matchBrackets!==`never`&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.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;let e=this._editor.getModel(),t=this._editor.getSelections().map(t=>{let n=t.getStartPosition(),r=e.bracketPairs.matchBracket(n),i=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?i=r[1].getStartPosition():r[1].containsPosition(n)&&(i=r[0].getStartPosition());else{let t=e.bracketPairs.findEnclosingBrackets(n);if(t)i=t[1].getStartPosition();else{let t=e.bracketPairs.findNextBracket(n);t&&t.range&&(i=t.range.getStartPosition())}}return i?new J(i.lineNumber,i.column,i.lineNumber,i.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;let t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{let i=r.getStartPosition(),a=t.bracketPairs.matchBracket(i);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(i),!a)){let e=t.bracketPairs.findNextBracket(i);e&&e.range&&(a=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let o=null,s=null;if(a){a.sort(w.compareRangesUsingStarts);let[t,n]=a;if(o=e?t.getStartPosition():t.getEndPosition(),s=e?n.getEndPosition():n.getStartPosition(),n.containsPosition(i)){let e=o;o=s,s=e}}o&&s&&n.push(new J(o.lineNumber,o.column,s.lineNumber,s.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(n=>{let r=n.getPosition(),i=t.bracketPairs.matchBracket(r);i||=t.bracketPairs.findEnclosingBrackets(r),i&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:i[0],text:``},{range:i[1],text:``}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=F.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:to(jp),position:Xi.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=F.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`})}_updateBrackets(){if(this._matchBrackets===`never`)return;this._recomputeBrackets();let e=[],t=0;for(let n of this._lastBracketsData){let r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getSelections();if(t.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let n=this._editor.getModel(),r=n.getVersionId(),i=[];this._lastVersionId===r&&(i=this._lastBracketsData);let a=[],o=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];n.isEmpty()&&(a[o++]=n.getStartPosition())}a.length>1&&a.sort(j.compare);let s=[],c=0,l=0,u=i.length;for(let t=0,r=a.length;t<r;t++){let r=a[t];for(;l<u&&i[l].position.isBefore(r);)l++;if(l<u&&i[l].position.equals(r))s[c++]=i[l];else{let t=n.bracketPairs.matchBracket(r,20),i=e._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!t&&this._matchBrackets===`always`&&(t=n.bracketPairs.findEnclosingBrackets(r,20),i=e._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),s[c++]=new Fp(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};Ms(Ip.ID,Ip,1),B(Np),B(Mp),B(Pp),Sn.appendMenuItem(O.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:S(856,`Go to &&Bracket`)},order:2}),Ma((e,t)=>{let n=e.getColor(Bf);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)}),B(class extends G{constructor(){super({id:`editor.action.transposeLetters`,label:R(863,`Transpose Letters`),precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let n=t.getModel(),r=[],i=t.getSelections();for(let e of i){if(!e.isEmpty())continue;let t=e.startLineNumber,i=e.startColumn,a=n.getLineMaxColumn(t);if(t===1&&(i===1||i===2&&a===2))continue;let o=i===a?e.getPosition():Ju.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=Ju.leftPosition(n,o),c=Ju.leftPosition(n,s),l=n.getValueInRange(w.fromPositions(c,s)),u=n.getValueInRange(w.fromPositions(s,o)),d=w.fromPositions(c,o);r.push(new qc(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Lp=class e{static{this.sep=`.`}static{this.None=new e(`@@none@@`)}static{this.Empty=new e(``)}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(t){return this.equals(t)||this.value===``||t.value.startsWith(this.value+e.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}},Rp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},zp=function(e,t){return function(n,r){t(n,r,e)}},Bp=F.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),Vp=class e extends K{static{this.baseId=`editor.widget.inlineProgressWidget`}constructor(e,t,n,r,i){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=N(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=N(`span.icon`);this.domNode.append(t),t.classList.add(...H.asClassNameArray(A.loading),`codicon-modifier-spin`);let n=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};n(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&n()})),this._register(L(this.domNode,El.CLICK,e=>{this.delegate.cancel()}))}getId(){return e.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)}},Hp=class extends K{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new sc),this._currentWidget=this._register(new sc),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,n,r,i){let a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=Va(()=>{let n=w.fromPositions(e);this._currentDecorations.set([{range:n,options:Bp}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Vp,this.id,this._editor,n,t,r))},i??this._showDelay);try{return await n}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Hp=Rp([zp(2,W)],Hp);var Up=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Wp=function(e,t){return function(n,r){t(n,r,e)}},Gp,Kp=class{static{Gp=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new M(`messageVisible`,!1,S(1353,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(Gp.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new sc,this._messageListeners=new I,this._mouseOverMessage=!1,this._editor=e,this._visible=Gp.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(vo(Nr(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Nr(e)){let n=this._messageListeners.add(vl(e,{actionHandler:(e,t)=>{this.closeMessage(),sn(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new Jp(this._editor,t,n.element)}else this._messageWidget.value=new Jp(this._editor,t,e);this._messageListeners.add(du.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&hn(uf(),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(L(this._messageWidget.value.getDomNode(),El.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(L(this._messageWidget.value.getDomNode(),El.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(n?n.containsPosition(e.target.position)||this.closeMessage():n=new w(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Jp.fadeOut(this._messageWidget.value))}};Kp=Gp=Up([Wp(1,Na),Wp(2,Jt)],Kp);var qp=$u.bindToContribution(Kp.get);U(new qp({id:`leaveEditorMessage`,precondition:Kp.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var Jp=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener(`animationend`,t)},n=setTimeout(t,110);return e.getDomNode().addEventListener(`animationend`,t),e.getDomNode().classList.add(`fadeOut`),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement(`div`),this._domNode.classList.add(`monaco-editor-overlaymessage`),this._domNode.style.marginLeft=`-6px`;let i=document.createElement(`div`);i.classList.add(`anchor`,`top`),this._domNode.appendChild(i);let a=document.createElement(`div`);typeof r==`string`?(a.classList.add(`message`),a.textContent=r):(r.classList.add(`message`),a.appendChild(r)),this._domNode.appendChild(a);let o=document.createElement(`div`);o.classList.add(`anchor`,`below`),this._domNode.appendChild(o),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)}};Ms(Kp.ID,Kp,4);var Yp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Xp=function(e,t){return function(n,r){t(n,r,e)}},Zp=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,n,r,i){let a=await this.getEdit(n,i);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,n,r){let i=await this.getEdit(n,r);if(i)return{edits:[{insertText:i.insertText,title:i.title,kind:i.kind,handledMimeType:i.handledMimeType,yieldTo:i.yieldTo}],dispose(){}}}},Qp=class e extends Zp{static{this.id=`text`}constructor(){super(Lp.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[wo.text],this.pasteMimeTypes=[wo.text]}async getEdit(e,t){let n=e.get(wo.text);if(!n||e.has(wo.uriList))return;let r=await n.asString();return{handledMimeType:wo.text,title:S(980,`Insert Plain Text`),insertText:r,kind:this.kind}}},$p=class extends Zp{constructor(){super(Lp.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[wo.uriList],this.pasteMimeTypes=[wo.uriList]}async getEdit(e,t){let n=await nm(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===al.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?S(981,`Insert Uris`):S(982,`Insert Uri`):n.length>1?S(983,`Insert Paths`):S(984,`Insert Path`),{handledMimeType:wo.uriList,insertText:i,title:a,kind:this.kind}}},em=class extends Zp{constructor(e){super(Lp.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[wo.uriList],this.pasteMimeTypes=[wo.uriList]}async getEdit(e,t){let n=await nm(e);if(!n.length||t.isCancellationRequested)return;let r=fu(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?un(t.uri,e):void 0}));if(r.length)return{handledMimeType:wo.uriList,insertText:r.join(` `),title:n.length>1?S(985,`Insert Relative Paths`):S(986,`Insert Relative Path`),kind:this.kind}}};em=Yp([Xp(0,vu)],em);var tm=class{constructor(){this.kind=new Lp(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:wo.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==da.PasteAs&&!r.only?.contains(this.kind))return;let a=await n.get(`text/html`)?.asString();if(a&&!i.isCancellationRequested)return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:S(987,`Insert HTML`),kind:this.kind}]}}};async function nm(e){let t=e.get(wo.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of Vl.parse(n))try{r.push({uri:qn.parse(e),originalText:e})}catch{}return r}var rm={scheme:`*`,hasAccessToAllModels:!0},im=class extends K{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(rm,new Qp)),this._register(e.documentDropEditProvider.register(rm,new $p)),this._register(e.documentDropEditProvider.register(rm,new em(t)))}};im=Yp([Xp(0,z),Xp(1,vu)],im);var am=class extends K{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(rm,new Qp)),this._register(e.documentPasteEditProvider.register(rm,new $p)),this._register(e.documentPasteEditProvider.register(rm,new em(t))),this._register(e.documentPasteEditProvider.register(rm,new tm))}};am=Yp([Xp(0,z),Xp(1,vu)],am);var om=class e{constructor(){this.value=``,this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}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};let t=this.pos,n=0,r=this.value.charCodeAt(t),i;if(i=e._table[r],typeof i==`number`)return this.pos+=1,{type:i,pos:t,len:1};if(e.isDigitCharacter(r)){i=8;do n+=1,r=this.value.charCodeAt(t+n);while(e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}if(e.isVariableCharacter(r)){i=9;do r=this.value.charCodeAt(t+ ++n);while(e.isVariableCharacter(r)||e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}i=10;do n+=1,r=this.value.charCodeAt(t+n);while(!isNaN(r)&&e._table[r]===void 0&&!e.isDigitCharacter(r)&&!e.isVariableCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}},sm=class{constructor(){this._children=[]}appendChild(e){return e instanceof cm&&this._children[this._children.length-1]instanceof cm?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:n}=e,r=n.children.indexOf(e),i=n.children.slice(0);i.splice(r,1,...t),n._children=i,(function e(t,n){for(let r of t)r.parent=n,e(r.children,r)})(t,n)}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 gm)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},cm=class e extends sm{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},lm=class extends sm{},um=class e extends lm{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:+(e.index>t.index)}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof dm?this._children[0]:void 0}clone(){let t=new e(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},dm=class e extends sm{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof cm&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let t=new e;return this.options.forEach(t.appendChild,t),t}},fm=class e extends sm{constructor(){super(...arguments),this.regexp=RegExp(``)}resolve(e){let t=this,n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(e=>e instanceof pm&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof pm){let r=e[n.index]||``;r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return``}clone(){let t=new e;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?`i`:``)+(this.regexp.global?`g`:``)),t._children=this.children.map(e=>e.clone()),t}},pm=class e extends sm{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}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,`-`);let t=e.trim().replace(/^_+|_+$/g,``),n=t.match(/\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(e=>e.toLowerCase()).join(`-`):t.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).join(`-`)}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(e=>e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((e,t)=>t===0?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,`$1_$2`).replace(/[\s\-]+/g,`_`).toLowerCase()}clone(){return new e(this.index,this.shorthandName,this.ifValue,this.elseValue)}},mm=class e extends lm{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 cm(t)],!0)}clone(){let t=new e(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}};function hm(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var gm=class e extends sm{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof um&&(e.push(n),t=!t||t.index<n.index?n:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){let{all:e}=this.placeholderInfo;return e}offset(e){let t=0,n=!1;return this.walk(r=>r===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return hm([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof um&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof mm&&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(){let t=new e;return t._children=this.children.map(e=>e.clone()),t}walk(e){hm(this.children,e)}},_m=class{constructor(){this._scanner=new om,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,n){let r=new gm;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){let n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let r=new Map,i=[];t.walk(e=>(e instanceof um&&(e.isFinalTabstop?r.set(0,void 0):!r.has(e.index)&&e.children.length>0?r.set(e.index,e.children):i.push(e)),!0));let a=(e,n)=>{let i=r.get(e.index);if(!i)return;let o=new um(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof um&&r.has(t.index)&&!n.has(t.index)&&(n.add(t.index),a(t,n),n.delete(t.index))}t.replace(e,[o])},o=new Set;for(let e of i)a(e,o);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(e=>e.index===0)||e.appendChild(new um(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){let t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){let e=this._scanner.next();if(e.type!==0&&e.type!==4&&e.type!==5)return!1}this._token=this._scanner.next()}let n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,`$1`);return this._token=this._scanner.next(),n}_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 cm(t)),!0):!1}_parseTabstopOrVariableName(e){let t,n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new um(Number(t)):new mm(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);let r=new um(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new cm("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new dm;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(t),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseChoiceElement(e){let t=this._token,n=[];for(;this._token.type!==2&&this._token.type!==7;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;n.push(e)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new cm(n.join(``))),!0)}_parseComplexVariable(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);let r=new mm(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new cm("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseTransform(e){let t=new fm,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,n+=e;else if(this._token.type!==14)n+=this._accept(void 0,!0);else return!1}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new cm(e));else if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);)if(this._token.type!==14)r+=this._accept(void 0,!0);else return!1;try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);let r=this._accept(8,!0);if(!r)return this._backTo(t),!1;if(!n||this._accept(4))return e.appendChild(new pm(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let n=this._accept(9,!0);return!n||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new pm(Number(r),n)),!0)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new pm(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new pm(Number(r),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let n=this._until(4);if(n)return e.appendChild(new pm(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new pm(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14&&(e.appendChild(new cm(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function vm(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new $c(e,{range:t,text:typeof n.insertText==`string`?_m.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function ym(e){function t(e,t){return`mimeType`in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}let n=new Map;for(let r of e)for(let i of r.yieldTo??[])for(let a of e)if(a!==r&&t(i,a)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(a)}if(!n.size)return Array.from(e);let r=new Set,i=[];function a(e){if(!e.length)return[];let t=e[0];if(i.includes(t))return console.warn(`Yield to cycle detected`,t),e;if(r.has(t))return a(e.slice(1));let o=[],s=n.get(t);return s&&(i.push(t),o=a(s),i.pop()),r.add(t),[...o,t,...a(e.slice(1))]}return a(Array.from(e))}function bm(e,t){return t&&(e.stack||e.stacktrace)?S(33,`{0}: {1}`,Sm(e),xm(e.stack)||xm(e.stacktrace)):Sm(e)}function xm(e){return Array.isArray(e)?e.join(`
3
3
  `):e}function Sm(e){return e.code===`ERR_UNC_HOST_NOT_ALLOWED`?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof e.code==`string`&&typeof e.errno==`number`&&typeof e.syscall==`string`?S(34,`A system error occurred ({0})`,e.message):e.message||S(35,`An unknown error occurred. Please consult the log for more details.`)}function Cm(e=null,t=!1){if(!e)return S(36,`An unknown error occurred. Please consult the log for more details.`);if(Array.isArray(e)){let n=fu(e),r=Cm(n[0],t);return n.length>1?S(37,`{0} ({1} errors in total)`,r,n.length):r}if(Bn(e))return e;if(e.detail){let n=e.detail;if(n.error)return bm(n.error,t);if(n.exception)return bm(n.exception,t)}return e.stack?bm(e,t):e.message?e.message:S(38,`An unknown error occurred. Please consult the log for more details.`)}var wm=class extends K{constructor(e){super(),this._onChange=this._register(new P),this.onChange=this._onChange.event,this._checked=!!e.checked,this._title=e.title??e.ariaLabel,this.domNode=N(`button.monaco-switch`),this.domNode.type=`button`,this.domNode.setAttribute(`role`,`switch`),q(this.domNode,N(`.monaco-switch-thumb`)),this._register(st().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}))),this.setAriaLabel(e.ariaLabel,e.title),this.disabled=!!e.disabled,this._applyState(),this._register(L(this.domNode,El.CLICK,e=>{Ts.stop(e,!0),!this.domNode.disabled&&(this._checked=!this._checked,this._applyState(),this._onChange.fire(this._checked))}))}get checked(){return this._checked}set checked(e){this._checked!==e&&(this._checked=e,this._applyState())}get disabled(){return this.domNode.disabled}set disabled(e){this.domNode.disabled=e}setAriaLabel(e,t=e){this.domNode.setAttribute(`aria-label`,e),this._title=t}_applyState(){this.domNode.setAttribute(`aria-checked`,String(this._checked)),this.domNode.classList.toggle(`checked`,this._checked)}},Tm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Em=function(e,t){return function(n,r){t(n,r,e)}},Dm=class extends K{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute(`aria-disabled`,`false`),this.el.tabIndex=0,this.el.style.pointerEvents=`auto`,this.el.style.opacity=`1`,this.el.style.cursor=`pointer`,this._enabled=!1):(this.el.setAttribute(`aria-disabled`,`true`),this.el.tabIndex=-1,this.el.style.pointerEvents=`none`,this.el.style.opacity=`0.4`,this.el.style.cursor=`default`,this._enabled=!0),this._enabled=e}constructor(e,t,n={},r,i){super(),this._link=t,this._hoverService=r,this._enabled=!0,this.el=q(e,N(`a.monaco-link`,{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=n.hoverDelegate??Qs(`mouse`),this.setTooltip(t.title),this.el.setAttribute(`role`,`button`);let a=this._register(new ff(this.el,`click`)),o=this._register(new ff(this.el,`keydown`)),s=du.chain(o.event,e=>e.map(e=>new ur(e)).filter(e=>e.keyCode===3||e.keyCode===10)),c=this._register(new ff(this.el,ga.Tap)).event;this._register(an.addTarget(this.el));let l=du.any(a.event,s,c);this._register(l(e=>{this.enabled&&(Ts.stop(e,!0),n?.opener?n.opener(this._link.href):i.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};Dm=Tm([Em(3,iu),Em(4,Jt)],Dm);var Om=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},km=function(e,t){return function(n,r){t(n,r,e)}},Am,jm=`acceptSelectedCodeAction`,Mm=`previewSelectedCodeAction`,Nm=new Set([jm,Mm,`toggleSectionCodeAction`]),Pm=`actionList.remove`,Fm=class{get templateId(){return`header`}renderTemplate(e){e.classList.add(`group-header`);let t=document.createElement(`span`);return e.append(t),{container:e,text:t}}renderElement(e,t,n){n.text.textContent=e.group?.title??e.label??``}disposeTemplate(e){}},Im=class{get templateId(){return`separator`}renderTemplate(e){e.classList.add(`separator`);let t=document.createElement(`span`);return e.append(t),{container:e,text:t}}renderElement(e,t,n){n.container.classList.toggle(`has-label`,!!e.label),n.text.textContent=e.label??``}disposeTemplate(e){}};function Lm(e){return!!e.submenuActions?.length&&!e.hover?.content||!!e.hover?.expandable}function Rm(e){return Lm(e)&&e.hover?.showIndicator!==!1}var zm=class{get templateId(){return`action`}constructor(e,t,n,r,i,a,o,s,c,l,u,d){this._supportsPreview=e,this._onRemoveItem=t,this._onShowSubmenu=n,this._reservesSubmenuSpace=r,this._groupTitleByIndex=i,this._linkHandler=a,this._hideDefaultKeybindingTooltip=o,this._stopToolbarPointerPropagation=s,this._registerStandaloneToggle=c,this._registerToolbar=l,this._keybindingService=u,this._openerService=d}renderTemplate(e){e.classList.add(this.templateId);let t=document.createElement(`div`);t.className=`icon`,e.append(t);let n=document.createElement(`span`);n.className=`title`,e.append(n);let r=document.createElement(`span`);r.className=`action-item-badge`,r.ariaHidden=`true`,e.append(r);let i=document.createElement(`span`);i.className=`description`,e.append(i);let a=document.createElement(`span`);a.className=`group-title`,e.append(a);let o=document.createElement(`span`);o.className=`detail`,e.append(o);let s=new Mf(e,ms),c=document.createElement(`div`);c.className=`action-list-item-toolbar`,e.append(c);let l=document.createElement(`div`);l.className=`action-list-submenu-indicator`,e.append(l);let u=document.createElement(`div`);return u.className=`action-list-item-inline-toggle`,e.append(u),{container:e,icon:t,text:n,detail:o,badge:r,description:i,groupTitle:a,keybinding:s,toolbar:c,submenuIndicator:l,inlineToggleContainer:u,elementDisposables:new I}}renderElement(e,t,n){if(n.elementDisposables.clear(),e.iconClasses?.length?(n.icon.className=[`icon`,...e.iconClasses].join(` `),n.icon.style.color=``):e.group?.icon?(n.icon.className=H.asClassName(e.group.icon),n.icon.style.color=e.group.icon.color?mn(e.group.icon.color.id):``):(n.icon.className=H.asClassName(A.lightBulb),n.icon.style.color=`var(--vscode-editorLightBulb-foreground)`),!e.item&&!e.standaloneToggle||!e.label)return;if(Dn(!e.hideIcon,n.icon),e.isSectionToggle){let t=e.group?.icon===A.chevronDown;n.container.setAttribute(`aria-expanded`,String(t))}else n.container.removeAttribute(`aria-expanded`);n.previousClassNames?.length&&n.container.classList.remove(...n.previousClassNames);let r=e.className?.split(/\s+/).filter(e=>e.length>0)??[];if(n.container.classList.toggle(`action-list-custom`,r.length>0),r.length&&n.container.classList.add(...r),n.previousClassNames=r,n.text.textContent=Gm(e.label),e.badge?(n.badge.textContent=e.badge,n.badge.style.display=``):(n.badge.textContent=``,n.badge.style.display=`none`),e.keybinding)n.description.textContent=e.keybinding.getLabel(),n.description.style.display=`inline`,n.description.style.letterSpacing=`0.5px`;else if(e.description){if(Sf(n.description),typeof e.description==`string`)n.description.textContent=Gm(e.description);else{let t=vl(e.description,{actionHandler:t=>{let n=qn.parse(t);this._linkHandler?this._linkHandler(n,e):this._openerService.open(n,{allowCommands:!0})}});n.elementDisposables.add(t),n.description.appendChild(t.element)}n.description.style.display=`inline`}else n.description.textContent=``,n.description.style.display=`none`;let i=this._groupTitleByIndex.get(t);i?(n.groupTitle.textContent=i,n.groupTitle.style.display=``):(n.groupTitle.textContent=``,n.groupTitle.style.display=`none`),e.detail?(n.detail.textContent=Gm(e.detail),n.detail.style.display=``):(n.detail.textContent=``,n.detail.style.display=`none`),n.container.classList.toggle(`has-detail`,!!e.detail),Sf(n.inlineToggleContainer);let a=e.standaloneToggle??e.inlineToggle;if(a){let t=document.createElement(`span`);t.className=`action-list-item-inline-toggle-label`,t.textContent=Gm(a.label),e.standaloneToggle||n.inlineToggleContainer.append(t),n.inlineToggleContainer.style.display=``,n.container.classList.toggle(`has-inline-toggle`,!!e.inlineToggle),n.container.classList.toggle(`has-standalone-toggle`,!!e.standaloneToggle);let r=n.elementDisposables.add(new wm({ariaLabel:a.title??a.label,checked:a.checked,disabled:a.disabled}));n.inlineToggleContainer.append(r.domNode),e.standaloneToggle&&n.elementDisposables.add(this._registerStandaloneToggle(e,r)),n.elementDisposables.add(r.onChange(()=>a.onChange(r.checked))),n.elementDisposables.add(L(n.inlineToggleContainer,El.CLICK,e=>e.stopPropagation()))}else n.inlineToggleContainer.style.display=`none`,n.container.classList.remove(`has-inline-toggle`),n.container.classList.remove(`has-standalone-toggle`);let o=this._keybindingService.lookupKeybinding(jm)?.getLabel(),s=this._keybindingService.lookupKeybinding(Mm)?.getLabel();n.container.classList.toggle(`option-disabled`,!!e.disabled),e.hover===void 0?e.tooltip?n.container.title=e.tooltip:e.disabled?n.container.title=e.label:e.standaloneToggle||this._hideDefaultKeybindingTooltip?n.container.title=``:o&&s?this._supportsPreview&&e.canPreview?n.container.title=S(1731,`{0} to Apply, {1} to Preview`,o,s):n.container.title=S(1732,`{0} to Apply`,o):n.container.title=``:n.container.title=``,Sf(n.toolbar);let c=[...e.toolbarActions??[]];if(e.onRemove&&c.push(Ro({id:Pm,label:S(1733,`Remove`),class:H.asClassName(A.close),run:async()=>{await e.onRemove(),this._onRemoveItem?.(e)}})),n.container.classList.toggle(`has-toolbar`,c.length>0),c.length>0){let t=new Lr(n.toolbar);n.elementDisposables.add(t),this._stopToolbarPointerPropagation?(n.elementDisposables.add(Su(n.toolbar,e=>{e.preventDefault(),e.stopPropagation()})),n.elementDisposables.add(L(n.toolbar,El.CLICK,e=>e.stopPropagation())),n.elementDisposables.add(L(n.toolbar,ga.Tap,e=>e.stopPropagation()))):n.elementDisposables.add(Su(n.toolbar,e=>e.preventDefault())),t.push(c,{icon:!0,label:!1}),n.elementDisposables.add(this._registerToolbar(e,t))}Rm(e)?(n.submenuIndicator.className=`action-list-submenu-indicator has-submenu `+H.asClassName(A.chevronRight),n.submenuIndicator.style.display=``,n.submenuIndicator.style.visibility=``,n.elementDisposables.add(L(n.submenuIndicator,El.CLICK,t=>{t.stopPropagation(),this._onShowSubmenu?.(e)}))):this._reservesSubmenuSpace()?(n.submenuIndicator.className=`action-list-submenu-indicator`,n.submenuIndicator.style.display=``,n.submenuIndicator.style.visibility=`hidden`):(n.submenuIndicator.className=`action-list-submenu-indicator`,n.submenuIndicator.style.display=`none`),Lm(e)?(n.container.setAttribute(`aria-haspopup`,e.hover?.expandable?`dialog`:`menu`),n.container.setAttribute(`aria-expanded`,`false`)):(n.container.removeAttribute(`aria-haspopup`),e.isSectionToggle||n.container.removeAttribute(`aria-expanded`))}disposeTemplate(e){e.keybinding.dispose(),e.elementDisposables.dispose()}};zm=Om([km(10,ba),km(11,Jt)],zm);var Bm=class extends UIEvent{constructor(){super(`acceptSelectedAction`)}},Vm=class extends UIEvent{constructor(){super(`previewSelectedAction`)}};function Hm(e){if(e.kind===`action`)return e.label}var Um=Am=class extends K{constructor(e,t,n,r,i,a,o,s,c){if(super(),this._supportsPreview=t,this._delegate=r,this._options=a,this._keybindingService=o,this._openerService=s,this._instantiationService=c,this._headerLineHeight=24,this._separatorLineHeight=8,this.cts=this._register(new Oo),this._submenuDisposables=this._register(new I),this._submenuHoverActionElements=[],this._itemMoveAnimation=this._register(new sc),this._collapsedSections=new Set,this._filterText=``,this._imeSessionInProgress=!1,this._isMeasuringWidth=!1,this._suppressHover=!1,this._hoverEnabled=!0,this._ignoreInitialHover=!0,this._hasLaidOut=!1,this._filterCts=this._register(new sc),this._groupTitleByIndex=new Map,this._standaloneToggles=new Map,this._itemToolbars=new Map,this._onDidRequestLayout=this._register(new P),this.onDidRequestLayout=this._onDidRequestLayout.event,this._visibleMenuItems=n,this._initialFocusItemId=this._options?.initialFocusItemId,this._filterText=this._options?.showFilter?this._options.initialFilterValue??``:``,this.domNode=document.createElement(`div`),this.domNode.classList.add(`actionList`),this._options?.inlineDescription&&this.domNode.classList.add(`inline-description`),this._options?.className){let e=this._options.className.split(/\s+/).filter(e=>e.length>0);e.length>0&&this.domNode.classList.add(...e)}if(this._actionLineHeight=24,this._submenuContainer=document.createElement(`div`),this._submenuContainer.className=`action-list-submenu-panel action-widget`,this._submenuContainer.style.display=`none`,this._options?.persistentHover&&(this._submenuContainer.style.boxSizing=`border-box`),this._submenuContainer.tabIndex=-1,this.domNode.append(this._submenuContainer),this._register(L(this._submenuContainer,`keydown`,e=>{if((e.key===`Enter`||e.key===` `)&&this._currentSubmenuElement?.hover?.tabThroughPanel){let t=Gi(e.target)?e.target:void 0;if(t&&this._currentSubmenuElement.hover.getTabbableElements?.().includes(t)){e.stopPropagation();return}}if(e.key!==`ArrowLeft`&&e.key!==`Escape`)return;Ts.stop(e,!0);let t=e.key===`Escape`&&this._currentSubmenuWidget!==void 0;this._hideSubmenu(),t?this.hide():(this._setKeyboardNavigation(!0),this._list.domFocus())})),this._register(L(this._submenuContainer,`mouseenter`,()=>{this._cancelSubmenuHide(),this._usesSubmenuPointerIntent()&&(this._cancelSubmenuShow(),this._resetSubmenuPointer())})),this._register(L(this._submenuContainer,`mouseleave`,()=>{this._scheduleSubmenuHide()})),this._register(L(this.domNode,El.MOUSE_LEAVE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer()})),this._usesSubmenuPointerIntent()&&this._register(L(this.domNode,El.MOUSE_MOVE,e=>{Gi(e.target)&&this._expandedTrigger?.contains(e.target)&&this._updateSubmenuPointer(e)})),this._register(Wo(()=>{this._cancelSubmenuHide(),this._cancelSubmenuShow()})),this._options?.collapsedByDefault)for(let e of this._options.collapsedByDefault)this._collapsedSections.add(e);let l={getHeight:e=>this._getItemHeight(e),getTemplateId:e=>e.kind},u=()=>{let e=this._options?.reserveSubmenuSpace??!0;return e===`always`||e&&this._allMenuItems.some(Rm)};this._list=this._register(new zo(e,this.domNode,l,[new zm(this._supportsPreview,e=>this._removeItem(e),e=>this._showSubmenuForItem(e),u,this._groupTitleByIndex,this._options?.linkHandler,this._options?.hideDefaultKeybindingTooltip??!1,this._options?.stopToolbarPointerPropagation??!1,(e,t)=>(this._standaloneToggles.set(e,t),Wo(()=>{this._standaloneToggles.get(e)===t&&this._standaloneToggles.delete(e)})),(e,t)=>(this._itemToolbars.set(e,t),this._updateToolbarFocusability(),Wo(()=>{this._itemToolbars.get(e)===t&&this._itemToolbars.delete(e)})),this._keybindingService,this._openerService),new Fm,new Im],{keyboardSupport:!1,typeNavigationEnabled:!this._options?.showFilter&&!this._options?.onType,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Hm},accessibilityProvider:{getAriaLabel:e=>{if(e.kind===`action`){let t=e.label?Gm(e?.label):``;if(e.badge&&(t=t+`, `+Gm(e.badge)),e.detail&&(t=t+`, `+Gm(e.detail)),e.ariaDescription)t=t+`, `+Gm(e.ariaDescription);else if(e.description){let n=typeof e.description==`string`?e.description:e.description.value;t=t+`, `+Gm(n)}if(e.hover?.content&&!e.ariaDescription&&!e.description){let n=e.hover.content,r=typeof n==`string`?n:Nr(n)?n.value:Gi(n)?n.textContent??void 0:void 0;r&&(!e.detail||Gm(e.detail)!==Gm(r))&&(t=t+`, `+Gm(r))}e.group?.title&&(t=t+`, `+e.group.title);let n=e.standaloneToggle??e.inlineToggle;return n&&(t=e.standaloneToggle?n.checked?S(1734,`{0}, on`,n.label):S(1735,`{0}, off`,n.label):t+`, `+(n.checked?S(1736,`{0}, on`,n.label):S(1737,`{0}, off`,n.label))),e.disabled&&(t=S(1738,`{0}, Disabled Reason: {1}`,t,e.disabled)),e.submenuActions?.length&&(t=S(1739,`{0}, use right arrow to access options`,t)),t}return null},getWidgetAriaLabel:()=>S(1740,`Action Widget`),getSetSize:()=>this._visibleMenuItems.filter(e=>e.kind===`action`).length,getPosInSet:(e,t)=>Math.max(this._visibleMenuItems.slice(0,t+1).filter(e=>e.kind===`action`).length,1),getRole:e=>{switch(e.kind){case`action`:return`option`;case`separator`:return`separator`;default:return`separator`}},getWidgetRole:()=>`listbox`,...i}})),this._list.style(Tr),this._register(this._list.onKeyDown(()=>this._setKeyboardNavigation(!0))),this._register(L(this._list.getHTMLElement(),El.MOUSE_MOVE,e=>{(e.movementX!==0||e.movementY!==0)&&this._setKeyboardNavigation(!1)})),this._register(this._list.onMouseClick(e=>this.onListClick(e))),this._register(this._list.onMouseOver(e=>{this._ignoreInitialHover||this.onListHover(e)}));let d=this._register(new sc);if(d.value=this._list.onMouseMove(e=>{(e.browserEvent.movementX!==0||e.browserEvent.movementY!==0)&&(d.clear(),this._ignoreInitialHover=!1,this.onListHover(e))}),this._register(this._list.onMouseDown(()=>{d.clear(),this._ignoreInitialHover=!1,this._setKeyboardNavigation(!1)})),this._register(this._list.onDidChangeFocus(()=>{this._updateToolbarFocusability(),this.onFocus()})),this._register(this._list.onDidChangeSelection(e=>this.onListSelection(e))),this._register(this._list.onDidScroll(()=>{this._isMeasuringWidth||this._layoutSubmenu?.()})),this._allMenuItems=[...n],this._options?.showFilter||this._options?.secondaryHeading){this._filterContainer=document.createElement(`div`),this._filterContainer.className=`action-list-filter`;let e=q(this._filterContainer,N(`.action-list-filter-row`));if(this._options?.showFilter){if(this._filterInput=document.createElement(`input`),this._filterInput.type=`text`,this._filterInput.className=`action-list-filter-input`,this._filterInput.placeholder=this._options?.filterPlaceholder??S(1741,`Search...`),this._filterInput.value=this._filterText,this._filterInput.setAttribute(`aria-label`,S(1742,`Filter items`)),e.appendChild(this._filterInput),this._register(L(this._filterInput,El.KEY_DOWN,e=>{if(this._setKeyboardNavigation(!0),e.isComposing||!this._filterInput?.closest(`.action-list-submenu-panel`))return;let t=this._keybindingService.softDispatch(new ur(e),this._filterInput);(t.kind===2&&t.commandId!==null&&Nm.has(t.commandId)||e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey)&&e.stopPropagation()})),this._register(L(this._filterInput,El.MOUSE_DOWN,()=>this._setKeyboardNavigation(!1))),this._options.tabThroughItemActions&&this._register(L(this._filterInput,`keydown`,e=>this._handleTabThroughPanelKeyDown(e),!0)),this._options.filterAsCombobox){let e=this._list.getHTMLElement();e.id=this._list.domId,this._filterInput.setAttribute(`role`,`combobox`),this._filterInput.setAttribute(`aria-label`,this._filterInput.placeholder),this._filterInput.setAttribute(`aria-autocomplete`,`list`),this._filterInput.setAttribute(`aria-expanded`,`true`),this._filterInput.setAttribute(`aria-controls`,e.id),this._register(this._list.onDidChangeFocus(()=>this._updateFilterActiveDescendant())),this._register(L(this._filterInput,`focus`,()=>this._updateFilterActiveDescendant())),this._register(L(this._filterInput,`blur`,()=>this._updateFilterActiveDescendant())),this._register(Uo(this._filterInput,`keydown`,e=>{if(this._imeSessionInProgress||e.browserEvent.isComposing||e.keyCode===114||e.keyCode===15||e.keyCode===17||e.keyCode===14||e.keyCode===13){e.stopPropagation();return}let t=e.keyCode===16||e.keyCode===18;(t||e.keyCode===3)&&(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey?t&&e.stopPropagation():(Ts.stop(e,!0),e.keyCode===16?this.focusPrevious():e.keyCode===18?this.focusNext():this.acceptSelected()))}))}let t=this._options?.filterActions??[];if(t.length>0){let n=q(e,N(`.action-list-filter-actions`));this._register(new Lr(n)).push(t,{icon:!0,label:!1})}let n=()=>{let e=this._filterInput.value;this._imeSessionInProgress||e===this._filterText&&!this._filterCts.value?.token.isCancellationRequested||(this._filterText=e,this._applyOrUpdateFilter())};this._register(L(this._filterInput,`compositionstart`,()=>{this._imeSessionInProgress=!0,this._filterCts.value?.cancel()})),this._register(L(this._filterInput,`compositionend`,()=>{this._imeSessionInProgress=!1,n()})),this._register(L(this._filterInput,`input`,n))}if(this._options?.secondaryHeading){let t=q(e,N(`.action-list-filter-label`));t.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){let e=q(this._headerContainer,N(`span.action-list-header-icon`));e.classList.add(...H.asClassNameArray(this._options.headerIcon)),e.setAttribute(`aria-hidden`,`true`)}let e=q(this._headerContainer,N(`span.action-list-header-text`));if(e.textContent=this._options.headerText,this._register(L(this._headerContainer,El.MOUSE_ENTER,()=>{this._options?.persistentHover?(this._cancelSubmenuShow(),this._resetSubmenuPointer()):this._hideSubmenu()})),this._options.headerLink){let{label:t,uri:n}=this._options.headerLink;e.textContent+=` `,this._register(this._instantiationService.createInstance(Dm,e,{label:t,href:n.toString(!0)},{}))}if(this._options.headerDismiss){let e=this._options.headerDismiss,t=q(this._headerContainer,N(`span.action-list-header-dismiss`));t.appendChild(N(H.asCSSSelector(A.close))),t.tabIndex=0,t.setAttribute(`role`,`button`),t.setAttribute(`aria-label`,S(1743,`Dismiss`));let n=()=>{e(),this.focus(),this._headerContainer?.remove(),this._headerContainer=void 0,this._onDidRequestLayout.fire()};this._register(Rl(t,()=>n())),this._register(L(t,El.KEY_DOWN,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())}))}}this._applyFilter(),this._list.length&&this._focusCheckedOrFirst(),this._register(L(this.domNode,`keydown`,e=>{if(e.key===`ArrowRight`&&!e.isComposing){let t=this._list.getFocus();if(t.length>0){let n=this._list.element(t[0]);if(n?.submenuActions?.length||n?.hover?.expandable){Ts.stop(e,!0);let r=this._getRowElement(t[0]);r&&(this._showSubmenuForElement(n,r),n.hover?.tabThroughPanel?this._focusFirstTabThroughPanelControl(n,r):this._currentSubmenuWidget?this._currentSubmenuWidget.focus():this._submenuContainer.focus())}}}})),this._register(L(this.domNode,`keydown`,e=>this._handleTabThroughPanelKeyDown(e),!0)),(this._filterInput||this._options?.onType)&&this._register(L(this.domNode,`keydown`,e=>{let t=e.target;(this._options?.onType||this._options?.filterAsCombobox)&&Gi(t)&&(kr(t)||t.closest(`button, a, [contenteditable="true"], .action-list-submenu-panel`))||(!this._filterInput||!Si(this._filterInput))&&!e.isComposing&&e.key.length===1&&e.key!==` `&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),e.stopPropagation(),this._filterInput?(this._filterInput.focus(),this._filterInput.value=e.key,this._filterText=e.key,this._applyOrUpdateFilter()):this._options?.onType?.(e.key))}))}_toggleSection(e){let t=this._collapsedSections.has(e);if(t)this._collapsedSections.delete(e);else{this._collapsedSections.add(e);let t=this.getFocusedElement();if(t?.section===e&&!t.isSectionToggle){let t=this._visibleMenuItems.findIndex(t=>t.section===e&&t.isSectionToggle);t>=0&&this._list.setFocus([t])}}this._options?.onDidToggleSection?.(e,this._collapsedSections.has(e)),this._applyFilter(),t&&this._revealFirstItemOfSection(e)}_revealFirstItemOfSection(e){for(let t=0;t<this._list.length;t++){let n=this._list.element(t);if(n.section===e&&!n.isSectionToggle){this._list.reveal(t);return}}}_applyOrUpdateFilter(){if(!this._delegate.onFilter){this._applyFilter();return}let e=this._filterText;this._filterCts.value?.cancel();let t=new Oo;this._filterCts.value=t,this._delegate.onFilter(e,t.token).then(e=>{t.token.isCancellationRequested||(this._allMenuItems=[...e],this._applyFilter(!0))}).catch(()=>{}).finally(()=>{this._filterCts.value===t&&!t.token.isCancellationRequested&&this._filterCts.clear()})}_applyFilter(e=!1,t=!0,n){this._itemMoveAnimation.clear();let r=e?``:this._filterText.toLowerCase(),i=!e&&r.length>0,a=[],o=this._list.getFocus(),s;if(o.length>0&&(s=this._list.element(o[0])),i){let e,t=[],n=!1,i=()=>{e&&n&&a.push(e),a.push(...t),e=void 0,t=[],n=!1},o=e=>{let t=(e.label??``).toLowerCase(),n=typeof e.description==`string`?e.description:e.description?.value??``;return t.includes(r)||n.toLowerCase().includes(r)};for(let r of this._allMenuItems)if(r.kind!==`header`){if(r.kind===`separator`)i(),e=r.label?r:void 0;else if(r.showAlways)t.push(r);else if(!r.isSectionToggle){if(r.filterItems){let e=o(r)?r.filterItems:r.filterItems.filter(o);e.length>0&&(n=!0,t.push(...e))}else o(r)&&(n=!0,t.push(r))}}i()}else for(let e of this._allMenuItems)if(e.kind===`header`)a.push(e);else if(e.kind===`separator`){if(e.section&&this._collapsedSections.has(e.section))continue;a.push(e)}else if(e.isSectionToggle&&e.section){let t=this._collapsedSections.has(e.section);a.push({...e,group:{...e.group,icon:t?A.chevronRight:A.chevronDown}})}else e.section&&this._collapsedSections.has(e.section)||a.push(e);let c=[],l=!1;for(let e=0;e<a.length;e++)c[e]=l,a[e].kind===`action`&&(l=!0);let u=[],d=!1;for(let e=a.length-1;e>=0;e--)a[e].kind===`action`?d=!0:a[e].kind===`separator`&&(u[e]=d,d=!1);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.kind!==`separator`)continue;let n=u[e],r=!t.label&&!c[e];(!n||r)&&a.splice(e,1)}this._options?.showGroupTitleOnFirstItem&&this._recomputeGroupTitles(a);let f=this._filterInput&&Si(this._filterInput),p=Yn(this._list.getHTMLElement());if(this._visibleMenuItems=a,this._list.splice(0,this._list.length,a),t&&this._onDidRequestLayout.fire(),f)this._filterInput?.focus(),this._focusCheckedOrFirst();else if(this._hasLaidOut&&(s||n)){let e=n??s?.item?.id;if(e){for(let t=0;t<this._list.length;t++)if(this._list.element(t).item?.id===e){this._list.setFocus([t]),this._list.reveal(t);break}p&&(this._focusCheckedOrFirst(),this._list.domFocus())}}}get filterContainer(){return this._filterContainer}get footerContainer(){return this._footerContainer}get headerContainer(){return this._headerContainer}get filterInput(){return this._filterInput}get closeAnimation(){return this._options?.closeAnimation}focusCondition(e){return!e.disabled&&e.kind===`action`}_setKeyboardNavigation(e){if(this._keyboardNavigation===e)return;this._keyboardNavigation=e;let t=this._list.getHTMLElement();t.classList.toggle(`keyboard-navigation`,e===!0),t.classList.toggle(`mouse-navigation`,e===!1)}_updateFilterActiveDescendant(){if(!this._filterInput)return;let[e]=this._list.getFocus();Si(this._filterInput)&&e!==void 0?this._filterInput.setAttribute(`aria-activedescendant`,this._list.getElementID(e)):this._filterInput.removeAttribute(`aria-activedescendant`)}focus(){this._setKeyboardNavigation(void 0),this._filterInput&&this._options?.focusFilterOnOpen?(this._filterInput.focus(),this._focusCheckedOrFirst()):(this._list.domFocus(),this._focusCheckedOrFirst(),this._showTabThroughPanelForFocusedItem())}clearFocus(){this._list.setFocus([])}getFocusedElement(){let e=this._list.getFocus();if(e.length>0)return this._list.element(e[0])}_updateToolbarFocusability(){if(!this._options?.tabThroughItemActions)return;let[e]=this._list.getFocus(),t=e!==void 0&&e<this._list.length?this._list.element(e):void 0;for(let[e,n]of this._itemToolbars)n.setFocusable(e===t)}_focusCheckedOrFirst(){let e=this._suppressHover;this._suppressHover=!0;try{let e=this._initialFocusItemId;if(this._initialFocusItemId=void 0,e)for(let t=0;t<this._list.length;t++){let n=this._list.element(t);if(this.focusCondition(n)&&n.item?.id===e){this._list.setFocus([t]),this._list.reveal(t);return}}let[t]=this._list.getFocus();if(t!==void 0){let e=this._list.element(t);if(e&&this.focusCondition(e)){this._list.reveal(t);return}}for(let e=0;e<this._list.length;e++){let t=this._list.element(e);if(this.focusCondition(t)&&t.item?.checked){this._list.setFocus([e]),this._list.reveal(e);return}}this._list.focusFirst(void 0,this.focusCondition);let n=this._list.getFocus();n.length>0&&this._list.reveal(n[0])}finally{this._suppressHover=e,this._options?.filterAsCombobox&&this._updateFilterActiveDescendant()}}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){return this._itemHeightWith(e,this._options)}_itemHeightWith(e,t){switch(e.kind){case`header`:return this._headerLineHeight;case`separator`:return e.label?this._actionLineHeight:this._separatorLineHeight;default:return e.inlineToggle?t?.inlineToggleItemHeight??70:e.detail?t?.detailItemHeight??48:this._actionLineHeight}}computeFullHeight(){return this.computeHeightForItems(this._allMenuItems,void 0,this._options)}computeHeightForItems(e,t,n){let r=0;for(let i of e)t&&i.section&&!i.isSectionToggle&&t.has(i.section)||(r+=this._itemHeightWith(i,n));return r}computeListHeight(){let e=this._list.length,t=0;for(let n=0;n<e;n++){let e=this._list.element(n);t+=this._getItemHeight(e)}return t}layout(e,t){this._hasLaidOut=!0,this._list.layout(e,t),this.domNode.style.height=`${e}px`;let n=this.domNode.parentElement;n&&this._filterContainer?.parentElement===n&&n.insertBefore(this._filterContainer,this.domNode),this._layoutSubmenu?.()}computeMaxWidth(e){let t=this._list.length,n=Math.max(e,this._options?.minWidth??0),r=this._options?.maxWidth??1/0,i=Math.max(r,n),a=e=>Math.min(Math.max(e,n),i),o=this._allMenuItems.length;if(o>=50)return a(380);if(o>t){let e=[];for(let n=0;n<t;n++)e.push(this._list.element(n));let n=this._list.renderHeight,r=this._list.scrollTop,i=this._list.getFocus(),o=this._isMeasuringWidth;this._isMeasuringWidth=!0;try{let e=[...this._allMenuItems];this._list.splice(0,t,e);let n=0;for(let t of e)n+=this._getItemHeight(t);this._list.layout(n);let r=this._measureItemWidths(e);return a(Math.max(...r))}finally{try{this._list.splice(0,this._list.length,e),this._list.layout(n),this._list.scrollTop=r;let t=this._suppressHover;this._suppressHover=!0;try{this._list.setFocus(i)}finally{this._suppressHover=t}}finally{this._isMeasuringWidth=o}}}let s=[];for(let e=0;e<t;e++)s.push(this._list.element(e));let c=this._measureItemWidths(s);return a(Math.max(...c))}focusPrevious(){if(this._setKeyboardNavigation(!0),this._focusFilterResult(`previous`))return;if(this._filterInput&&Si(this._filterInput)){this._list.domFocus();let e=this._list.getFocus();if(e.length>0){this._list.focusPrevious(1,!1,void 0,this.focusCondition);let t=this._list.getFocus();t.length>0&&t[0]>=e[0]?this._filterInput.focus():t.length>0&&this._list.reveal(t[0])}else{this._list.focusLast(void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}return}let e=this._list.getFocus();this._list.focusPrevious(1,!0,void 0,this.focusCondition);let 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._setKeyboardNavigation(!0),this._focusFilterResult(`next`))return;if(this._filterInput&&Si(this._filterInput)){if(this._list.domFocus(),this._list.getFocus().length>0){this._list.focusNext(1,!1,void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}else{this._list.focusFirst(void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}return}let e=this._list.getFocus();this._list.focusNext(1,!0,void 0,this.focusCondition);let 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])}}_focusFilterResult(e){if(!this._options?.filterAsCombobox||!this._filterInput||!Si(this._filterInput))return!1;e===`previous`?this._list.focusPrevious(1,!0,void 0,this.focusCondition):this._list.focusNext(1,!0,void 0,this.focusCondition);let[t]=this._list.getFocus();return t!==void 0&&this._list.reveal(t),!0}collapseFocusedSection(){let e=this._getFocusedSection();e&&!this._collapsedSections.has(e)&&this._toggleSection(e)}expandFocusedSection(){let e=this._getFocusedSection();e&&this._collapsedSections.has(e)&&this._toggleSection(e)}toggleFocusedSection(){let e=this._list.getFocus();if(e.length===0)return!1;let t=this._list.element(e[0]);return t.isSectionToggle&&t.section?(this._toggleSection(t.section),!0):!1}_getFocusedSection(){let e=this._list.getFocus();if(e.length===0)return;let t=this._list.element(e[0]);return t.isSectionToggle&&t.section,t.section}acceptSelected(e){let t=this._list.getFocus();if(t.length===0)return;let n=t[0],r=this._list.element(n);if(!this.focusCondition(r))return;let i=e?new Vm:new Bm;this._list.setSelection([n],i)}onListSelection(e){if(!e.elements.length)return;let t=e.elements[0];if(t.standaloneToggle){this._list.setSelection([]);let e=this._standaloneToggles.get(t);e&&!e.disabled&&(e.checked=!e.checked,t.standaloneToggle.onChange(e.checked));return}if(t.isSectionToggle&&t.section){this._list.setSelection([]);let e=t.section;queueMicrotask(()=>{this._toggleSection(e)});return}let n=Pf(e.browserEvent)||e.browserEvent?.type===ga.Tap;if(n){let t=e.browserEvent.target;if(Gi(t)&&(t.closest(`.action-list-item-toolbar`)||t.closest(`.action-list-submenu-indicator`)||t.closest(`.action-list-item-inline-toggle`))){this._list.setSelection([]);return}}if(t.openSubmenuOnClick&&t.submenuActions?.length&&(n||e.browserEvent instanceof Bm))this._list.setSelection([]),this._showSubmenuForItem(t),n||this._currentSubmenuWidget?.focus();else if(t.item&&this.focusCondition(t)){let n=e.browserEvent instanceof Vm;this._delegate.onSelect(t.item,n&&this._supportsPreview)}else this._list.setSelection([])}onFocus(){let e=this._list.getFocus();if(e.length===0)return;let t=e[0],n=this._list.element(t);this._delegate.onFocus?.(n.item),this._suppressHover||(this._options?.persistentHover&&(this._cancelSubmenuShow(),this._resetSubmenuPointer(),this._list.reveal(t)),this._showHoverForElement(n,t))}_removeItem(e){let t=this._allMenuItems.indexOf(e);t>=0&&(this._allMenuItems.splice(t,1),this._applyFilter())}_recomputeGroupTitles(e){this._groupTitleByIndex.clear();let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];r.kind===`action`&&r.group?.title&&!t.has(r.group.title)&&(t.add(r.group.title),this._groupTitleByIndex.set(n,r.group.title))}}_measureItemWidths(e){let t=[];for(let n=0;n<e.length;n++){let r=this._getRowElement(n);r&&(r.style.width=`auto`,t.push({element:r,item:e[n]}))}try{return t.map(({element:e,item:t})=>e.getBoundingClientRect().width+(t.detail?0:this._computeToolbarWidth(t)))}finally{for(let{element:e}of t)e.style.width=``}}_computeToolbarWidth(e){let t=e.toolbarActions?.length??0;return e.onRemove&&t++,t===0?0:t*22+6+10}_getRowElement(e){return e<0?null:this.domNode.ownerDocument.getElementById(this._list.getElementID(e))}_showTabThroughPanelForFocusedItem(){let e=this._list.getFocus();if(e.length===0)return;let t=e[0],n=this._list.element(t);if(!n.hover?.tabThroughPanel)return;let r=this._getRowElement(t);r&&this._showSubmenuForElement(n,r)}_getTabThroughPanelControls(e,t){return e.hover?.tabThroughPanel&&this._currentSubmenuElement!==e&&this._showSubmenuForElement(e,t),{toolbar:this._itemToolbars.get(e),panelControls:[...e.hover?.getTabbableElements?.()??[],...this._submenuHoverActionElements]}}_focusFirstTabThroughPanelControl(e,t){let n=this._getTabThroughPanelControls(e,t);n.toolbar?.length()?n.toolbar.focus(0):(n.panelControls[0]??this._list.getHTMLElement()).focus()}_handleTabThroughPanelKeyDown(e){if(e.isComposing)return;let t=this._list.getFocus();if(t.length===0)return;let n=t[0],r=this._list.element(n);if(!r.hover?.tabThroughPanel&&!this._options?.tabThroughItemActions)return;let i=this._getRowElement(n),a=uf();if(!i||!Gi(a))return;let o=this._getTabThroughPanelControls(r,i),s=o.toolbar?.isFocused()??!1,c=this._submenuContainer.contains(a);if((e.key===`ArrowUp`||e.key===`ArrowDown`)&&(s||c)){Ts.stop(e,!0),this._list.domFocus(),e.key===`ArrowUp`?this.focusPrevious():this.focusNext();return}if(e.key!==`Tab`||e.ctrlKey||e.metaKey||e.altKey)return;let l;if(e.shiftKey){if(c){let t=o.panelControls.indexOf(a);if(t>0)l=o.panelControls[t-1];else if(o.toolbar?.length()){Ts.stop(e,!0),o.toolbar.focus(o.toolbar.length()-1);return}else l=this._list.getHTMLElement()}else if(o.toolbar?.isFocused()){let t=o.toolbar.viewItems.findIndex((e,t)=>o.toolbar?.isFocused(t));if(t>0){Ts.stop(e,!0),o.toolbar.focus(t-1);return}l=this._options?.filterAsCombobox?this._filterInput:this._list.getHTMLElement()}}else if(a===this._list.getHTMLElement()||a===this._filterInput){if(o.toolbar?.length()){Ts.stop(e,!0),o.toolbar.focus(0);return}l=o.panelControls[0]}else if(o.toolbar?.isFocused()){let t=o.toolbar.viewItems.findIndex((e,t)=>o.toolbar?.isFocused(t));if(t+1<o.toolbar.length()){Ts.stop(e,!0),o.toolbar.focus(t+1);return}l=o.panelControls[0]}else{let e=o.panelControls.indexOf(a);e>=0&&(l=o.panelControls[e+1]??this._list.getHTMLElement())}l&&(Ts.stop(e,!0),l.focus())}_showHoverForElement(e,t){if(this._currentSubmenuElement===e)return;let n=!!e.hover?.content,r=!!e.submenuActions?.length;if(n||r){let n=this._getRowElement(t);n&&this._showSubmenuForElement(e,n)}else this._options?.persistentHover||this._hideSubmenu()}_showSubmenuForItem(e){let t=this._list.indexOf(e);if(t>=0){let n=this._getRowElement(t);n&&this._showSubmenuForElement(e,n)}}_showSubmenuForElement(e,t){if(!this._hoverEnabled||this._currentSubmenuElement===e)return;this._currentSubmenuElement=e,this._clearSubmenuContainer(),t.setAttribute(`aria-expanded`,`true`),this._expandedTrigger=t,this._submenuPanelClassName=e.hover?.panelClassName,this._submenuPanelClassName&&this._submenuContainer.classList.add(this._submenuPanelClassName);let n=e.hover?.preserveVerticalPosition,r=!!e.submenuActions?.length,i=n?N(`.action-list-submenu-content`):this._submenuContainer,a=n?N(`.action-list-submenu-viewport`,void 0,i):void 0,o=a&&!r?this._submenuDisposables.add(new ia(a,{horizontal:2,vertical:1,consumeMouseWheelIfScrollbarIsNeeded:!0,useShadows:!1})):void 0;o&&a?(this._submenuContainer.appendChild(o.getDomNode()),this._submenuDisposables.add(L(a,El.SCROLL,()=>o.scanDomNode())),this._submenuDisposables.add(L(this._submenuContainer,El.KEY_DOWN,e=>{let t=new ur(e);(t.equals(12)||t.equals(11))&&(Ts.stop(e,!0),o.setScrollPosition({scrollTop:o.getScrollPosition().scrollTop+(t.equals(12)?1:-1)*a.clientHeight}))}))):a&&this._submenuContainer.appendChild(a);let s,c=typeof e.hover?.content==`function`?e.hover.content():e.hover?.content;if(c){if(Gi(c))s=c,e.hover?.disposable&&this._register(e.hover.disposable);else{let t=typeof c==`string`?new Ei(c):c,n=this._options?.linkHandler,r=vl(t,{actionHandler:t=>{let r=qn.parse(t);n?n(r,e):this._openerService.open(r,{allowCommands:!0})}});this._submenuDisposables.add(r),s=r.element}s.classList.add(`action-list-submenu-hover-header`),s.classList.toggle(`content-owns-padding`,e.hover?.contentOwnsPadding===!0),e.submenuActions?.length&&s.classList.add(`has-submenu`),i.appendChild(s)}if(e.hover?.actions?.length){let t=N(`.hover-row.status-bar`),n=q(t,N(`.actions`));for(let t of e.hover.actions){let e=this._keybindingService.lookupKeybinding(t.commandId),r=this._submenuDisposables.add(uo.render(n,{label:t.label,commandId:t.commandId,run:e=>t.run(e),iconClass:t.iconClass},e?.getLabel()??null));this._submenuHoverActionElements.push(r.actionContainer)}this._submenuContainer.appendChild(t)}this._submenuContainer.style.display=``,this._submenuContainer.style.position=`absolute`,e.hover?.expandable?(this._submenuContainer.setAttribute(`role`,`dialog`),e.label&&this._submenuContainer.setAttribute(`aria-label`,e.label)):this._submenuContainer.removeAttribute(`role`);let l=rl(this.domNode),u=0,d=s?s.offsetWidth:0,f;if(r){let t=this._createSubmenuItems(e.submenuActions),n=this._submenuDisposables.add(this._instantiationService.createInstance(Am,`submenu`,!1,t,{onHide:()=>{},onSelect:e=>{e.run();let t=this._currentSubmenuElement?.item;this._hideSubmenu(),t&&this._delegate.onSelect(t),this.hide()}},void 0,e.submenuOptions));f=n,n.headerContainer&&i.appendChild(n.headerContainer),n.filterContainer&&i.appendChild(n.filterContainer),i.appendChild(n.domNode),n.footerContainer&&i.appendChild(n.footerContainer),this._currentSubmenuWidget=n,n.clearFocus(),u=n.computeListHeight(),n.layout(u);let r=n.computeMaxWidth(0);d=Math.max(d,r,n.footerContainer?.offsetWidth??0),n.layout(u,d),n.domNode.style.width=`${d}px`,e.submenuOptions&&(this._submenuContainer.style.boxSizing=`border-box`,this._submenuContainer.style.width=`${d+10}px`),this._submenuDisposables.add(n.onDidRequestLayout(()=>{u=n.computeListHeight(),n.layout(u,d),this._layoutSubmenu?.()})),this._submenuDisposables.add(L(i,`keydown`,e=>{e.key===`Escape`?(Ts.stop(e,!0),this._hideSubmenu(),this.hide()):e.key===`ArrowLeft`?(Ts.stop(e,!0),this._hideSubmenu(),this._setKeyboardNavigation(!0),this._list.domFocus()):e.key===`Enter`||e.key===` `?(Ts.stop(e,!0),n.acceptSelected()):e.key===`ArrowDown`?(Ts.stop(e,!0),n.focusNext()):e.key===`ArrowUp`&&(Ts.stop(e,!0),n.focusPrevious())}))}let p,m,h=()=>{let e=this._currentSubmenuElement;if(!e||this._layoutSubmenu!==h)return;let t=this._list.indexOf(e),r=t>=0?this._getRowElement(t):null,s=this._options?.persistentHover;if(!r&&(!s||!this._allMenuItems.includes(e))){this._hideSubmenu();return}this._expandedTrigger!==r&&(this._expandedTrigger?.hasAttribute(`aria-expanded`)&&this._expandedTrigger.setAttribute(`aria-expanded`,`false`),this._expandedTrigger=r??void 0),r?.setAttribute(`aria-expanded`,`true`);let c=this.domNode.getBoundingClientRect(),g=s||e.hover?.alignToParent,_=g?this.domNode.parentElement?.closest(`.action-widget`)?.getBoundingClientRect()??c:c,v=r?.getBoundingClientRect()??_,y=g||n?nn(this.domNode):1;s&&(this._submenuContainer.style.width=`${_.width/y}px`);let b=this._submenuContainer.getBoundingClientRect(),ee=g?b.width:d+10,te=l.innerWidth-(g?_.right:v.right),ne=_.left,re=g?0:4;if(!g){let e=l.innerWidth-8;ee>e&&(ee=Math.max(e,0)),this._submenuContainer.style.boxSizing=`border-box`,this._submenuContainer.style.width=`${ee}px`}let ie=te>=ee||te>=ne;s&&this._submenuSide&&(this._submenuSide===`right`?te:ne)>=ee&&(ie=this._submenuSide===`right`),s&&(this._submenuSide=ie?`right`:`left`);let ae=ie?_.right-c.left+re:_.left-c.left-ee-re,oe=c.left+ae;oe<4?ae+=4-oe:oe+ee>l.innerWidth-4&&(ae-=oe+ee-(l.innerWidth-4)),this._submenuContainer.style.left=`${ae/y}px`;let se=b.height;n&&(p??=se/y);let ce=p===void 0?se:p*y,le=m===void 0?r&&e.hover?.alignToAnchorTop?v.top-c.top:r?v.top-c.top+(v.height-ce)/2:b.top-c.top:m*y;if(n&&e.hover?.alignToAnchorTop&&a&&f){let e=b.height-a.getBoundingClientRect().height+((f.headerContainer?.offsetHeight??0)+(f.filterContainer?.offsetHeight??0)+(f.footerContainer?.offsetHeight??0)+u)*y;le=Math.min(le,l.innerHeight-c.top-e-8)}let ue=c.top+le+ce;if(ue>l.innerHeight&&!(n&&e.hover?.alignToAnchorTop)&&(le-=ue-l.innerHeight+8),c.top+le<0&&(le=-c.top),n&&(m??=le/y),a&&o){let e=(b.height-o.getDomNode().getBoundingClientRect().height)/y,t=Math.max(0,(l.innerHeight-c.top-le-8)/y-e);a.style.height=`${Math.min(i.getBoundingClientRect().height/y,t)}px`,o.scanDomNode()}else if(a&&f){let e=(b.height-a.getBoundingClientRect().height)/y,t=Math.max(0,(l.innerHeight-c.top-le-8)/y-e),n=(f.headerContainer?.offsetHeight??0)+(f.filterContainer?.offsetHeight??0)+(f.footerContainer?.offsetHeight??0),r=u===0?0:Math.max(this._actionLineHeight,Math.min(u,t-n));f.layout(r,d),a.style.height=`${n+r}px`}this._submenuContainer.style.top=`${le/y}px`};if(this._layoutSubmenu=h,h(),(this._options?.persistentHover||e.hover?.alignToParent||e.hover?.tabThroughPanel||n)&&this._currentSubmenuElement===e){if(!f){let e=this._submenuDisposables.add(new sc),t=this._submenuDisposables.add(new id(`ActionListWidget.hoverPanel`,()=>{e.value||=Ya(l,()=>{e.clear(),h()})},l));this._submenuDisposables.add(t.observe(n?i:this._submenuContainer,{box:`border-box`}))}(this._options?.persistentHover||n)&&this._submenuDisposables.add(L(l,El.RESIZE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer(),h()}))}}_createSubmenuItems(e){let t=[],n=e.filter(e=>e instanceof mo).filter(e=>e.actions.length>0);for(let e=0;e<n.length;e++){let r=n[e];r.label&&t.push({kind:`header`,group:{title:r.label},label:r.label});for(let e of r.actions){let n=e,r=n.icon??H.fromId(e.checked?A.check.id:A.blank.id),i=n.hoverContent,a=i?new Ei().appendText(`${e.label}\n`).appendMarkdown(i):void 0;t.push({item:e,kind:`action`,label:e.label,description:e.tooltip&&e.tooltip!==e.label?e.tooltip:void 0,group:{title:``,icon:r},hideIcon:!1,hover:a?{content:a}:void 0,tooltip:e.tooltip||e.label,onRemove:n.onRemove,submenuActions:e instanceof mo?[new mo(e.id,``,e.actions)]:void 0})}e<n.length-1&&t.push({kind:`separator`,label:``})}for(let n of e)if(!(n instanceof mo)){let e=n,r=e.icon??H.fromId(n.checked?A.check.id:A.blank.id),i=e.hoverContent,a=i?new Ei().appendText(`${n.label}\n`).appendMarkdown(i):void 0;t.push({item:n,kind:`action`,label:n.label,description:n.tooltip&&n.tooltip!==n.label?n.tooltip:void 0,group:{title:``,icon:r},hideIcon:!1,hover:a?{content:a}:void 0,tooltip:n.tooltip||n.label,onRemove:e.onRemove})}return t}_hideSubmenu(){this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._currentSubmenuElement=void 0,this._submenuSide=void 0,this._clearSubmenuContainer(),this._submenuContainer.style.display=`none`}_clearSubmenuContainer(){this._layoutSubmenu=void 0,this._resetSubmenuPointer(),this._submenuContainer.contains(uf())&&this._list.domFocus(),this._submenuDisposables.clear(),this._currentSubmenuWidget=void 0,this._submenuHoverActionElements=[],this._submenuPanelClassName&&=(this._submenuContainer.classList.remove(this._submenuPanelClassName),void 0),this._submenuContainer.removeAttribute(`role`),this._submenuContainer.removeAttribute(`aria-label`),this._expandedTrigger?.hasAttribute(`aria-expanded`)&&this._expandedTrigger.setAttribute(`aria-expanded`,`false`),this._expandedTrigger=void 0,Sf(this._submenuContainer),this._submenuContainer.style.width=``,this._submenuContainer.style.boxSizing=this._options?.persistentHover?`border-box`:``}_scheduleSubmenuHide(){this._cancelSubmenuHide(),!this._options?.persistentHover&&(this._submenuHideTimeout=setTimeout(()=>{this._hideSubmenu()},300))}_cancelSubmenuHide(){this._submenuHideTimeout!==void 0&&(clearTimeout(this._submenuHideTimeout),this._submenuHideTimeout=void 0)}_scheduleSubmenuShow(e,t){this._cancelSubmenuShow();let n=this._options?.submenuHoverDelay??500;if(this._usesSubmenuPointerIntent()){n=0;let e=this._submenuPointerOrigin;if(e&&t.clientX!==e.x&&this._currentSubmenuElement&&new Ls(e.x,e.y,this._submenuContainer).contains(t.clientX,t.clientY)){let e=Date.now();this._submenuPointerGraceDeadline??=e+200,n=Math.max(0,this._submenuPointerGraceDeadline-e)}}let r=()=>{this._submenuShowTimeout=void 0;let n=this._list.indexOf(e),r=n>=0?this._getRowElement(n):null;r&&(this._showSubmenuForElement(e,r),this._usesSubmenuPointerIntent()&&this._updateSubmenuPointer(t))};n===0?r():this._submenuShowTimeout=setTimeout(r,n)}_updateSubmenuPointer(e){this._submenuPointerOrigin={x:e.clientX,y:e.clientY},this._submenuPointerGraceDeadline=void 0}_resetSubmenuPointer(){this._submenuPointerOrigin=void 0,this._submenuPointerGraceDeadline=void 0}_usesSubmenuPointerIntent(){return this._options?.persistentHover===!0||this._options?.submenuPointerIntent===!0}_cancelSubmenuShow(){this._submenuShowTimeout!==void 0&&(clearTimeout(this._submenuShowTimeout),this._submenuShowTimeout=void 0)}async onListHover(e){this._setKeyboardNavigation(!1);let t=e.element;if(t&&t.item&&this.focusCondition(t)){let n=typeof e.index==`number`?[e.index]:[],r=uf();if(this._options?.tabThroughItemActions&&this._list.getFocus()[0]!==e.index&&Gi(r)&&this.domNode.contains(r)&&r.closest(`.action-list-item-toolbar`)&&this._list.domFocus(),Gi(e.browserEvent.target)&&e.browserEvent.target.closest(`.action-list-item-toolbar`)!==null){t.submenuActions?.length||this._cancelSubmenuShow(),this._list.setFocus(this._options?.tabThroughItemActions?n:[]);return}let i=!!(t.submenuActions?.length||t.hover?.content),a=this._suppressHover;(i||this._usesSubmenuPointerIntent())&&(this._suppressHover=!0);try{this._list.setFocus(n)}finally{this._suppressHover=a}if(i){this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._usesSubmenuPointerIntent()&&this._updateSubmenuPointer(e.browserEvent)):(this._usesSubmenuPointerIntent()||this._hideSubmenu(),this._scheduleSubmenuShow(t,e.browserEvent));return}if(this._currentSubmenuElement===t?this._cancelSubmenuHide():(this._cancelSubmenuShow(),this._options?.submenuPointerIntent?this._scheduleSubmenuHide():this._options?.persistentHover||this._hideSubmenu()),this._delegate.onHover&&!t.disabled&&t.kind===`action`&&this._currentSubmenuElement!==t){let n=await this._delegate.onHover(t.item,this.cts.token),r=n?n.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._options?.persistentHover||this._hideSubmenu(),this._scheduleSubmenuShow(t,e.browserEvent)))}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Um=Am=Om([km(6,ba),km(7,Jt),km(8,W)],Um);var Wm=class extends K{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 closeAnimation(){return this._widget.closeAnimation}get widgetClassName(){return this._widgetClassName}get anchorPosition(){if(this._preferredAnchorPosition!==void 0)return this._preferredAnchorPosition;if(this._showAbove!==void 0)return+!!this._showAbove}constructor(e,t,n,r,i,a,o,s,c,l){super(),this._contextViewService=s,this._layoutService=c,this._lastMinWidth=0,this._hasLaidOut=!1,this._anchor=o,this._preferredAnchorPosition=a?.anchorPosition,this._useFullHeight=a?.useFullHeight??!1,this._widgetClassName=a?.widgetClassName,this._widget=this._register(l.createInstance(Um,e,t,n,r,i,a)),this._register(this._widget.onDidRequestLayout(()=>{this._hasLaidOut&&(this.layout(this._lastMinWidth),this._contextViewService.layout())}))}focus(){this._widget.focus()}hide(e,t=!0){this._widget.hide(e),t&&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(){let e=this.domNode.parentElement?.closest(`.action-widget`);if(!e)return 0;let t=rl(e).getComputedStyle(e),n=e=>Number.parseFloat(e)||0;return n(t.paddingTop)+n(t.paddingBottom)+n(t.borderTopWidth)+n(t.borderBottomWidth)}computeHeight(){let e=this._fixedContentHeight??this._widget.computeListHeight(),t=this._widget.filterContainer?36:0,n=this._widget.footerContainer?32:0,r=this._widget.headerContainer&&!this._widget.headerContainer.hidden?this._widget.headerContainer.offsetHeight||36:0,i=t+n+r,a=rl(this.domNode),o;if(this.hasDynamicHeight()||this._preferredAnchorPosition!==void 0){let e=a.innerHeight,t=tf(this._anchor),n=t.top-a.pageYOffset,r=e-n-t.height-30,s=n;if(this._showAbove===void 0){let e=this._fixedContentHeight??this._widget.computeFullHeight();this._showAbove=this._preferredAnchorPosition===void 0?i+e>r&&s>r:this._preferredAnchorPosition===1}o=Math.max(0,(this._showAbove?s:r)-this.computeActionWidgetVerticalChromeHeight())}else{let e=this._layoutService.getContainer(a).clientHeight,t=this.domNode.getBoundingClientRect().top;o=t>0?e-t-10:e*.7}let s=this._useFullHeight?a.innerHeight:Math.floor(a.innerHeight*.6),c=this._widget.lineHeight;if(this._preferredAnchorPosition!==void 0){let t=Math.min(o,s),n=Math.min(e+i,Math.max(0,t));return Math.max(0,n-i)}let l=Math.min(Math.max(o,c*3+i),s);return Math.min(e+i,l)-i}layout(e,t){this._hasLaidOut=!0,this._lastMinWidth=e,t!==void 0&&(this._fixedContentHeight=t);let n=this.computeHeight();this._widget.layout(n);let r=this._widget.computeMaxWidth(e);return this._cachedMaxWidth=r,this._widget.layout(n,this._cachedMaxWidth),this._cachedMaxWidth}};Wm=Om([km(7,Sd),km(8,It),km(9,W)],Wm);function Gm(e){return e.replace(/\r\n|\r|\n/g,` `)}var Km=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},qm=function(e,t){return function(n,r){t(n,r,e)}};k(`actionBar.toggledBackground`,qi,S(1744,`Background color for toggled action items in action bar.`));var Jm=`--action-widget-close-start-opacity`,Ym=`--action-widget-close-start-transform`,Xm={Visible:new M(`codeActionMenuVisible`,!1,S(1745,`Whether the action widget list is visible`)),FilterFocused:new M(`codeActionMenuFilterFocused`,!1,S(1746,`Whether the action widget filter input is focused`))},Zm=Zl(`actionWidgetService`),Qm=class extends K{get isVisible(){return Xm.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new sc),this._closeAnimation=this._register(new sc)}show(e,t,n,r,i,a,o,s,c){let l=Xm.Visible.bindTo(this._contextKeyService),u=this._instantiationService.createInstance(Wm,e,t,n,r,s,c,i);this._contextViewService.showContextView({getAnchor:()=>i,render:e=>(l.set(!0),this._renderWidget(e,u,o??[],c)),onHide:e=>{l.reset(),this._onWidgetClosed(e)},get anchorPosition(){return u.anchorPosition},focus:()=>u.focus()},a,!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){let t=this._list.value,n=this._widgetElement;if(!t||this._closingList===t)return;let r=t.closeAnimation;if(!n||!r||r.duration<=0||!this._hasRequiredAncestorClasses(n,r.requiredAncestorClasses)){this._closingList=t,t.hide(e);return}this._closingList=t;let i=rl(n).getComputedStyle(n);n.style.setProperty(Jm,i.opacity),n.style.setProperty(Ym,i.transform),n.classList.add(r.className),t.hide(e,!1),this._closeAnimation.value=Va(()=>{this._list.value===t&&this._contextViewService.hideContextView(e)},r.duration)}clear(){this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement?.style.removeProperty(Jm),this._widgetElement?.style.removeProperty(Ym),this._widgetElement=void 0,this._list.clear()}_renderWidget(e,t,n,r){let i=document.createElement(`div`);i.classList.add(`action-widget`);let a=t.widgetClassName?.split(/\s+/).filter(Boolean);if(a?.length&&i.classList.add(...a),e.appendChild(i),this._widgetElement=i,this._list.value=t,this._list.value)this._list.value.headerContainer&&i.appendChild(this._list.value.headerContainer),this._list.value.filterContainer&&i.appendChild(this._list.value.filterContainer),i.appendChild(this._list.value.domNode),this._list.value.footerContainer&&i.appendChild(this._list.value.footerContainer);else throw Error(`List has no value`);let o=new I;r?.filterAsCombobox&&o.add(Uo(i,`keydown`,e=>{e.keyCode===9&&!e.browserEvent.isComposing&&(Ts.stop(e,!0),this.hide(!0))}));let s=this._list.value.headerContainer;s&&o.add(Su(s,e=>e.preventDefault()));let c=0;o.add(Su(i,()=>{c=Date.now()+1e3}));let l=document.createElement(`div`),u=e.appendChild(l);u.classList.add(`context-view-block`),o.add(Su(u,e=>e.stopPropagation()));let d=0;if(n.length){let e=this._createActionBar(`.action-widget-action-bar`,n);e&&(i.appendChild(e.getContainer().parentElement),o.add(e),d=e.getContainer().offsetWidth)}let f=this._list.value?.layout(d);i.style.width=`${f}px`;let p=Xm.FilterFocused.bindTo(this._contextKeyService);if(o.add({dispose:()=>p.reset()}),this._list.value?.filterInput){let e=this._list.value.filterInput;o.add(L(e,`focus`,()=>p.set(!0))),o.add(L(e,`blur`,()=>p.set(!1)))}let m=o.add(sr(e)),h=o.add(new sc);return o.add(m.onDidFocus(()=>h.clear())),o.add(m.onDidBlur(()=>{let t=()=>{let n=c-Date.now();if(n>0){h.value=Va(t,n);return}let r=uf();r&&(e.contains(r)||r.closest(`.action-widget-hover`)||r.closest(`.action-list-submenu-panel`))||this.hide(!0)};h.value=Va(t,75)})),o}_createActionBar(e,t){if(!t.length)return;let n=N(e),r=new Lr(n);return r.push(t,{icon:!1,label:!0}),r}_hasRequiredAncestorClasses(e,t){if(!t?.length)return!0;for(let n=e;n;n=n.parentElement)if(t.every(e=>n.classList.contains(e)))return!0;return!1}_onWidgetClosed(e){this._closingList===this._list.value?this.clear():(this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement=void 0,this._list.value?.hide(e))}};Qm=Km([qm(0,Sd),qm(1,Na),qm(2,W)],Qm),fo(Zm,Qm,1);var $m=1100;Qi(class extends ll{constructor(){super({id:`hideCodeActionWidget`,title:R(1747,`Hide action widget`),precondition:Xm.Visible,keybinding:{weight:$m,primary:9,secondary:[1033]}})}run(e){e.get(Zm).hide(!0)}}),Qi(class extends ll{constructor(){super({id:`clearFilterCodeActionWidget`,title:R(1748,`Clear action widget filter`),precondition:T.and(Xm.Visible,Xm.FilterFocused),keybinding:{weight:1101,primary:9}})}run(e){let t=e.get(Zm);t instanceof Qm&&(t.clearFilter()||t.hide(!0))}}),Qi(class extends ll{constructor(){super({id:`selectPrevCodeAction`,title:R(1749,`Select previous action`),precondition:Xm.Visible,keybinding:{weight:$m,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){let t=e.get(Zm);t instanceof Qm&&t.focusPrevious()}}),Qi(class extends ll{constructor(){super({id:`selectNextCodeAction`,title:R(1750,`Select next action`),precondition:Xm.Visible,keybinding:{weight:$m,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){let t=e.get(Zm);t instanceof Qm&&t.focusNext()}}),Qi(class extends ll{constructor(){super({id:`collapseSectionCodeAction`,title:R(1751,`Collapse section`),precondition:T.and(Xm.Visible,Xm.FilterFocused.negate()),keybinding:{weight:$m,primary:15}})}run(e){let t=e.get(Zm);t instanceof Qm&&t.collapseSection()}}),Qi(class extends ll{constructor(){super({id:`expandSectionCodeAction`,title:R(1752,`Expand section`),precondition:T.and(Xm.Visible,Xm.FilterFocused.negate()),keybinding:{weight:$m,primary:17}})}run(e){let t=e.get(Zm);t instanceof Qm&&t.expandSection()}}),Qi(class extends ll{constructor(){super({id:`toggleSectionCodeAction`,title:R(1753,`Toggle section`),precondition:T.and(Xm.Visible,Xm.FilterFocused.negate()),keybinding:{weight:$m,primary:10}})}run(e){let t=e.get(Zm);t instanceof Qm&&(t.toggleSection()||t.acceptSelected())}}),Qi(class extends ll{constructor(){super({id:jm,title:R(1754,`Accept selected action`),precondition:Xm.Visible,keybinding:{weight:$m,primary:3,secondary:[2137]}})}run(e){let t=e.get(Zm);t instanceof Qm&&t.acceptSelected()}}),Qi(class extends ll{constructor(){super({id:Mm,title:R(1755,`Preview selected action`),precondition:Xm.Visible,keybinding:{weight:$m,primary:2051}})}run(e){let t=e.get(Zm);t instanceof Qm&&t.acceptSelected(!0)}});var eh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},th=function(e,t){return function(n,r){t(n,r,e)}},nh,rh=class extends K{static{nh=this}static{this.baseId=`editor.widget.postEditWidget`}constructor(e,t,n,r,i,a,o,s,c,l,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=i,this.edits=a,this.onSelectNewEdit=o,this.additionalActions=s,this._keybindingService=l,this._actionWidgetService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(Wo(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Wo((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(e=>{this.dispose()})),this._register(du.runAndSubscribe(l.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){this.button.element.title=this._keybindingService.appendKeybinding(this.showCommand.label,this.showCommand.id)}create(){this.domNode=N(`.post-edit-widget`),this.button=this._register(new qa(this.domNode,{supportIcons:!0})),this.button.label=`$(insert)`,this._register(L(this.domNode,El.CLICK,()=>this.showSelector()))}getId(){return nh.baseId+`.`+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){let e=ma(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show(`postEditWidget`,!1,this.edits.allEdits.map((e,t)=>({kind:`action`,item:e,label:e.title,disabled:!1,canPreview:!1,group:{title:``,icon:H.fromId(t===this.edits.activeEditIndex?A.check.id:A.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:e=>{this._actionWidgetService.hide(!1);let t=this.edits.allEdits.findIndex(t=>t===e);if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}};rh=nh=eh([th(8,Na),th(9,ba),th(10,Zm)],rh);var ih=class extends K{constructor(e,t,n,r,i,a,o,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._getAdditionalActions=i,this._instantiationService=a,this._bulkEditService=o,this._notificationService=s,this._currentWidget=this._register(new sc),this._register(du.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,n,r,i){if(!e.length||!this._editor.hasModel())return;let a=this._editor.getModel(),o=t.allEdits.at(t.activeEditIndex);if(!o)return;let s=async a=>{let o=this._editor.getModel();o&&(await o.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:a,allEdits:t.allEdits},n,r,i))},c=(r,i)=>{Fi(r)||(this._notificationService.error(i),n&&this.show(e[0],t,s))},l=new Td(this._editor,3,void 0,i),u;try{u=await Qa(r(o,l.token),l.token)}catch(e){return c(e,S(991,`Error resolving edit '{0}':
4
4
  {1}`,o.title,Cm(e)))}finally{l.dispose()}if(i.isCancellationRequested)return;let d=vm(a.uri,e,u),f=e[0],p=a.deltaDecorations([],[{range:f,options:{description:`paste-line-suffix`,stickiness:0}}]);this._editor.focus();let m,h;try{m=await this._bulkEditService.apply(d,{editor:this._editor,token:i}),h=a.getDecorationRange(p[0])}catch(e){return c(e,S(992,`Error applying edit '{0}':
5
5
  {1}`,o.title,Cm(e)))}finally{a.deltaDecorations(p,[])}i.isCancellationRequested||n&&m.isApplied&&t.allEdits.length>1&&this.show(h??f,t,s)}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(rh,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};ih=eh([th(5,W),th(6,ed),th(7,gt)],ih);var ah=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},oh=function(e,t){return function(n,r){t(n,r,e)}},sh,ch=`editor.changePasteType`,lh=`editor.pasteAs.preferences`,uh=new M(`pasteWidgetVisible`,!1,S(971,`Whether the paste widget is showing`)),dh=`application/vnd.code.copymetadata`,fh=class extends K{static{sh=this}static{this.ID=`editor.contrib.copyPasteActionController`}static get(e){return e.getContribution(sh.ID)}constructor(e,t,n,r,i,a,o,s,c,l){super(),this._logService=n,this._bulkEditService=r,this._clipboardService=i,this._commandService=a,this._configService=o,this._languageFeaturesService=s,this._quickInputService=c,this._progressService=l,this._editor=e,this._register(e.onWillCopy(e=>this.handleCopy(e))),this._register(e.onWillCut(e=>this.handleCopy(e))),this._register(e.onWillPaste(e=>this.handlePaste(e))),this._pasteProgressManager=this._register(new Hp(`pasteIntoEditor`,e,t)),this._postPasteWidgetManager=this._register(t.createInstance(ih,`pasteIntoEditor`,e,uh,{id:ch,label:S(972,`Show paste options...`)},()=>sh._configureDefaultAction?[sh._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;let t=this._editor.getModel(),n=this._editor._getViewModel(),r=this._editor.getSelections();if(!t||!n||!r?.length)return;let i={multicursorText:e.dataToCopy.multicursorText??null,pasteOnNewLine:e.dataToCopy.isFromEmptySelection,mode:null},a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(e=>!!e.prepareDocumentPaste);if(!a.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:i});return}let o=new Pc,s=a.flatMap(e=>e.copyMimeTypes??[]),c=wf();this.setCopyMetadata(e.clipboardData,{id:c,providerCopyMimeTypes:s,defaultPastePayload:i});let l=a.map(n=>({providerMimeTypes:n.copyMimeTypes,operation:wt(r=>n.prepareDocumentPaste(t,e.dataToCopy.sourceRanges,o,r).catch(e=>{console.error(e)}))}));sh._currentCopyOperation?.operations.forEach(e=>e.operation.cancel()),sh._currentCopyOperation={handle:c,operations:l}}async handlePaste(e){if(this._logService.trace(`CopyPasteController#handlePaste for id : `,e.metadata?.id),!this._editor.hasTextFocus())return;let t=e.toExternalVSDataTransfer();if(!t)return;t.delete(dh),Kp.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;let n=this._editor.getModel(),r=this._editor.getSelections();if(!r?.length||!n||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;let i=this.fetchCopyMetadata(e);this._logService.trace(`CopyPasteController#handlePaste with metadata : `,i?.id,` and text.length : `,e.clipboardData.getData(`text/plain`).length);let a=Array.from(e.clipboardData.files).map(e=>e.type),o=[...e.clipboardData.types,...a,...i?.providerCopyMimeTypes??[],wo.uriList],s=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(e=>{let t=this._pasteAsActionContext?.preferred;return t&&!this.providerMatchesPreference(e,t)?!1:e.pasteMimeTypes?.some(e=>Ko(e,o))});s.length?(e.setHandled(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,s,r,t,i):this.doPasteInline(s,r,t,i,e.browserEvent)):this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(r,this._pasteAsActionContext.preferred),e.setHandled())}showPasteAsNoEditMessage(e,t){let n=`only`in t?t.only.value:`preferences`in t?t.preferences.length?t.preferences.map(e=>e.value).join(`, `):S(973,`empty`):t.providerId;Kp.get(this._editor)?.showMessage(S(974,`No paste edits for '{0}' found`,n),e[0].getStartPosition())}doPasteInline(e,t,n,r,i){this._logService.trace(`CopyPasteController#doPasteInline`);let a=this._editor;if(!a.hasModel())return;let o=new Td(a,3,void 0),s=wt(async a=>{let c=this._editor;if(!c.hasModel())return;let l=c.getModel(),u=new I,d=u.add(new Oo(a));u.add(o.token.onCancellationRequested(()=>d.cancel()));let f=d.token;try{if(await this.mergeInDataFromCopy(e,n,r,f),f.isCancellationRequested)return;let a=e.filter(e=>this.isSupportedPasteProvider(e,n));if(!a.length||a.length===1&&a[0]instanceof Qp)return this.applyDefaultPasteHandler(n,r,f,i);let o={triggerKind:da.Automatic},s=await this.getPasteEdits(a,n,l,t,o,f);if(u.add(s),f.isCancellationRequested)return;if(s.edits.length===1&&s.edits[0].provider instanceof Qp)return this.applyDefaultPasteHandler(n,r,f,i);if(s.edits.length){let e=c.getOption(97).showPasteSelector===`afterPaste`;return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(l,s.edits),allEdits:s.edits},e,async(e,n)=>{if(!e.provider.resolveDocumentPasteEdit)return e;let r=e.provider.resolveDocumentPasteEdit(e,n),i=new vn,a=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),S(975,`Resolving paste edit for '{0}'. Click to cancel`,e.title),ka(Promise.race([i.p,r]),n),{cancel:()=>i.cancel()},0);return a&&(e.insertText=a.insertText,e.additionalEdit=a.additionalEdit),e},f)}await this.applyDefaultPasteHandler(n,r,f,i)}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),S(976,`Running paste handlers. Click to cancel and do basic paste`),s,{cancel:async()=>{s.cancel(),!o.token.isCancellationRequested&&await this.applyDefaultPasteHandler(n,r,o.token,i)}}).finally(()=>{o.dispose()}),this._currentPasteOperation=s}showPasteAsPick(e,t,n,r,i){this._logService.trace(`CopyPasteController#showPasteAsPick`);let a=wt(async o=>{let s=this._editor;if(!s.hasModel())return;let c=s.getModel(),l=new I,u=l.add(new Td(s,3,void 0,o));try{if(await this.mergeInDataFromCopy(t,r,i,u.token),u.token.isCancellationRequested)return;let a=t.filter(t=>this.isSupportedPasteProvider(t,r,e));e&&(a=a.filter(t=>this.providerMatchesPreference(t,e)));let o={triggerKind:da.PasteAs,only:e&&`only`in e?e.only:void 0},s=l.add(await this.getPasteEdits(a,r,c,n,o,u.token));if(u.token.isCancellationRequested)return;if(e&&(s={edits:s.edits.filter(t=>`only`in e?e.only.contains(t.kind):`preferences`in e?e.preferences.some(e=>e.contains(t.kind)):e.providerId===t.provider.id),dispose:s.dispose}),!s.edits.length){e&&this.showPasteAsNoEditMessage(n,e);return}let d;if(e)d=s.edits.at(0);else{let e={id:`editor.pasteAs.default`,label:S(977,`Configure default paste action`),edit:void 0},t=await this._quickInputService.pick([...s.edits.map(e=>({label:e.title,description:e.kind?.value,edit:e})),...sh._configureDefaultAction?[Xa({type:`separator`}),{label:sh._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:S(978,`Select Paste Action`)});if(t===e){sh._configureDefaultAction?.run();return}d=t?.edit}if(!d)return;let f=vm(c.uri,n,d);await this._bulkEditService.apply(f,{editor:this._editor})}finally{l.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:S(979,`Running paste handlers`)},()=>a)}setCopyMetadata(e,t){this._logService.trace(`CopyPasteController#setCopyMetadata new id : `,t.id),e.setData(dh,JSON.stringify(t))}fetchCopyMetadata(e){this._logService.trace(`CopyPasteController#fetchCopyMetadata`);let t=e.clipboardData.getData(dh);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,n,r){if(this._logService.trace(`CopyPasteController#mergeInDataFromCopy with metadata : `,n?.id),n?.id&&sh._currentCopyOperation?.handle===n.id){let n=sh._currentCopyOperation.operations.filter(t=>e.some(e=>e.pasteMimeTypes.some(e=>Ko(e,t.providerMimeTypes)))).map(e=>e.operation),i=await Promise.all(n);if(r.isCancellationRequested)return;for(let e of i.reverse())if(e)for(let[n,r]of e)t.replace(n,r)}if(!t.has(wo.uriList)){let e=await this._clipboardService.readResources();if(r.isCancellationRequested)return;e.length&&t.append(wo.uriList,Sc(Vl.create(e)))}}async getPasteEdits(e,t,n,r,i,a){let o=new I,s=await ka(Promise.all(e.map(async e=>{try{let s=await e.provideDocumentPasteEdits?.(n,r,t,i,a);return s&&o.add(s),s?.edits?.map(t=>({...t,provider:e}))}catch(e){Fi(e)||console.error(e);return}})),a);return{edits:ym(fu(s??[]).flat().filter(e=>!i.only||i.only.contains(e.kind))),dispose:()=>o.dispose()}}async applyDefaultPasteHandler(e,t,n,r){let i=await(e.get(wo.text)??e.get(`text`))?.asString()??``;if(n.isCancellationRequested)return;let a={clipboardEvent:r,text:i,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,n){return e.pasteMimeTypes?.some(e=>t.matches(e))?!n||this.providerMatchesPreference(e,n):!1}providerMatchesPreference(e,t){return`only`in t?e.providedPasteEditKinds.some(e=>t.only.contains(e)):`preferences`in t?e.providedPasteEditKinds.some(e=>t.preferences.some(t=>t.contains(e))):e.id===t.providerId}getInitialActiveEditIndex(e,t){let n=this._configService.getValue(lh,{resource:e.uri});for(let e of Array.isArray(n)?n:[]){let n=new Lp(e),r=t.findIndex(e=>n.contains(e.kind));if(r>=0)return r}return 0}};fh=sh=ah([oh(1,W),oh(2,ku),oh(3,ed),oh(4,as),oh(5,wr),oh(6,zi),oh(7,z),oh(8,Ud),oh(9,Au)],fh);var ph=`9_cutcopypaste`,mh=ha||document.queryCommandSupported&&document.queryCommandSupported(`cut`),hh=ha||document.queryCommandSupported&&document.queryCommandSupported(`copy`),gh=navigator.clipboard===void 0||So?document.queryCommandSupported&&document.queryCommandSupported(`paste`):!0;function _h(e){return e.register(),e}var vh=mh?_h(new Qc({id:`editor.action.clipboardCutAction`,precondition:void 0,kbOpts:ha?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:O.MenubarEditMenu,group:`2_ccp`,title:S(864,`Cu&&t`),order:1},{menuId:O.EditorContext,group:ph,title:S(865,`Cut`),when:D.writable,order:1},{menuId:O.CommandPalette,group:``,title:S(866,`Cut`),order:1},{menuId:O.SimpleEditorContext,group:ph,title:S(867,`Cut`),when:D.writable,order:1}]})):void 0,yh=hh?_h(new Qc({id:`editor.action.clipboardCopyAction`,precondition:void 0,kbOpts:ha?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:O.MenubarEditMenu,group:`2_ccp`,title:S(868,`&&Copy`),order:2},{menuId:O.EditorContext,group:ph,title:S(869,`Copy`),order:2},{menuId:O.CommandPalette,group:``,title:S(870,`Copy`),order:1},{menuId:O.SimpleEditorContext,group:ph,title:S(871,`Copy`),order:2}]})):void 0;Sn.appendMenuItem(O.MenubarEditMenu,{submenu:O.MenubarCopy,title:R(876,`Copy As`),group:`2_ccp`,order:3}),Sn.appendMenuItem(O.EditorContext,{submenu:O.EditorContextCopy,title:R(877,`Copy As`),group:ph,order:3}),Sn.appendMenuItem(O.EditorContext,{submenu:O.EditorContextShare,title:R(878,`Share`),group:`11_share`,order:-1,when:T.and(T.notEquals(`resourceScheme`,`output`),D.editorTextFocus)}),Sn.appendMenuItem(O.ExplorerContext,{submenu:O.ExplorerContextShare,title:R(879,`Share`),group:`11_share`,order:-1});var bh=gh?_h(new Qc({id:`editor.action.clipboardPasteAction`,precondition:void 0,kbOpts:ha?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:O.MenubarEditMenu,group:`2_ccp`,title:S(872,`&&Paste`),order:4},{menuId:O.EditorContext,group:ph,title:S(873,`Paste`),when:D.writable,order:4},{menuId:O.CommandPalette,group:``,title:S(874,`Paste`),order:1},{menuId:O.SimpleEditorContext,group:ph,title:S(875,`Paste`),when:D.writable,order:4}]})):void 0,xh=class extends G{constructor(){super({id:`editor.action.clipboardCopyWithSyntaxHighlightingAction`,label:R(880,`Copy with Syntax Highlighting`),precondition:void 0,kbOpts:{kbExpr:D.textInputFocus,primary:0,weight:100}})}run(e,t){let n=e.get(ku),r=e.get(as);n.trace(`ExecCommandCopyWithSyntaxHighlightingAction#run`),t.hasModel()&&(t.getOption(45)||!t.getSelection().isEmpty())&&(kl.forceCopyWithSyntaxHighlighting=!0,t.focus(),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)`),Sh(t,r),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)`),kl.forceCopyWithSyntaxHighlighting=!1)}};function Sh(e,t){if(kl.electronBugWorkaroundCopyEventHasFired=!1,e.getContainerDomNode().ownerDocument.execCommand(`copy`),ha&&kl.electronBugWorkaroundCopyEventHasFired===!1){let{dataToCopy:n}=zs(e._getViewModel(),void 0,So);t.writeText(n.text)}}function Ch(e,t){e&&(e.addImplementation(1e4,`code-editor`,(e,n)=>{let r=e.get(ku),i=e.get(as);r.trace(`registerExecCommandImpl (addImplementation code-editor for : `,t,`)`);let a=e.get(Js).getFocusedCodeEditor();if(a&&a.hasTextFocus()&&a.hasModel()){let e=a.getOption(45),n=a.getSelection();return n&&n.isEmpty()&&!e||(a.getOption(171)&&t===`cut`?(wh(a),r.trace(`registerExecCommandImpl (before execCommand copy)`),Sh(a,i),a.trigger(void 0,`cut`,void 0),r.trace(`registerExecCommandImpl (after execCommand copy)`)):(wh(a),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),t===`copy`?Sh(a,i):a.getContainerDomNode().ownerDocument.execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`))),!0}return!1}),e.addImplementation(0,`generic-dom`,(e,n)=>{let r=e.get(ku);return r.trace(`registerExecCommandImpl (addImplementation generic-dom for : `,t,`)`),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),ps().execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`),!0}))}function wh(e){if(e.getOption(171)){let t=rf.get(e.getId());t&&t.handleWillCopy()}}Ch(vh,`cut`),Ch(yh,`copy`),bh&&(bh.addImplementation(1e4,`code-editor`,(e,t)=>{let n=e.get(ku);n.trace(`registerExecCommandImpl (addImplementation code-editor for : paste)`);let r=e.get(Js),i=e.get(as),a=r.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(171)){let e=rf.get(a.getId());e&&e.handleWillPaste()}n.trace(`registerExecCommandImpl (before triggerPaste)`);let e=i.triggerPaste(na().vscodeWindowId);return e?(n.trace(`registerExecCommandImpl (triggerPaste defined)`),e.then(async()=>(n.trace(`registerExecCommandImpl (after triggerPaste)`),fh.get(a)?.finishedPaste()??Promise.resolve()))):(n.trace(`registerExecCommandImpl (triggerPaste undefined)`),!rn||(n.trace(`registerExecCommandImpl (Paste handling on web)`),(async()=>{let e=await i.readText();if(e!==``){let t=kd.INSTANCE.get(e),r=!1,i=null,o=null;t&&(r=a.getOption(45)&&!!t.isFromEmptySelection,i=t.multicursorText===void 0?null:t.multicursorText,o=t.mode),n.trace(`registerExecCommandImpl (clipboardText.length : `,e.length,` id : `,t?.id,`)`),a.trigger(`keyboard`,`paste`,{text:e,pasteOnNewLine:r,multicursorText:i,mode:o})}})()))}return!1}),bh.addImplementation(0,`generic-dom`,(e,t)=>(e.get(ku).trace(`registerExecCommandImpl (addImplementation generic-dom for : paste)`),e.get(as).triggerPaste(na().vscodeWindowId)??!1))),hh&&B(xh);var Th=new class{constructor(){this.QuickFix=new Lp(`quickfix`),this.Refactor=new Lp(`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 Lp(`notebook`),this.Source=new Lp(`source`),this.SourceOrganizeImports=this.Source.append(`organizeImports`),this.SourceFixAll=this.Source.append(`fixAll`),this.SurroundWith=this.Refactor.append(`surround`)}},Eh;(function(e){e.Refactor=`refactor`,e.RefactorPreview=`refactor preview`,e.Lightbulb=`lightbulb`,e.Default=`other (default)`,e.SourceAction=`source action`,e.QuickFix=`quick fix action`,e.FixAll=`fix all`,e.OrganizeImports=`organize imports`,e.AutoFix=`auto fix`,e.QuickFixHover=`quick fix hover window`,e.OnSave=`save participants`,e.ProblemsView=`problems view`})(Eh||={});function Dh(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some(n=>kh(t,n,e.include))||!e.includeSourceActions&&Th.Source.contains(t))}function Oh(e,t){let n=t.kind?new Lp(t.kind):void 0;return!(e.include&&(!n||!e.include.contains(n))||e.excludes&&n&&e.excludes.some(t=>kh(n,t,e.include))||!e.includeSourceActions&&n&&Th.Source.contains(n)||e.onlyIncludePreferredActions&&!t.isPreferred)}function kh(e,t,n){return!(!t.contains(e)||n&&t.contains(n))}var Ah=class e{static fromUser(t,n){return!t||typeof t!=`object`?new e(n.kind,n.apply,!1):new e(e.getKindFromUser(t,n.kind),e.getApplyFromUser(t,n.apply),e.getPreferredUser(t))}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 Lp(e.kind):t}static getPreferredUser(e){return typeof e.preferred==`boolean`&&e.preferred}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}},jh=class{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(e){Ys(e)}t&&(this.action.edit=t.edit)}return this}},Mh=`editor.action.codeAction`,Nh=`editor.action.quickFix`,Ph=`editor.action.autoFix`,Fh=`editor.action.refactor`,Ih=`editor.action.sourceAction`,Lh=`editor.action.organizeImports`,Rh=`editor.action.fixAll`,zh=1e3,Bh=class e extends K{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:t},{action:n}){return t.isAI&&!n.isAI?1:!t.isAI&&n.isAI?-1:wu(t.diagnostics)?wu(n.diagnostics)?e.codeActionsPreferredComparator(t,n):-1:wu(n.diagnostics)?1:e.codeActionsPreferredComparator(t,n)}constructor(t,n,r){super(),this.documentation=n,this._register(r),this.allActions=[...t].sort(e.codeActionsComparator),this.validActions=this.allActions.filter(({action:e})=>!e.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Th.QuickFix.contains(new Lp(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},Vh={actions:[],documentation:void 0};async function Hh(e,t,n,r,i,a){let o=r.filter||{},s={...o,excludes:[...o.excludes||[],Th.Notebook]},c={only:o.include?.value,trigger:r.type},l=new Fs(t,a),u=Uh(e,t,r.type===2?s:o),d=new I,f=u.map(async e=>{let r=setTimeout(()=>i.report(e),1250);try{let r=await e.provideCodeActions(t,n,c,l.token);if(l.token.isCancellationRequested)return r?.dispose(),Vh;r&&d.add(r);let i=(r?.actions||[]).filter(e=>e&&Oh(o,e)),a=Gh(e,i,o.include);return{actions:i.map(t=>new jh(t,e)),documentation:a}}catch(e){if(Fi(e))throw e;return Ys(e),Vh}finally{clearTimeout(r)}}),p=e.onDidChange(()=>{let n=e.all(t);Od(n,u)||l.cancel()});try{let n=await Promise.all(f),i=n.map(e=>e.actions).flat(),a=new Bh(i,[...fu(n.map(e=>e.documentation)),...Wh(e,t,r,i)],d);return d.add(a),a}catch(e){throw d.dispose(),e}finally{p.dispose(),l.dispose()}}function Uh(e,t,n){return e.all(t).filter(e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some(e=>Dh(n,new Lp(e))))}function*Wh(e,t,n,r){if(t&&r.length)for(let i of e.all(t))i._getAdditionalMenuItems&&(yield*i._getAdditionalMenuItems?.({trigger:n.type,only:n.filter?.include?.value},r.map(e=>e.action)))}function Gh(e,t,n){if(!e.documentation)return;let r=e.documentation.map(e=>({kind:new Lp(e.kind),command:e.command}));if(n){let e;for(let t of r)t.kind.contains(n)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return e?.command}for(let e of t)if(e.kind){for(let t of r)if(t.kind.contains(new Lp(e.kind)))return t.command}}var Kh;(function(e){e.OnSave=`onSave`,e.FromProblemsView=`fromProblemsView`,e.FromCodeActions=`fromCodeActions`,e.FromAILightbulb=`fromAILightbulb`,e.FromProblemsHover=`fromProblemsHover`})(Kh||={});async function qh(e,t,n,r,i=E.None){let a=e.get(ed),o=e.get(wr),s=e.get(_t),c=e.get(gt),l=e.get(ld);if(s.publicLog2(`codeAction.applyCodeAction`,{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:n}),l.playSignal(hu.codeActionTriggered),await t.resolve(i),!i.isCancellationRequested&&(!t.action.edit?.edits.length||(await a.apply(t.action.edit,{editor:r?.editor,label:t.action.title,quotableLabel:t.action.title,code:`undoredo.codeAction`,respectAutoSaveConfig:n!==Kh.OnSave,showPreview:r?.preview,reason:ys.codeAction({kind:t.action.kind,providerId:dl.fromExtensionId(t.provider?.extensionId)})})).isApplied)){if(t.action.command)try{await o.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(e){let t=Jh(e);c.error(typeof t==`string`?t:S(881,`An unknown error occurred while applying the code action`))}setTimeout(()=>l.playSignal(hu.codeActionApplied),zh)}}function Jh(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}Pn.registerCommand(`_executeCodeActionProvider`,async function(e,t,n,r,i){if(!(t instanceof qn))throw Mo();let{codeActionProvider:a}=e.get(z),o=e.get(ot).getModel(t);if(!o)throw Mo();let s=J.isISelection(n)?J.liftSelection(n):w.isIRange(n)?o.validateRange(n):void 0;if(!s)throw Mo();let c=typeof r==`string`?new Lp(r):void 0,l=await Hh(a,o,s,{type:1,triggerAction:Eh.Default,filter:{includeSourceActions:!0,include:c}},ql.None,E.None),u=[],d=Math.min(l.validActions.length,typeof i==`number`?i:0);for(let e=0;e<d;e++)u.push(l.validActions[e].resolve(E.None));try{return await Promise.all(u),l.validActions.map(e=>e.action)}finally{setTimeout(()=>l.dispose(),100)}});var Yh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Xh=function(e,t){return function(n,r){t(n,r,e)}},Zh,Qh=class{static{Zh=this}static{this.codeActionCommands=[Fh,Mh,Ih,Lh,Rh]}constructor(e){this.keybindingService=e}getResolver(){let e=new kc(()=>this.keybindingService.getKeybindings().filter(e=>Zh.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return e.command===`editor.action.organizeImports`?t={kind:Th.SourceOrganizeImports.value}:e.command===`editor.action.fixAll`&&(t={kind:Th.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...Ah.fromUser(t,{kind:Lp.None,apply:`never`})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;let n=new Lp(e.kind);return t.filter(e=>e.kind.contains(n)).filter(t=>!t.preferred||e.isPreferred).reduceRight((e,t)=>e?e.kind.contains(t.kind)?t:e:t,void 0)}};Qh=Zh=Yh([Xh(0,ba)],Qh),k(`symbolIcon.arrayForeground`,Qr,S(1569,`The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.booleanForeground`,Qr,S(1570,`The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.classForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},S(1571,`The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.colorForeground`,Qr,S(1572,`The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.constantForeground`,Qr,S(1573,`The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.constructorForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},S(1574,`The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.enumeratorForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},S(1575,`The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.enumeratorMemberForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},S(1576,`The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.eventForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},S(1577,`The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.fieldForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},S(1578,`The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.fileForeground`,Qr,S(1579,`The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.folderForeground`,Qr,S(1580,`The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.functionForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},S(1581,`The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.interfaceForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},S(1582,`The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.keyForeground`,Qr,S(1583,`The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.keywordForeground`,Qr,S(1584,`The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.methodForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},S(1585,`The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.moduleForeground`,Qr,S(1586,`The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.namespaceForeground`,Qr,S(1587,`The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.nullForeground`,Qr,S(1588,`The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.numberForeground`,Qr,S(1589,`The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.objectForeground`,Qr,S(1590,`The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.operatorForeground`,Qr,S(1591,`The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.packageForeground`,Qr,S(1592,`The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.propertyForeground`,Qr,S(1593,`The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.referenceForeground`,Qr,S(1594,`The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.snippetForeground`,Qr,S(1595,`The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.stringForeground`,Qr,S(1596,`The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.structForeground`,Qr,S(1597,`The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.textForeground`,Qr,S(1598,`The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.typeParameterForeground`,Qr,S(1599,`The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.unitForeground`,Qr,S(1600,`The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),k(`symbolIcon.variableForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},S(1601,`The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`));var $h=Object.freeze({kind:Lp.Empty,title:S(917,`More Actions...`)}),eg=Object.freeze([{kind:Th.QuickFix,title:S(918,`Quick Fix`)},{kind:Th.RefactorExtract,title:S(919,`Extract`),icon:A.wrench},{kind:Th.RefactorInline,title:S(920,`Inline`),icon:A.wrench},{kind:Th.RefactorRewrite,title:S(921,`Rewrite`),icon:A.wrench},{kind:Th.RefactorMove,title:S(922,`Move`),icon:A.wrench},{kind:Th.SurroundWith,title:S(923,`Surround With`),icon:A.surroundWith},{kind:Th.Source,title:S(924,`Source Action`),icon:A.symbolFile},$h]);function tg(e,t,n){if(!t)return e.map(e=>({kind:`action`,item:e,group:$h,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!e.action.edit?.edits.length}));let r=eg.map(e=>({group:e,actions:[]}));for(let t of e){let e=t.action.kind?new Lp(t.action.kind):Lp.None;for(let n of r)if(n.group.kind.contains(e)){n.actions.push(t);break}}let i=[];for(let e of r)if(e.actions.length){i.push({kind:`header`,group:e.group});for(let t of e.actions){let r=e.group;i.push({kind:`action`,item:t,group:t.action.isAI?{title:r.title,kind:r.kind,icon:A.sparkle}:r,label:t.action.title,disabled:!!t.action.disabled,keybinding:n(t.action)})}}return i}var ng=new M(`supportedCodeAction`,``),rg=class extends K{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new Ji),this.ignoreLightbulbOff=!1,this._register(this._markerService.onMarkerChanged(e=>this._onMarkerChanges(e))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){let t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){let t=this._editor.getModel();t&&e.some(e=>zt(e,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Eh.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;let t=this._editor.getSelection();if(e.type===1)return t;let n=this._editor.getOption(73).enabled;if(n!==ct.Off||this.ignoreLightbulbOff){if(n===ct.Off||n===ct.On)return t;if(n===ct.OnCode){if(!t.isEmpty())return t;let e=this._editor.getModel(),{lineNumber:n,column:r}=t.getPosition(),i=e.getLineContent(n);if(i.length===0)return;if(r===1){if(/\s/.test(i[0]))return}else if(r===e.getLineMaxColumn(n)){if(/\s/.test(i[i.length-1]))return}else if(/\s/.test(i[r-2])&&/\s/.test(i[r-1]))return}return t}}},ig;(function(e){e.Empty={type:0};class t{constructor(e,t,n){this.trigger=e,this.position=t,this._cancellablePromise=n,this.type=1,this.actions=n.catch(e=>{if(Fi(e))return ag;throw e})}cancel(){this._cancellablePromise.cancel()}}e.Triggered=t})(ig||={});var ag=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),og=class extends K{constructor(e,t,n,r,i,a){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=i,this._configurationService=a,this._codeActionOracle=this._register(new sc),this._state=ig.Empty,this._onDidChangeState=this._register(new P),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new sc),this._disposed=!1,this._ignoreLightbulbOff=!1,this._supportedCodeActions=ng.bindTo(r),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(e=>{e.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(ig.Empty,!0))}_settingEnabledNearbyQuickfixes(){let 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(ig.Empty),this.codeActionsDisposable.clear();let e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){let t=this._registry.all(e).flatMap(e=>e.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(` `));let n=new rg(this._editor,this._markerService,t=>{if(!t){this.setState(ig.Empty);return}let n=t.selection.getStartPosition(),r=wt(async n=>{if(this._settingEnabledNearbyQuickfixes()&&t.trigger.type===1&&(t.trigger.triggerAction===Eh.QuickFix||t.trigger.filter?.include?.contains(Th.QuickFix))){let r=new I,i=!1;try{let a=r.add(await Hh(this._registry,e,t.selection,t.trigger,ql.None,n)),o=[...a.allActions];if(n.isCancellationRequested)return ag;let s=a.validActions?.some(e=>e.action.kind&&Th.QuickFix.contains(new Lp(e.action.kind))&&!e.action.isAI),c=this._markerService.read({resource:e.uri});if(s){for(let e of a.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...c.filter(e=>e.relatedInformation)]);let e=this._setCodeActions({validActions:a.validActions,allActions:o,documentation:a.documentation,hasAutoFix:a.hasAutoFix,hasAIFix:a.hasAIFix,allAIFixes:a.allAIFixes,dispose:()=>r.dispose()});return i=!0,e}if(!s&&c.length>0){let s=t.selection.getPosition(),l=s,u=Number.MAX_VALUE,d=[...a.validActions];for(let i of c){let f=i.endColumn,p=i.endLineNumber,m=i.startLineNumber;if(p===s.lineNumber||m===s.lineNumber){l=new j(p,f);let i={type:t.trigger.type,triggerAction:t.trigger.triggerAction,filter:{include:t.trigger.filter?.include?t.trigger.filter?.include:Th.QuickFix},autoApply:t.trigger.autoApply,context:{notAvailableMessage:t.trigger.context?.notAvailableMessage||``,position:l}},m=new J(l.lineNumber,l.column,l.lineNumber,l.column),h=r.add(await Hh(this._registry,e,m,i,ql.None,n));if(n.isCancellationRequested)return ag;if(h.validActions.length!==0){for(let e of h.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...c.filter(e=>e.relatedInformation)]);a.allActions.length===0&&o.push(...h.allActions),Math.abs(s.column-f)<u?d.unshift(...h.validActions):d.push(...h.validActions)}u=Math.abs(s.column-f)}}let f=d.filter((e,t,n)=>n.findIndex(t=>t.action.title===e.action.title)===t);f.sort((e,t)=>e.action.isPreferred&&!t.action.isPreferred?-1:!e.action.isPreferred&&t.action.isPreferred||e.action.isAI&&!t.action.isAI?1:!e.action.isAI&&t.action.isAI?-1:0);let p=this._setCodeActions({validActions:f,allActions:o,documentation:a.documentation,hasAutoFix:a.hasAutoFix,hasAIFix:a.hasAIFix,allAIFixes:a.allAIFixes,dispose:()=>r.dispose()});return i=!0,p}}finally{i||r.dispose()}}if(t.trigger.type===1){let r=await Hh(this._registry,e,t.selection,t.trigger,ql.None,n);return n.isCancellationRequested?(r.dispose(),ag):this._setCodeActions(r)}let r=await Hh(this._registry,e,t.selection,t.trigger,ql.None,n);return n.isCancellationRequested?(r.dispose(),ag):this._setCodeActions(r)});t.trigger.type===1&&this._progressService?.showWhile(r,250);let i=new ig.Triggered(t.trigger,n,r),a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&i.type===1&&i.trigger.type===2&&this._state.position!==i.position),a?setTimeout(()=>{this.setState(i)},500):this.setState(i)},void 0);n.ignoreLightbulbOff=this._ignoreLightbulbOff,this._codeActionOracle.value=n,this._codeActionOracle.value.trigger({type:2,triggerAction:Eh.Default})}else this._supportedCodeActions.reset()}_setCodeActions(e){return this.codeActionsDisposable.value=e,e}takeCodeActions(e){if(this.codeActionsDisposable.value===e)return this.codeActionsDisposable.clearAndLeak(),e}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.clear()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}},sg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},cg=function(e,t){return function(n,r){t(n,r,e)}},lg,ug=Dr(`gutter-lightbulb`,A.lightBulb,S(925,`Icon which spawns code actions menu from the gutter when there is no space in the editor.`)),dg=Dr(`gutter-lightbulb-auto-fix`,A.lightbulbAutofix,S(926,`Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.`)),fg=Dr(`gutter-lightbulb-sparkle`,A.lightbulbSparkle,S(927,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.`)),pg=Dr(`gutter-lightbulb-aifix-auto-fix`,A.lightbulbSparkleAutofix,S(928,`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.`)),mg=Dr(`gutter-lightbulb-sparkle-filled`,A.sparkleFilled,S(929,`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.`)),hg;(function(e){e.Hidden={type:0};class t{constructor(e,t,n,r){this.actions=e,this.trigger=t,this.editorPosition=n,this.widgetPosition=r,this.type=1}}e.Showing=t})(hg||={});function gg(e,t,n,r,i=!1){if(e.validActions.length<=0)return;let a,o=!1;e.allAIFixes?(a=i?mg:A.sparkleFilled,e.validActions.length===1&&(o=!0)):a=e.hasAutoFix?e.hasAIFix?i?pg:A.lightbulbSparkleAutofix:i?dg:A.lightbulbAutofix:e.hasAIFix?i?fg:A.lightbulbSparkle:i?ug:A.lightBulb;let s;return s=o?S(930,`Run: {0}`,e.validActions[0].action.title):e.hasAutoFix&&n?S(931,`Show Code Actions. Preferred Quick Fix Available ({0})`,n):!e.hasAutoFix&&r?S(932,`Show Code Actions ({0})`,r):S(933,`Show Code Actions`),{actions:e,trigger:t,icon:a,autoRun:o,title:s,isGutter:i}}var _g=class extends K{static{lg=this}static{this.GUTTER_DECORATION=F.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:H.asClassName(A.lightBulb),glyphMargin:{position:er.Left},stickiness:1})}static{this.ID=`editor.contrib.lightbulbWidget`}static{this._posPref=[0]}static _computeLightBulbInfo(e,t,n,r){if(e.type===1)return gg(e.actions,e.trigger,n,r,t)}constructor(e,t){super(),this._editor=e,this._keybindingService=t,this.onlyWithEmptySelection=!1,this._onClick=this._register(new P),this.onClick=this._onClick.event,this._state=is(this,hg.Hidden),this._gutterState=is(this,hg.Hidden),this._combinedInfo=V(this,e=>{let t=this._gutterState.read(e);if(t.type===1)return lg._computeLightBulbInfo(t,!0,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e));let n=this._state.read(e);if(n.type===1)return lg._computeLightBulbInfo(n,!1,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e))}),this._iconClasses=[],this.lightbulbClasses=[`codicon-`+ug.id,`codicon-`+pg.id,`codicon-`+dg.id,`codicon-`+fg.id,`codicon-`+mg.id],this._preferredKbLabel=is(this,void 0),this._quickFixKbLabel=is(this,void 0),this.gutterDecoration=lg.GUTTER_DECORATION,this._domNode=N(`div.lightBulbWidget`),this._domNode.role=`listbox`,this._register(an.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(e=>{let t=this._editor.getModel(),n=this._state.get();(n.type!==1||!t||n.editorPosition.lineNumber>=t.getLineCount())&&this.hide();let r=this._gutterState.get();(r.type!==1||!t||r.editorPosition.lineNumber>=t.getLineCount())&&this.gutterHide()})),this._register(yc(this._domNode,e=>{let t=this._state.get();if(t.type!==1)return;this._editor.focus(),e.preventDefault();let{top:n,height:r}=ma(this._domNode),i=this._editor.getOption(75),a=Math.floor(i/3);t.widgetPosition.position!==null&&t.widgetPosition.position.lineNumber<t.editorPosition.lineNumber&&(a+=i),this._onClick.fire({x:e.posx,y:n+r+a,actions:t.actions,trigger:t.trigger})})),this._register(L(this._domNode,`mouseenter`,e=>{(e.buttons&1)==1&&this.hide()})),this._register(du.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.autoFix`)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.quickFix`)?.getLabel()??void 0,void 0)})),this._register(Al(e=>{let t=this._combinedInfo.read(e);this._updateLightBulbTitleAndIcon(t),this._updateGutterDecorationOptions(t)})),this._register(this._editor.onMouseDown(async e=>{if(!e.target.element||!this.lightbulbClasses.some(t=>e.target.element&&e.target.element.classList.contains(t)))return;let t=this._gutterState.get();if(t.type!==1)return;this._editor.focus();let{top:n,height:r}=ma(e.target.element),i=this._editor.getOption(75),a=Math.floor(i/3);t.widgetPosition.position!==null&&t.widgetPosition.position.lineNumber<t.editorPosition.lineNumber&&(a+=i),this._onClick.fire({x:e.event.posx,y:n+r+a,actions:t.actions,trigger:t.trigger})}))}dispose(){super.dispose(),this._editor.removeContentWidget(this),this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID)}getId(){return`LightBulbWidget`}getDomNode(){return this._domNode}getPosition(){let e=this._state.get();return e.type===1?e.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0||this.onlyWithEmptySelection&&!this._editor.getSelection()?.isEmpty()||!this._editor.hasTextFocus()||this._editor.getOptions().get(73).enabled===ct.Off)return this.gutterHide(),this.hide();let r=this._editor.getModel();if(!r)return this.gutterHide(),this.hide();let{lineNumber:i,column:a}=r.validatePosition(n),o=r.getOptions().tabSize,s=this._editor.getOptions().get(59),c=r.getLineContent(i),l=Zi(c,o),u=s.spaceWidth*l>22,d=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1),f=this._editor.getLineDecorations(i),p=!1;if(f)for(let e of f){let t=e.options.glyphMarginClassName;if(t&&!this.lightbulbClasses.some(e=>t.includes(e))){p=!0;break}}let m=i,h=1;if(!u){let o=e=>{let t=r.getLineContent(e);return/^\s*$|^\s+/.test(t)||t.length<=h};if(i>1&&!d(i-1)){let a=i===r.getLineCount(),s=i>1&&o(i-1),c=!a&&o(i+1),l=o(i),u=!c&&!s;if(!c&&!s&&!p)return this._gutterState.set(new hg.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:lg._posPref}),void 0),this.renderGutterLightbub(),this.hide();s||a||s&&!l?--m:(c||u&&l)&&(m+=1)}else if(i===1&&(i===r.getLineCount()||!o(i+1)&&!o(i))){if(this._gutterState.set(new hg.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:lg._posPref}),void 0),p)this.gutterHide();else return this.renderGutterLightbub(),this.hide()}else if(i<r.getLineCount()&&!d(i+1))m+=1;else if(a*s.spaceWidth<22)return this.hide();h=/^\S\s*$/.test(r.getLineContent(m))?2:1}this._state.set(new hg.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:lg._posPref}),void 0),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());let g=e.validActions;e.validActions[0].action.kind,g.length,this._editor.layoutContentWidget(this)}hide(){this._state.get()!==hg.Hidden&&(this._state.set(hg.Hidden,void 0),this._editor.layoutContentWidget(this))}gutterHide(){this._gutterState.get()!==hg.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this._gutterState.set(hg.Hidden,void 0))}_updateLightBulbTitleAndIcon(e){this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],e&&!e.isGutter&&(this._domNode.title=e.title,this._iconClasses=H.asClassNameArray(e.icon),this._domNode.classList.add(...this._iconClasses))}_updateGutterDecorationOptions(e){e&&e.isGutter&&(this.gutterDecoration=F.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:H.asClassName(e.icon),glyphMargin:{position:er.Left},stickiness:1}))}renderGutterLightbub(){let 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 w(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(n=>{n.changeDecoration(e,new w(t,0,t,0)),n.changeDecorationOptions(e,this.gutterDecoration)})}};_g=lg=sg([cg(1,ba)],_g);var vg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},yg=function(e,t){return function(n,r){t(n,r,e)}},bg,xg=`quickfix-edit-highlight`,Sg=class extends K{static{bg=this}static{this.ID=`editor.contrib.codeActionController`}static get(e){return e.getContribution(bg.ID)}constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(),this._commandService=o,this._configurationService=s,this._actionWidgetService=c,this._instantiationService=l,this._progressService=u,this._keybindingService=d,this._activeCodeActions=this._register(new sc),this._showDisabled=!1,this._disposed=!1,this._onlyLightBulbWithEmptySelection=!1,this._lightBulbInfoObs=is(this,void 0),this._preferredKbLabel=is(this,void 0),this._quickFixKbLabel=is(this,void 0),this._editor=e,this._model=this._register(new og(this._editor,i.codeActionProvider,t,n,a,s)),this._register(this._model.onDidChangeState(e=>this.update(e))),this._register(du.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.autoFix`)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.quickFix`)?.getLabel()??void 0,void 0)})),this._lightBulbWidget=new kc(()=>{let e=this._editor.getContribution(_g.ID);return e&&(this._register(e.onClick(e=>this.showCodeActionsFromLightbulb(e.actions,e))),e.onlyWithEmptySelection=this._onlyLightBulbWithEmptySelection),e}),this._resolver=r.createInstance(Qh),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){let t=e.validActions[0],n=t.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(t,!1,!1,Kh.FromAILightbulb)}else await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,r){if(!this._editor.hasModel())return;Kp.get(this._editor)?.closeMessage();let i=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:r,context:{notAvailableMessage:e,position:i}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,n,r){let i=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(qh,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Eh.QuickFix,filter:{}}),i.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=this._model.takeCodeActions(await e.actions)}catch(e){et(e);return}if(t){if(this._disposed)t.dispose();else if(this._editor.getSelection()?.startLineNumber!==e.position.lineNumber)t.dispose();else if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),this._lightBulbInfoObs.set(gg(t,e.trigger,this._preferredKbLabel.get(),this._quickFixKbLabel.get()),void 0),e.trigger.type===1){if(e.trigger.filter?.include){let n=this.tryGetValidActionToApply(e.trigger,t);if(n){try{this.hideLightBulbWidget(),await this.applyCodeAction(n,!1,!1,Kh.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){let n=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(n&&n.action.disabled){Kp.get(this._editor)?.showMessage(n.action.disabled,e.trigger.context.position),t.dispose();return}}}let n=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!n&&!t.validActions.length)){Kp.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:e})=>e.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]}static{this.DECORATION=F.register({description:`quickfix-highlight`,className:xg})}async showCodeActionList(e,t,n){let r=this._editor.createDecorationsCollection(),i=this._editor.getDomNode();if(!i)return;let a=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!a.length)return;let o=j.isIPosition(t)?this.toCoords(t):t;this._actionWidgetService.show(`codeActionWidget`,!0,tg(a,this._shouldShowHeaders(),this._resolver.getResolver()),{onSelect:async(e,t)=>{this.applyCodeAction(e,!0,!!t,n.fromLightbulb?Kh.FromAILightbulb:Kh.FromCodeActions),this._actionWidgetService.hide(!1),r.clear()},onHide:e=>{this._editor?.focus(),r.clear()},onHover:async(e,t)=>{if(t.isCancellationRequested)return;let n=!1,r=e.action.kind;if(r){let e=new Lp(r);n=[Th.RefactorExtract,Th.RefactorInline,Th.RefactorRewrite,Th.RefactorMove,Th.Source].some(t=>t.contains(e))}return{canPreview:n||!!e.action.edit?.edits.length}},onFocus:e=>{if(e&&e.action){let t=e.action.ranges,n=e.action.diagnostics;if(r.clear(),t&&t.length>0){let e=n&&n?.length>1?n.map(e=>({range:e,options:bg.DECORATION})):t.map(e=>({range:e,options:bg.DECORATION}));r.set(e)}else if(n&&n.length>0){let e=n.map(e=>({range:e,options:bg.DECORATION}));r.set(e);let t=n[0];if(t.startLineNumber&&t.startColumn){let e=this._editor.getModel()?.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn})?.word;ao(S(914,`Context: {0} at line {1} and column {2}.`,e,t.startLineNumber,t.startColumn))}}}else r.clear()}},o,i,this._getActionBarActions(e,t,n))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();let t=this._editor.getScrolledVisiblePosition(e),n=ma(this._editor.getDomNode());return{x:n.left+t.left,y:n.top+t.top+t.height}}_shouldShowHeaders(){let e=this._editor?.getModel();return this._configurationService.getValue(`editor.codeActionWidget.showHeaders`,{resource:e?.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];let r=e.documentation.map(e=>({id:e.id,label:e.title,tooltip:e.tooltip??``,class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(e.id,...e.arguments??[])}));return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:`hideMoreActions`,label:S(915,`Hide Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:`showMoreActions`,label:S(916,`Show Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};Sg=bg=vg([yg(1,Oc),yg(2,Na),yg(3,W),yg(4,z),yg(5,hc),yg(6,wr),yg(7,zi),yg(8,Zm),yg(9,W),yg(10,hc),yg(11,ba)],Sg),Ma((e,t)=>{((e,n)=>{n&&t.addRule(`.monaco-editor ${e} { background-color: ${n}; }`)})(`.quickfix-edit-highlight`,e.getColor(Wu));let n=e.getColor(Uc);n&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${ft(e.type)?`dotted`:`solid`} ${n}; box-sizing: border-box; }`)});function Cg(e){return T.regex(ng.keys()[0],RegExp(`(\\s|^)`+td(e.value)+`\\b`))}var wg={type:`object`,defaultSnippets:[{body:{kind:``}}],properties:{kind:{type:`string`,description:S(882,`Kind of the code action to run.`)},apply:{type:`string`,description:S(883,`Controls when the returned actions are applied.`),default:`ifSingle`,enum:[`first`,`ifSingle`,`never`],enumDescriptions:[S(884,`Always apply the first returned code action.`),S(885,`Apply the first returned code action if it is the only one.`),S(886,`Do not apply the returned code actions.`)]},preferred:{type:`boolean`,default:!1,description:S(887,`Controls if only preferred code actions should be returned.`)}}};function Tg(e,t,n,r,i=Eh.Default){e.hasModel()&&Sg.get(e)?.manualTriggerAtCurrentPosition(t,i,n,r)}var Eg=class extends au{constructor(){super({id:Nh,title:R(904,`Quick Fix...`),precondition:T.and(D.writable,D.hasCodeActionsProvider),icon:A.lightBulb,f1:!0,keybinding:{when:D.textInputFocus,primary:2137,weight:100},menu:{id:O.InlineChatEditorAffordance,group:`1_quickfix`,order:0,when:T.and(D.writable,D.hasCodeActionsProvider)}})}runEditorCommand(e,t){return Tg(t,S(888,`No code actions available`),void 0,void 0,Eh.QuickFix)}},Dg=class extends $u{constructor(){super({id:Mh,precondition:T.and(D.writable,D.hasCodeActionsProvider),metadata:{description:`Trigger a code action`,args:[{name:`args`,schema:wg}]}})}runEditorCommand(e,t,n){let r=Ah.fromUser(n,{kind:Lp.Empty,apply:`ifSingle`});return Tg(t,typeof n?.kind==`string`?r.preferred?S(889,`No preferred code actions for '{0}' available`,n.kind):S(890,`No code actions for '{0}' available`,n.kind):r.preferred?S(891,`No preferred code actions available`):S(892,`No code actions available`),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}},Og=class extends G{constructor(){super({id:Fh,label:R(905,`Refactor...`),precondition:T.and(D.writable,D.hasCodeActionsProvider),kbOpts:{kbExpr:D.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:`1_modification`,order:2,when:T.and(D.writable,Cg(Th.Refactor))},metadata:{description:`Refactor...`,args:[{name:`args`,schema:wg}]}})}run(e,t,n){let r=Ah.fromUser(n,{kind:Th.Refactor,apply:`never`});return Tg(t,typeof n?.kind==`string`?r.preferred?S(893,`No preferred refactorings for '{0}' available`,n.kind):S(894,`No refactorings for '{0}' available`,n.kind):r.preferred?S(895,`No preferred refactorings available`):S(896,`No refactorings available`),{include:Th.Refactor.contains(r.kind)?r.kind:Lp.None,onlyIncludePreferredActions:r.preferred},r.apply,Eh.Refactor)}},kg=class extends G{constructor(){super({id:Ih,label:R(906,`Source Action...`),precondition:T.and(D.writable,D.hasCodeActionsProvider),contextMenuOpts:{group:`1_modification`,order:2.1,when:T.and(D.writable,Cg(Th.Source))},metadata:{description:`Source Action...`,args:[{name:`args`,schema:wg}]}})}run(e,t,n){let r=Ah.fromUser(n,{kind:Th.Source,apply:`never`});return Tg(t,typeof n?.kind==`string`?r.preferred?S(897,`No preferred source actions for '{0}' available`,n.kind):S(898,`No source actions for '{0}' available`,n.kind):r.preferred?S(899,`No preferred source actions available`):S(900,`No source actions available`),{include:Th.Source.contains(r.kind)?r.kind:Lp.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Eh.SourceAction)}},Ag=class extends G{constructor(){super({id:Lh,label:R(907,`Organize Imports`),precondition:T.and(D.writable,Cg(Th.SourceOrganizeImports)),kbOpts:{kbExpr:D.textInputFocus,primary:1581,weight:100},metadata:{description:R(908,`Organize imports in the current file. Also called 'Optimize Imports' by some tools`)}})}run(e,t){return Tg(t,S(901,`No organize imports action available`),{include:Th.SourceOrganizeImports,includeSourceActions:!0},`ifSingle`,Eh.OrganizeImports)}},jg=class extends G{constructor(){super({id:Rh,label:R(909,`Fix All`),precondition:T.and(D.writable,Cg(Th.SourceFixAll))})}run(e,t){return Tg(t,S(902,`No fix all action available`),{include:Th.SourceFixAll,includeSourceActions:!0},`ifSingle`,Eh.FixAll)}},Mg=class extends G{constructor(){super({id:Ph,label:R(910,`Auto Fix...`),precondition:T.and(D.writable,Cg(Th.QuickFix)),kbOpts:{kbExpr:D.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Tg(t,S(903,`No auto fixes available`),{include:Th.QuickFix,onlyIncludePreferredActions:!0},`ifSingle`,Eh.AutoFix)}};Ms(Sg.ID,Sg,3),Ms(_g.ID,_g,4),Qi(Eg),B(Og),B(kg),B(Ag),B(Mg),B(jg),U(new Dg),Ot.as(zu.Configuration).registerConfiguration({...Cd,properties:{"editor.codeActionWidget.showHeaders":{type:`boolean`,scope:6,description:S(911,`Enable/disable showing group headers in the Code Action menu.`),default:!0}}}),Ot.as(zu.Configuration).registerConfiguration({...Cd,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:`boolean`,scope:6,description:S(912,`Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.`),default:!0}}}),Ot.as(zu.Configuration).registerConfiguration({...Cd,properties:{"editor.codeActions.triggerOnFocusChange":{type:`boolean`,scope:6,markdownDescription:S(913,`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}}});var Ng=class e{constructor(){this.lenses=[]}static{this.Empty=new e}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){bc(e)&&(this._store??=new I,this._store.add(e));for(let n of e.lenses)this.lenses.push({symbol:n,provider:t})}};async function Pg(e,t,n){let r=e.ordered(t),i=new Map,a=new Ng,o=r.map(async(e,r)=>{i.set(e,r);try{let r=await Promise.resolve(e.provideCodeLenses(t,n));r&&a.add(r,e)}catch(e){Ys(e)}});return await Promise.all(o),n.isCancellationRequested?(a.dispose(),Ng.Empty):(a.lenses=a.lenses.sort((e,t)=>e.symbol.range.startLineNumber<t.symbol.range.startLineNumber?-1:e.symbol.range.startLineNumber>t.symbol.range.startLineNumber?1:i.get(e.provider)<i.get(t.provider)?-1:i.get(e.provider)>i.get(t.provider)?1:e.symbol.range.startColumn<t.symbol.range.startColumn?-1:+(e.symbol.range.startColumn>t.symbol.range.startColumn)),a)}Pn.registerCommand(`_executeCodeLensProvider`,function(e,...t){let[n,r]=t;Xn(qn.isUri(n)),Xn(typeof r==`number`||!r);let{codeLensProvider:i}=e.get(z),a=e.get(ot).getModel(n);if(!a)throw Mo();let o=[],s=new I;return Pg(i,a,E.None).then(e=>{s.add(e);let t=[];for(let n of e.lenses)r==null||n.symbol.command?o.push(n.symbol):r-->0&&n.provider.resolveCodeLens&&t.push(Promise.resolve(n.provider.resolveCodeLens(a,n.symbol,E.None)).then(e=>o.push(e||n.symbol)));return Promise.all(t)}).then(()=>o).finally(()=>{setTimeout(()=>s.dispose(),100)})});var Fg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ig=function(e,t){return function(n,r){t(n,r,e)}},Lg=Zl(`ICodeLensCache`),Rg=class{constructor(e,t){this.lineCount=e,this.data=t}},zg=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw Error(`not supported`)}},this._cache=new _i(20,.75),Ea(Jd,()=>e.remove(`codelens/cache`,1));let t=`codelens/cache2`,n=e.get(t,1,`{}`);this._deserialize(n);let r=du.filter(e.onWillSaveState,e=>e.reason===Jo.SHUTDOWN);du.once(r)(n=>{e.store(t,this._serialize(),1,1)})}put(e,t){let n=t.lenses.map(e=>({range:e.symbol.range,command:e.symbol.command&&{id:``,title:e.symbol.command?.title}})),r=new Ng;r.add({lenses:n},this._fakeProvider);let i=new Rg(e.getLineCount(),r);this._cache.set(e.uri.toString(),i)}get(e){let 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(){let e=Object.create(null);for(let[t,n]of this._cache){let r=new Set;for(let e of n.data.lenses)r.add(e.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{let t=JSON.parse(e);for(let e in t){let n=t[e],r=[];for(let e of n.lines)r.push({range:new w(e,1,e,11)});let i=new Ng;i.add({lenses:r},this._fakeProvider),this._cache.set(e,new Rg(n.lineCount,i))}}catch{}}};zg=Fg([Ig(0,wc)],zg),fo(Lg,zg,1);var Bg=class{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement(`div`)}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute(`monaco-visible-view-zone`)}},Vg=class e{static{this._idPool=0}constructor(t,n){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=t,this._id=`codelens.widget-${e._idPool++}`,this.updatePosition(n),this._domNode=document.createElement(`span`),this._domNode.className=`codelens-decoration`}withCommands(t,n){this._commands.clear();let r=[],i=!1;for(let n=0;n<t.length;n++){let a=t[n];if(a&&(i=!0,a.command)){let i=ol(a.command.title.trim());if(a.command.id){let t=`c${e._idPool++}`;r.push(N(`a`,{id:t,title:a.command.tooltip,role:`button`},...i)),this._commands.set(t,a.command)}else r.push(N(`span`,{title:a.command.tooltip},...i));n+1<t.length&&r.push(N(`span`,void 0,`\xA0|\xA0`))}}i?(Ra(this._domNode,...r),this._isEmpty&&n&&this._domNode.classList.add(`fadein`),this._isEmpty=!1):Ra(this._domNode,N(`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){let t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}},Hg=class{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){let t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let e=0,n=t.length;e<n;e++)this._addDecorationsCallbacks[e](t[e])}},Ug=F.register({collapseOnReplaceEdit:!0,description:`codelens`}),Wg=class{constructor(e,t,n,r,i,a){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let o,s=[];this._data.forEach((e,t)=>{e.symbol.command&&s.push(e.symbol),n.addDecoration({range:e.symbol.range,options:Ug},e=>this._decorationIds[t]=e),o=o?w.plusRange(o,e.symbol.range):w.lift(e.symbol.range)}),this._viewZone=new Bg(o.startLineNumber-1,i,a),this._viewZoneId=r.addZone(this._viewZone),s.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(s,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new Vg(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),void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{let n=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(n&&w.isEmpty(r.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((e,n)=>{t.addDecoration({range:e.symbol.range,options:Ug},e=>this._decorationIds[n]=e)})}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++){let n=e.getDecorationRange(this._decorationIds[t]);n&&(this._data[t].symbol.range=n)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){let n=e[t];if(n){let{symbol:e}=this._data[t];e.command=n.command||e.command}}}getCommand(e){return this._contentWidget?.getCommand(e)}getLineNumber(){let e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){let 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)))}}},Gg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Kg=function(e,t){return function(n,r){t(n,r,e)}},qg=class{static{this.ID=`css.editor.codeLens`}constructor(e,t,n,r,i,a){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=i,this._codeLensCache=a,this._disposables=new I,this._localToDispose=new I,this._lenses=[],this._oldCodeLensModels=new I,this._provideCodeLensDebounce=n.for(t.codeLensProvider,`CodeLensProvide`,{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,`CodeLensResolve`,{min:250,salt:`resolve`}),this._resolveCodeLensesScheduler=new Mr(()=>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(e=>{(e.hasChanged(59)||e.hasChanged(25)||e.hasChanged(24))&&this._updateLensStyle(),e.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(){let e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61)),t=this._editor.getOption(25);return(!t||t<5)&&(t=this._editor.getOption(61)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){let{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(24),r=this._editor.getOption(59),{style:i}=this._editor.getContainerDomNode();i.setProperty(`--vscode-editorCodeLens-lineHeight`,`${e}px`),i.setProperty(`--vscode-editorCodeLens-fontSize`,`${t}px`),i.setProperty(`--vscode-editorCodeLens-fontFeatureSettings`,r.fontFeatureSettings),n&&(i.setProperty(`--vscode-editorCodeLens-fontFamily`,n),i.setProperty(`--vscode-editorCodeLens-fontFamilyDefault`,Ku.fontFamily)),this._editor.changeViewZones(t=>{for(let n of this._lenses)n.updateHeight(e,t)})}_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();let e=this._editor.getModel();if(!e||!this._editor.getOption(23)||e.isTooLargeForTokenization())return;let t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&Va(()=>{let n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},3e4,this._localToDispose);return}for(let t of this._languageFeaturesService.codeLensProvider.all(e))if(typeof t.onDidChange==`function`){let e=t.onDidChange(()=>n.schedule());this._localToDispose.add(e)}let n=new Mr(()=>{let t=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=wt(t=>Pg(this._languageFeaturesService.codeLensProvider,e,t)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);let i=this._provideCodeLensDebounce.update(e,Date.now()-t);n.delay=i,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},et)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(Wo(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let n=[],r=-1;this._lenses.forEach(e=>{!e.isValid()||r===e.getLineNumber()?n.push(e):(e.update(t),r=e.getLineNumber())});let i=new Hg;n.forEach(e=>{e.dispose(i,t),this._lenses.splice(this._lenses.indexOf(e),1)}),i.commit(e)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Wo(()=>{if(this._editor.getModel()){let e=lt.capture(this._editor);this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{this._disposeAllLenses(e,t)})}),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(e=>{if(e.target.type!==9)return;let t=e.target.element;if(t?.tagName===`SPAN`&&(t=t.parentElement),t?.tagName===`A`)for(let e of this._lenses){let n=e.getCommand(t);if(n){this._commandService.executeCommand(n.id,...n.arguments||[]).catch(e=>this._notificationService.error(e));break}}})),n.schedule()}_disposeAllLenses(e,t){let n=new Hg;for(let e of this._lenses)e.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t=this._editor.getModel().getLineCount(),n=[],r;for(let i of e.lenses){let e=i.symbol.range.startLineNumber;e<1||e>t||(r&&r[r.length-1].symbol.range.startLineNumber===e?r.push(i):(r=[i],n.push(r)))}if(!n.length&&!this._lenses.length)return;let i=lt.capture(this._editor),a=this._getLayoutInfo();this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let r=new Hg,i=0,o=0;for(;o<n.length&&i<this._lenses.length;){let e=n[o][0].symbol.range.startLineNumber,s=this._lenses[i].getLineNumber();s<e?(this._lenses[i].dispose(r,t),this._lenses.splice(i,1)):s===e?(this._lenses[i].updateCodeLensSymbols(n[o],r),o++,i++):(this._lenses.splice(i,0,new Wg(n[o],this._editor,r,t,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),i++,o++)}for(;i<this._lenses.length;)this._lenses[i].dispose(r,t),this._lenses.splice(i,1);for(;o<n.length;)this._lenses.push(new Wg(n[o],this._editor,r,t,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),o++;r.commit(e)})}),i.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;let e=this._editor.getModel();if(!e)return;let t=[],n=[];if(this._lenses.forEach(r=>{let i=r.computeIfNecessary(e);i&&(t.push(i),n.push(r))}),t.length===0){this._oldCodeLensModels.clear();return}let r=Date.now(),i=wt(r=>{let i=t.map((t,i)=>{let a=Array(t.length),o=t.map((t,n)=>!t.symbol.command&&typeof t.provider.resolveCodeLens==`function`?Promise.resolve(t.provider.resolveCodeLens(e,t.symbol,r)).then(e=>{a[n]=e},Ys):(a[n]=t.symbol,Promise.resolve(void 0)));return Promise.all(o).then(()=>{!r.isCancellationRequested&&!n[i].isDisposed()&&n[i].updateCommands(a)})});return Promise.all(i)});this._resolveCodeLensesPromise=i,this._resolveCodeLensesPromise.then(()=>{let t=this._resolveCodeLensesDebounce.update(e,Date.now()-r);this._resolveCodeLensesScheduler.delay=t,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},e=>{et(e),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}};qg=Gg([Kg(1,z),Kg(2,Vs),Kg(3,wr),Kg(4,gt),Kg(5,Lg)],qg),Ms(qg.ID,qg,1),B(class extends G{constructor(){super({id:`codelens.showLensesInCurrentLine`,precondition:D.hasCodeLensProvider,label:R(935,`Show CodeLens Commands for Current Line`)})}async run(e,t){if(!t.hasModel())return;let n=e.get(Ud),r=e.get(wr),i=e.get(gt),a=t.getSelection().positionLineNumber,o=t.getContribution(qg.ID);if(!o)return;let s=await o.getModel();if(!s)return;let c=[];for(let e of s.lenses)e.symbol.command&&e.symbol.range.startLineNumber===a&&c.push({label:e.symbol.command.title,command:e.symbol.command});if(c.length===0)return;let l=await n.pick(c,{canPickMany:!1,placeHolder:S(934,`Select a command`)});if(!l)return;let u=l.command;if(s.isDisposed){let e=(await o.getModel())?.lenses.find(e=>e.symbol.range.startLineNumber===a&&e.symbol.command?.title===u.title);if(!e||!e.symbol.command)return;u=e.symbol.command}try{await r.executeCommand(u.id,...u.arguments||[])}catch(e){i.error(e)}}});var Jg=class{constructor(e,t,n,r){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=r,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}},Yg=class{constructor(e,t,n,r,i,a){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=i,this.supportsMarkerHover=a,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}},Xg=class{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(let e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}},Zg=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}},Qg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},$g=function(e,t){return function(n,r){t(n,r,e)}},e_=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){let r=t.range,i=t.color,a=new Hs(new Du(Math.round(255*i.red),Math.round(255*i.green),Math.round(255*i.blue),i.alpha)),o=Hs.Format.CSS.formatRGB(a),s=Hs.Format.CSS.formatHSL(a),c=Hs.Format.CSS.formatHexA(a,!0),l=[];return l.push({label:o,textEdit:{range:r,text:o}}),l.push({label:s,textEdit:{range:r,text:s}}),l.push({label:c,textEdit:{range:r,text:c}}),l}};e_=Qg([$g(0,or)],e_);var t_=class extends K{constructor(e,t){super(),this._register(e.colorProvider.register(`*`,new e_(t)))}};t_=Qg([$g(0,z),$g(1,or)],t_);async function n_(e,t,n,r=`auto`){return s_(new i_,e,t,n,r)}function r_(e,t,n,r){return Promise.resolve(n.provideColorPresentations(e,t,r))}var i_=class{constructor(){}async compute(e,t,n,r){let i=await e.provideDocumentColors(t,n);if(Array.isArray(i))for(let t of i)r.push({colorInfo:t,provider:e});return Array.isArray(i)}},a_=class{constructor(){}async compute(e,t,n,r){let i=await e.provideDocumentColors(t,n);if(Array.isArray(i))for(let e of i)r.push({range:e.range,color:[e.color.red,e.color.green,e.color.blue,e.color.alpha]});return Array.isArray(i)}},o_=class{constructor(e){this.colorInfo=e}async compute(e,t,n,r){let i=await e.provideColorPresentations(t,this.colorInfo,E.None);return Array.isArray(i)&&r.push(...i),Array.isArray(i)}};async function s_(e,t,n,r,i){let a=!1,o,s=[],c=t.ordered(n);for(let t=c.length-1;t>=0;t--){let l=c[t];if(i!==`always`&&l instanceof e_)o=l;else try{await e.compute(l,n,r,s)&&(a=!0)}catch(e){Ys(e)}}return a?s:o&&i!==`never`?(await e.compute(o,n,r,s),s):[]}function c_(e,t){let{colorProvider:n}=e.get(z),r=e.get(ot).getModel(t);if(!r)throw Mo();return{model:r,colorProviderRegistry:n,defaultColorDecoratorsEnablement:e.get(zi).getValue(`editor.defaultColorDecorators`,{resource:t})}}var l_=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},u_=function(e,t){return function(n,r){t(n,r,e)}},d_,f_=Object.create({}),p_=class extends K{static{d_=this}static{this.ID=`editor.contrib.colorDetector`}static{this.RECOMPUTE_TIME=1e3}static{this.colorDecoratorInnerWidthInEm=.8}static{this.colorDecoratorMarginInEm=.2}constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new I),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new m_),this._colorDecorationClassRefs=this._register(new I),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new il(this._editor));let i=this._editor.getContainerDomNode();i.style.setProperty(`--vscode-colorPicker-colorDecoratorWidth`,`${d_.colorDecoratorInnerWidthInEm}em`),i.style.setProperty(`--vscode-colorPicker-colorDecoratorMargin`,`${d_.colorDecoratorMarginInEm}em`),this._register(Wo(()=>{i.style.removeProperty(`--vscode-colorPicker-colorDecoratorWidth`),i.style.removeProperty(`--vscode-colorPicker-colorDecoratorMargin`)})),this._debounceInformation=r.for(n.colorProvider,`Document Colors`,{min:d_.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(e=>{let t=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(168);let n=t!==this._isColorDecoratorsEnabled||e.hasChanged(27),r=e.hasChanged(168);(n||r)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(168),this.updateColors()}isEnabled(){let e=this._editor.getModel();if(!e)return!1;let t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n==`object`){let e=n.colorDecorators;if(e&&e.enable!==void 0&&!e.enable)return e.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){this.removeAllDecorations();return}let e=this._editor.getModel();e&&this._languageFeaturesService.colorProvider.has(e)&&(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Ji,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=wt(async e=>{let t=this._editor.getModel();if(!t)return[];let n=new Es(!1),r=await n_(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,n.elapsed()),r});try{let e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){et(e)}}stop(){this._timeoutTimer&&=(this._timeoutTimer.cancel(),null),this._computePromise&&=(this._computePromise.cancel(),null),this._localToDispose.clear()}updateDecorations(e){let t=e.map(e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:F.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((t,n)=>this._colorDatas.set(t,e[n]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();let t=[],n=d_.colorDecoratorInnerWidthInEm+2*d_.colorDecoratorMarginInEm,r=this._editor.getOption(27);for(let i=0;i<e.length&&t.length<r;i++){let{red:r,green:a,blue:o,alpha:s}=e[i].colorInfo.color,c=new Du(Math.round(r*255),Math.round(a*255),Math.round(o*255),s),l=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,u=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:l}));t.push({range:{startLineNumber:e[i].colorInfo.range.startLineNumber,startColumn:e[i].colorInfo.range.startColumn,endLineNumber:e[i].colorInfo.range.endLineNumber,endColumn:e[i].colorInfo.range.endColumn},options:{description:`colorDetector`,before:{content:`\xA0`,inlineClassName:`${u.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:f_,widthInEm:n}}})}let i=r<e.length&&r;this._decoratorLimitReporter.update(e.length,i),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){let t=this._editor.getModel();if(!t)return null;let n=t.getDecorationsInRange(w.fromPositions(e,e)).filter(e=>this._colorDatas.has(e.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};p_=d_=l_([u_(1,zi),u_(2,z),u_(3,Vs)],p_);var m_=class extends K{constructor(){super(...arguments),this._onDidChange=this._register(new P),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}},h_=`editor.action.showHover`,g_=`editor.action.showDefinitionPreviewHover`,__=`editor.action.hideHover`,v_=`editor.action.scrollUpHover`,y_=`editor.action.scrollDownHover`,b_=`editor.action.scrollLeftHover`,x_=`editor.action.scrollRightHover`,S_=`editor.action.pageUpHover`,C_=`editor.action.pageDownHover`,w_=`editor.action.goToTopHover`,T_=`editor.action.goToBottomHover`,E_=`editor.action.increaseHoverVerbosityLevel`,D_=S(1160,`Increase Hover Verbosity Level`),O_=`editor.action.decreaseHoverVerbosityLevel`,k_=S(1161,`Decrease Hover Verbosity Level`),A_=`editor.action.hideLongLineWarningHover`,j_=`editor.action.inlineSuggest.commit`,M_=`editor.action.inlineSuggest.commitAlternativeAction`,N_=`editor.action.inlineSuggest.showPrevious`,P_=`editor.action.inlineSuggest.showNext`,F_=`editor.action.inlineSuggest.jump`,I_=`editor.action.inlineSuggest.hide`,L_=`editor.action.inlineSuggest.toggleShowCollapsed`,R_=`editor.action.inlineSuggest.renameSymbol`,z_=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},B_=function(e,t){return function(n,r){t(n,r,e)}},V_,H_=class extends K{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=tu(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar===`always`),this.sessionPosition=void 0,this.position=V(this,e=>{let t=this.model.read(e)?.primaryGhostText.read(e);if(!this.alwaysShowToolbar.read(e)||!t||t.parts.length===0)return this.sessionPosition=void 0,null;let n=t.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==t.lineNumber&&(this.sessionPosition=void 0);let r=new j(t.lineNumber,Math.min(n,this.sessionPosition?.column??2**53-1));return this.sessionPosition=r,r}),this._register(Bs((t,n)=>{let r=this.model.read(t);if(!r||!this.alwaysShowToolbar.read(t))return;let i=V(t=>{let n=t.store.add(this.instantiationService.createInstance(G_.hot.read(t),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(n),t.store.add(Wo(()=>e.removeContentWidget(n))),t.store.add(Al(e=>{this.position.read(e)&&r.lastTriggerKind.read(e)!==yi.Explicit&&r.triggerExplicitly()})),n}),a=jo(this,(e,t)=>!!this.position.read(e)||!!t);n.add(Al(e=>{a.read(e)&&i.read(e)}))}))}};H_=z_([B_(2,W)],H_);var U_=Dr(`inline-suggestion-hints-next`,A.chevronRight,S(1270,`Icon for show next parameter hint.`)),W_=Dr(`inline-suggestion-hints-previous`,A.chevronLeft,S(1271,`Icon for show previous parameter hint.`)),G_=class extends K{static{V_=this}static{this.hot=Zr(this)}static{this._dropDownVisible=!1}static get dropDownVisible(){return this._dropDownVisible}static{this.id=0}createCommandAction(e,t,n){let r=new mr(e,t,n,!0,()=>this._commandService.executeCommand(e));return r.tooltip=this.keybindingService.appendKeybinding(t,e,this._contextKeyService),r}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=i,this._extraCommands=a,this._warning=o,this._relayout=s,this._commandService=c,this.keybindingService=u,this._contextKeyService=d,this._menuService=f,this.id=`InlineSuggestionHintsContentWidget${V_.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=V(e=>{let t=this._warning.read(e);if(t)return typeof t.message==`string`?t.message:e.store.add(vl(t.message)).element}),this._warningMessageNode=C.div({class:`warningMessage`,style:{maxWidth:400,margin:4,marginBottom:4,display:V(e=>this._warning.read(e)?`block`:`none`)}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=Vr(`div.inlineSuggestionsHints`,{className:this.withBorder?`monaco-hover monaco-hover-content`:``},[this._warningMessageNode.element,Vr(`div@toolBar`)]),this.previousAction=this._register(this.createCommandAction(N_,S(1272,`Previous`),H.asClassName(W_))),this.availableSuggestionCountAction=this._register(new mr(`inlineSuggestionHints.availableSuggestionCount`,``,void 0,!1)),this.nextAction=this._register(this.createCommandAction(P_,S(1273,`Next`),H.asClassName(U_))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(O.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Mr(()=>{this.availableSuggestionCountAction.label=``},100)),this.disableButtonsDebounced=this._register(new Mr(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(Al(e=>{this._warningMessageContentNode.read(e),this._warningMessageNode.readEffect(e),this._relayout()})),this.toolBar=this._register(l.createInstance(J_,this.nodes.toolBar,O.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith(`primary`)},actionViewItemProvider:(e,t)=>{if(e instanceof ki)return l.createInstance(q_,e,void 0);if(e===this.availableSuggestionCountAction){let t=new K_(void 0,e,{label:!0,icon:!1});return t.setClass(`availableSuggestionCount`),t}},telemetrySource:`InlineSuggestionToolbar`})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(e=>{V_._dropDownVisible=e})),this._register(Al(e=>{this._position.read(e),this.editor.layoutContentWidget(this)})),this._register(Al(e=>{let t=this._suggestionCount.read(e),n=this._currentSuggestionIdx.read(e);t===void 0?this.clearAvailableSuggestionCountLabelDebounced.schedule():(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${n+1}/${t}`),t!==void 0&&t>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Al(e=>{let t=this._extraCommands.read(e).map(e=>({class:void 0,id:e.command.id,enabled:!0,tooltip:e.command.tooltip||``,label:e.command.title,run:()=>this._commandService.executeCommand(e.command.id,...e.command.arguments??[])}));for(let[e,n]of this.inlineCompletionsActionsMenus.getActions())for(let e of n)e instanceof ki&&t.push(e);t.length>0&&t.unshift(new Eo),this.toolBar.setAdditionalSecondaryActions(t)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};G_=V_=z_([B_(8,wr),B_(9,W),B_(10,ba),B_(11,Na),B_(12,Jr)],G_);var K_=class extends ho{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(){}},q_=class extends $i{updateLabel(){let e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){let t=Vr(`div.keybinding`).root;this._register(new Mf(t,ms,{disableTitle:!0,...bt})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add(`inlineSuggestionStatusBarItemLabel`)}}updateTooltip(){}},J_=class extends bf{constructor(e,t,n,r,i,a,o,s,c){super(e,{resetMenu:t,...n},r,i,a,o,s,c),this.menuId=t,this.options2=n,this.menuService=r,this.contextKeyService=i,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(){let{primary:e,secondary:t}=Ka(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){Od(this.prependedPrimaryActions,e,(e,t)=>e===t)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Od(this.additionalActions,e,(e,t)=>e===t)||(this.additionalActions=e,this.updateToolbar())}};J_=z_([B_(3,Jr),B_(4,Na),B_(5,ec),B_(6,ba),B_(7,wr),B_(8,_t)],J_);function Y_(e,t,n){let r=ma(e);return!(t<r.left+3||t>r.left+r.width-3||n<r.top+3||n>r.top+r.height-3)}function X_(e,t,n){return e===`on`||e!==`off`&&Z_(t,n.event)}function Z_(e,t){return e===`altKey`?t.ctrlKey||t.metaKey:t.altKey}var Q_=class{constructor(e,t,n,r){this.value=e,this.isComplete=t,this.hasLoadingMessage=n,this.options=r}},$_=class extends K{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new P),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new ev(e=>this._triggerAsyncComputation(e),0)),this._syncComputationScheduler=this._register(new ev(e=>this._triggerSyncComputation(e),0)),this._loadingMessageScheduler=this._register(new ev(e=>this._triggerLoadingMessage(e),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&=(this._asyncIterable.cancel(),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=Lf(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(let 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(e){et(e)}})()):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;let t=this._state===0,n=this._state===4;this._onResult.fire(new Q_(this._result.slice(0),t,n,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)}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&=(this._asyncIterable.cancel(),null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}},ev=class extends K{constructor(e,t){super(),this._scheduler=this._register(new Mr(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}},tv=class{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new P,this._onDidResize=new P,this._sashListener=new I,this._size=new uu(0,0),this._minSize=new uu(0,0),this._maxSize=new uu(2**53-1,2**53-1),this.domNode=document.createElement(`div`),this._eastSash=new oi(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new oi(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new oi(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:Yr.North}),this._southSash=new oi(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:Yr.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,n=0;this._sashListener.add(du.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(du.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(n=r.currentX-r.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(n=-(r.currentX-r.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(du.any(this._eastSash.onDidReset,this._westSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(du.any(this._northSash.onDidReset,this._southSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,n,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){let{height:n,width:r}=this._minSize,{height:i,width:a}=this._maxSize;e=Math.max(n,Math.min(i,e)),t=Math.max(r,Math.min(a,t));let o=new uu(t,e);uu.equals(o,this._size)||(this.domNode.style.height=e+`px`,this.domNode.style.width=t+`px`,this._size=o,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}},nv=30,rv=24,iv=class extends K{constructor(e,t=new uu(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new tv),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position=`absolute`,this._resizableNode.minSize=uu.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(e=>{this._resize(new uu(e.dimension.width,e.dimension.height)),e.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?j.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(t&&n)return ma(t).top+n.top-nv}_availableVerticalSpaceBelow(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;let r=ma(t),i=Mt(t.ownerDocument.body),a=r.top+n.top+n.height;return i.height-a-rv}_findPositionPreference(e,t){let n=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),r=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),i=Math.min(e,Math.min(Math.max(r,n),e)),a;return a=this._editor.getOption(69).above?i<=r?1:2:i<=n?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)}},av=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ov=function(e,t){return function(n,r){t(n,r,e)}},sv,cv=30,lv=class extends iv{static{sv=this}static{this.ID=`editor.contrib.resizableContentHoverWidget`}static{this._lastDimensions=new uu(0,0)}get isVisibleFromKeyboard(){return this._renderedHover?.source===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,n,r,i){let a=e.getOption(75)+8,o=new uu(150,a);super(e,o),this._configurationService=n,this._accessibilityService=r,this._keybindingService=i,this._hover=this._register(new Fo(!0)),this._onDidResize=this._register(new P),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new P),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new P),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=o,this._hoverVisibleKey=D.hoverVisible.bindTo(t),this._hoverFocusedKey=D.hoverFocused.bindTo(t),q(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(e=>{e.hasChanged(59)&&this._updateFont()}));let s=this._register(sr(this._resizableNode.domNode));this._register(s.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(s.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(e=>{this._onDidScroll.fire(e)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return sv.ID}static _applyDimensions(e,t,n){let r=typeof t==`number`?`${t}px`:t,i=typeof n==`number`?`${n}px`:n;e.style.width=r,e.style.height=i}_setContentsDomNodeDimensions(e,t){let n=this._hover.contentsDomNode;return sv._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){let n=this._hover.containerDomNode;return sv._applyDimensions(n,e,t)}_setScrollableElementDimensions(e,t){let n=this._hover.scrollbar.getDomNode();return sv._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){let r=typeof t==`number`?`${t}px`:t,i=typeof n==`number`?`${n}px`:n;e.style.maxWidth=r,e.style.maxHeight=i}_setHoverWidgetMaxDimensions(e,t){sv._applyMaxDimensions(this._hover.contentsDomNode,e,t),sv._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),sv._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(){let e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new uu(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){sv._lastDimensions=new uu(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(){let e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){let e=this._findAvailableSpaceVertically();if(!e)return;let t=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(e=>{t+=e.clientHeight}),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty(`--vscode-hover-whiteSpace`,`nowrap`),this._hover.containerDomNode.style.setProperty(`--vscode-hover-sourceWhiteSpace`,`nowrap`);let e=Array.from(this._hover.contentsDomNode.children).some(e=>e.scrollWidth>e.clientWidth);return this._hover.containerDomNode.style.removeProperty(`--vscode-hover-whiteSpace`),this._hover.containerDomNode.style.removeProperty(`--vscode-hover-sourceWhiteSpace`),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;let e=this._isHoverTextOverflowing(),t=this._contentWidth===void 0?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidth<t?Mt(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;let n=ma(this.getDomNode());this._renderedHover.closestMouseDistance===void 0&&(this._renderedHover.closestMouseDistance=uv(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,n.left,n.top,n.width,n.height));let r=uv(e,t,n.left,n.top,n.width,n.height);return r>this._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,r),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle(`hidden`,!e)}_updateFont(){let{fontSize:e,lineHeight:t}=this._editor.getOption(59),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName(`code`)).forEach(e=>this._editor.applyFontInfo(e))}_updateContent(e){let t=this._hover.contentsDomNode;t.style.paddingBottom=``,t.textContent=``,t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){let e=Math.max(this._editor.getLayoutInfo().height/4,250,sv._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,sv._lastDimensions.width);this._resizableNode.maxSize=new uu(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);let t=ml(this._hover.containerDomNode),n=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,n)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();let r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&rt(this._configurationService.getValue(`accessibility.verbosity.hover`)===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding(`editor.action.accessibleView`)?.getAriaLabel()??``);r&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+`, `+r)}hide(){if(!this._renderedHover)return;let e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new uu(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){let e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions(`auto`,`auto`),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new uu(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){let e=this._contentWidth===void 0?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new uu(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();let e=this._hover.contentsDomNode,t=ml(e),n=dt(e)+2;if(this._resizableNode.layout(t,n),this._setHoverWidgetDimensions(n,t),t=ml(e),n=dt(e),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(t,n),this._renderedHover?.showAtPosition){let e=ml(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(e,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-cv})}scrollRight(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+cv})}pageUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){let 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})}};lv=sv=av([ov(1,Na),ov(2,zi),ov(3,En),ov(4,ba)],lv);function uv(e,t,n,r,i,a){let o=n+i/2,s=r+a/2,c=Math.max(Math.abs(e-o)-i/2,0),l=Math.max(Math.abs(t-s)-a/2,0);return Math.sqrt(c*c+l*l)}var dv=class e{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];let n=e.getModel(),r=t.range.startLineNumber;if(r>n.getLineCount())return[];let i=n.getLineMaxColumn(r);return e.getLineDecorations(r).filter(e=>{if(e.options.isWholeLine)return!0;let n=e.range.startLineNumber===r?e.range.startColumn:1,a=e.range.endLineNumber===r?e.range.endColumn:i;if(e.options.showIfCollapsed){if(n>t.range.startColumn+1||t.range.endColumn-1>a)return!1}else if(n>t.range.startColumn||t.range.endColumn>a)return!1;return!0})}computeAsync(t,n){let r=t.anchor;if(!this._editor.hasModel()||!r)return Ti.EMPTY;let i=e._getLineDecorations(this._editor,r);return Ti.merge(this._participants.map(e=>e.computeAsync?e.computeAsync(r,i,t.source,n):Ti.EMPTY))}computeSync(t){if(!this._editor.hasModel())return[];let n=t.anchor,r=e._getLineDecorations(this._editor,n),i=[];for(let e of this._participants)i=i.concat(e.computeSync(n,r,t.source));return fu(i)}},fv=class{constructor(e,t,n){this.hoverParts=e,this.isComplete=t,this.options=n}filter(e){let t=this.hoverParts.filter(t=>t.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new pv(this,t,this.isComplete,this.options)}},pv=class extends fv{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}},mv=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},hv=function(e,t){return function(n,r){t(n,r,e)}},gv=N,_v=class extends K{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=gv(`div.hover-row.status-bar`),this.hoverElement.tabIndex=0,this.actionsElement=q(this.hoverElement,gv(`div.actions`))}addAction(e){let t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;this._hasContent=!0;let r=this._register(uo.render(this.actionsElement,e,n));return this._register(this._hoverService.setupManagedHover(Qs(`element`),r.actionContainer,r.actionRenderedLabel)),this.actions.push(r),r}append(e){let t=q(this.actionsElement,e);return this._hasContent=!0,t}};_v=mv([hv(0,ba),hv(1,iu)],_v);var vv=class e{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){let e=this._findScopeDecorationIds.map(e=>this._editor.getModel().getDecorationRange(e)).filter(e=>!!e);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){let t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){let t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(t){let n=this._editor.getModel().getDecorationsInRange(t);for(let t of n){let n=t.options;if(n===e._FIND_MATCH_DECORATION||n===e._FIND_MATCH_NO_OVERVIEW_DECORATION||n===e._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(t.id)}return 0}setCurrentFindMatch(t){let n=null,r=0;if(t)for(let e=0,i=this._decorations.length;e<i;e++){let i=this._editor.getModel().getDecorationRange(this._decorations[e]);if(t.equalsRange(i)){n=this._decorations[e],r=e+1;break}}return(this._highlightedDecorationId!==null||n!==null)&&this._editor.changeDecorations(t=>{if(this._highlightedDecorationId!==null&&(t.changeDecorationOptions(this._highlightedDecorationId,e._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),n!==null&&(this._highlightedDecorationId=n,t.changeDecorationOptions(this._highlightedDecorationId,e._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(t.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),n!==null){let r=this._editor.getModel().getDecorationRange(n);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){let e=r.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);r=new w(r.startLineNumber,r.startColumn,e,t)}this._rangeHighlightDecorationId=t.addDecoration(r,e._RANGE_HIGHLIGHT_DECORATION)}}),r}set(t,n){this._editor.changeDecorations(r=>{let i=e._FIND_MATCH_DECORATION,a=[];if(t.length>1e3){i=e._FIND_MATCH_NO_OVERVIEW_DECORATION;let n=this._editor.getModel().getLineCount(),r=this._editor.getLayoutInfo().height/n,o=Math.max(2,Math.ceil(3/r)),s=t[0].range.startLineNumber,c=t[0].range.endLineNumber;for(let n=1,r=t.length;n<r;n++){let r=t[n].range;c+o>=r.startLineNumber?r.endLineNumber>c&&(c=r.endLineNumber):(a.push({range:new w(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),s=r.startLineNumber,c=r.endLineNumber)}a.push({range:new w(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let o=Array(t.length);for(let e=0,n=t.length;e<n;e++)o[e]={range:t[e].range,options:i};this._decorations=r.deltaDecorations(this._decorations,o),this._overviewRulerApproximateDecorations=r.deltaDecorations(this._overviewRulerApproximateDecorations,a),this._rangeHighlightDecorationId&&=(r.removeDecoration(this._rangeHighlightDecorationId),null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(e=>r.removeDecoration(e)),this._findScopeDecorationIds=[]),n?.length&&(this._findScopeDecorationIds=n.map(t=>r.addDecoration(t,e._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){let n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.endLineNumber>e.lineNumber)&&(r.endLineNumber<e.lineNumber||!(r.endColumn>e.column)))return r}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;t<n;t++){let n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.startLineNumber<e.lineNumber)&&(r.startLineNumber>e.lineNumber||!(r.startColumn<e.column)))return r}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}static{this._CURRENT_FIND_MATCH_DECORATION=F.register({description:`current-find-match`,stickiness:1,zIndex:13,className:`currentFindMatch`,inlineClassName:`currentFindMatchInline`,showIfCollapsed:!0,overviewRuler:{color:to(pa),position:Xi.Center},minimap:{color:to(Iu),position:1}})}static{this._FIND_MATCH_DECORATION=F.register({description:`find-match`,stickiness:1,zIndex:10,className:`findMatch`,inlineClassName:`findMatchInline`,showIfCollapsed:!0,overviewRuler:{color:to(pa),position:Xi.Center},minimap:{color:to(Iu),position:1}})}static{this._FIND_MATCH_NO_OVERVIEW_DECORATION=F.register({description:`find-match-no-overview`,stickiness:1,className:`findMatch`,showIfCollapsed:!0})}static{this._FIND_MATCH_ONLY_OVERVIEW_DECORATION=F.register({description:`find-match-only-overview`,stickiness:1,overviewRuler:{color:to(pa),position:Xi.Center}})}static{this._RANGE_HIGHLIGHT_DECORATION=F.register({description:`find-range-highlight`,stickiness:1,className:`rangeHighlight`,isWholeLine:!0})}static{this._FIND_SCOPE_DECORATION=F.register({description:`find-scope`,className:`findScope`,isWholeLine:!0})}},yv=class{constructor(e,t,n){this._editorSelection=e,this._ranges=t,this._replaceStrings=n,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){let e=[];for(let t=0;t<this._ranges.length;t++)e.push({range:this._ranges[t],text:this._replaceStrings[t]});e.sort((e,t)=>w.compareRangesUsingStarts(e.range,t.range));let n=[],r=e[0];for(let t=1;t<e.length;t++)r.range.endLineNumber===e[t].range.startLineNumber&&r.range.endColumn===e[t].range.startColumn?(r.range=r.range.plusRange(e[t].range),r.text+=e[t].text):(n.push(r),r=e[t]);n.push(r);for(let e of n)t.addEditOperation(e.range,e.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}};function bv(e,t){if(e&&e[0]!==``){let n=xv(e,t,`-`),r=xv(e,t,`_`);return n&&!r?Sv(e,t,`-`):!n&&r?Sv(e,t,`_`):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():su(e[0][0])&&t.length>0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}return t}function xv(e,t,n){return e[0].indexOf(n)!==-1&&t.indexOf(n)!==-1&&e[0].split(n).length===t.split(n).length}function Sv(e,t,n){let r=t.split(n),i=e[0].split(n),a=``;return r.forEach((e,t)=>{a+=bv([i[t]],e)+n}),a.slice(0,-1)}var Cv=class{constructor(e){this.staticValue=e,this.kind=0}},wv=class{constructor(e){this.pieces=e,this.kind=1}},Tv=class e{static fromStaticValue(t){return new e([Ev.staticValue(t)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){this._state=!e||e.length===0?new Cv(``):e.length===1&&e[0].staticValue!==null?new Cv(e[0].staticValue):new wv(e)}buildReplaceString(t,n){if(this._state.kind===0)return n?bv(t,this._state.staticValue):this._state.staticValue;let r=``;for(let n=0,i=this._state.pieces.length;n<i;n++){let i=this._state.pieces[n];if(i.staticValue!==null){r+=i.staticValue;continue}let a=e._substitute(i.matchIndex,t);if(i.caseOps!==null&&i.caseOps.length>0){let e=[],t=i.caseOps.length,n=0;for(let r=0,o=a.length;r<o;r++){if(n>=t){e.push(a.slice(r));break}switch(i.caseOps[n]){case`U`:e.push(a[r].toUpperCase());break;case`u`:e.push(a[r].toUpperCase()),n++;break;case`L`:e.push(a[r].toLowerCase());break;case`l`:e.push(a[r].toLowerCase()),n++;break;default:e.push(a[r])}}a=e.join(``)}r+=a}return r}static _substitute(e,t){if(t===null)return``;if(e===0)return t[0];let n=``;for(;e>0;){if(e<t.length)return(t[e]||``)+n;n=String(e%10)+n,e=Math.floor(e/10)}return`$`+n}},Ev=class e{static staticValue(t){return new e(t,-1,null)}static caseOps(t,n){return new e(null,t,n)}constructor(e,t,n){this.staticValue=e,this.matchIndex=t,this.caseOps=!n||n.length===0?null:n.slice(0)}},Dv=class{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=``}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,n){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Ev.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),this._result[this._resultLen++]=Ev.caseOps(e,n),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Ev.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),new Tv(this._result)}};function Ov(e){if(!e||e.length===0)return new Tv(null);let t=[],n=new Dv(e);for(let r=0,i=e.length;r<i;r++){let a=e.charCodeAt(r);if(a===92){if(r++,r>=i)break;let a=e.charCodeAt(r);switch(a){case 92:n.emitUnchanged(r-1),n.emitStatic(`\\`,r+1);break;case 110:n.emitUnchanged(r-1),n.emitStatic(`
@@ -49,4 +49,4 @@ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{a as t,c as n,n as r,r
49
49
  `);return new e(t,n,i,l,a,o,u)}constructor(e,t,n,r,i,a,o){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=r,this.wholeWord=i,this.matchCase=a,this.currentMatch=o}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;let e=this._getNextMatch();return e?new yz(this._editor.getSelections().concat(e),e,0):null}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;let e=this._getNextMatch();if(!e)return null;let t=this._editor.getSelections();return new yz(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){let e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();let e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return n?new J(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;let e=this._getPreviousMatch();return e?new yz(this._editor.getSelections().concat(e),e,0):null}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;let e=this._getPreviousMatch();if(!e)return null;let t=this._editor.getSelections();return new yz(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){let e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();let e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return n?new J(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();let t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}},xz=class e extends K{static{this.ID=`editor.contrib.multiCursorController`}static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._sessionDispose=this._register(new I),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){let t=bz.create(this._editor,e);if(!t)return;this._session=t;let n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(e=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(e=>{(e.matchCase||e.wholeWord)&&this._endSession()}))}}_endSession(){this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController&&this._session.findController.getState().change({wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0},!1),this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;let n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new J(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){let t=this._editor.getSelections();if(t.length>1){let n=e.getState().matchCase;if(!jz(this._editor.getModel(),t,n)){let e=this._editor.getModel(),n=[];for(let r=0,i=t.length;r<i;r++)n[r]=this._expandEmptyToWord(e,t[r]);this._editor.setSelections(n);return}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null,n=e.getState();if(n.isRevealed&&n.searchString.length>0&&n.isRegex){let e=this._editor.getModel();t=n.searchScope?e.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(148):null,!1,1073741824):e.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){let e=this._editor.getSelection();for(let n=0,r=t.length;n<r;n++){let r=t[n];if(r.range.intersectRanges(e)){t[n]=t[0],t[0]=r;break}}this._setSelections(t.map(e=>new J(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)))}}},Sz=class extends G{run(e,t){let n=xz.get(t);if(!n)return;let r=t._getViewModel();if(r){let i=r.getCursorStates(),a=_w.get(t);if(a)this._run(n,a);else{let r=e.get(W).createInstance(_w,t);this._run(n,r),r.dispose()}pz(i,r.getCursorStates())}}},Cz=class extends Sz{constructor(){super({id:`editor.action.addSelectionToNextFindMatch`,label:R(1369,`Add Selection to Next Find Match`),precondition:void 0,kbOpts:{kbExpr:D.focus,primary:2082,weight:100},menuOpts:{menuId:O.MenubarSelectionMenu,group:`3_multi`,title:S(1359,`Add &&Next Occurrence`),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}},wz=class extends Sz{constructor(){super({id:`editor.action.addSelectionToPreviousFindMatch`,label:R(1370,`Add Selection to Previous Find Match`),precondition:void 0,menuOpts:{menuId:O.MenubarSelectionMenu,group:`3_multi`,title:S(1360,`Add P&&revious Occurrence`),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}},Tz=class extends Sz{constructor(){super({id:`editor.action.moveSelectionToNextFindMatch`,label:R(1371,`Move Last Selection to Next Find Match`),precondition:void 0,kbOpts:{kbExpr:D.focus,primary:Er(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}},Ez=class extends Sz{constructor(){super({id:`editor.action.moveSelectionToPreviousFindMatch`,label:R(1372,`Move Last Selection to Previous Find Match`),precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}},Dz=class extends Sz{constructor(){super({id:`editor.action.selectHighlights`,label:R(1373,`Select All Occurrences of Find Match`),precondition:void 0,kbOpts:{kbExpr:D.focus,primary:3114,weight:100},menuOpts:{menuId:O.MenubarSelectionMenu,group:`3_multi`,title:S(1361,`Select All &&Occurrences`),order:7}})}_run(e,t){e.selectAll(t)}},Oz=class extends Sz{constructor(){super({id:`editor.action.changeAll`,label:R(1374,`Change All Occurrences`),precondition:T.and(D.writable,D.editorTextFocus),kbOpts:{kbExpr:D.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:`1_modification`,order:1.2}})}_run(e,t){e.selectAll(t)}},kz=class{constructor(e,t,n,r,i){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=r,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),i&&this._model===i._model&&this._searchText===i._searchText&&this._matchCase===i._matchCase&&this._wordSeparators===i._wordSeparators&&this._modelVersionId===i._modelVersionId&&(this._cachedFindMatches=i._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(w.compareRangesUsingStarts)),this._cachedFindMatches}},Az=class extends K{static{fz=this}static{this.ID=`editor.contrib.selectionHighlighter`}constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Mr(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(t=>{this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123)})),this._register(e.onDidChangeCursorSelection(e=>{this._isEnabled&&(e.selection.isEmpty()?e.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(e=>{this._setState(null)})),this._register(e.onDidChangeModelContent(e=>{this._isEnabled&&this.updateSoon.schedule()}));let n=_w.get(e);n&&this._register(n.getState().onFindReplaceStateChange(e=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(fz._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(e,t,n,r,i){if(!t||!i.hasModel())return null;if(!n){let e=i.getSelection();if(e.startLineNumber!==e.endLineNumber)return null}let a=xz.get(i);if(!a)return null;let o=_w.get(i);if(!o)return null;let s=a.getSession(o);if(!s){let e=i.getSelections();if(e.length>1){let t=o.getState().matchCase;if(!jz(i.getModel(),e,t))return null}s=bz.create(i,o)}if(!s||s.currentMatch||/^[ \t]+$/.test(s.searchText)||r>0&&s.searchText.length>r)return null;let c=o.getState(),l=c.matchCase;if(c.isRevealed){let e=c.searchString;l||(e=e.toLowerCase());let t=s.searchText;if(l||(t=t.toLowerCase()),e===t&&s.matchCase===c.matchCase&&s.wholeWord===c.wholeWord&&!c.isRegex)return null}return new kz(i.getModel(),s.searchText,s.matchCase,s.wholeWord?i.getOption(148):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;let t=this.editor.getModel();if(t.isTooLargeForTokenization())return;let n=this.state.findMatches(),r=this.editor.getSelections();r.sort(w.compareRangesUsingStarts);let i=[];for(let e=0,t=0,a=n.length,o=r.length;e<a;){let a=n[e];if(t>=o)i.push(a),e++;else{let n=w.compareRangesUsingStarts(a,r[t]);n<0?((r[t].isEmpty()||!w.areIntersecting(a,r[t]))&&i.push(a),e++):(n>0||e++,t++)}}let a=this.editor.getOption(90)!==`off`,o=this._languageFeaturesService.documentHighlightProvider.has(t)&&a,s=i.map(e=>({range:e,options:lz(o)}));this._decorations.set(s)}dispose(){this._setState(null),super.dispose()}};Az=fz=uz([dz(1,z)],Az);function jz(e,t,n){let r=Mz(e,t[0],!n);for(let i=1,a=t.length;i<a;i++){let a=t[i];if(a.isEmpty()||r!==Mz(e,a,!n))return!1}return!0}function Mz(e,t,n){let r=e.getValueInRange(t);return n?r.toLowerCase():r}var Nz=class extends G{constructor(){super({id:`editor.action.focusNextCursor`,label:R(1375,`Focus Next Cursor`),metadata:{description:S(1362,`Focuses the next cursor`),args:[]},precondition:void 0})}run(e,t,n){if(!t.hasModel())return;let r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();let i=Array.from(r.getCursorStates()),a=i.shift();a&&(i.push(a),r.setCursorStates(n.source,3,i),r.revealPrimaryCursor(n.source,!0),pz(i,r.getCursorStates()))}},Pz=class extends G{constructor(){super({id:`editor.action.focusPreviousCursor`,label:R(1376,`Focus Previous Cursor`),metadata:{description:S(1363,`Focuses the previous cursor`),args:[]},precondition:void 0})}run(e,t,n){if(!t.hasModel())return;let r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();let i=Array.from(r.getCursorStates()),a=i.pop();a&&(i.unshift(a),r.setCursorStates(n.source,3,i),r.revealPrimaryCursor(n.source,!0),pz(i,r.getCursorStates()))}};Ms(xz.ID,xz,4),Ms(Az.ID,Az,1),B(mz),B(hz),B(gz),B(Cz),B(wz),B(Tz),B(Ez),B(Dz),B(Oz),B(_z),B(vz),B(Nz),B(Pz);var Fz={Visible:new M(`parameterHintsVisible`,!1),MultipleSignatures:new M(`parameterHintsMultipleSignatures`,!1)};async function Iz(e,t,n,r,i){let a=e.ordered(t);for(let e of a)try{let a=await e.provideSignatureHelp(t,n,i,r);if(a)return a}catch(e){Ys(e)}}Pn.registerCommand(`_executeSignatureHelpProvider`,async(e,...t)=>{let[n,r,i]=t;Xn(qn.isUri(n)),Xn(j.isIPosition(r)),Xn(typeof i==`string`||!i);let a=e.get(z),o=await e.get(Vi).createModelReference(n);try{let e=await Iz(a.signatureHelpProvider,o.object.textEditorModel,j.lift(r),{triggerKind:si.Invoke,isRetrigger:!1,triggerCharacter:i},E.None);return e?(setTimeout(()=>e.dispose(),0),e.value):void 0}finally{o.dispose()}});var Lz;(function(e){e.Default={type:0};class t{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}}e.Pending=t;class n{constructor(e){this.hints=e,this.type=1}}e.Active=n})(Lz||={});var Rz=class e extends K{static{this.DEFAULT_DELAY=120}constructor(t,n,r=e.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new P),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Lz.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new sc),this.triggerChars=new Wn,this.retriggerChars=new Wn,this.triggerId=0,this.editor=t,this.providers=n,this.throttledDelayer=this._register(new Qn(r)),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(e=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(e=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(e=>this.onCursorChange(e))),this._register(this.editor.onDidChangeModelContent(e=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(e=>this.onDidType(e))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Lz.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){let n=this.editor.getModel();if(!n||!this.providers.has(n))return;let r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(et)}next(){if(this.state.type!==1)return;let e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,r=this.editor.getOption(98).cycle;(e<2||n)&&!r?this.cancel():this.updateActiveSignature(n&&r?0:t+1)}previous(){if(this.state.type!==1)return;let e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,r=this.editor.getOption(98).cycle;(e<2||n)&&!r?this.cancel():this.updateActiveSignature(n&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Lz.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){let t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;let r=this._pendingTriggers.reduce(zz);this._pendingTriggers=[];let i={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;let a=this.editor.getModel(),o=this.editor.getPosition();this.state=new Lz.Pending(wt(e=>Iz(this.providers,a,o,i,e)),n);try{let t=await this.state.request;return e===this.triggerId?!t||!t.value.signatures||t.value.signatures.length===0?(t?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Lz.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(t?.dispose(),!1)}catch(t){return e===this.triggerId&&(this.state=Lz.Default),et(t),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();let e=this.editor.getModel();if(e)for(let t of this.providers.ordered(e)){for(let e of t.signatureHelpTriggerCharacters||[])if(e.length){let t=e.charCodeAt(0);this.triggerChars.add(t),this.retriggerChars.add(t)}for(let e of t.signatureHelpRetriggerCharacters||[])e.length&&this.retriggerChars.add(e.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;let t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:si.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source===`mouse`?this.cancel():this.isTriggered&&this.trigger({triggerKind:si.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:si.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};function zz(e,t){switch(t.triggerKind){case si.Invoke:return t;case si.ContentChange:return e;case si.TriggerCharacter:default:return t}}var Bz=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Vz=function(e,t){return function(n,r){t(n,r,e)}},Hz,Uz=N,Wz=Dr(`parameter-hints-next`,A.chevronDown,S(1378,`Icon for show next parameter hint.`)),Gz=Dr(`parameter-hints-previous`,A.chevronUp,S(1379,`Icon for show previous parameter hint.`)),Kz=class extends K{static{Hz=this}static{this.ID=`editor.widget.parameterHintsWidget`}constructor(e,t,n,r){super(),this.editor=e,this.model=t,this.markdownRendererService=r,this.renderDisposeables=this._register(new I),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.keyVisible=Fz.Visible.bindTo(n),this.keyMultipleSignatures=Fz.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){let e=Uz(`.editor-widget.parameter-hints-widget`),t=q(e,Uz(`.phwrapper`));t.tabIndex=-1;let n=q(t,Uz(`.controls`)),r=q(n,Uz(`.button`+H.asCSSSelector(Gz))),i=q(n,Uz(`.overloads`)),a=q(n,Uz(`.button`+H.asCSSSelector(Wz)));this._register(L(r,`click`,e=>{Ts.stop(e),this.previous()})),this._register(L(a,`click`,e=>{Ts.stop(e),this.next()}));let o=Uz(`.body`),s=new ia(o,{alwaysConsumeMouseWheel:!0});this._register(s),t.appendChild(s.getDomNode());let c=q(o,Uz(`.signature`)),l=q(o,Uz(`.docs`));e.style.userSelect=`text`,this.domNodes={element:e,signature:c,overloads:i,docs:l,scrollbar:s},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(e=>{this.visible&&this.editor.layoutContentWidget(this)}));let u=()=>{if(!this.domNodes)return;let e=this.editor.getOption(59),t=this.domNodes.element;t.style.fontSize=`${e.fontSize}px`,t.style.lineHeight=`${e.lineHeight/e.fontSize}`,t.style.setProperty(`--vscode-parameterHintsWidget-editorFontFamily`,e.fontFamily),t.style.setProperty(`--vscode-parameterHintsWidget-editorFontFamilyDefault`,Ku.fontFamily)};u(),this._register(du.chain(this.editor.onDidChangeConfiguration.bind(this.editor),e=>e.filter(e=>e.hasChanged(59)))(u)),this._register(this.editor.onDidLayoutChange(e=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes?.element.classList.add(`visible`)},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove(`visible`),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;let t=e.signatures.length>1;this.domNodes.element.classList.toggle(`multiple`,t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText=``,this.domNodes.docs.innerText=``;let n=e.signatures[e.activeSignature];if(!n)return;let r=q(this.domNodes.signature,Uz(`.code`)),i=n.parameters.length>0,a=n.activeParameter??e.activeParameter;if(i)this.renderParameters(r,n,a);else{let e=q(r,Uz(`span`));e.textContent=n.label}let o=n.parameters[a];if(o?.documentation){let e=Uz(`span.documentation`);if(typeof o.documentation==`string`)e.textContent=o.documentation;else{let t=this.renderMarkdownDocs(o.documentation);e.appendChild(t.element)}q(this.domNodes.docs,Uz(`p`,{},e))}if(n.documentation!==void 0){if(typeof n.documentation==`string`)q(this.domNodes.docs,Uz(`p`,{},n.documentation));else{let e=this.renderMarkdownDocs(n.documentation);q(this.domNodes.docs,e.element)}}let s=this.hasDocs(n,o);if(this.domNodes.signature.classList.toggle(`has-docs`,s),this.domNodes.docs.classList.toggle(`empty`,!s),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,`0`)+`/`+e.signatures.length,o){let e=``,t=n.parameters[a];e=Array.isArray(t.label)?n.label.substring(t.label[0],t.label[1]):t.label,t.documentation&&(e+=typeof t.documentation==`string`?`, ${t.documentation}`:`, ${t.documentation.value}`),n.documentation&&(e+=typeof n.documentation==`string`?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==e&&(vo(S(1380,`{0}, hint`,e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){let t=this.renderDisposeables.add(this.markdownRendererService.render(e,{context:this.editor,asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));return t.element.classList.add(`markdown-docs`),t}hasDocs(e,t){return!!(t&&typeof t.documentation==`string`&&gn(t.documentation).length>0||t&&typeof t.documentation==`object`&&gn(t.documentation).value.length>0||e.documentation&&typeof e.documentation==`string`&&gn(e.documentation).length>0||e.documentation&&typeof e.documentation==`object`&&gn(e.documentation.value).length>0)}renderParameters(e,t,n){let[r,i]=this.getParameterLabelOffsets(t,n),a=document.createElement(`span`);a.textContent=t.label.substring(0,r);let o=document.createElement(`span`);o.textContent=t.label.substring(r,i),o.className=`parameter active`;let s=document.createElement(`span`);s.textContent=t.label.substring(i),q(e,a,o,s)}getParameterLabelOffsets(e,t){let n=e.parameters[t];if(!n)return[0,0];if(Array.isArray(n.label))return n.label;if(n.label.length){let t=RegExp(`(\\W|^)${td(n.label)}(?=\\W|$)`,`g`);t.test(e.label);let r=t.lastIndex-n.label.length;return r>=0?[r,t.lastIndex]:[0,0]}return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return Hz.ID}updateMaxHeight(){if(!this.domNodes)return;let e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;let t=this.domNodes.element.getElementsByClassName(`phwrapper`);t.length&&(t[0].style.maxHeight=e)}};Kz=Hz=Bz([Vz(2,Na),Vz(3,va)],Kz),k(`editorHoverWidget.highlightForeground`,br,S(1381,`Foreground color of the active item in the parameter hint.`));var qz=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Jz=function(e,t){return function(n,r){t(n,r,e)}},Yz,Xz=class extends K{static{Yz=this}static{this.ID=`editor.controller.parameterHints`}static get(e){return e.getContribution(Yz.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new Rz(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(e=>{e?(this.widget.value.show(),this.widget.value.render(e)):this.widget.rawValue?.hide()})),this.widget=new kc(()=>this._register(t.createInstance(Kz,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}};Xz=Yz=qz([Jz(1,W),Jz(2,z)],Xz);var Zz=class extends G{constructor(){super({id:`editor.action.triggerParameterHints`,label:R(1377,`Trigger Parameter Hints`),precondition:D.hasSignatureHelpProvider,kbOpts:{kbExpr:D.editorTextFocus,primary:3082,weight:100}})}run(e,t){Xz.get(t)?.trigger({triggerKind:si.Invoke})}};Ms(Xz.ID,Xz,2),B(Zz);var Qz=175,$z=$u.bindToContribution(Xz.get);U(new $z({id:`closeParameterHints`,precondition:Fz.Visible,handler:e=>e.cancel(),kbOpts:{weight:Qz,kbExpr:D.focus,primary:9,secondary:[1033]}})),U(new $z({id:`showPrevParameterHint`,precondition:T.and(Fz.Visible,Fz.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:Qz,kbExpr:D.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),U(new $z({id:`showNextParameterHint`,precondition:T.and(Fz.Visible,Fz.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:Qz,kbExpr:D.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var eB=class extends K{static{this.ID=`editor.contrib.placeholderText`}constructor(e){super(),this._editor=e,this._editorObs=ds(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=Cc({owner:this,equalsFn:_a},e=>{let t=this._placeholderText.read(e);if(t&&this._editorObs.valueIsEmpty.read(e))return{placeholder:t}}),this._shouldViewBeAlive=tB(this,e=>this._state.read(e)?.placeholder!==void 0),this._view=V(e=>{if(!this._shouldViewBeAlive.read(e))return;let t=Vr(`div.editorPlaceholder`);e.store.add(Al(e=>{let n=this._state.read(e),r=n?.placeholder!==void 0;t.root.style.display=r?`block`:`none`,t.root.innerText=n?.placeholder??``})),e.store.add(Al(e=>{let n=this._editorObs.layoutInfo.read(e);t.root.style.left=`${n.contentLeft}px`,t.root.style.width=n.contentWidth-n.verticalScrollbarWidth+`px`,t.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),e.store.add(Al(e=>{t.root.style.fontFamily=this._editorObs.getOption(58).read(e),t.root.style.fontSize=this._editorObs.getOption(61).read(e)+`px`,t.root.style.lineHeight=this._editorObs.getOption(75).read(e)+`px`})),e.store.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:Hi(0),position:Hi(null),domNode:t.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};function tB(e,t){return jo(e,(e,n)=>n===!0||t(e))}var nB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},rB=function(e,t){return function(n,r){t(n,r,e)}},iB=class{constructor(e){this.instantiationService=e}init(...e){}};function aB(e){return e()}var oB=class extends iB{constructor(e,t){super(t),this.init(e)}};oB=nB([rB(1,W)],oB),Ms(eB.ID,aB(()=>eB),0),k(`editor.placeholder.foreground`,Dt,S(1400,`Foreground color of the placeholder text in the editor.`));function sB(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return t}var cB=class e{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){let n=this.computeEmbedding(e),r=new Map,i=[];for(let[e,a]of this.documents){if(t.isCancellationRequested)return[];for(let t of a.chunks){let a=this.computeSimilarityScore(t,n,r);a>0&&i.push({key:e,score:a})}}return i}static termFrequencies(t){return sB(e.splitTerms(t))}static*splitTerms(e){let t=e=>e.toLowerCase();for(let[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);let e=n.replace(/([a-z])([A-Z])/g,`$1 $2`).split(/\s+/g);if(e.length>1)for(let n of e)n.length>2&&/\p{Letter}{3,}/gu.test(n)&&(yield t(n))}}updateDocuments(t){for(let{key:e}of t)this.deleteDocument(e);for(let n of t){let t=[];for(let r of n.textChunks){let n=e.termFrequencies(r);for(let e of n.keys())this.chunkOccurrences.set(e,(this.chunkOccurrences.get(e)??0)+1);t.push({text:r,tf:n})}this.chunkCount+=t.length,this.documents.set(n.key,{chunks:t})}return this}deleteDocument(e){let t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(let e of t.chunks)for(let t of e.tf.keys()){let e=this.chunkOccurrences.get(t);if(typeof e==`number`){let n=e-1;n<=0?this.chunkOccurrences.delete(t):this.chunkOccurrences.set(t,n)}}}}computeSimilarityScore(e,t,n){let r=0;for(let[i,a]of Object.entries(t)){let t=e.tf.get(i);if(!t)continue;let o=n.get(i);typeof o!=`number`&&(o=this.computeIdf(i),n.set(i,o));let s=t*o;r+=s*a}return r}computeEmbedding(t){let n=e.termFrequencies(t);return this.computeTfidf(n)}computeIdf(e){let t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){let t=Object.create(null);for(let[n,r]of e){let e=this.computeIdf(n);e>0&&(t[n]=r*e)}return t}};function lB(e){let t=e.slice(0);t.sort((e,t)=>t.score-e.score);let n=t[0]?.score??0;if(n>0)for(let e of t)e.score/=n;return t}var uB;(function(e){e[e.NO_ACTION=0]=`NO_ACTION`,e[e.CLOSE_PICKER=1]=`CLOSE_PICKER`,e[e.REFRESH_PICKER=2]=`REFRESH_PICKER`,e[e.REMOVE_ITEM=3]=`REMOVE_ITEM`})(uB||={});function dB(e){let t=e;return Array.isArray(t.items)}function fB(e){let t=e;return!!t.picks&&t.additionalPicks instanceof Promise}var pB=class extends K{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){let r=new I;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let i,a=r.add(new sc),o=async()=>{i?.dispose(!0),e.busy=!1;let r=a.value=new I;i=r.add(new Oo(t));let o=i.token,s=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(s=s.trim());let c=this._getPicks(s,r,o,n),l=(t,n)=>{let r,i;if(dB(t)?(r=t.items,i=t.active):r=t,r.length===0){if(n)return!1;(s.length>0||e.hideInput)&&this.options?.noResultsPick&&(r=Ff(this.options.noResultsPick)?[this.options.noResultsPick(s)]:[this.options.noResultsPick])}return e.items=r,i&&(e.activeItems=[i]),!0},u=async t=>{let n=!1,r=!1;await Promise.all([(async()=>{typeof t.mergeDelay==`number`&&(await xr(t.mergeDelay),o.isCancellationRequested)||r||(n=l(t.picks,!0))})(),(async()=>{e.busy=!0;try{let r=await t.additionalPicks;if(o.isCancellationRequested)return;let i,a;dB(t.picks)?(i=t.picks.items,a=t.picks.active):i=t.picks;let s,c;if(dB(r)?(s=r.items,c=r.active):s=r,s.length>0||!n){let t;if(!a&&!c){let n=e.activeItems[0];n&&i.indexOf(n)!==-1&&(t=n)}l({items:[...i,...s],active:a||c||t})}}finally{o.isCancellationRequested||(e.busy=!1),r=!0}})()])};if(c!==null){if(fB(c))await u(c);else if(!(c instanceof Promise))l(c);else{e.busy=!0;try{let e=await c;if(o.isCancellationRequested)return;fB(e)?await u(e):l(e)}finally{o.isCancellationRequested||(e.busy=!1)}}}};r.add(e.onDidChangeValue(()=>o())),o(),r.add(e.onDidAccept(t=>{if(n?.handleAccept){t.inBackground||e.hide(),n.handleAccept?.(e.activeItems[0],t.inBackground);return}let[r]=e.selectedItems;if(typeof r?.accept==`function`){if(mf(e.keyMods)&&r.attach){r.attach(e.keyMods,t);return}t.inBackground||e.hide(),r.accept(e.keyMods,t)}}));let s=async(n,r)=>{if(typeof r.trigger!=`function`)return;let i=r.buttons?.indexOf(n)??-1;if(i>=0){let n=r.trigger(i,e.keyMods),a=typeof n==`number`?n:await n;if(t.isCancellationRequested)return;switch(a){case uB.NO_ACTION:break;case uB.CLOSE_PICKER:e.hide();break;case uB.REFRESH_PICKER:o();break;case uB.REMOVE_ITEM:{let t=e.items.indexOf(r);if(t!==-1){let n=e.items.slice(),r=n.splice(t,1),i=e.activeItems.filter(e=>e!==r[0]),a=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=n,i&&(e.activeItems=i),e.keepScrollPosition=a}break}}}};return r.add(e.onDidTriggerItemButton(({button:e,item:t})=>s(e,t))),r.add(e.onDidTriggerSeparatorButton(({button:e,separator:t})=>s(e,t))),r}},mB=Object.freeze({View:R(1718,`View`),Help:R(1719,`Help`),Test:R(1720,`Test`),File:R(1721,`File`),Preferences:R(1722,`Preferences`),Developer:R(1723,`Developer`)}),hB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},gB=function(e,t){return function(n,r){t(n,r,e)}},_B,vB,yB=class extends pB{static{_B=this}static{this.PREFIX=`>`}static{this.TFIDF_THRESHOLD=.5}static{this.TFIDF_MAX_RESULTS=5}static{this.WORD_FILTER=dr(jn,Ru)}constructor(e,t,n,r,i,a){super(_B.PREFIX,e),this.keybindingService=n,this.commandService=r,this.telemetryService=i,this.dialogService=a,this.commandsHistory=this._register(t.createInstance(bB)),this.options=e}async _getPicks(e,t,n,r){let i=await this.getCommandPicks(n);if(n.isCancellationRequested)return[];let a=Cf(()=>{let t=new cB;return t.updateDocuments(i.map(e=>({key:e.commandId,textChunks:[this.getTfIdfChunk(e)]}))),lB(t.calculateScores(e,n)).filter(e=>e.score>_B.TFIDF_THRESHOLD).slice(0,_B.TFIDF_MAX_RESULTS)}),o=[];for(let t of i){let r=_B.WORD_FILTER(e,t.label)??void 0,i;if(t.commandAlias&&(i=_B.WORD_FILTER(e,t.commandAlias)??void 0),r||i)t.highlights={label:r,detail:this.options.showAlias?i:void 0},o.push(t);else if(e===t.commandId)o.push(t);else if(e.length>=3){let e=a();if(n.isCancellationRequested)return[];let r=e.find(e=>e.key===t.commandId);r&&(t.tfIdfScore=r.score,o.push(t))}}let s=new Map;for(let e of o){let t=s.get(e.label);t?(e.description=e.commandId,t.description=t.commandId):s.set(e.label,e)}o.sort((e,t)=>{if(e.tfIdfScore&&t.tfIdfScore)return e.tfIdfScore===t.tfIdfScore?e.label.localeCompare(t.label):t.tfIdfScore-e.tfIdfScore;if(e.tfIdfScore)return 1;if(t.tfIdfScore)return-1;let n=this.commandsHistory.peek(e.commandId),r=this.commandsHistory.peek(t.commandId);if(n&&r)return n>r?-1:1;if(n)return-1;if(r)return 1;if(this.options.suggestedCommandIds){let n=this.options.suggestedCommandIds.has(e.commandId),r=this.options.suggestedCommandIds.has(t.commandId);if(n&&r)return 0;if(n)return-1;if(r)return 1}let i=e.commandCategory===mB.Developer.value,a=t.commandCategory===mB.Developer.value;return i&&!a?1:!i&&a?-1:e.label.localeCompare(t.label)});let c=[],l=!1,u=!0,d=!!this.options.suggestedCommandIds;for(let e=0;e<o.length;e++){let t=o[e],n=!!this.commandsHistory.peek(t.commandId);e===0&&n&&(c.push({type:`separator`,label:S(1836,`recently used`)}),l=!0),u&&t.tfIdfScore!==void 0&&(c.push({type:`separator`,label:S(1837,`similar commands`)}),u=!1),d&&t.tfIdfScore===void 0&&!n&&this.options.suggestedCommandIds?.has(t.commandId)&&(c.push({type:`separator`,label:S(1838,`commonly used`)}),l=!0,d=!1),l&&t.tfIdfScore===void 0&&!n&&!this.options.suggestedCommandIds?.has(t.commandId)&&(c.push({type:`separator`,label:S(1839,`other commands`)}),l=!1),c.push(this.toCommandPick(t,r,n))}return this.hasAdditionalCommandPicks(e,n)?{picks:c,additionalPicks:(async()=>{let t=await this.getAdditionalCommandPicks(i,o,e,n);if(n.isCancellationRequested)return[];let a=t.map(e=>this.toCommandPick(e,r));return u&&a[0]?.type!==`separator`&&a.unshift({type:`separator`,label:S(1840,`similar commands`)}),a})()}:c}toCommandPick(e,t,n=!1){if(e.type===`separator`)return e;let r=e.tooltip??e.commandDescription?.value,i=this.keybindingService.lookupKeybinding(e.commandId),a=i?S(1841,`{0}, {1}`,e.label,i.getAriaLabel()):e.label,o=e.buttons||[],s=n?[...o,{iconClass:H.asClassName(A.close),tooltip:S(1842,`Remove from Recently Used`)}]:e.buttons;return{...e,id:e.commandId,tooltip:r,ariaLabel:a,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,buttons:s,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(t){Fi(t)||this.dialogService.error(S(1843,`Command '{0}' resulted in an error`,e.label),Cm(t))}},trigger:n?(t,n)=>t===o.length?(this.commandsHistory.remove(e.commandId),uB.REMOVE_ITEM):e.trigger?e.trigger(t,n):uB.NO_ACTION:e.trigger}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:n}){let r=e;return t&&t!==e&&(r+=` - ${t}`),n&&n.value!==e&&(r+=` - ${n.value===n.original?n.value:`${n.value} (${n.original})`}`),r}};yB=_B=hB([gB(1,W),gB(2,ba),gB(3,wr),gB(4,_t),gB(5,oa)],yB);var bB=class extends K{static{vB=this}static{this.DEFAULT_COMMANDS_HISTORY_LENGTH=50}static{this.PREF_KEY_CACHE=`commandPalette.mru.cache`}static{this.PREF_KEY_COUNTER=`commandPalette.mru.counter`}static{this.counter=1}static{this.hasChanges=!1}constructor(e,t,n){super(),this.storageService=e,this.configurationService=t,this.logService=n,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===Jo.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){(!e||e.affectsConfiguration(`workbench.commandPalette.history`))&&(this.configuredCommandsHistoryLength=vB.getConfiguredCommandHistoryLength(this.configurationService),vB.cache&&vB.cache.limit!==this.configuredCommandsHistoryLength&&(vB.cache.limit=this.configuredCommandsHistoryLength,vB.hasChanges=!0))}load(){let e=this.storageService.get(vB.PREF_KEY_CACHE,0),t;if(e)try{t=JSON.parse(e)}catch(e){this.logService.error(`[CommandsHistory] invalid data: ${e}`)}let n=vB.cache=new _i(this.configuredCommandsHistoryLength,1);if(t){let e;e=t.usesLRU?t.entries:t.entries.sort((e,t)=>e.value-t.value),e.forEach(e=>n.set(e.key,e.value))}vB.counter=this.storageService.getNumber(vB.PREF_KEY_COUNTER,0,vB.counter)}push(e){vB.cache&&(vB.cache.set(e,vB.counter++),vB.hasChanges=!0)}peek(e){return vB.cache?.peek(e)}remove(e){vB.cache&&(vB.cache.delete(e),vB.hasChanges=!0)}saveState(){if(!vB.cache||!vB.hasChanges)return;let e={usesLRU:!0,entries:[]};vB.cache.forEach((t,n)=>e.entries.push({key:n,value:t})),this.storageService.store(vB.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(vB.PREF_KEY_COUNTER,vB.counter,0,0),vB.hasChanges=!1}static getConfiguredCommandHistoryLength(e){let t=e.getValue().workbench?.commandPalette?.history;return typeof t==`number`?t:vB.DEFAULT_COMMANDS_HISTORY_LENGTH}};bB=vB=hB([gB(0,wc),gB(1,zi),gB(2,ku)],bB);var xB=class extends yB{constructor(e,t,n,r,i,a){super(e,t,n,r,i,a)}getCodeEditorCommandPicks(){let e=this.activeTextEditorControl;if(!e)return[];let t=[];for(let n of e.getSupportedActions()){let e;n.metadata?.description&&(e=Do(n.metadata.description)?n.metadata.description:{original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:e,label:Yi(n.label)||n.id})}return t}},SB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},CB=function(e,t){return function(n,r){t(n,r,e)}},wB=class extends xB{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,n,r,i,a){super({showAlias:!1},e,n,r,i,a),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};wB=SB([CB(0,W),CB(1,Js),CB(2,ba),CB(3,wr),CB(4,_t),CB(5,oa)],wB);var TB=class e extends G{static{this.ID=`editor.action.quickCommand`}constructor(){super({id:e.ID,label:_o.quickCommandActionLabel,alias:`Command Palette`,precondition:void 0,kbOpts:{kbExpr:D.focus,primary:59,weight:100},contextMenuOpts:{group:`z_commands`,order:1}})}run(e){e.get(Ud).quickAccess.show(wB.PREFIX)}};B(TB),Ot.as(Tn.Quickaccess).registerQuickAccessProvider({ctor:wB,prefix:wB.PREFIX,helpEntries:[{description:_o.quickCommandHelp,commandId:TB.ID}]});var EB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},DB=function(e,t){return function(n,r){t(n,r,e)}},OB,kB=class{static{OB=this}static{this.PREFIX=`?`}constructor(e,t,n){this.quickInputService=e,this.keybindingService=t,this.contextKeyService=n,this.registry=Ot.as(Tn.Quickaccess)}provide(e){let t=new I;return t.add(e.onDidAccept(()=>{let[t]=e.selectedItems;t&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(e=>{let t=this.registry.getQuickAccessProvider(e.substr(OB.PREFIX.length),this.contextKeyService);t?.prefix&&t.prefix!==OB.PREFIX&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(e=>e.prefix!==OB.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders(this.contextKeyService).sort((e,t)=>e.prefix.localeCompare(t.prefix)).flatMap(e=>this.createPicks(e))}createPicks(e){return e.helpEntries.map(t=>{let n=t.prefix||e.prefix,r=n||`…`;return{prefix:n,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:S(1844,`{0}, {1}`,r,t.description),description:t.description}})}};kB=OB=EB([DB(0,Ud),DB(1,ba),DB(2,Na)],kB),Ot.as(Tn.Quickaccess).registerQuickAccessProvider({ctor:kB,prefix:``,helpEntries:[{description:io.helpQuickAccessActionLabel}]});var AB=[void 0,[]];function jB(e,t,n=0,r=0){let i=t;return i.values&&i.values.length>1?MB(e,i.values,n,r):NB(e,t,n,r)}function MB(e,t,n,r){let i=0,a=[];for(let o of t){let[t,s]=NB(e,o,n,r);if(typeof t!=`number`)return AB;i+=t,a.push(...s)}return[i,PB(a)]}function NB(e,t,n,r){let i=Aa(t.normalized,t.normalizedLowercase,n,e,e.toLowerCase(),r,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?[i[0],Un(i)]:AB}new pi(`allowNonContiguousMatches`),new pi(`description`),new pi(`label`),new pi(`values`),new pi(`expectContiguousMatch`),new pi(`value`);function PB(e){let t=e.sort((e,t)=>e.start-t.start),n=[],r;for(let e of t)!r||!FB(r,e)?(r=e,n.push(e)):(r.start=Math.min(r.start,e.start),r.end=Math.max(r.end,e.end));return n}function FB(e,t){return!(e.end<t.start||t.end<e.start)}function IB(e){return e.startsWith(`"`)&&e.endsWith(`"`)}var LB=` `;function RB(e){typeof e!=`string`&&(e=``);let t=e.toLowerCase(),{pathNormalized:n,normalized:r,normalizedLowercase:i}=zB(e),a=n.indexOf(In)>=0,o=IB(e),s,c=e.split(LB);if(c.length>1)for(let e of c){let t=IB(e),{pathNormalized:n,normalized:r,normalizedLowercase:i}=zB(e);r&&(s||=[],s.push({original:e,originalLowercase:e.toLowerCase(),pathNormalized:n,normalized:r,normalizedLowercase:i,expectContiguousMatch:t}))}return{original:e,originalLowercase:t,pathNormalized:n,normalized:r,normalizedLowercase:i,values:s,containsPathSeparator:a,expectContiguousMatch:o}}function zB(e){let t;t=Gt?e.replace(/\//g,In):e.replace(/\\/g,In);let n=t.replace(/[\*\u2026\s"]/g,``).replace(/(?<=.)#$/,``);return{pathNormalized:t,normalized:n,normalizedLowercase:n.toLowerCase()}}function BB(e){return RB(Array.isArray(e)?e.map(e=>e.original).join(LB):e.original)}var VB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},HB=function(e,t){return function(n,r){t(n,r,e)}},UB,WB=class extends BE{static{UB=this}static{this.PREFIX=`@`}static{this.SCOPE_PREFIX=`:`}static{this.PREFIX_BY_CATEGORY=`${this.PREFIX}${this.SCOPE_PREFIX}`}constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,S(1414,`To go to a symbol, first open a text editor with symbol information.`)),K.None}provideWithTextEditor(e,t,n,r){let i=e.editor,a=this.getModel(i);return a?this._languageFeaturesService.documentSymbolProvider.has(a)?this.doProvideWithEditorSymbols(e,a,t,n,r):this.doProvideWithoutEditorSymbols(e,a,t,n):K.None}doProvideWithoutEditorSymbols(e,t,n,r){let i=new I;return this.provideLabelPick(n,S(1415,`The active text editor does not provide symbol information.`)),(async()=>{await this.waitForLanguageSymbolRegistry(t,i)&&!r.isCancellationRequested&&i.add(this.doProvideWithEditorSymbols(e,t,n,r))})(),i}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;let n=new vn,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),n.complete(!0))}));return t.add(Wo(()=>n.complete(!1))),n.p}doProvideWithEditorSymbols(e,t,n,r,i){let a=e.editor,o=new I;o.add(n.onDidAccept(t=>{let[r]=n.selectedItems;if(r&&r.range){if(n.keyMods.shift&&r.attach){r.attach(n.keyMods,t);return}this.gotoLocation(e,{range:r.range.selection,keyMods:n.keyMods,preserveFocus:t.inBackground}),i?.handleAccept?.(r,t.inBackground),t.inBackground||n.hide()}})),o.add(n.onDidTriggerItemButton(({item:t})=>{t&&t.range&&(this.gotoLocation(e,{range:t.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));let s=this.getDocumentSymbols(t,r),c=o.add(new sc),l=async e=>{c?.value?.cancel(),n.busy=!1,c.value=new Oo,n.busy=!0;try{let i=RB(n.value.substr(UB.PREFIX.length).trim()),a=await this.doGetSymbolPicks(s,i,void 0,c.value.token,t);if(r.isCancellationRequested)return;if(a.length>0){if(n.items=a,e&&i.original.length===0){let t=ht(a,t=>!!(t.type!==`separator`&&t.range&&w.containsPosition(t.range.decoration,e)));t&&(n.activeItems=[t])}}else i.original.length>0?this.provideLabelPick(n,S(1416,`No matching editor symbols`)):this.provideLabelPick(n,S(1417,`No editor symbols`))}finally{r.isCancellationRequested||(n.busy=!1)}};return o.add(n.onDidChangeValue(()=>l(void 0))),l(a.getSelection()?.getPosition()),o.add(n.onDidChangeActive(()=>{let[e]=n.activeItems;e&&e.range&&(a.revealRangeInCenter(e.range.selection,0),this.addDecorations(a,e.range.decoration))})),o}async doGetSymbolPicks(e,t,n,r,i){let a=await e;if(r.isCancellationRequested)return[];let o=t.original.indexOf(UB.SCOPE_PREFIX)===0,s=+!!o,c,l;t.values&&t.values.length>1?(c=BB(t.values[0]),l=BB(t.values.slice(1))):c=t;let u,d=this.options?.openSideBySideDirection?.();d&&(u=[{iconClass:d===`right`?H.asClassName(A.splitHorizontal):H.asClassName(A.splitVertical),tooltip:d===`right`?S(1418,`Open to the Side`):S(1419,`Open to the Bottom`)}]);let f=[];for(let e=0;e<a.length;e++){let r=a[e],o=Vc(r.name),d=`$(${ji.toIcon(r.kind).id}) ${o}`,p=d.length-o.length,m=r.containerName;n?.extraContainerLabel&&(m=m?`${n.extraContainerLabel} • ${m}`:n.extraContainerLabel);let h,g,_,v;if(t.original.length>s){let e=!1;if(c!==t&&([h,g]=jB(d,{...t,values:void 0},s,p),typeof h==`number`&&(e=!0)),typeof h!=`number`&&([h,g]=jB(d,c,s,p),typeof h!=`number`))continue;if(!e&&l){if(m&&l.original.length>0&&([_,v]=jB(m,l)),typeof _!=`number`)continue;typeof h==`number`&&(h+=_)}}let y=r.tags&&r.tags.indexOf(1)>=0;f.push({index:e,kind:r.kind,score:h,label:d,ariaLabel:ir(r.name,r.kind),description:m,highlights:y?void 0:{label:g,description:v},range:{selection:w.collapseToStart(r.selectionRange),decoration:r.range},uri:i.uri,symbolName:o,strikethrough:y,buttons:u})}let p=f.sort((e,t)=>o?this.compareByKindAndScore(e,t):this.compareByScore(e,t)),m=[];if(o){let e,t,n=0;function r(){t&&typeof e==`number`&&n>0&&(t.label=us(KB[e]||GB,n))}for(let i of p)e===i.kind?n++:(r(),e=i.kind,n=1,t={type:`separator`},m.push(t)),m.push(i);r()}else p.length>0&&(m=[{label:S(1420,`symbols ({0})`,f.length),type:`separator`},...p]);return m}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)}compareByKindAndScore(e,t){let n=KB[e.kind]||GB,r=KB[t.kind]||GB,i=n.localeCompare(r);return i===0?this.compareByScore(e,t):i}async getDocumentSymbols(e,t){let n=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()}};WB=UB=VB([HB(0,z),HB(1,LC)],WB);var GB=S(1421,`properties ({0})`),KB={5:S(1422,`methods ({0})`),11:S(1423,`functions ({0})`),8:S(1424,`constructors ({0})`),12:S(1425,`variables ({0})`),4:S(1426,`classes ({0})`),22:S(1427,`structs ({0})`),23:S(1428,`events ({0})`),24:S(1429,`operators ({0})`),10:S(1430,`interfaces ({0})`),2:S(1431,`namespaces ({0})`),3:S(1432,`packages ({0})`),25:S(1433,`type parameters ({0})`),1:S(1434,`modules ({0})`),6:S(1435,`properties ({0})`),9:S(1436,`enumerations ({0})`),21:S(1437,`enumeration members ({0})`),14:S(1438,`strings ({0})`),0:S(1439,`files ({0})`),17:S(1440,`arrays ({0})`),15:S(1441,`numbers ({0})`),16:S(1442,`booleans ({0})`),18:S(1443,`objects ({0})`),19:S(1444,`keys ({0})`),7:S(1445,`fields ({0})`),13:S(1446,`constants ({0})`)},qB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},JB=function(e,t){return function(n,r){t(n,r,e)}},YB=class extends WB{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=du.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};YB=qB([JB(0,Js),JB(1,z),JB(2,LC)],YB);var XB=class e extends G{static{this.ID=`editor.action.quickOutline`}constructor(){super({id:e.ID,label:ko.quickOutlineActionLabel,alias:`Go to Symbol...`,precondition:D.hasDocumentSymbolProvider,kbOpts:{kbExpr:D.focus,primary:3117,weight:100},contextMenuOpts:{group:`navigation`,order:3}})}run(e){e.get(Ud).quickAccess.show(WB.PREFIX,{itemActivation:Ef.NONE})}};B(XB),Ot.as(Tn.Quickaccess).registerQuickAccessProvider({ctor:YB,prefix:WB.PREFIX,helpEntries:[{description:ko.quickOutlineActionLabel,prefix:WB.PREFIX,commandId:XB.ID},{description:ko.quickOutlineByCategoryActionLabel,prefix:WB.PREFIX_BY_CATEGORY}]});var ZB=class extends K{static{this.ID=`editor.contrib.readOnlyMessageController`}constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){let e=Kp.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||=this.editor.isSimpleWidget?new Ei(S(1447,`Cannot edit in read-only input`)):new Ei(S(1448,`Cannot edit in read-only editor`)),e.showMessage(t,this.editor.getPosition())}}};Ms(ZB.ID,ZB,2);var QB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},$B=function(e,t){return function(n,r){t(n,r,e)}},eV=class extends Nx{constructor(e,t,n,r,i,a,o){super(!0,e,t,n,r,i,a,o)}};eV=QB([$B(1,Na),$B(2,Js),$B(3,gt),$B(4,W),$B(5,wc),$B(6,zi)],eV),Ms(Nx.ID,eV,4);var tV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},nV=function(e,t){return function(n,r){t(n,r,e)}},rV=class extends K{static{this.ID=`editor.sectionHeaderDetector`}constructor(e,t,n){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=n,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(t=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(t=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(t=>{let n=this.editor.getModel()?.getLanguageId();n&&t.affects(n)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(t=>{(!this.options||t.hasChanged(81))&&(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(e=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(e=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new Mr(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;let t=this.editor.getModel().getLanguageId();if(!t)return;let n=this.languageConfigurationService.getLanguageConfiguration(t).comments,r=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(n||r?.markers)return{foldingRules:r,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;let e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;let t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(n=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(n)})}updateDecorations(e){let t=this.editor.getModel();t&&(e=e.filter(e=>{if(!e.shouldBeInComments)return!0;let n=t.validateRange(e.range),r=t.tokenization.getLineTokens(n.startLineNumber),i=r.findTokenIndexAtOffset(n.startColumn-1),a=r.getStandardTokenType(i),o=t.getLanguageIdAtPosition(n.startLineNumber,n.startColumn);return r.getLanguageId(i)===o&&a===1}));let n=Object.values(this.currentOccurrences).map(e=>e.decorationId),r=e.map(e=>iV(e));this.editor.changeDecorations(t=>{let i=t.deltaDecorations(n,r);this.currentOccurrences={};for(let t=0,n=i.length;t<n;t++){let n={sectionHeader:e[t],decorationId:i[t]};this.currentOccurrences[n.decorationId]=n}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&=(this.computePromise.cancel(),null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}};rV=tV([nV(1,Mn),nV(2,or)],rV);function iV(e){return{range:e.range,options:F.createDynamic({description:`section-header`,stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:e.hasSeparatorLine?2:1,sectionHeaderText:e.text}})}}Ms(rV.ID,rV,1);function aV(e){for(let t=0,n=e.length;t<n;t+=4){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];e[t+0]=a,e[t+1]=i,e[t+2]=r,e[t+3]=n}}function oV(e){let t=new Uint8Array(e.buffer,e.byteOffset,e.length*4);return Nt()||aV(t),pt.wrap(t)}function sV(e){let t=new Uint32Array(cV(e)),n=0;if(t[n++]=e.id,e.type===`full`)t[n++]=1,t[n++]=e.data.length,t.set(e.data,n),n+=e.data.length;else{t[n++]=2,t[n++]=e.deltas.length;for(let r of e.deltas)t[n++]=r.start,t[n++]=r.deleteCount,r.data?(t[n++]=r.data.length,t.set(r.data,n),n+=r.data.length):t[n++]=0}return oV(t)}function cV(e){let t=0;if(t+=2,e.type===`full`)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(let n of e.deltas)n.data&&(t+=n.data.length)}return t}function lV(e){return e&&!!e.data}function uV(e){return e&&Array.isArray(e.edits)}var dV=class{constructor(e,t,n){this.provider=e,this.tokens=t,this.error=n}};function fV(e,t){return e.has(t)}function pV(e,t){let n=e.orderedGroups(t);return n.length>0?n[0]:[]}async function mV(e,t,n,r,i){let a=pV(e,t),o=await Promise.all(a.map(async e=>{let a,o=null;try{a=await e.provideDocumentSemanticTokens(t,e===n?r:null,i)}catch(e){o=e,a=null}return(!a||!lV(a)&&!uV(a))&&(a=null),new dV(e,a,o)}));for(let e of o){if(e.error)throw e.error;if(e.tokens)return e}return o.length>0?o[0]:null}function hV(e,t){let n=e.orderedGroups(t);return n.length>0?n[0]:null}var gV=class{constructor(e,t){this.provider=e,this.tokens=t}};function _V(e,t){return e.has(t)}function vV(e,t){let n=e.orderedGroups(t);return n.length>0?n[0]:[]}async function yV(e,t,n,r){let i=vV(e,t),a=await Promise.all(i.map(async e=>{let i;try{i=await e.provideDocumentRangeSemanticTokens(t,n,r)}catch(e){Ys(e),i=null}return(!i||!lV(i))&&(i=null),new gV(e,i)}));for(let e of a)if(e.tokens)return e;return a.length>0?a[0]:null}Pn.registerCommand(`_provideDocumentSemanticTokensLegend`,async(e,...t)=>{let[n]=t;Xn(n instanceof qn);let r=e.get(ot).getModel(n);if(!r)return;let{documentSemanticTokensProvider:i}=e.get(z),a=hV(i,r);return a?a[0].getLegend():e.get(wr).executeCommand(`_provideDocumentRangeSemanticTokensLegend`,n)}),Pn.registerCommand(`_provideDocumentSemanticTokens`,async(e,...t)=>{let[n]=t;Xn(n instanceof qn);let r=e.get(ot).getModel(n);if(!r)return;let{documentSemanticTokensProvider:i}=e.get(z);if(!fV(i,r))return e.get(wr).executeCommand(`_provideDocumentRangeSemanticTokens`,n,r.getFullModelRange());let a=await mV(i,r,null,null,E.None);if(!a)return;let{provider:o,tokens:s}=a;if(!s||!lV(s))return;let c=sV({id:0,type:`full`,data:s.data});return s.resultId&&o.releaseDocumentSemanticTokens(s.resultId),c}),Pn.registerCommand(`_provideDocumentRangeSemanticTokensLegend`,async(e,...t)=>{let[n,r]=t;Xn(n instanceof qn);let i=e.get(ot).getModel(n);if(!i)return;let{documentRangeSemanticTokensProvider:a}=e.get(z),o=vV(a,i);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!r||!w.isIRange(r))return console.warn(`provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in`),o[0].getLegend();let s=await yV(a,i,w.lift(r),E.None);if(s)return s.provider.getLegend()}),Pn.registerCommand(`_provideDocumentRangeSemanticTokens`,async(e,...t)=>{let[n,r]=t;Xn(n instanceof qn),Xn(w.isIRange(r));let i=e.get(ot).getModel(n);if(!i)return;let{documentRangeSemanticTokensProvider:a}=e.get(z),o=await yV(a,i,w.lift(r),E.None);if(o&&o.tokens)return sV({id:0,type:`full`,data:o.tokens.data})});var bV=`editor.semanticHighlighting`;function xV(e,t,n){let r=n.getValue(bV,{overrideIdentifier:e.getLanguageId(),resource:e.uri})?.enabled;return typeof r==`boolean`?r:t.getColorTheme().semanticHighlighting}var SV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},CV=function(e,t){return function(n,r){t(n,r,e)}},wV=class extends K{static{this.ID=`editor.contrib.viewportSemanticTokens`}constructor(e,t,n,r,i,a){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=r,this._editor=e,this._provider=a.documentRangeSemanticTokensProvider,this._debounceInformation=i.for(this._provider,`DocumentRangeSemanticTokens`,{min:100,max:500}),this._tokenizeViewport=this._register(new Mr(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];let o=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},s=()=>{if(this._cleanupProviderListeners(),this._editor.hasModel()){let e=this._editor.getModel();for(let t of this._provider.all(e)){let e=t.onDidChange?.(()=>{this._cancelAll(),o()});e&&this._rangeProvidersChangeListeners.push(e)}}};this._register(this._editor.onDidScrollChange(()=>{o()})),this._register(this._editor.onDidChangeModel(()=>{s(),this._cancelAll(),o()})),this._register(this._editor.onDidChangeModelLanguage(()=>{s(),this._cancelAll(),o()})),this._register(this._editor.onDidChangeModelContent(e=>{this._cancelAll(),o()})),s(),this._register(this._provider.onDidChange(()=>{s(),this._cancelAll(),o()})),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(`editor.semanticHighlighting`)&&(this._cancelAll(),o())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),o()})),o()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){Mc(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(let e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,n=this._outstandingRequests.length;t<n;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;let e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!xV(e,this._themeService,this._configurationService)||!_V(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}let t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(t=>this._requestRange(e,t)))}_requestRange(e,t){let n=e.getVersionId(),r=wt(n=>Promise.resolve(yV(this._provider,e,t,n))),i=new Es(!1);return r.then(r=>{if(this._debounceInformation.update(e,i.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==n)return;let{provider:a,tokens:o}=r,s=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,jl(o,s,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};wV=SV([CV(1,As),CV(2,Gn),CV(3,zi),CV(4,Vs),CV(5,z)],wV),Ms(wV.ID,wV,1);var TV=class{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){let n=[];for(let r of t){let t=[];n.push(t),this.selectSubwords&&this._addInWordRanges(t,e,r),this._addWordRanges(t,e,r),this._addWhitespaceLine(t,e,r),t.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){let r=t.getWordAtPosition(n);if(!r)return;let{word:i,startColumn:a}=r,o=n.column-a,s=o,c=o,l=0;for(;s>=0;s--){let e=i.charCodeAt(s);if(s!==o&&(e===95||e===45)||Ks(e)&&gc(l))break;l=e}for(s+=1;c<i.length;c++){let e=i.charCodeAt(c);if(gc(e)&&Ks(l)||e===95||e===45)break;l=e}s<c&&e.push({range:new w(n.lineNumber,a+s,n.lineNumber,a+c)})}_addWordRanges(e,t,n){let r=t.getWordAtPosition(n);r&&e.push({range:new w(n.lineNumber,r.startColumn,n.lineNumber,r.endColumn)})}_addWhitespaceLine(e,t,n){t.getLineLength(n.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new w(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}},EV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},DV=function(e,t){return function(n,r){t(n,r,e)}},OV,kV=class e{constructor(e,t){this.index=e,this.ranges=t}mov(t){let n=this.index+(t?1:-1);if(n<0||n>=this.ranges.length)return this;let r=new e(n,this.ranges);return r.ranges[n].equalsRange(this.ranges[this.index])?r.mov(t):r}},AV=class{static{OV=this}static{this.ID=`editor.contrib.smartSelectController`}static get(e){return e.getContribution(OV.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;let t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||await PV(this._languageFeaturesService.selectionRangeProvider,n,t.map(e=>e.getPosition()),this._editor.getOption(129),E.None).then(e=>{if(wu(e)&&e.length===t.length&&this._editor.hasModel()&&Od(this._editor.getSelections(),t,(e,t)=>e.equalsSelection(t))){for(let n=0;n<e.length;n++)e[n]=e[n].filter(e=>e.containsPosition(t[n].getStartPosition())&&e.containsPosition(t[n].getEndPosition())),e[n].unshift(t[n]);this._state=e.map(e=>new kV(0,e)),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(t=>t.mov(e));let r=this._state.map(e=>J.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}};AV=OV=EV([DV(1,z)],AV);var jV=class extends G{constructor(e,t){super(t),this._forward=e}async run(e,t){let n=AV.get(t);n&&await n.run(this._forward)}},MV=class extends jV{constructor(){super(!0,{id:`editor.action.smartSelect.expand`,label:R(1469,`Expand Selection`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:O.MenubarSelectionMenu,group:`1_basic`,title:S(1467,`&&Expand Selection`),order:2}})}};Pn.registerCommandAlias(`editor.action.smartSelect.grow`,`editor.action.smartSelect.expand`);var NV=class extends jV{constructor(){super(!1,{id:`editor.action.smartSelect.shrink`,label:R(1470,`Shrink Selection`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:O.MenubarSelectionMenu,group:`1_basic`,title:S(1468,`&&Shrink Selection`),order:3}})}};Ms(AV.ID,AV,4),B(MV),B(NV);async function PV(e,t,n,r,i){let a=e.all(t).concat(new TV(r.selectSubwords));a.length===1&&a.unshift(new HM);let o=[],s=[];for(let e of a)o.push(Promise.resolve(e.provideSelectionRanges(t,n,i)).then(e=>{if(wu(e)&&e.length===n.length)for(let t=0;t<n.length;t++){s[t]||(s[t]=[]);for(let r of e[t])w.isIRange(r.range)&&w.containsPosition(r.range,n[t])&&s[t].push(w.lift(r.range))}},Ys));return await Promise.all(o),s.map(e=>{if(e.length===0)return[];e.sort((e,t)=>j.isBefore(e.getStartPosition(),t.getStartPosition())?1:j.isBefore(t.getStartPosition(),e.getStartPosition())||j.isBefore(e.getEndPosition(),t.getEndPosition())?-1:+!!j.isBefore(t.getEndPosition(),e.getEndPosition()));let n=[],i;for(let t of e)(!i||w.containsRange(t,i)&&!w.equalsRange(t,i))&&(n.push(t),i=t);if(!r.selectLeadingAndTrailingWhitespace)return n;let a=[n[0]];for(let e=1;e<n.length;e++){let r=n[e-1],i=n[e];if(i.startLineNumber!==r.startLineNumber||i.endLineNumber!==r.endLineNumber){let e=new w(r.startLineNumber,t.getLineFirstNonWhitespaceColumn(r.startLineNumber),r.endLineNumber,t.getLineLastNonWhitespaceColumn(r.endLineNumber));e.containsRange(r)&&!e.equalsRange(r)&&i.containsRange(e)&&!i.equalsRange(e)&&a.push(e);let n=new w(r.startLineNumber,1,r.endLineNumber,t.getLineMaxColumn(r.endLineNumber));n.containsRange(r)&&!n.equalsRange(e)&&i.containsRange(n)&&!i.equalsRange(n)&&a.push(n)}a.push(i)}return a})}Pn.registerCommand(`_executeSelectionRangeProvider`,async function(e,...t){let[n,r]=t;Xn(qn.isUri(n)),Xn(Ar(r,e=>j.isIPosition(e)));let i=e.get(z).selectionRangeProvider,a=await e.get(Vi).createModelReference(n);try{return PV(i,a.object.textEditorModel,r.map(j.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},E.None)}finally{a.dispose()}});var FV=class extends au{constructor(){super({id:`editor.action.toggleStickyScroll`,title:{...R(1518,`Toggle Editor Sticky Scroll`),mnemonicTitle:S(1514,`&&Toggle Editor Sticky Scroll`)},metadata:{description:R(1519,`Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport`)},category:mB.View,toggled:{condition:T.equals(`config.editor.stickyScroll.enabled`,!0),title:S(1515,`Sticky Scroll`),mnemonicTitle:S(1516,`&&Sticky Scroll`)},menu:[{id:O.CommandPalette},{id:O.MenubarAppearanceMenu,group:`4_editor`,order:3},{id:O.StickyScrollContext}]})}async runEditorCommand(e,t){let n=e.get(zi),r=!n.getValue(`editor.stickyScroll.enabled`),i=PP.get(t)?.isFocused();n.updateValue(`editor.stickyScroll.enabled`,r),i&&t.focus()}},IV=100,LV=class extends au{constructor(){super({id:`editor.action.focusStickyScroll`,title:{...R(1520,`Focus Editor Sticky Scroll`),mnemonicTitle:S(1517,`&&Focus Editor Sticky Scroll`)},precondition:T.and(T.has(`config.editor.stickyScroll.enabled`),D.stickyScrollVisible),menu:[{id:O.CommandPalette}]})}runEditorCommand(e,t){PP.get(t)?.focus()}},RV=class extends au{constructor(){super({id:`editor.action.selectNextStickyScrollLine`,title:R(1521,`Select the next editor sticky scroll line`),precondition:D.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:IV,primary:18}})}runEditorCommand(e,t){PP.get(t)?.focusNext()}},zV=class extends au{constructor(){super({id:`editor.action.selectPreviousStickyScrollLine`,title:R(1522,`Select the previous sticky scroll line`),precondition:D.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:IV,primary:16}})}runEditorCommand(e,t){PP.get(t)?.focusPrevious()}},BV=class extends au{constructor(){super({id:`editor.action.goToFocusedStickyScrollLine`,title:R(1523,`Go to the focused sticky scroll line`),precondition:D.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:IV,primary:3}})}runEditorCommand(e,t){PP.get(t)?.goToFocused()}},VV=class extends au{constructor(){super({id:`editor.action.selectEditor`,title:R(1524,`Select Editor`),precondition:D.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:IV,primary:9}})}runEditorCommand(e,t){PP.get(t)?.selectEditor()}};Ms(PP.ID,PP,1),Qi(FV),Qi(LV),Qi(zV),Qi(RV),Qi(BV),Qi(VV);var HV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},UV=function(e,t){return function(n,r){t(n,r,e)}},WV=class{constructor(e,t,n,r,i,a,o){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=r,this.command=i,this.gutterMenuLinkAction=a,this.completion=o,this.doNotLog=!0}},GV=class extends Cu{constructor(e,t,n,r,i,a){super(i.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=r,this._suggestMemoryService=a}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn<n.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){let e=[],{items:t}=this.completionModel,n=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),r=zd.slice(t,n),i=zd.slice(t,0,n),a=5;for(let t of zd.concat(r,i)){if(t.score===Rf.Default)continue;let n=new w(t.editStart.lineNumber,t.editStart.column,t.editInsertEnd.lineNumber,t.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),r=t.completion.insertTextRules&&t.completion.insertTextRules&4?{snippet:t.completion.insertText}:t.completion.insertText;e.push(new WV(n,r,t.filterTextLow??t.labelLow,t.completion.additionalTextEdits,t.completion.command,t.completion.action,t)),a-->=0&&t.resolve(E.None)}return e}};GV=HV([UV(5,AM)],GV);var KV=class extends K{constructor(e,t,n,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=n,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register(`*`,this))}async provideInlineCompletions(e,t,n,r){if(n.selectedSuggestionInfo)return;let i;for(let t of this._editorService.listCodeEditors())if(t.getModel()===e){i=t;break}if(!i)return;let a=i.getOption(102);if(PO.isAllOff(a))return;e.tokenization.tokenizeIfCheap(t.lineNumber);let o=e.tokenization.getLineTokens(t.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(PO.valueFor(a,s)!==`inline`)return;let c=e.getWordAtPosition(t),l;if(c?.word||(l=this._getTriggerCharacterInfo(e,t)),!c?.word&&!l||(c||=e.getWordUntilPosition(t),c.endColumn!==t.column))return;let u,d=e.getValueInRange(new w(t.lineNumber,1,t.lineNumber,t.column));if(!l&&this._lastResult?.canBeReused(e,t.lineNumber,c)){let e=new BM(d,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=e,this._lastResult.acquire(),u=this._lastResult}else{let n=await DO(this._languageFeatureService.completionProvider,e,t,new TO(void 0,XM.createSuggestFilter(i).itemKind,l?.providers),l&&{triggerKind:1,triggerCharacter:l.ch},r),a;n.needsClipboard&&(a=await this._clipboardService.readText());let o=new VM(n.items,t.column,new BM(d,0),UM.None,i.getOption(134),i.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},a);u=new GV(e,t.lineNumber,c,o,n,this._suggestMemoryService)}return this._lastResult=u,u}handleItemDidShow(e,t){t.completion.resolve(E.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){let n=e.getValueInRange(w.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(let t of this._languageFeatureService.completionProvider.all(e))t.triggerCharacters?.includes(n)&&r.add(t);if(r.size!==0)return{providers:r,ch:n}}};KV=HV([UV(0,z),UV(1,as),UV(2,AM),UV(3,Js)],KV),Ze(KV),B(class extends G{constructor(){super({id:`editor.action.toggleHighContrast`,label:Mi.toggleHighContrast,alias:`Toggle High Contrast Theme`,precondition:void 0}),this._originalThemeName=null}run(e,t){let n=e.get(gr),r=n.getColorTheme();ft(r.type)?(n.setTheme(this._originalThemeName||(gl(r.type)?`vs-dark`:`vs`)),this._originalThemeName=null):(n.setTheme(gl(r.type)?bi:pn),this._originalThemeName=r.themeName)}});var qV=class e extends ll{static{this.ID=`editor.action.toggleTabFocusMode`}constructor(){super({id:e.ID,title:R(1604,`Toggle Tab Key Moves Focus`),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:R(1605,`Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.`)},f1:!0})}run(){let e=!_r.getTabFocusMode();_r.setTabFocusMode(e),vo(e?S(1602,`Pressing Tab will now move focus to the next focusable element`):S(1603,`Pressing Tab will now insert the tab character`))}};Qi(qV),B(class extends G{constructor(){super({id:`editor.action.forceRetokenize`,label:R(1606,`Developer: Force Retokenize`),precondition:void 0})}run(e,t){if(!t.hasModel())return;let n=t.getModel();n.tokenization.resetTokenization();let r=new Es;n.tokenization.forceTokenization(n.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}});var JV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},YV=function(e,t){return function(n,r){t(n,r,e)}},XV=26,ZV=class extends K{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(QV))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,XV)}};ZV=JV([YV(1,W)],ZV);var QV=class extends K{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=N(`div.editor-banner`),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message==`string`)return e.message}getBannerMessage(e){if(typeof e==`string`){let t=N(`span`);return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){Sf(this.element)}show(e){Sf(this.element);let t=this.getAriaLabel(e);t&&this.element.setAttribute(`aria-label`,t);let n=q(this.element,N(`div.icon-container`));n.setAttribute(`aria-hidden`,`true`),e.icon&&n.appendChild(N(`div${H.asCSSSelector(e.icon)}`));let r=q(this.element,N(`div.message-container`));if(r.setAttribute(`aria-hidden`,`true`),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=q(this.element,N(`div.message-actions-container`)),e.actions)for(let t of e.actions)this._register(this.instantiationService.createInstance(Dm,this.messageActionsContainer,{...t,tabIndex:-1},{}));let i=q(this.element,N(`div.action-container`));this.actionBar=this._register(new Lr(i)),this.actionBar.push(this._register(new mr(`banner.close`,S(1607,`Close Banner`),H.asClassName(Wi),!0,()=>{typeof e.onClose==`function`&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};QV=JV([YV(0,W),YV(1,va)],QV);var $V=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},eH=function(e,t){return function(n,r){t(n,r,e)}},tH=Dr(`extensions-warning-message`,A.warning,S(1608,`Icon shown with a warning message in the extensions editor.`)),nH=class extends K{static{this.ID=`editor.contrib.unicodeHighlighter`}constructor(e,t,n,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=e=>{if(e&&e.hasMore){if(this._bannerClosed)return;let t=Math.max(e.ambiguousCharacterCount,e.nonBasicAsciiCharacterCount,e.invisibleCharacterCount),n;if(e.nonBasicAsciiCharacterCount>=t)n={message:S(1609,`This document contains many non-basic ASCII unicode characters`),command:new _H};else if(e.ambiguousCharacterCount>=t)n={message:S(1610,`This document contains many ambiguous unicode characters`),command:new hH};else if(e.invisibleCharacterCount>=t)n={message:S(1611,`This document contains many invisible unicode characters`),command:new gH};else throw Error(`Unreachable`);this._bannerController.show({id:`unicodeHighlightBanner`,message:n.message,icon:tH,actions:[{label:n.command.shortLabel,href:`command:${n.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(ZV,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(n.onDidChangeTrust(e=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&=(this._highlighter.dispose(),null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&=(this._highlighter.dispose(),null),!this._editor.hasModel())return;let e=rH(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(e=>e===!1))return;let t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(e=>e.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(e=>e===`_os`?Ua.NumberFormat().value.resolvedOptions().locale:e===`_vscode`?di:e)};this._highlighter=this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?new iH(this._editor,t,this._updateState,this._editorWorkerService):new aH(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};nH=$V([eH(1,or),eH(2,ls),eH(3,W)],nH);function rH(e,t){return{nonBasicASCII:t.nonBasicASCII===`inUntrustedWorkspace`?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments===`inUntrustedWorkspace`?!e:t.includeComments,includeStrings:t.includeStrings===`inUntrustedWorkspace`?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}var iH=class extends K{constructor(e,t,n,r){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Mr(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}let e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);let n=[];if(!t.hasMore)for(let e of t.ranges)n.push({range:e,options:fH.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;let t=this._editor.getModel();return Fr(t,e)?{reason:dH(t.getValueInRange(e.range),this._options),inComment:xn(t,e),inString:tr(t,e)}:null}};iH=$V([eH(3,or)],iH);var aH=class extends K{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Mr(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}let e=this._editor.getVisibleRanges(),t=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(let t of e){let e=Di.computeUnicodeHighlights(this._model,this._options,t);for(let t of e.ranges)n.ranges.push(t);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||e.hasMore}if(!n.hasMore)for(let e of n.ranges)t.push({range:e,options:fH.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;let t=this._editor.getModel(),n=t.getValueInRange(e.range);return Fr(t,e)?{reason:dH(n,this._options),inComment:xn(t,e),inString:tr(t,e)}:null}},oH=S(1612,`Configure Unicode Highlight Options`),sH=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];let n=this._editor.getModel(),r=this._editor.getContribution(nH.ID);if(!r)return[];let i=[],a=new Set,o=300;for(let e of t){let t=r.getDecorationInfo(e);if(!t)continue;let s=n.getValueInRange(e.range).codePointAt(0),c=lH(s),l;switch(t.reason.kind){case 0:l=pd(t.reason.confusableWith)?S(1613,`The character {0} could be confused with the ASCII character {1}, which is more common in source code.`,c,lH(t.reason.confusableWith.codePointAt(0))):S(1614,`The character {0} could be confused with the character {1}, which is more common in source code.`,c,lH(t.reason.confusableWith.codePointAt(0)));break;case 1:l=S(1615,`The character {0} is invisible.`,c);break;case 2:l=S(1616,`The character {0} is not a basic ASCII character.`,c)}if(a.has(l))continue;a.add(l);let u={codePoint:s,reason:t.reason,inComment:t.inComment,inString:t.inString},d=S(1617,`Adjust settings`),f=yn(vH.ID,u),p=new Ei(``,!0).appendMarkdown(l).appendText(` `).appendLink(f,d,oH);i.push(new Yy(this,e.range,[p],!1,o++))}return i}renderHoverParts(e,t){return eb(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(e=>e.value).join(`
50
50
  `)}};sH=$V([eH(1,va)],sH);function cH(e){return`U+${e.toString(16).padStart(4,`0`)}`}function lH(e){let t=`\`${cH(e)}\``;return lo.isInvisibleCharacter(e)||(t+=` "${`${uH(e)}`}"`),t}function uH(e){return e===96?"`` ` ``":"`"+String.fromCodePoint(e)+"`"}function dH(e,t){return Di.computeUnicodeHighlightReason(e,t)}var fH=class e{constructor(){this.map=new Map}static{this.instance=new e}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){let n=`${e}${t}`,r=this.map.get(n);return r||(r=F.createDynamic({description:`unicode-highlight`,stickiness:1,className:`unicode-highlight`,showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,r)),r}},pH=class extends G{constructor(){super({id:hH.ID,label:R(1626,`Disable highlighting of characters in comments`),precondition:void 0}),this.shortLabel=S(1618,`Disable Highlight In Comments`)}async run(e,t){let n=e.get(zi);n&&this.runAction(n)}async runAction(e){await e.updateValue(gd.includeComments,!1,2)}},mH=class extends G{constructor(){super({id:hH.ID,label:R(1627,`Disable highlighting of characters in strings`),precondition:void 0}),this.shortLabel=S(1619,`Disable Highlight In Strings`)}async run(e,t){let n=e.get(zi);n&&this.runAction(n)}async runAction(e){await e.updateValue(gd.includeStrings,!1,2)}},hH=class e extends ll{static{this.ID=`editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters`}constructor(){super({id:e.ID,title:R(1628,`Disable highlighting of ambiguous characters`),precondition:void 0,f1:!1}),this.shortLabel=S(1620,`Disable Ambiguous Highlight`)}async run(e,t){let n=e.get(zi);n&&this.runAction(n)}async runAction(e){await e.updateValue(gd.ambiguousCharacters,!1,2)}},gH=class e extends ll{static{this.ID=`editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters`}constructor(){super({id:e.ID,title:R(1629,`Disable highlighting of invisible characters`),precondition:void 0,f1:!1}),this.shortLabel=S(1621,`Disable Invisible Highlight`)}async run(e,t){let n=e.get(zi);n&&this.runAction(n)}async runAction(e){await e.updateValue(gd.invisibleCharacters,!1,2)}},_H=class e extends ll{static{this.ID=`editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters`}constructor(){super({id:e.ID,title:R(1630,`Disable highlighting of non basic ASCII characters`),precondition:void 0,f1:!1}),this.shortLabel=S(1622,`Disable Non ASCII Highlight`)}async run(e,t){let n=e.get(zi);n&&this.runAction(n)}async runAction(e){await e.updateValue(gd.nonBasicASCII,!1,2)}},vH=class e extends ll{static{this.ID=`editor.action.unicodeHighlight.showExcludeOptions`}constructor(){super({id:e.ID,title:R(1631,`Show Exclude Options`),precondition:void 0,f1:!1})}async run(e,t){let{codePoint:n,reason:r,inString:i,inComment:a}=t,o=String.fromCodePoint(n),s=e.get(Ud),c=e.get(zi);function l(e){return lo.isInvisibleCharacter(e)?S(1623,`Exclude {0} (invisible character) from being highlighted`,cH(e)):S(1624,`Exclude {0} from being highlighted`,`${cH(e)} "${o}"`)}let u=[];if(r.kind===0)for(let e of r.notAmbiguousInLocales)u.push({label:S(1625,`Allow unicode characters that are more common in the language "{0}".`,e),run:async()=>{bH(c,[e])}});if(u.push({label:l(n),run:()=>yH(c,[n])}),a){let e=new pH;u.push({label:e.label,run:async()=>e.runAction(c)})}else if(i){let e=new mH;u.push({label:e.label,run:async()=>e.runAction(c)})}function d(e){return typeof e.desc.title==`string`?e.desc.title:e.desc.title.value}if(r.kind===0){let e=new hH;u.push({label:d(e),run:async()=>e.runAction(c)})}else if(r.kind===1){let e=new gH;u.push({label:d(e),run:async()=>e.runAction(c)})}else if(r.kind===2){let e=new _H;u.push({label:d(e),run:async()=>e.runAction(c)})}else xH(r);let f=await s.pick(u,{title:oH});f&&await f.run()}};async function yH(e,t){let n=e.getValue(gd.allowedCharacters),r;r=typeof n==`object`&&n?n:{};for(let e of t)r[String.fromCodePoint(e)]=!0;await e.updateValue(gd.allowedCharacters,r,2)}async function bH(e,t){let n=e.inspect(gd.allowedLocales).user?.value,r;r=typeof n==`object`&&n?Object.assign({},n):{};for(let e of t)r[e]=!0;await e.updateValue(gd.allowedLocales,r,2)}function xH(e){throw Error(`Unexpected value: ${e}`)}Qi(hH),Qi(gH),Qi(_H),Qi(vH),Ms(nH.ID,nH,1),Zg.register(sH);var SH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},CH=function(e,t){return function(n,r){t(n,r,e)}},wH=`ignoreUnusualLineTerminators`;function TH(e,t,n){e.setModelProperty(t.uri,wH,n)}function EH(e,t){return e.getModelProperty(t.uri,wH)}var DH=class extends K{static{this.ID=`editor.contrib.unusualLineTerminatorsDetector`}constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(e=>{e.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config===`off`||!this._editor.hasModel())return;let e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||EH(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config===`auto`){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let t;try{this._isPresentingDialog=!0,t=await this._dialogService.confirm({title:S(1632,`Unusual Line Terminators`),message:S(1633,`Detected unusual line terminators`),detail:S(1634,`The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).
51
51
 
52
- It is recommended to remove them from the file. This can be configured via \`editor.unusualLineTerminators\`.`,Kd(e.uri)),primaryButton:S(1635,`&&Remove Unusual Line Terminators`),cancelButton:S(1636,`Ignore`)})}finally{this._isPresentingDialog=!1}t.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):TH(this._codeEditorService,e,!0)}};DH=SH([CH(1,oa),CH(2,Js)],DH),Ms(DH.ID,DH,1);var OH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},kH=function(e,t){return function(n,r){t(n,r,e)}},AH=class{constructor(){this.selector={language:`*`}}provideDocumentHighlights(e,t,n){if(e.isDisposed())return;let r=[],i=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return i?e.findMatches(i.word,!0,!1,!0,Ql,!1).map(e=>({range:e.range,kind:yf.Text})):Promise.resolve(r)}provideMultiDocumentHighlights(e,t,n,r){if(e.isDisposed())return;let i=new xl,a=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!a)return Promise.resolve(i);for(let t of[e,...n]){if(t.isDisposed())continue;let e=t.findMatches(a.word,!0,!1,!0,Ql,!1).map(e=>({range:e.range,kind:yf.Text}));e&&i.set(t.uri,e)}return i}},jH=class extends K{constructor(e){super(),this._register(e.documentHighlightProvider.register(`*`,new AH)),this._register(e.multiDocumentHighlightProvider.register(`*`,new AH))}};jH=OH([kH(0,z)],jH);var MH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},NH=function(e,t){return function(n,r){t(n,r,e)}},PH,FH,IH=new M(`hasWordHighlights`,!1);function LH(e,t,n,r){let i=e.ordered(t);return Hn(i.map(e=>()=>Promise.resolve(e.provideDocumentHighlights(t,n,r)).then(void 0,Ys)),e=>e!=null).then(e=>{if(e){let n=new xl;return n.set(t.uri,e),n}return new xl})}function RH(e,t,n,r,i){let a=e.ordered(t);return Hn(a.map(e=>()=>{let a=i.filter(e=>zf(e)).filter(t=>jd(e.selector,t.uri,t.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(e.provideMultiDocumentHighlights(t,n,a,r)).then(void 0,Ys)}),e=>e!=null)}var zH=class{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||=wt(e=>this._compute(this._model,this._selection,this._wordSeparators,e)),this._result}_getCurrentWordRange(e,t){let n=e.getWordAtPosition(t.getPosition());return n?new w(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}cancel(){this.result.cancel()}},BH=class extends zH{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return LH(this._providers,e,t.getPosition(),r).then(e=>e||new xl)}},VH=class extends zH{constructor(e,t,n,r,i){super(e,t,n),this._providers=r,this._otherModels=i}_compute(e,t,n,r){return RH(this._providers,e,t.getPosition(),r,this._otherModels).then(e=>e||new xl)}};function HH(e,t,n,r){return new BH(t,n,r,e)}function UH(e,t,n,r,i){return new VH(t,n,r,e,i)}Pd(`_executeDocumentHighlights`,async(e,t,n)=>(await LH(e.get(z).documentHighlightProvider,t,n,E.None))?.get(t.uri));var WH=class{static{PH=this}static{this.storedDecorationIDs=new xl}static{this.query=null}constructor(e,t,n,r,i,a,o,s){this.toUnhook=new I,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new xl,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new Qn(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=a,this.textModelService=i,this.configurationService=o,this.logService=s,this._hasWordHighlights=IH.bindTo(r),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(e=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!==`off`&&this.runDelayer.trigger(()=>{this._onPositionChanged(e)}).catch(et)})),this.toUnhook.add(e.onDidFocusEditorText(e=>{this.occurrencesHighlightEnablement!==`off`&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}).catch(et))})),this.toUnhook.add(e.onDidChangeModelContent(e=>{Wr(this.model.uri,`output`)||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(e=>{!e.newModelUrl&&e.oldModelUrl?this._stopSingular():PH.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(e=>{let t=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==t)switch(this.occurrencesHighlightEnablement=t,t){case`off`:this._stopAll();break;case`singleFile`:this._stopAll(PH.query?.modelInfo?.modelURI);break;case`multiFile`:PH.query&&this._run(!0);break;default:console.warn(`Unknown occurrencesHighlight setting value:`,t)}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(`editor.occurrencesHighlightDelay`)){let e=o.getValue(`editor.occurrencesHighlightDelay`);this.occurrencesHighlightDelay!==e&&(this.occurrencesHighlightDelay=e)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{let e=this.codeEditorService.getFocusedCodeEditor();e?e.getModel()?.uri.scheme===al.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==al.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,PH.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(et))}stop(){this.occurrencesHighlightEnablement!==`off`&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(w.compareRangesUsingStarts)}moveNext(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);vo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);vo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;let e=PH.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),PH.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){let t=this.codeEditorService.listCodeEditors(),n=[];for(let r of t){if(!r.hasModel()||zt(r.getModel().uri,e))continue;let t=PH.storedDecorationIDs.get(r.getModel().uri);if(!t)continue;r.removeDecorations(t),n.push(r.getModel().uri);let i=GH.get(r);i?.wordHighlighter&&i.wordHighlighter.decorations.length>0&&(i.wordHighlighter.decorations.clear(),i.wordHighlighter.workerRequest=null,i.wordHighlighter._hasWordHighlights.set(!1))}for(let e of n)PH.storedDecorationIDs.delete(e)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==al.vscodeNotebookCell&&PH.query?.modelInfo?.modelURI.scheme!==al.vscodeNotebookCell?(PH.query=null,this._run()):PH.query?.modelInfo&&(PH.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++,!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++,!0)}_onPositionChanged(e){this.occurrencesHighlightEnablement===`off`||e.source!==`api`&&e.reason!==3?this._stopAll():this._run()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===al.vscodeNotebookCell){let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){let n=r.getModel();n&&n!==e&&n.uri.scheme===al.vscodeNotebookCell&&t.push(n)}return t}let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){if(!Il(r))continue;let n=r.getModel();n&&e===n.modified&&t.push(n.modified)}if(t.length)return t;if(this.occurrencesHighlightEnablement===`singleFile`)return[];for(let r of n){let n=r.getModel();n&&n!==e&&t.push(n)}return t}async _run(e,t){if(this.editor.hasTextFocus()){let e=this.editor.getSelection();if(!e||e.startLineNumber!==e.endLineNumber){PH.query=null,this._stopAll();return}let t=e.startColumn,n=e.endColumn,r=this._getWord();if(!r||r.startColumn>t||r.endColumn<n){PH.query=null,this._stopAll();return}PH.query={modelInfo:{modelURI:this.model.uri,selection:e}}}else if(!PH.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),zt(this.editor.getModel().uri,PH.query.modelInfo?.modelURI)){if(!e){let e=this.decorations.getRanges();for(let t of e)if(t.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);let n=++this.workerRequestTokenId;this.workerRequestCompleted=!1;let r=this.getOtherModelsToHighlight(this.editor.getModel());if(!PH.query||!PH.query.modelInfo)return;let i=await this.textModelService.createModelReference(PH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(i.object.textEditorModel,PH.query.modelInfo.selection,r),this.workerRequest?.result.then(e=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=e||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},et)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{i.dispose()}}else if(this.model.uri.scheme===al.vscodeNotebookCell){let e=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!PH.query||!PH.query.modelInfo)return;let n=await this.textModelService.createModelReference(PH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(n.object.textEditorModel,PH.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(n=>{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=n||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},et)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{n.dispose()}}}computeWithModel(e,t,n){return n.length?UH(this.multiDocumentProviders,e,t,this.editor.getOption(148),n):HH(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){let t=new Date().getTime(),n=this.lastCursorPositionChangeTime+e;t>=n?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},n-t)}renderDecorations(){this.renderDecorationsTimer=void 0;let e=this.codeEditorService.listCodeEditors();for(let t of e){let e=GH.get(t);if(!e)continue;let n=[],r=t.getModel()?.uri;if(r&&this.workerRequestValue.has(r)){let i=PH.storedDecorationIDs.get(r),a=this.workerRequestValue.get(r);if(a)for(let e of a)e.range&&n.push({range:e.range,options:cz(e.kind)});let o=[];t.changeDecorations(e=>{o=e.deltaDecorations(i??[],n)}),PH.storedDecorationIDs=PH.storedDecorationIDs.set(r,o),n.length>0&&(e.wordHighlighter?.decorations.set(n),e.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}};WH=PH=MH([NH(4,Vi),NH(5,Js),NH(6,zi),NH(7,ku)],WH);var GH=class extends K{static{FH=this}static{this.ID=`editor.contrib.wordHighlighter`}static get(e){return e.getContribution(FH.ID)}constructor(e,t,n,r,i,a,o){super(),this._wordHighlighter=null;let s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==al.accessibleView&&(this._wordHighlighter=new WH(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,i,r,a,o))};this._register(e.onDidChangeModel(e=>{this._wordHighlighter&&=(!e.newModelUrl&&e.oldModelUrl?.scheme!==al.vscodeNotebookCell&&this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),null),s()})),s()}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(),null),super.dispose()}};GH=FH=MH([NH(1,Na),NH(2,z),NH(3,Js),NH(4,Vi),NH(5,zi),NH(6,ku)],GH);var KH=class extends G{constructor(e,t){super(t),this._isNext=e}run(e,t){let n=GH.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}},qH=class extends KH{constructor(){super(!0,{id:`editor.action.wordHighlight.next`,label:R(1646,`Go to Next Symbol Highlight`),precondition:IH,kbOpts:{kbExpr:D.editorTextFocus,primary:65,weight:100}})}},JH=class extends KH{constructor(){super(!1,{id:`editor.action.wordHighlight.prev`,label:R(1647,`Go to Previous Symbol Highlight`),precondition:IH,kbOpts:{kbExpr:D.editorTextFocus,primary:1089,weight:100}})}},YH=class extends G{constructor(){super({id:`editor.action.wordHighlight.trigger`,label:R(1648,`Trigger Symbol Highlight`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:0,weight:100}})}run(e,t){let n=GH.get(t);n&&n.restoreViewState(!0)}};Ms(GH.ID,GH,0),B(qH),B(JH),B(YH),Ze(jH);var XH=class extends $u{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;let r=Et(t.getOption(148),t.getOption(147)),i=t.getModel(),a=t.getSelections(),o=a.length>1,s=a.map(e=>{let t=new j(e.positionLineNumber,e.positionColumn),n=this._move(r,i,t,this._wordNavigationType,o);return this._moveTo(e,n,this._inSelectionMode)});if(i.pushStackElement(),t._getViewModel().setCursorStates(`moveWordCommand`,3,s.map(e=>sd.fromModelSelection(e))),s.length===1){let e=new j(s[0].positionLineNumber,s[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,n){return n?new J(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new J(t.lineNumber,t.column,t.lineNumber,t.column)}},ZH=class extends XH{_move(e,t,n,r,i){return vd.moveWordLeft(e,t,n,r,i)}},QH=class extends XH{_move(e,t,n,r,i){return vd.moveWordRight(e,t,n,r)}},$H=class extends ZH{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartLeft`,precondition:void 0})}},eU=class extends ZH{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndLeft`,precondition:void 0})}},tU=class extends ZH{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:`cursorWordLeft`,precondition:void 0,kbOpts:{kbExpr:T.and(D.textInputFocus,T.and(Ja,Xu)?.negate()),primary:2063,mac:{primary:527},weight:100}})}},nU=class extends ZH{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartLeftSelect`,precondition:void 0})}},rU=class extends ZH{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndLeftSelect`,precondition:void 0})}},iU=class extends ZH{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:`cursorWordLeftSelect`,precondition:void 0,kbOpts:{kbExpr:T.and(D.textInputFocus,T.and(Ja,Xu)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}},aU=class extends ZH{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityLeft`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Et(Ui.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},oU=class extends ZH{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityLeftSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Et(Ui.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},sU=class extends QH{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartRight`,precondition:void 0})}},cU=class extends QH{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndRight`,precondition:void 0,kbOpts:{kbExpr:T.and(D.textInputFocus,T.and(Ja,Xu)?.negate()),primary:2065,mac:{primary:529},weight:100}})}},lU=class extends QH{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordRight`,precondition:void 0})}},uU=class extends QH{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartRightSelect`,precondition:void 0})}},dU=class extends QH{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndRightSelect`,precondition:void 0,kbOpts:{kbExpr:T.and(D.textInputFocus,T.and(Ja,Xu)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}},fU=class extends QH{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordRightSelect`,precondition:void 0})}},pU=class extends QH{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityRight`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Et(Ui.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},mU=class extends QH{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityRightSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Et(Ui.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},hU=class extends $u{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){let r=e?.get(Mn);if(!t.hasModel()||!r)return;let i=Et(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections(),s=t.getOption(10),c=t.getOption(15),l=r.getLanguageConfiguration(a.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),d=o.map(e=>{let n=this._delete({wordSeparators:i,model:a,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:s,autoClosingQuotes:c,autoClosingPairs:l,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new qc(n,``)});t.pushUndoStop(),t.executeCommands(this.id,d),t.pushUndoStop()}},gU=class extends hU{_delete(e,t){return vd.deleteWordLeft(e,t)||new w(1,1,1,1)}},_U=class extends hU{_delete(e,t){let n=vd.deleteWordRight(e,t);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new w(r,i,r,i)}},vU=class extends gU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartLeft`,precondition:D.writable})}},yU=class extends gU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndLeft`,precondition:D.writable})}},bU=class extends gU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordLeft`,precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}},xU=class extends _U{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartRight`,precondition:D.writable})}},SU=class extends _U{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndRight`,precondition:D.writable})}},CU=class extends _U{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordRight`,precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}},wU=class extends G{constructor(){super({id:`deleteInsideWord`,precondition:D.writable,label:R(1650,`Delete Word`),metadata:{description:R(1651,`Delete the word at the cursor`),args:[{name:`args`,schema:{type:`object`,properties:{onlyWord:{type:`boolean`,default:!1,description:S(1649,`Delete only the word and leave surrounding whitespace`)}}}}]}})}run(e,t,n){if(!t.hasModel())return;let r=!!(n&&typeof n==`object`&&n.onlyWord),i=Et(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections().map(e=>{let t=vd.deleteInsideWord(i,a,e,r);return new qc(t,``)});t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}};U(new $H),U(new eU),U(new tU),U(new nU),U(new rU),U(new iU),U(new sU),U(new cU),U(new lU),U(new uU),U(new dU),U(new fU),U(new aU),U(new oU),U(new pU),U(new mU),U(new vU),U(new yU),U(new bU),U(new xU),U(new SU),U(new CU),B(wU);var TU=class extends hU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordPartLeft`,precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){return eu.deleteWordPartLeft(e)||new w(1,1,1,1)}},EU=class extends hU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordPartRight`,precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let n=eu.deleteWordPartRight(e);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new w(r,i,r,i)}},DU=class extends XH{_move(e,t,n,r,i){return eu.moveWordPartLeft(e,t,n,i)}},OU=class extends DU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordPartLeft`,precondition:void 0,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:783},weight:100}})}};Pn.registerCommandAlias(`cursorWordPartStartLeft`,`cursorWordPartLeft`);var kU=class extends DU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordPartLeftSelect`,precondition:void 0,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}};Pn.registerCommandAlias(`cursorWordPartStartLeftSelect`,`cursorWordPartLeftSelect`);var AU=class extends XH{_move(e,t,n,r,i){return eu.moveWordPartRight(e,t,n)}},jU=class extends AU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordPartRight`,precondition:void 0,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:785},weight:100}})}},MU=class extends AU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordPartRightSelect`,precondition:void 0,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}};U(new TU),U(new EU),U(new OU),U(new kU),U(new jU),U(new MU),self.MonacoEnvironment={async getWorker(){return new(await(x(()=>import(`./editor.worker-D2ouzCu8.js`),[]))).default}};function NU(e,t){let n=Yl.registerCommand(`offsite.block`,(e,n)=>t(n)),r=e===`stage`?`Stage`:`Unstage`,i={id:e===`stage`?`add`:`remove`},a=[Sn.appendMenuItem(O.DiffEditorHunkToolbar,{command:{id:`offsite.block`,title:`${r} Block`,icon:i},group:`primary`,order:10}),Sn.appendMenuItem(O.DiffEditorSelectionToolbar,{command:{id:`offsite.block`,title:`${r} Selection`,icon:i},group:`primary`,order:10})];return()=>{n.dispose();for(let e of a)e.dispose()}}function PU(e,t,n){let r=t.getValue();for(let i of n.innerChanges.slice().reverse()){let n=i.modifiedRange;r=r.slice(0,t.getOffsetAt({lineNumber:n.startLineNumber,column:n.startColumn}))+e.getValueInRange(i.originalRange)+r.slice(t.getOffsetAt({lineNumber:n.endLineNumber,column:n.endColumn}))}return r}var FU=Ke({themes:[],langs:[]}),IU=new Map([[`tsx`,()=>x(()=>import(`./typescript-fNZ3iur6.js`),__vite__mapDeps([13,8,1,2,3,4]))],[`jsx`,()=>x(()=>import(`./javascript-Dj-Vzbp-.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`json`,()=>x(()=>import(`./javascript-Dj-Vzbp-.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`jsonc`,()=>x(()=>import(`./javascript-Dj-Vzbp-.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`shellscript`,()=>x(()=>import(`./shell-CC2rA5mh.js`),[])],[`docker`,()=>x(()=>import(`./dockerfile-DZFCIeNp.js`),[])],[`c`,()=>x(()=>import(`./cpp-C7h46wYY.js`),[])],[`objective-cpp`,()=>x(()=>import(`./cpp-C7h46wYY.js`),[])],[`vue`,()=>x(()=>import(`./html-BwGTVsqZ.js`),__vite__mapDeps([6,1,2,3,4]))],[`svelte`,()=>x(()=>import(`./html-BwGTVsqZ.js`),__vite__mapDeps([6,1,2,3,4]))]]);async function LU(e){let t=d(e),n=Xe.find(e=>e.id===t||e.aliases?.includes(t)===!0);if(n===void 0)return{id:`plaintext`,name:`Plain Text`};let r=await FU;if(!r.getLoadedLanguages().includes(n.id)){if(await r.loadLanguage(n.import),!Hc.getLanguages().some(e=>e.id===n.id)){Hc.register({id:n.id});let e=IU.get(n.id);e!==void 0&&Hc.setLanguageConfiguration(n.id,(await e()).conf)}await RU()}return{id:n.id,name:n.name}}async function RU(){let e=Se(),t=Ge.find(t=>t.id===e.codeTheme);if(t===void 0)throw Error(`unknown code theme ${e.codeTheme}`);let n=(await t.import()).default,r=await FU;await r.loadTheme({...n,colors:{...n.colors,"editor.background":e.background}}),pp(r,Uu),Yl.setTheme(e.codeTheme)}function zU(e){return{fontFamily:e.font.family,fontSize:e.font.size,lineHeight:e.font.lineHeight,fontLigatures:e.font.ligatures?e.font.features===``||e.font.features:!1,cursorStyle:e.cursor.style===`bar`?`line`:e.cursor.style,cursorBlinking:e.cursor.blink?`expand`:`solid`,tabSize:e.tabSize,insertSpaces:!0,detectIndentation:!1,trimAutoWhitespace:!1,wordWrap:e.wordWrap?`on`:`off`,wrappingStrategy:`advanced`,minimap:{enabled:!1},stickyScroll:{enabled:!1},overviewRulerBorder:!1,padding:{top:3,bottom:48},cursorSurroundingLines:2,copyWithSyntaxHighlighting:!1,accessibilitySupport:`off`,guides:{bracketPairs:!0,bracketPairsHorizontal:!1,highlightActiveBracketPair:!0,highlightActiveIndentation:!0},dragAndDrop:!1,glyphMargin:!1,useTabStops:!1,selectionHighlight:!1,emptySelectionClipboard:!1,renderWhitespace:`selection`,smartSelect:{selectLeadingAndTrailingWhitespace:!1},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},scrollBeyondLastLine:!1,smoothScrolling:!0,hover:{above:!1},find:{cursorMoveOnType:!1},acceptSuggestionOnCommitCharacter:!1,suggestSelection:`first`,suggest:{localityBonus:!0,insertMode:`replace`,snippetsPreventQuickSuggestions:!1},quickSuggestions:{comments:`on`,strings:`on`,other:`on`},quickSuggestionsDelay:0}}async function BU(e){await document.fonts.load(`${e.font.size}px ${e.font.family}`),Yl.remeasureFonts()}function VU(e){return(0,X.jsx)(Ce,{open:e.open,onOpenChange:t=>{t||e.onCancel()},children:(0,X.jsxs)(Me,{children:[(0,X.jsxs)(Ne,{children:[(0,X.jsx)(_e,{children:e.paths.length===1?`Do you want to save the changes you made to ${sp(e.paths[0])}?`:`Do you want to save the changes to the following ${e.paths.length} files?`}),(0,X.jsxs)(ge,{children:[e.paths.length>1&&`${e.paths.map(sp).join(`, `)}. `,`Your changes will be lost if you don't save them.`]})]}),(0,X.jsxs)(De,{children:[(0,X.jsx)(Oe,{children:`Cancel`}),(0,X.jsx)(he,{variant:`outline`,onClick:()=>e.onFinish(!1),children:`Don't Save`}),(0,X.jsx)(he,{onClick:()=>e.onFinish(!0),children:e.paths.length===1?`Save`:`Save All`})]})]})})}function HU(e){let[t,n]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{let t=e.editor;if(t===null)return;n(UU(t));let r=[t.onDidChangeCursorSelection(()=>n(UU(t))),t.onDidChangeModel(()=>n(UU(t))),t.onDidChangeModelOptions(()=>n(UU(t)))];return()=>{for(let e of r)e.dispose()}},[e.editor]),(0,X.jsxs)(`div`,{className:`bg-sidebar border-sidebar-border text-muted-foreground flex h-[22px] shrink-0 items-center justify-end gap-4 border-t px-3 text-xs whitespace-nowrap`,children:[e.children,e.language!==null&&t!==null&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{children:[`Ln `,t.line,`, Col `,t.column,t.selected>0&&` (${t.selected} selected)`]}),(0,X.jsxs)(`span`,{children:[t.spaces?`Spaces`:`Tab Size`,`: `,t.tabSize]}),(0,X.jsx)(`span`,{children:`UTF-8`}),(0,X.jsx)(`span`,{children:t.eol}),(0,X.jsx)(`span`,{children:e.language})]})]})}function UU(e){let t=e.getModel(),n=e.getSelection();if(t===null||n===null)return null;let r=t.getOptions();return{line:n.positionLineNumber,column:n.positionColumn,selected:t.getValueLengthInRange(n),tabSize:r.tabSize,spaces:r.insertSpaces,eol:t.getEndOfLineSequence()===Yl.EndOfLineSequence.LF?`LF`:`CRLF`}}function WU(e){let t=GU(e.spec),n=t?.kind??null,r=(0,Y.useEffectEvent)(n=>{let r=e.spec,i=e.original,a=e.modified;if(r===void 0||t===null||i===null||a===null)throw Error(`This diff has no blocks to stage`);e.onPerform(()=>ve(e.machine,`git.run`,{projectId:e.projectId,repo:r.repo,action:{kind:`stageContent`,path:t.path,content:t.kind===`stage`?n.originalWithModifiedChanges:PU(i,a,n.mapping)}}))});(0,Y.useEffect)(()=>{if(n!==null)return NU(n,r)},[n])}function GU(e){return e?.left?.kind===`git`&&e.left.ref===``&&e.right.kind===`worktree`?{kind:`stage`,path:e.left.path}:e?.left?.kind===`git`&&e.right.kind===`git`&&e.right.ref===``?{kind:`unstage`,path:e.right.path}:null}var KU={M:`Modified`,T:`Type Changed`,A:`Added`,D:`Deleted`,R:`Renamed`,C:`Copied`,U:`Untracked`,"!":`Conflict`},qU={M:`text-warning`,T:`text-warning`,A:`text-success`,D:`text-destructive`,R:`text-success`,C:`text-success`,U:`text-success`,"!":`text-destructive`};function JU(e,t){return e===``?t:`${e}/${t}`}function YU(e){return e.slice(0,7)}function XU(e,t,n){let r=JU(e,n.path),i={kind:`git`,ref:``,path:n.path};function a(t,n,i){return{id:`${t}:${r}`,repo:e,path:r,label:`${sp(r)} (${t})`,left:n,right:i}}return t===`merge`?a(`Working Tree`,null,{kind:`worktree`}):t===`staged`&&n.status===`A`?a(`Index`,null,i):t===`staged`&&n.status===`D`?a(`Deleted`,null,{kind:`git`,ref:`HEAD`,path:n.path}):t===`staged`?a(`Index`,{kind:`git`,ref:`HEAD`,path:n.from??n.path},i):n.status===`U`?a(`Untracked`,null,{kind:`worktree`}):n.status===`A`?a(`Intent to Add`,null,{kind:`worktree`}):n.status===`D`?a(`Deleted`,null,i):a(`Working Tree`,i,{kind:`worktree`})}function ZU(e,t){return{id:`File:${t}`,repo:e,path:t,label:sp(t),left:null,right:{kind:`worktree`}}}function QU(e,t){let n=JU(e,t.path);return{id:`HEAD:${n}`,repo:e,path:n,label:`${sp(n)} (HEAD)`,left:null,right:{kind:`git`,ref:`HEAD`,path:t.from??t.path}}}function $U(e,t,n){let r=JU(e,n.path),i=t.parents.at(0)??null;return{id:`${t.hash}:${r}`,repo:e,path:r,label:`${sp(r)} (${i===null?`empty`:YU(i)} ↔ ${YU(t.hash)})`,left:i===null||n.status===`A`?{kind:`empty`}:{kind:`git`,ref:i,path:n.from??n.path},right:n.status===`D`?{kind:`empty`}:{kind:`git`,ref:t.hash,path:n.path}}}function eW(e,t){return[...e].sort((e,n)=>t===`name`?sp(e.path).localeCompare(sp(n.path))||e.path.localeCompare(n.path):t===`status`&&e.status.localeCompare(n.status)||e.path.localeCompare(n.path))}function tW(e,t){let n={folders:new Map,files:[]};for(let t of e){let e=n,r=op(t.path);for(let t of r===``?[]:r.split(`/`)){let n=e.folders.get(t)??{folders:new Map,files:[]};e.folders.set(t,n),e=n}e.files.push(t)}return nW(n,``,t)}function nW(e,t,n){return[...[...e.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(e=>{let r=e[0],i=e[1];for(;i.files.length===0&&i.folders.size===1;){let e=[...i.folders][0];r=`${r}/${e[0]}`,i=e[1]}let a=t===``?r:`${t}/${r}`,o=nW(i,a,n);return{kind:`folder`,path:a,label:r,children:o,resources:o.flatMap(e=>e.kind===`file`?[e.resource]:e.resources)}}),...eW(e.files,n).map(e=>({kind:`file`,resource:e}))]}var rW=new WeakSet;function iW(e){let[t,n]=(0,Y.useState)(()=>e.saved.tabs.map(e=>({spec:e.spec,document:{status:`loading`}}))),[r,a]=(0,Y.useState)(e.saved.active),[o,s]=(0,Y.useState)(null),c=t.filter(e=>e.document.status===`text`&&e.document.dirty),l=o?.kind===`tab`?t.filter(e=>e.spec.id===o.id):c;(0,Y.useEffect)(()=>{let e=new Set(t.flatMap(e=>e.document.status===`text`?[e.document.modified,e.document.original]:[]));for(let t of Yl.getModels())e.has(t)||t.dispose()},[t]),(0,Y.useEffect)(()=>()=>{for(let e of Yl.getModels())e.dispose()},[]);async function u(t,n){if(n.kind===`empty`)return``;if(n.kind===`git`)return ve(e.machine,`git.show`,{projectId:e.projectId,repo:t.repo,ref:n.ref,path:n.path});let r=await ve(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return r.kind===`text`?r.content:null}function d(e){return Promise.all([e.left===null?``:u(e,e.left),u(e,e.right)])}function f(e,t){n(n=>n.map(n=>n.spec.id===e?{...n,document:t}:n))}async function p(t){try{if(t.left===null&&t.right.kind===`worktree`){let n=await ve(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return n.kind===`image`?{status:`image`,src:`data:${n.mediaType};base64,${n.data}`}:n.kind===`large`?{status:`large`,size:n.size,limit:n.limit}:n.kind===`binary`?{status:`binary`}:await m(t,``,n.content)}let n=await d(t);return n[0]===null||n[1]===null?{status:`binary`}:await m(t,n[0],n[1])}catch(e){return{status:`error`,message:i(e)}}}async function m(e,t,r){let i=await LU(e.path),a=e.left===null?null:Yl.createModel(t,i.id),o=Yl.createModel(r,i.id);return o.onDidChangeContent(()=>{rW.has(o)||n(e=>{let t=e.find(e=>e.document.status===`text`&&e.document.modified===o);if(t===void 0||t.document.status!==`text`)return e;let n=o.getAlternativeVersionId()!==t.document.saved;return t.document.dirty===n?e:e.map(e=>e===t?{...t,document:{...t.document,dirty:n}}:e)})}),{status:`text`,original:a,modified:o,language:i.name,saved:o.getAlternativeVersionId(),dirty:!1}}async function h(e){let r=t.find(t=>t.spec.id===e);if(r?.document.status!==`text`||r.document.dirty)return;let a=r.document,o=a.modified.getAlternativeVersionId();try{let t=await d(r.spec);if(a.modified.isDisposed()||a.modified.getAlternativeVersionId()!==o)return;if(t[0]===null||t[1]===null){f(e,{status:`binary`});return}a.original!==null&&aW(a.original,t[0]),rW.add(a.modified),aW(a.modified,t[1]),rW.delete(a.modified);let i=a.modified.getAlternativeVersionId();i!==o&&n(e=>e.map(e=>e.document.status===`text`&&e.document.modified===a.modified?{...e,document:{...e.document,saved:i}}:e))}catch(t){f(e,{status:`error`,message:i(t)})}}async function g(e){a(e.id),!t.some(t=>t.spec.id===e.id)&&(n([...t,{spec:e,document:{status:`loading`}}]),await _(e))}async function _(e){let t=await p(e);n(n=>n.map(n=>n.spec.id===e.id&&n.document.status===`loading`?{...n,document:t}:n))}async function v(r){let i=t.find(e=>e.spec.id===r);if(i?.document.status!==`text`||i.spec.right.kind!==`worktree`)return!0;let a=i.document.modified,o=a.getAlternativeVersionId();try{await ve(e.machine,`files.write`,{projectId:e.projectId,path:i.spec.path,content:a.getValue()})}catch(e){return xe(e),!1}return n(e=>e.map(e=>e.document.status===`text`&&e.document.modified===a?{...e,document:{...e.document,saved:o,dirty:a.getAlternativeVersionId()!==o}}:e)),e.onSaved(),!0}function y(e){let i=t.filter(t=>!e(t.spec));n(i);let o=t.findIndex(e=>e.spec.id===r);o!==-1&&e(t[o].spec)&&a(i.at(Math.min(o,i.length-1))?.spec.id??null)}function b(e,i){function o(t){return t===e?i:t.startsWith(`${e}/`)?`${i}${t.slice(e.length)}`:t}let s=t.map(e=>e.spec.id===ZU(e.spec.repo,e.spec.path).id?{...e,spec:ZU(e.spec.repo,o(e.spec.path))}:e);n(s);let c=t.findIndex(e=>e.spec.id===r);c!==-1&&a(s[c].spec.id)}function ee(e){y(t=>t.right.kind===`worktree`&&(t.path===e||t.path.startsWith(`${e}/`)))}function te(e){c.some(t=>t.spec.id===e)?s({kind:`tab`,id:e}):y(t=>t.id===e)}function ne(){c.length>0?s({kind:`dialog`}):e.onClose()}async function re(t){o!==null&&(s(null),!(t&&(await Promise.all(l.map(e=>v(e.spec.id)))).includes(!1))&&(o.kind===`tab`&&y(e=>e.id===o.id),o.kind===`dialog`&&e.onClose()))}let ie=(0,Y.useEffectEvent)(()=>{for(let t of e.saved.tabs)_(t.spec)});return(0,Y.useEffect)(()=>ie(),[]),{tabs:t,active:r,setActive:a,dirty:c,closing:o,setClosing:s,closingTabs:l,open:g,reload:h,save:v,close:te,renamed:b,deleted:ee,requestClose:ne,finish:re}}function aW(e,t){let n=e.getValue(),r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r++;let i=0;for(;i<n.length-r&&i<t.length-r&&n[n.length-1-i]===t[t.length-1-i];)i++;(r!==n.length||r!==t.length)&&e.applyEdits([{range:md.fromPositions(e.getPositionAt(r),e.getPositionAt(n.length-i)),text:t.slice(r,t.length-i)}])}function oW(e){return(0,X.jsxs)(u,{children:[(0,X.jsxs)(ne,{className:`hover:bg-accent data-[state=open]:bg-accent mr-auto ml-1 flex h-6 min-w-0 cursor-pointer items-center gap-1 rounded-sm px-1 text-[11px] font-bold tracking-wide uppercase outline-none`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.view===`explorer`?`Explorer`:`Source Control`}),(0,X.jsx)(Le,{icon:je,className:`size-3.5 shrink-0`})]}),(0,X.jsx)(se,{align:`start`,className:`bg-popover! w-44`,children:(0,X.jsxs)(f,{value:e.view,onValueChange:t=>{(t===`explorer`||t===`scm`)&&e.onView(t)},children:[(0,X.jsx)(re,{value:`explorer`,children:`Explorer`}),(0,X.jsx)(re,{value:`scm`,children:`Source Control`})]})})]})}function sW(e){return(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 pl-1.5`,children:[(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Open File`,"aria-label":`Open File`,onClick:e.onOpenFile,children:(0,X.jsx)(Le,{icon:Gf,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Previous Change`,"aria-label":`Previous Change`,onClick:e.onPrevious,children:(0,X.jsx)(Le,{icon:h,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Next Change`,"aria-label":`Next Change`,onClick:e.onNext,children:(0,X.jsx)(Le,{icon:b,className:`size-4`})}),(0,X.jsxs)(u,{children:[(0,X.jsx)(ne,{asChild:!0,children:(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,children:(0,X.jsx)(Le,{icon:ee,className:`size-4`})})}),(0,X.jsxs)(se,{align:`end`,className:`bg-popover! w-80`,children:[(0,X.jsx)(Pe,{checked:e.settings.inline,onCheckedChange:t=>e.onSettings({inline:t}),children:`Inline View`}),(0,X.jsx)(Pe,{checked:e.settings.whitespace,onCheckedChange:t=>e.onSettings({whitespace:t}),children:`Show Leading/Trailing Whitespace Differences`}),(0,X.jsx)(Pe,{checked:e.settings.collapse,onCheckedChange:t=>e.onSettings({collapse:t}),children:`Collapse Unchanged Regions`})]})]})]})}function cW(e){let t=e.repo;return(0,X.jsxs)(`div`,{className:`mr-auto -ml-1.5 flex h-full items-center`,children:[(0,X.jsxs)(`button`,{type:`button`,title:`${t.branch??`HEAD`} (Git) - Checkout Branch/Tag...`,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onCheckout,children:[(0,X.jsx)(Le,{icon:oe,className:`size-3.5`}),t.branch??(t.head===null?`HEAD`:YU(t.head)),t.changes.length>0&&`*`,t.staged.length>0&&`+`,t.merge.length>0&&`!`]}),t.upstream!==null&&(0,X.jsxs)(`button`,{type:`button`,title:`Synchronize Changes`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onSync,children:[(0,X.jsx)(Le,{icon:Xf,className:o(`size-3.5`,e.busy&&`animate-spin`)}),(t.behind>0||t.ahead>0)&&`${t.behind}↓ ${t.ahead}↑`]}),t.upstream===null&&t.branch!==null&&t.remote&&(0,X.jsx)(`button`,{type:`button`,title:`Publish Branch`,"aria-label":`Publish Branch`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onPublish,children:(0,X.jsx)(Le,{icon:l,className:`size-3.5`})})]})}var lW={all:null,amend:!1,then:null};function uW(e){let n=e.repo,r=n.merge.length+n.staged.length+n.changes.length>0,i=!r&&n.branch!==null&&n.upstream===null&&n.remote,a=!r&&n.upstream!==null&&(n.ahead>0||n.behind>0);return(0,X.jsxs)(`div`,{className:o(`grid gap-1.5 pt-1.5 pr-2 pb-1.5`,e.nested?`pl-4`:`pl-2`),children:[(0,X.jsxs)(`div`,{className:`bg-input/40 border-input focus-within:border-primary relative rounded-sm border`,children:[(0,X.jsx)(`textarea`,{rows:7,"aria-label":`Source Control Input`,value:e.message,placeholder:`Message (${t===`⌘`?`⌘Enter`:`Ctrl+Enter`} to commit on "${n.branch??(n.head===null?`HEAD`:YU(n.head))}")`,className:`placeholder:text-muted-foreground block w-full resize-none bg-transparent py-1 pr-7 pl-2 text-[13px] leading-[18px] outline-none`,onChange:t=>e.onMessage(t.target.value),onKeyDown:t=>{(t.metaKey||t.ctrlKey)&&t.key===`Enter`&&(t.preventDefault(),e.onCommit({...lW,then:`push`}))}}),(0,X.jsx)(`button`,{type:`button`,title:e.generating?`Cancel`:`Generate Commit Message`,"aria-label":e.generating?`Cancel`:`Generate Commit Message`,className:`text-muted-foreground hover:text-foreground hover:bg-accent absolute top-[3px] right-[3px] grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:e.generating?e.onCancel:e.onGenerate,children:(0,X.jsx)(Le,{icon:e.generating?Zf:ie,className:`size-3.5`})})]}),i&&(0,X.jsxs)(Ie,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.push`),children:[(0,X.jsx)(Le,{icon:l}),`Publish Branch`]}),a&&(0,X.jsxs)(Ie,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.sync`),children:[(0,X.jsx)(Le,{icon:Xf}),`Sync Changes`,n.behind>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[n.behind,(0,X.jsx)(Le,{icon:b,className:`size-3`})]}),n.ahead>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[n.ahead,(0,X.jsx)(Le,{icon:h,className:`size-3`})]})]}),!i&&!a&&(0,X.jsxs)(`div`,{className:`flex`,children:[(0,X.jsxs)(Ie,{size:`xs`,className:`flex-1 rounded-sm rounded-r-none`,disabled:!r||e.busy,onClick:()=>e.onCommit({...lW,then:`push`}),children:[(0,X.jsx)(Le,{icon:ue}),`Commit & Push`]}),(0,X.jsxs)(u,{children:[(0,X.jsx)(ne,{asChild:!0,children:(0,X.jsx)(Ie,{size:`xs`,className:`rounded-sm rounded-l-none px-1 before:absolute before:inset-y-1 before:-left-px before:w-px before:bg-white/10`,disabled:!r||e.busy,title:`More Actions...`,"aria-label":`More Commit Actions`,children:(0,X.jsx)(Le,{icon:je})})}),(0,X.jsxs)(se,{align:`end`,className:`bg-popover! w-48`,children:[(0,X.jsx)(p,{onSelect:()=>e.onCommit(lW),children:`Commit`}),(0,X.jsx)(p,{onSelect:()=>e.onCommit({...lW,amend:!0}),children:`Commit (Amend)`}),(0,X.jsx)(p,{onSelect:()=>e.onCommit({...lW,then:`push`}),children:`Commit & Push`}),(0,X.jsx)(p,{onSelect:()=>e.onCommit({...lW,then:`sync`}),children:`Commit & Sync`})]})]})]})]})}var dW=[{id:`merge`,title:`Merge Changes`},{id:`staged`,title:`Staged Changes`},{id:`changes`,title:`Changes`}];function fW(e){let[t,n]=(0,Y.useState)([]),[r,i]=(0,Y.useState)(null),a=Ae(),s=e.repo;function c(e){n(t.includes(e)?t.filter(t=>t!==e):[...t,e])}function l(t,n,r){let i=r===`group`?`All Changes`:`Changes`;return(0,X.jsxs)(X.Fragment,{children:[r===`file`&&n[0].status!==`D`&&(0,X.jsx)(mW,{title:`Open File`,icon:Gf,onClick:()=>e.onOpen(ZU(s.path,JU(s.path,n[0].path)))}),t===`changes`&&(0,X.jsx)(mW,{title:`Discard ${i}`,icon:$f,onClick:()=>e.onDiscard(n)}),t===`staged`&&(0,X.jsx)(mW,{title:`Unstage ${i}`,icon:ze,onClick:()=>e.onUnstage(n)}),t!==`staged`&&(0,X.jsx)(mW,{title:t===`merge`&&r===`group`?`Stage All Merge Changes`:`Stage ${i}`,icon:Re,onClick:()=>e.onStage(n)})]})}function u(t,n,r){let a=XU(s.path,t,n),c=JU(s.path,n.path);return(0,X.jsxs)(`div`,{"data-resource":!0,role:`button`,tabIndex:0,title:`${e.root}/${c} • ${KU[n.status]}`,className:o(`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,a.id===e.active&&`bg-sidebar-row-active`),style:{paddingLeft:20+r*8},onClick:()=>e.onOpen(a),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(a)},onContextMenu:()=>i({group:t,resource:n}),children:[(0,X.jsx)(Ve,{path:n.path}),(0,X.jsx)(`span`,{className:o(`min-w-0 shrink-0 truncate`,qU[n.status],n.status===`D`&&`line-through`),children:sp(n.path)}),!e.tree&&(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:op(n.path)}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(t,[n],`file`)}),(0,X.jsx)(`span`,{className:o(`w-3.5 text-center text-xs`,qU[n.status]),children:n.status})]})]},`${t}:${n.path}`)}function d(e,n,r){return n.map(n=>{if(n.kind===`file`)return u(e,n.resource,r);let i=`${s.path}:${e}:${n.path}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:n.path,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+r*8},onClick:()=>c(i),onKeyDown:e=>{e.key===`Enter`&&c(i)},children:[(0,X.jsx)(pW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.label}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(e,n.resources,`folder`)})]}),a&&d(e,n.children,r+1)]},i)})}return(0,X.jsxs)(y,{children:[(0,X.jsx)(ae,{asChild:!0,children:(0,X.jsx)(`div`,{onContextMenu:e=>{(!(e.target instanceof Element)||e.target.closest(`[data-resource]`)===null)&&e.preventDefault()},children:dW.map(n=>{let r=s[n.id];if(r.length===0)return null;let i=`${s.path}:${n.id}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+e.depth*8},onClick:()=>c(i),onKeyDown:e=>{e.key===`Enter`&&c(i)},children:[(0,X.jsx)(pW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.title}),(0,X.jsx)(`span`,{className:`hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(n.id,r,`group`)}),(0,X.jsx)(`span`,{className:`bg-muted text-foreground grid h-4.5 min-w-4.5 shrink-0 place-items-center rounded-full px-1 text-[11px] tabular-nums`,children:r.length})]}),a&&(e.tree?d(n.id,tW(r,e.sort),e.depth+1):eW(r,e.sort).map(t=>u(n.id,t,e.depth+1)))]},n.id)})})}),r!==null&&(0,X.jsxs)(fe,{className:`min-w-52`,children:[(0,X.jsx)(de,{onSelect:()=>e.onOpen(XU(s.path,r.group,r.resource)),children:`Open Changes`}),r.resource.status!==`D`&&(0,X.jsx)(de,{onSelect:()=>e.onOpen(ZU(s.path,JU(s.path,r.resource.path))),children:`Open File`}),r.resource.status!==`U`&&r.resource.status!==`A`&&(0,X.jsx)(de,{onSelect:()=>e.onOpen(QU(s.path,r.resource)),children:`Open File (HEAD)`}),(0,X.jsx)(pe,{}),r.group===`staged`&&(0,X.jsx)(de,{onSelect:()=>e.onUnstage([r.resource]),children:`Unstage Changes`}),r.group!==`staged`&&(0,X.jsx)(de,{onSelect:()=>e.onStage([r.resource]),children:`Stage Changes`}),r.group===`changes`&&(0,X.jsx)(de,{onSelect:()=>e.onDiscard([r.resource]),children:`Discard Changes`}),r.resource.status===`U`&&(0,X.jsx)(de,{onSelect:()=>e.onIgnore([r.resource]),children:`Add to .gitignore`}),(0,X.jsx)(pe,{}),(0,X.jsx)(de,{onSelect:()=>void a.copy(`${e.root}/${JU(s.path,r.resource.path)}`),children:`Copy Path`}),(0,X.jsx)(de,{onSelect:()=>void a.copy(JU(s.path,r.resource.path)),children:`Copy Relative Path`})]})]})}function pW(e){return(0,X.jsx)(Le,{icon:ce,"aria-hidden":!0,className:o(`text-muted-foreground size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)})}function mW(e){return(0,X.jsx)(`button`,{type:`button`,title:e.title,"aria-label":e.title,className:`text-foreground hover:bg-accent grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:t=>{t.stopPropagation(),e.onClick()},children:(0,X.jsx)(Le,{icon:e.icon,className:`size-4`})})}var hW=50,gW=11,_W=22,vW=[`#59A4F9`,`#FFB000`,`#DC267F`,`#994F00`,`#40B0A6`,`#B66DFF`];function yW(e){let[t,n]=(0,Y.useState)(null),[a,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(hW),[f,p]=(0,Y.useState)(0),[h,g]=(0,Y.useState)([]),[_,v]=(0,Y.useState)({}),y=e.repos.find(e=>e.path===t)??e.repos.at(0),b=y?.path??null,ee=y?.head??null,te=y?.upstream??null,ne=y?.behind??0;(0,Y.useEffect)(()=>{if(b===null||ee===null){s([]);return}let t=!0;return ve(e.machine,`git.history`,{projectId:e.projectId,repo:b,limit:u}).then(e=>{t&&(s(e),l(null))},e=>{t&&l(i(e))}),()=>{t=!1}},[e.machine,e.projectId,b,ee,te,ne,u,f]);async function re(t){if(h.includes(t.hash))g(h.filter(e=>e!==t.hash));else if(g([...h,t.hash]),y!==void 0&&_[t.hash]===void 0)try{let n=await ve(e.machine,`git.commitFiles`,{projectId:e.projectId,repo:y.path,hash:t.hash,parent:t.parents.at(0)??null});v(e=>({...e,[t.hash]:n}))}catch(e){xe(e)}}let ie=wW(a??[]);return(0,X.jsxs)(`div`,{className:o(`border-sidebar-border relative flex shrink-0 flex-col border-t`,e.open&&`min-h-20`),style:e.open?{height:e.height}:void 0,children:[e.open&&(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,className:`hover:bg-primary absolute inset-x-0 -top-0.5 z-10 h-1 cursor-row-resize touch-none transition-colors delay-100`,onPointerDown:t=>{let n=t.currentTarget.parentElement?.parentElement;if(n==null)return;let i=n.getBoundingClientRect();r(t,t=>e.onHeight(Math.min(Math.max(i.bottom-t.clientY,80),i.height-120)))}}),(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row text-sidebar-foreground flex h-[22px] shrink-0 cursor-pointer items-center gap-0.5 pr-2 pl-0.5 outline-none select-none`,onClick:e.onToggle,onKeyDown:t=>{t.key===`Enter`&&e.onToggle()},children:[(0,X.jsx)(Le,{icon:ce,"aria-hidden":!0,className:o(`size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-bold tracking-wide uppercase`,children:`Graph`}),e.repos.length>1&&(0,X.jsx)(`select`,{"aria-label":`Repository`,value:y?.path??``,className:`bg-sidebar text-muted-foreground max-w-28 cursor-pointer truncate text-xs outline-none`,onClick:e=>e.stopPropagation(),onChange:e=>{n(e.target.value),g([]),d(hW)},children:e.repos.map(e=>(0,X.jsx)(`option`,{value:e.path,children:e.path===``?`.`:e.path},e.path))}),e.open&&y!==void 0&&(0,X.jsxs)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex`,children:[(0,X.jsx)(mW,{title:`Fetch From All Remotes`,icon:Uf,onClick:()=>e.onFetch(y)}),(0,X.jsx)(mW,{title:`Refresh`,icon:m,onClick:()=>p(f+1)})]})]}),e.open&&(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[c!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:c}),c===null&&ie.length===0&&a!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:`No commits yet.`}),c===null&&y!==void 0&&ie.map(t=>{let n=t.commit,r=h.includes(n.hash);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${n.author}, ${new Date(n.date).toLocaleString()}\n\n${n.subject}\n\n${YU(n.hash)}`,className:`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,onClick:()=>void re(n),onKeyDown:e=>{e.key===`Enter`&&re(n)},children:[(0,X.jsx)(bW,{row:t,child:!1}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.subject}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 shrink-[2] truncate text-xs`,children:n.author}),(0,X.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:n.refs.map(e=>xW(e,y))})]}),r&&(_[n.hash]??[]).map(r=>{let i=$U(y.path,n,r);return(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${r.path} • ${KU[r.status]}`,className:o(`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,i.id===e.active&&`bg-sidebar-row-active`),onClick:()=>e.onOpen(i),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(i)},children:[(0,X.jsx)(bW,{row:t,child:!0}),(0,X.jsx)(Ve,{path:r.path}),(0,X.jsx)(`span`,{className:o(`min-w-0 shrink-0 truncate`,qU[r.status],r.status===`D`&&`line-through`),children:sp(r.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:op(r.path)}),(0,X.jsx)(`span`,{className:o(`ml-auto w-3.5 shrink-0 text-center text-xs`,qU[r.status]),children:r.status})]},r.path)})]},n.hash)}),a!==null&&a.length===u&&(0,X.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground w-full cursor-pointer px-4 py-1 text-left text-xs`,onClick:()=>d(u+hW),children:`Load More…`})]})]})}function bW(e){let t=e.row,n=_W/2,r=SW(t.lane);return e.child?(0,X.jsx)(`svg`,{"aria-hidden":!0,width:gW*(t.width+1),height:_W,className:`shrink-0`,children:t.after.map(e=>(0,X.jsx)(`line`,{x1:SW(e),x2:SW(e),y1:0,y2:_W,stroke:CW(e),strokeWidth:1},e))}):(0,X.jsxs)(`svg`,{"aria-hidden":!0,width:gW*(t.width+1),height:_W,className:`shrink-0`,children:[t.through.map(e=>(0,X.jsx)(`line`,{x1:SW(e),x2:SW(e),y1:0,y2:_W,stroke:CW(e),strokeWidth:1},`through-${e}`)),t.up.map(e=>(0,X.jsx)(`path`,{d:`M ${SW(e)} 0 Q ${SW(e)} ${n} ${r} ${n}`,fill:`none`,stroke:CW(e),strokeWidth:1},`up-${e}`)),t.down.map(e=>(0,X.jsx)(`path`,{d:`M ${r} ${n} Q ${SW(e)} ${n} ${SW(e)} ${_W}`,fill:`none`,stroke:CW(e),strokeWidth:1},`down-${e}`)),(0,X.jsx)(`circle`,{cx:r,cy:n,r:t.commit.parents.length>1?3.5:4,fill:t.commit.parents.length>1?`var(--sidebar)`:CW(t.lane),stroke:CW(t.lane),strokeWidth:t.commit.parents.length>1?2:0})]})}function xW(e,t){if(e.endsWith(`/HEAD`))return null;let n=e===`HEAD`||e.startsWith(`HEAD -> `),r=e.startsWith(`tag: `),i=e===t.upstream,a=e.replace(/^HEAD -> /,``).replace(/^tag: /,``);return(0,X.jsxs)(`span`,{title:a,className:o(`inline-flex h-4 max-w-32 items-center gap-0.5 rounded-full px-1.5 text-[11px] font-medium`,n&&`text-background bg-[#59A4F9]`,i&&`text-background bg-[#B180D7]`,!n&&!i&&`bg-muted text-foreground`),children:[(0,X.jsx)(Le,{icon:r?Qf:i?le:oe,className:`size-3 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:a})]},e)}function SW(e){return gW*(e+1)}function CW(e){return vW[e%vW.length]}function wW(e){let t=[];return e.map(e=>{let n=t,r=n.indexOf(e.hash),i=n.indexOf(null),a=r===-1?i===-1?n.length:i:r,o=n.map(t=>t===e.hash?null:t);o[a]=e.parents.at(0)??null;let s=e.parents.length>0?[a]:[];for(let t of e.parents.slice(1)){let e=o.indexOf(t);if(e!==-1){s.push(e);continue}let n=o.indexOf(null),r=n===-1?o.length:n;o[r]=t,s.push(r)}for(;o.length>0&&o.at(-1)===null;)o.pop();return t=o,{commit:e,lane:a,up:n.flatMap((t,n)=>t===e.hash?[n]:[]),through:n.flatMap((t,n)=>t!==null&&t!==e.hash?[n]:[]),down:s,after:o.flatMap((e,t)=>e===null?[]:[t]),width:Math.max(n.length,o.length,a+1)}})}function TW(e){let t=e.repo;function n(t,n){return(0,X.jsx)(p,{onSelect:()=>e.onCommit({...lW,...n}),children:t})}return(0,X.jsxs)(u,{children:[(0,X.jsx)(ne,{asChild:!0,children:(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Le,{icon:ee,className:`size-4`})})}),(0,X.jsxs)(se,{align:`end`,className:`bg-popover! w-56`,children:[(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`View & Sort`}),(0,X.jsxs)(we,{className:`w-44`,children:[(0,X.jsxs)(f,{value:e.settings.tree?`tree`:`list`,onValueChange:t=>e.onSettings({tree:t===`tree`}),children:[(0,X.jsx)(re,{value:`list`,children:`View as List`}),(0,X.jsx)(re,{value:`tree`,children:`View as Tree`})]}),(0,X.jsx)(Te,{}),(0,X.jsxs)(f,{value:e.settings.sort,onValueChange:t=>{(t===`name`||t===`path`||t===`status`)&&e.onSettings({sort:t})},children:[(0,X.jsx)(re,{value:`name`,children:`Sort by Name`}),(0,X.jsx)(re,{value:`path`,children:`Sort by Path`}),(0,X.jsx)(re,{value:`status`,children:`Sort by Status`})]})]})]}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(p,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(p,{onSelect:e.onCheckout,children:`Checkout to...`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(Te,{}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Commit`}),(0,X.jsxs)(we,{className:`w-52`,children:[n(`Commit`,{}),n(`Commit Staged`,{all:!1}),n(`Commit All`,{all:!0}),(0,X.jsx)(p,{disabled:t.head===null,onSelect:e.onUndo,children:`Undo Last Commit`}),(0,X.jsx)(Te,{}),n(`Commit (Amend)`,{amend:!0}),n(`Commit Staged (Amend)`,{all:!1,amend:!0}),n(`Commit All (Amend)`,{all:!0,amend:!0})]})]}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Changes`}),(0,X.jsxs)(we,{className:`w-52`,children:[(0,X.jsx)(p,{onSelect:()=>e.onStage([...t.merge,...t.changes]),children:`Stage All Changes`}),(0,X.jsx)(p,{onSelect:()=>e.onUnstage(t.staged),children:`Unstage All Changes`}),(0,X.jsx)(p,{disabled:t.changes.length===0,onSelect:()=>e.onDiscard(t.changes),children:`Discard All Changes`})]})]}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Pull, Push`}),(0,X.jsxs)(we,{className:`w-52`,children:[(0,X.jsx)(p,{onSelect:()=>e.onRemote(`git.sync`),children:`Sync`}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`pull`,rebase:!0}),children:`Pull (Rebase)`}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`fetch`,prune:!0,all:!1}),children:`Fetch (Prune)`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!0}),children:`Fetch From All Remotes`})]})]}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Branch`}),(0,X.jsxs)(we,{className:`w-52`,children:[(0,X.jsx)(p,{onSelect:e.onCheckout,children:`Create Branch...`}),(0,X.jsx)(p,{disabled:t.branch===null||t.upstream!==null,onSelect:()=>e.onRemote(`git.push`),children:`Publish Branch...`})]})]}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Stash`}),(0,X.jsxs)(we,{className:`w-56`,children:[(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`stash`,mode:`tracked`}),children:`Stash`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`stash`,mode:`untracked`}),children:`Stash (Include Untracked)`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`stash`,mode:`staged`}),children:`Stash Staged`}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`unstash`,pop:!1}),children:`Apply Latest Stash`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`unstash`,pop:!0}),children:`Pop Latest Stash`})]})]})]})]})}function EW(e){let[t,n]=(0,Y.useState)([]),r=(0,Y.useRef)(new Map),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=e.repos??[],l=c.length===1?c[0]:null,u=e.settings;function d(e){return u.messages[e.path]??``}function f(t,n){return e.onPerform(()=>ve(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:n}))}function p(t,n){return e.onPerform(()=>ve(e.machine,n,{projectId:e.projectId,repo:t.path}))}async function h(t,n){let r=d(t).trim();if(r===``&&!n.amend){xe(`Please provide a commit message.`);return}let i=t.changes.length+t.merge.length>0;if(n.all===null&&!n.amend&&t.staged.length===0){if(!i){xe(`There are no changes to commit.`);return}if(!u.smartCommit){a({repo:t,options:n});return}}let o=n.all??(t.staged.length===0&&!n.amend&&i);await e.onPerform(async()=>{await ve(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:{kind:`commit`,message:r,all:o,amend:n.amend}}),e.onMessage(t.path,``),n.then!==null&&await ve(e.machine,n.then===`push`?`git.push`:`git.sync`,{projectId:e.projectId,repo:t.path})})}async function g(t){let i={};r.current.set(t.path,i),n(e=>[...e,t.path]);try{let n=await ve(e.machine,`git.message`,{projectId:e.projectId,repo:t.path,staged:t.staged.length>0});r.current.get(t.path)===i&&e.onMessage(t.path,n)}catch(e){r.current.get(t.path)===i&&xe(e)}finally{r.current.get(t.path)===i&&_(t)}}function _(e){r.current.delete(e.path),n(t=>t.filter(t=>t!==e.path))}function v(t){e.onPerform(async()=>{e.onMessage(t.path,await ve(e.machine,`git.undoCommit`,{projectId:e.projectId,repo:t.path}))})}function y(e,t){f(e,{kind:`unstage`,paths:t.flatMap(e=>e.from===null?[e.path]:[e.path,e.from])})}function b(e,t){f(e,{kind:`stage`,paths:t.map(e=>e.path)})}function ee(t){return(0,X.jsx)(TW,{repo:t,settings:u,onSettings:e.onSettings,onCommit:e=>void h(t,e),onUndo:()=>v(t),onRun:e=>void f(t,e),onRemote:e=>void p(t,e),onStage:e=>b(t,e),onUnstage:e=>y(t,e),onDiscard:e=>s({repo:t,resources:e}),onCheckout:()=>e.onCheckout(t)})}let te=o?.resources??[],ne=te.filter(e=>e.status===`U`);return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border relative flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:u.tree?`View as List`:`View as Tree`,"aria-label":u.tree?`View as List`:`View as Tree`,onClick:()=>e.onSettings({tree:!u.tree}),children:(0,X.jsx)(Le,{icon:u.tree?Yf:Jf,className:`size-4`})}),l!==null&&(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Commit`,"aria-label":`Commit`,disabled:e.busy,onClick:()=>void h(l,lW),children:(0,X.jsx)(Le,{icon:ue,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Refresh`,"aria-label":`Refresh`,onClick:e.onRefresh,children:(0,X.jsx)(Le,{icon:m,className:`size-4`})}),l!==null&&ee(l),(e.busy||t.length>0)&&(0,X.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 overflow-hidden`,children:(0,X.jsx)(`span`,{className:`bg-primary block h-full w-[2%] animate-[progress_4s_linear_infinite]`})})]}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[e.error!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:e.error}),e.error===null&&e.repos===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),e.error===null&&e.repos?.length===0&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`The folder currently open doesn't have a git repository.`}),c.map(n=>(0,X.jsxs)(`div`,{children:[l===null&&(0,X.jsxs)(`div`,{className:`group/row text-sidebar-foreground flex h-[22px] items-center gap-1.5 pr-1 pl-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`truncate font-semibold`,children:n.path===``?e.name:sp(n.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:n.branch??(n.head===null?``:YU(n.head))}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex`,children:(0,X.jsx)(mW,{title:`Commit`,icon:ue,onClick:()=>void h(n,lW)})}),ee(n)]}),(0,X.jsx)(uW,{repo:n,message:d(n),generating:t.includes(n.path),busy:e.busy,nested:l===null,onMessage:t=>e.onMessage(n.path,t),onGenerate:()=>void g(n),onCancel:()=>_(n),onCommit:e=>void h(n,e),onRemote:e=>void p(n,e)}),(0,X.jsx)(fW,{repo:n,root:e.root,tree:u.tree,sort:u.sort,depth:+(l===null),active:e.active,onOpen:e.onOpen,onStage:e=>b(n,e),onUnstage:e=>y(n,e),onDiscard:e=>s({repo:n,resources:e}),onIgnore:e=>void f(n,{kind:`ignore`,paths:e.map(e=>e.path)})})]},n.path))]}),c.length>0&&(0,X.jsx)(yW,{machine:e.machine,projectId:e.projectId,repos:c,open:u.graph,height:u.graphHeight,active:e.active,onToggle:()=>e.onSettings({graph:!u.graph}),onHeight:t=>e.onSettings({graphHeight:t}),onOpen:e.onOpen,onFetch:e=>void f(e,{kind:`fetch`,prune:!1,all:!0})}),(0,X.jsx)(Ce,{open:i!==null,onOpenChange:e=>{e||a(null)},children:(0,X.jsxs)(Me,{children:[(0,X.jsxs)(Ne,{children:[(0,X.jsx)(_e,{children:`There are no staged changes to commit.`}),(0,X.jsx)(ge,{children:`Would you like to stage all your changes and commit them directly?`})]}),(0,X.jsxs)(De,{children:[(0,X.jsx)(Oe,{children:`Cancel`}),(0,X.jsx)(he,{variant:`outline`,onClick:()=>{i!==null&&(e.onSettings({smartCommit:!0}),h(i.repo,{...i.options,all:!0}))},children:`Always`}),(0,X.jsx)(he,{onClick:()=>{i!==null&&h(i.repo,{...i.options,all:!0})},children:`Yes`})]})]})}),(0,X.jsx)(Ce,{open:o!==null,onOpenChange:e=>{e||s(null)},children:(0,X.jsxs)(Me,{children:[(0,X.jsxs)(Ne,{children:[(0,X.jsx)(_e,{children:te.length>1?`Are you sure you want to discard ALL changes in ${te.length} files?`:ne.length===1?`Are you sure you want to DELETE the following untracked file: '${sp(te[0].path)}'?`:`Are you sure you want to discard changes in '${sp(te.at(0)?.path??``)}'?`}),(0,X.jsxs)(ge,{children:[te.length>1&&`This is IRREVERSIBLE! Your current working set will be FOREVER LOST if you proceed.`,te.length===1&&ne.length===1&&`This is IRREVERSIBLE! This file will be FOREVER LOST if you proceed.`]})]}),(0,X.jsxs)(De,{children:[(0,X.jsx)(Oe,{children:`Cancel`}),(0,X.jsx)(he,{variant:`destructive`,onClick:()=>{o!==null&&f(o.repo,{kind:`discard`,tracked:te.filter(e=>e.status!==`U`).map(e=>e.path),untracked:ne.map(e=>e.path)})},children:te.length>1?`Discard All ${te.length} Files`:ne.length===1?`Delete File`:`Discard File`})]})]})})]})}var DW=3e3;function OW(e){let[t,n]=(0,Y.useState)(null),[r,a]=(0,Y.useState)(null),o=(0,Y.useEffectEvent)(e.onLoaded);return(0,Y.useEffect)(()=>{let t=!0,r=!1;async function c(){if(!r){r=!0;try{let r=await ve(e.machine,`git.changes`,{projectId:e.projectId});if(!t)return;a(null),n(e=>s(e,r)?e:r),o()}catch(e){t&&a(i(e))}finally{r=!1}}}function l(){document.hidden||c()}c();let u=window.setInterval(l,DW);return window.addEventListener(`focus`,l),()=>{t=!1,window.clearInterval(u),window.removeEventListener(`focus`,l)}},[e.machine,e.projectId,e.version]),{repos:t,error:r}}var kW=(0,Y.lazy)(async()=>({default:(await x(async()=>{let{ZoomableImage:e}=await import(`./zoomable-image-DzvW3FEl.js`);return{ZoomableImage:e}},__vite__mapDeps([16,17,2,18,19,20]))).ZoomableImage}));function AW(e){let t=me(t=>ke(t,e.machine,e.projectId)),n=be(),i=me(e=>e.prefs.editor),[a]=(0,Y.useState)(()=>tp(e.machine,e.projectId)),[s]=(0,Y.useState)(()=>new Map(a.tabs.map(e=>[e.spec.id,e.view]))),[c,l]=(0,Y.useState)(()=>({...a.settings,width:Math.min(a.settings.width,window.innerWidth*.6)})),[u,d]=(0,Y.useState)(a.expanded),[f,p]=(0,Y.useState)(0),[m,h]=(0,Y.useState)(0),[g,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(null),[ee,te]=(0,Y.useState)(null),ne=(0,Y.useRef)(null),re=(0,Y.useCallback)(e=>{if(e===null)return;let t=Yl.create(e,{automaticLayout:!0,model:null});return b(t),()=>t.dispose()},[]),ie=(0,Y.useCallback)(e=>{if(e===null)return;let t=Yl.createDiffEditor(e,{automaticLayout:!0,originalEditable:!1,experimental:{showMoves:!0},useInlineViewWhenSpaceIsLimited:!0});return te(t),()=>t.dispose()},[]),ae=(0,Y.useCallback)(()=>p(e=>e+1),[]),oe=iW({machine:e.machine,projectId:e.projectId,saved:a,onSaved:ae,onClose:()=>{Ee(),e.onClose()}}),se=oe.active;function ce(){se!==null&&oe.reload(se)}let le=OW({machine:e.machine,projectId:e.projectId,version:f,onLoaded:ce}),ue=le.repos,de=oe.tabs.find(e=>e.spec.id===se),fe=de?.document.status===`text`?de.document:null,pe=fe?.original??null,he=fe?.modified??null,ge=de?.spec.right.kind===`worktree`,_e=ue?.find(e=>e.path===de?.spec.repo)??ue?.at(0)??null;(0,Y.useEffect)(()=>{RU().catch(xe)},[n]),(0,Y.useEffect)(()=>{y?.updateOptions(zU(i)),ee?.updateOptions(zU(i)),BU(i).catch(xe)},[y,ee,i]),(0,Y.useEffect)(()=>{ee?.updateOptions({renderSideBySide:!c.inline,ignoreTrimWhitespace:!c.whitespace,hideUnchangedRegions:{enabled:c.collapse}})},[ee,c.inline,c.whitespace,c.collapse]),(0,Y.useEffect)(()=>{if(y===null||ee===null||(ne.current!==null&&s.set(ne.current.id,ne.current.editor.saveViewState()),ne.current=null,y.setModel(pe===null?he:null),ee.setModel(pe===null||he===null?null:{original:pe,modified:he}),he===null||se===null))return;let e=pe===null?y:ee.getModifiedEditor();e.updateOptions({readOnly:!ge}),ee.updateOptions({readOnly:!ge}),e.restoreViewState(s.get(se)??null),e.focus(),ne.current={id:se,editor:e}},[y,ee,pe,he,se,ge,s]);let Se=(0,Y.useEffectEvent)(ce);(0,Y.useEffect)(()=>Se(),[se]),WU({machine:e.machine,projectId:e.projectId,spec:de?.spec,original:pe,modified:he,onPerform:we});function Ce(e){window.innerWidth<640&&Te({sidebar:!1}),oe.open(e)}async function we(e){h(e=>e+1);try{await e()}catch(e){xe(e)}finally{h(e=>e-1),ae()}}function Te(e){l(t=>({...t,...e}))}function Ee(){ne.current!==null&&s.set(ne.current.id,ne.current.editor.saveViewState()),np(e.machine,e.projectId,{tabs:oe.tabs.map(e=>({spec:e.spec,view:s.get(e.spec.id)??null})),active:se,expanded:u,settings:c})}(0,Y.useEffect)(Ee);let De=(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Toggle Primary Side Bar`,"aria-label":`Toggle Primary Side Bar`,"aria-pressed":c.sidebar,onClick:()=>Te({sidebar:!c.sidebar}),children:(0,X.jsx)(Le,{icon:_,className:`size-4`})}),Oe=(0,X.jsxs)(X.Fragment,{children:[De,(0,X.jsx)(oW,{view:c.view,onView:e=>Te({view:e})})]});return(0,X.jsx)(We,{open:!0,onOpenChange:()=>oe.requestClose(),children:(0,X.jsxs)(He,{"aria-describedby":void 0,showCloseButton:!1,className:`top-0 left-0 flex h-dvh w-dvw max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none border-0 p-0 sm:max-w-none`,onEscapeKeyDown:e=>e.preventDefault(),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),se!==null&&oe.save(se)),(e.metaKey||e.ctrlKey)&&e.key===`w`&&(e.preventDefault(),se!==null&&oe.close(se))},children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:o(`border-sidebar-border relative shrink-0 border-r`,!c.sidebar&&`hidden`),style:{width:c.width},children:[c.view===`explorer`&&(0,X.jsx)(ip,{machine:e.machine,projectId:e.projectId,root:t?.path??``,header:Oe,expanded:u,onExpanded:d,active:de?.spec.path??null,onOpen:e=>Ce(ZU(``,e)),onRenamed:oe.renamed,onDeleted:oe.deleted}),c.view===`scm`&&(0,X.jsx)(EW,{machine:e.machine,projectId:e.projectId,name:t?.name??``,root:t?.path??``,header:Oe,repos:ue,error:le.error,busy:m>0,settings:c,onSettings:Te,onMessage:(e,t)=>l(n=>({...n,messages:{...n.messages,[e]:t}})),active:se,onOpen:Ce,onRefresh:ae,onPerform:we,onCheckout:v}),(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`hover:bg-primary absolute inset-y-0 -right-0.5 z-10 w-1 cursor-col-resize touch-none transition-colors delay-100`,onPointerDown:e=>r(e,e=>Te({width:Math.min(Math.max(e.clientX,200),window.innerWidth-240)}))})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-9 shrink-0 items-center shadow-[inset_0_-1px_0_var(--sidebar-border)]`,children:[!c.sidebar&&(0,X.jsx)(`div`,{className:`shrink-0 px-1.5`,children:De}),(0,X.jsx)(Ue,{className:`sr-only`,children:`Editor`}),(0,X.jsx)(cp,{tabs:oe.tabs.map(e=>({id:e.spec.id,path:e.spec.path,label:e.spec.label})),active:se,dirty:oe.dirty.map(e=>e.spec.id),onSelect:oe.setActive,onClose:oe.close}),de!==void 0&&pe!==null&&(0,X.jsx)(sW,{settings:c,onSettings:Te,onOpenFile:()=>Ce(ZU(de.spec.repo,de.spec.path)),onPrevious:()=>ee?.goToDiff(`previous`),onNext:()=>ee?.goToDiff(`next`)}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,className:`mx-1.5 shrink-0`,title:`Close`,"aria-label":`Close`,onClick:oe.requestClose,children:(0,X.jsx)(Le,{icon:Be,className:`size-4`})})]}),(0,X.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,X.jsx)(`div`,{ref:re,className:o(`absolute inset-0`,(he===null||pe!==null)&&`hidden`)}),(0,X.jsx)(`div`,{ref:ie,className:o(`absolute inset-0`,(he===null||pe===null)&&`hidden`)}),de===void 0&&(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:c.view===`explorer`?`Open a file from the explorer to start editing.`:`Select a change to see its diff.`}),de?.document.status===`image`&&(0,X.jsx)(Y.Suspense,{children:(0,X.jsx)(kW,{src:de.document.src,alt:de.spec.path})}),de?.document.status===`large`&&(0,X.jsxs)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:[`This file is `,jW(de.document.size),`, too large to open in the editor (limit `,jW(de.document.limit),`).`]}),de?.document.status===`binary`&&(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:`The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding.`}),de?.document.status===`error`&&(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:de.document.message})]})]})]}),(0,X.jsx)(HU,{editor:he===null?null:pe===null?y:ee?.getModifiedEditor()??null,language:fe?.language??null,children:_e!==null&&(0,X.jsx)(cW,{repo:_e,busy:m>0,onCheckout:()=>v(_e),onSync:()=>void we(()=>ve(e.machine,`git.sync`,{projectId:e.projectId,repo:_e.path})),onPublish:()=>void we(()=>ve(e.machine,`git.push`,{projectId:e.projectId,repo:_e.path}))})}),(0,X.jsx)(ep,{}),(0,X.jsx)(VU,{open:oe.closing!==null,paths:oe.closingTabs.map(e=>e.spec.path),onCancel:()=>oe.setClosing(null),onFinish:e=>void oe.finish(e)}),g!==null&&(0,X.jsx)(ye,{machine:e.machine,projectId:e.projectId,repo:{...g,changed:g.merge.length+g.staged.length+g.changes.length},onRefresh:ae,onClose:()=>v(null)})]})})}function jW(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}export{AW as EditorDialog};
52
+ It is recommended to remove them from the file. This can be configured via \`editor.unusualLineTerminators\`.`,Kd(e.uri)),primaryButton:S(1635,`&&Remove Unusual Line Terminators`),cancelButton:S(1636,`Ignore`)})}finally{this._isPresentingDialog=!1}t.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):TH(this._codeEditorService,e,!0)}};DH=SH([CH(1,oa),CH(2,Js)],DH),Ms(DH.ID,DH,1);var OH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},kH=function(e,t){return function(n,r){t(n,r,e)}},AH=class{constructor(){this.selector={language:`*`}}provideDocumentHighlights(e,t,n){if(e.isDisposed())return;let r=[],i=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return i?e.findMatches(i.word,!0,!1,!0,Ql,!1).map(e=>({range:e.range,kind:yf.Text})):Promise.resolve(r)}provideMultiDocumentHighlights(e,t,n,r){if(e.isDisposed())return;let i=new xl,a=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!a)return Promise.resolve(i);for(let t of[e,...n]){if(t.isDisposed())continue;let e=t.findMatches(a.word,!0,!1,!0,Ql,!1).map(e=>({range:e.range,kind:yf.Text}));e&&i.set(t.uri,e)}return i}},jH=class extends K{constructor(e){super(),this._register(e.documentHighlightProvider.register(`*`,new AH)),this._register(e.multiDocumentHighlightProvider.register(`*`,new AH))}};jH=OH([kH(0,z)],jH);var MH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},NH=function(e,t){return function(n,r){t(n,r,e)}},PH,FH,IH=new M(`hasWordHighlights`,!1);function LH(e,t,n,r){let i=e.ordered(t);return Hn(i.map(e=>()=>Promise.resolve(e.provideDocumentHighlights(t,n,r)).then(void 0,Ys)),e=>e!=null).then(e=>{if(e){let n=new xl;return n.set(t.uri,e),n}return new xl})}function RH(e,t,n,r,i){let a=e.ordered(t);return Hn(a.map(e=>()=>{let a=i.filter(e=>zf(e)).filter(t=>jd(e.selector,t.uri,t.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(e.provideMultiDocumentHighlights(t,n,a,r)).then(void 0,Ys)}),e=>e!=null)}var zH=class{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||=wt(e=>this._compute(this._model,this._selection,this._wordSeparators,e)),this._result}_getCurrentWordRange(e,t){let n=e.getWordAtPosition(t.getPosition());return n?new w(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}cancel(){this.result.cancel()}},BH=class extends zH{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return LH(this._providers,e,t.getPosition(),r).then(e=>e||new xl)}},VH=class extends zH{constructor(e,t,n,r,i){super(e,t,n),this._providers=r,this._otherModels=i}_compute(e,t,n,r){return RH(this._providers,e,t.getPosition(),r,this._otherModels).then(e=>e||new xl)}};function HH(e,t,n,r){return new BH(t,n,r,e)}function UH(e,t,n,r,i){return new VH(t,n,r,e,i)}Pd(`_executeDocumentHighlights`,async(e,t,n)=>(await LH(e.get(z).documentHighlightProvider,t,n,E.None))?.get(t.uri));var WH=class{static{PH=this}static{this.storedDecorationIDs=new xl}static{this.query=null}constructor(e,t,n,r,i,a,o,s){this.toUnhook=new I,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new xl,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new Qn(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=a,this.textModelService=i,this.configurationService=o,this.logService=s,this._hasWordHighlights=IH.bindTo(r),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(e=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!==`off`&&this.runDelayer.trigger(()=>{this._onPositionChanged(e)}).catch(et)})),this.toUnhook.add(e.onDidFocusEditorText(e=>{this.occurrencesHighlightEnablement!==`off`&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}).catch(et))})),this.toUnhook.add(e.onDidChangeModelContent(e=>{Wr(this.model.uri,`output`)||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(e=>{!e.newModelUrl&&e.oldModelUrl?this._stopSingular():PH.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(e=>{let t=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==t)switch(this.occurrencesHighlightEnablement=t,t){case`off`:this._stopAll();break;case`singleFile`:this._stopAll(PH.query?.modelInfo?.modelURI);break;case`multiFile`:PH.query&&this._run(!0);break;default:console.warn(`Unknown occurrencesHighlight setting value:`,t)}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(`editor.occurrencesHighlightDelay`)){let e=o.getValue(`editor.occurrencesHighlightDelay`);this.occurrencesHighlightDelay!==e&&(this.occurrencesHighlightDelay=e)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{let e=this.codeEditorService.getFocusedCodeEditor();e?e.getModel()?.uri.scheme===al.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==al.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,PH.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(et))}stop(){this.occurrencesHighlightEnablement!==`off`&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(w.compareRangesUsingStarts)}moveNext(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);vo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);vo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;let e=PH.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),PH.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){let t=this.codeEditorService.listCodeEditors(),n=[];for(let r of t){if(!r.hasModel()||zt(r.getModel().uri,e))continue;let t=PH.storedDecorationIDs.get(r.getModel().uri);if(!t)continue;r.removeDecorations(t),n.push(r.getModel().uri);let i=GH.get(r);i?.wordHighlighter&&i.wordHighlighter.decorations.length>0&&(i.wordHighlighter.decorations.clear(),i.wordHighlighter.workerRequest=null,i.wordHighlighter._hasWordHighlights.set(!1))}for(let e of n)PH.storedDecorationIDs.delete(e)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==al.vscodeNotebookCell&&PH.query?.modelInfo?.modelURI.scheme!==al.vscodeNotebookCell?(PH.query=null,this._run()):PH.query?.modelInfo&&(PH.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++,!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++,!0)}_onPositionChanged(e){this.occurrencesHighlightEnablement===`off`||e.source!==`api`&&e.reason!==3?this._stopAll():this._run()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===al.vscodeNotebookCell){let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){let n=r.getModel();n&&n!==e&&n.uri.scheme===al.vscodeNotebookCell&&t.push(n)}return t}let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){if(!Il(r))continue;let n=r.getModel();n&&e===n.modified&&t.push(n.modified)}if(t.length)return t;if(this.occurrencesHighlightEnablement===`singleFile`)return[];for(let r of n){let n=r.getModel();n&&n!==e&&t.push(n)}return t}async _run(e,t){if(this.editor.hasTextFocus()){let e=this.editor.getSelection();if(!e||e.startLineNumber!==e.endLineNumber){PH.query=null,this._stopAll();return}let t=e.startColumn,n=e.endColumn,r=this._getWord();if(!r||r.startColumn>t||r.endColumn<n){PH.query=null,this._stopAll();return}PH.query={modelInfo:{modelURI:this.model.uri,selection:e}}}else if(!PH.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),zt(this.editor.getModel().uri,PH.query.modelInfo?.modelURI)){if(!e){let e=this.decorations.getRanges();for(let t of e)if(t.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);let n=++this.workerRequestTokenId;this.workerRequestCompleted=!1;let r=this.getOtherModelsToHighlight(this.editor.getModel());if(!PH.query||!PH.query.modelInfo)return;let i=await this.textModelService.createModelReference(PH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(i.object.textEditorModel,PH.query.modelInfo.selection,r),this.workerRequest?.result.then(e=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=e||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},et)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{i.dispose()}}else if(this.model.uri.scheme===al.vscodeNotebookCell){let e=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!PH.query||!PH.query.modelInfo)return;let n=await this.textModelService.createModelReference(PH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(n.object.textEditorModel,PH.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(n=>{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=n||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},et)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{n.dispose()}}}computeWithModel(e,t,n){return n.length?UH(this.multiDocumentProviders,e,t,this.editor.getOption(148),n):HH(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){let t=new Date().getTime(),n=this.lastCursorPositionChangeTime+e;t>=n?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},n-t)}renderDecorations(){this.renderDecorationsTimer=void 0;let e=this.codeEditorService.listCodeEditors();for(let t of e){let e=GH.get(t);if(!e)continue;let n=[],r=t.getModel()?.uri;if(r&&this.workerRequestValue.has(r)){let i=PH.storedDecorationIDs.get(r),a=this.workerRequestValue.get(r);if(a)for(let e of a)e.range&&n.push({range:e.range,options:cz(e.kind)});let o=[];t.changeDecorations(e=>{o=e.deltaDecorations(i??[],n)}),PH.storedDecorationIDs=PH.storedDecorationIDs.set(r,o),n.length>0&&(e.wordHighlighter?.decorations.set(n),e.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}};WH=PH=MH([NH(4,Vi),NH(5,Js),NH(6,zi),NH(7,ku)],WH);var GH=class extends K{static{FH=this}static{this.ID=`editor.contrib.wordHighlighter`}static get(e){return e.getContribution(FH.ID)}constructor(e,t,n,r,i,a,o){super(),this._wordHighlighter=null;let s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==al.accessibleView&&(this._wordHighlighter=new WH(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,i,r,a,o))};this._register(e.onDidChangeModel(e=>{this._wordHighlighter&&=(!e.newModelUrl&&e.oldModelUrl?.scheme!==al.vscodeNotebookCell&&this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),null),s()})),s()}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(),null),super.dispose()}};GH=FH=MH([NH(1,Na),NH(2,z),NH(3,Js),NH(4,Vi),NH(5,zi),NH(6,ku)],GH);var KH=class extends G{constructor(e,t){super(t),this._isNext=e}run(e,t){let n=GH.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}},qH=class extends KH{constructor(){super(!0,{id:`editor.action.wordHighlight.next`,label:R(1646,`Go to Next Symbol Highlight`),precondition:IH,kbOpts:{kbExpr:D.editorTextFocus,primary:65,weight:100}})}},JH=class extends KH{constructor(){super(!1,{id:`editor.action.wordHighlight.prev`,label:R(1647,`Go to Previous Symbol Highlight`),precondition:IH,kbOpts:{kbExpr:D.editorTextFocus,primary:1089,weight:100}})}},YH=class extends G{constructor(){super({id:`editor.action.wordHighlight.trigger`,label:R(1648,`Trigger Symbol Highlight`),precondition:void 0,kbOpts:{kbExpr:D.editorTextFocus,primary:0,weight:100}})}run(e,t){let n=GH.get(t);n&&n.restoreViewState(!0)}};Ms(GH.ID,GH,0),B(qH),B(JH),B(YH),Ze(jH);var XH=class extends $u{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;let r=Et(t.getOption(148),t.getOption(147)),i=t.getModel(),a=t.getSelections(),o=a.length>1,s=a.map(e=>{let t=new j(e.positionLineNumber,e.positionColumn),n=this._move(r,i,t,this._wordNavigationType,o);return this._moveTo(e,n,this._inSelectionMode)});if(i.pushStackElement(),t._getViewModel().setCursorStates(`moveWordCommand`,3,s.map(e=>sd.fromModelSelection(e))),s.length===1){let e=new j(s[0].positionLineNumber,s[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,n){return n?new J(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new J(t.lineNumber,t.column,t.lineNumber,t.column)}},ZH=class extends XH{_move(e,t,n,r,i){return vd.moveWordLeft(e,t,n,r,i)}},QH=class extends XH{_move(e,t,n,r,i){return vd.moveWordRight(e,t,n,r)}},$H=class extends ZH{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartLeft`,precondition:void 0})}},eU=class extends ZH{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndLeft`,precondition:void 0})}},tU=class extends ZH{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:`cursorWordLeft`,precondition:void 0,kbOpts:{kbExpr:T.and(D.textInputFocus,T.and(Ja,Xu)?.negate()),primary:2063,mac:{primary:527},weight:100}})}},nU=class extends ZH{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartLeftSelect`,precondition:void 0})}},rU=class extends ZH{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndLeftSelect`,precondition:void 0})}},iU=class extends ZH{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:`cursorWordLeftSelect`,precondition:void 0,kbOpts:{kbExpr:T.and(D.textInputFocus,T.and(Ja,Xu)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}},aU=class extends ZH{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityLeft`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Et(Ui.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},oU=class extends ZH{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityLeftSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Et(Ui.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},sU=class extends QH{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartRight`,precondition:void 0})}},cU=class extends QH{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndRight`,precondition:void 0,kbOpts:{kbExpr:T.and(D.textInputFocus,T.and(Ja,Xu)?.negate()),primary:2065,mac:{primary:529},weight:100}})}},lU=class extends QH{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordRight`,precondition:void 0})}},uU=class extends QH{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartRightSelect`,precondition:void 0})}},dU=class extends QH{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndRightSelect`,precondition:void 0,kbOpts:{kbExpr:T.and(D.textInputFocus,T.and(Ja,Xu)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}},fU=class extends QH{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordRightSelect`,precondition:void 0})}},pU=class extends QH{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityRight`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Et(Ui.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},mU=class extends QH{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityRightSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Et(Ui.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},hU=class extends $u{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){let r=e?.get(Mn);if(!t.hasModel()||!r)return;let i=Et(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections(),s=t.getOption(10),c=t.getOption(15),l=r.getLanguageConfiguration(a.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),d=o.map(e=>{let n=this._delete({wordSeparators:i,model:a,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:s,autoClosingQuotes:c,autoClosingPairs:l,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new qc(n,``)});t.pushUndoStop(),t.executeCommands(this.id,d),t.pushUndoStop()}},gU=class extends hU{_delete(e,t){return vd.deleteWordLeft(e,t)||new w(1,1,1,1)}},_U=class extends hU{_delete(e,t){let n=vd.deleteWordRight(e,t);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new w(r,i,r,i)}},vU=class extends gU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartLeft`,precondition:D.writable})}},yU=class extends gU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndLeft`,precondition:D.writable})}},bU=class extends gU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordLeft`,precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}},xU=class extends _U{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartRight`,precondition:D.writable})}},SU=class extends _U{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndRight`,precondition:D.writable})}},CU=class extends _U{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordRight`,precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}},wU=class extends G{constructor(){super({id:`deleteInsideWord`,precondition:D.writable,label:R(1650,`Delete Word`),metadata:{description:R(1651,`Delete the word at the cursor`),args:[{name:`args`,schema:{type:`object`,properties:{onlyWord:{type:`boolean`,default:!1,description:S(1649,`Delete only the word and leave surrounding whitespace`)}}}}]}})}run(e,t,n){if(!t.hasModel())return;let r=!!(n&&typeof n==`object`&&n.onlyWord),i=Et(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections().map(e=>{let t=vd.deleteInsideWord(i,a,e,r);return new qc(t,``)});t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}};U(new $H),U(new eU),U(new tU),U(new nU),U(new rU),U(new iU),U(new sU),U(new cU),U(new lU),U(new uU),U(new dU),U(new fU),U(new aU),U(new oU),U(new pU),U(new mU),U(new vU),U(new yU),U(new bU),U(new xU),U(new SU),U(new CU),B(wU);var TU=class extends hU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordPartLeft`,precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){return eu.deleteWordPartLeft(e)||new w(1,1,1,1)}},EU=class extends hU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordPartRight`,precondition:D.writable,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let n=eu.deleteWordPartRight(e);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new w(r,i,r,i)}},DU=class extends XH{_move(e,t,n,r,i){return eu.moveWordPartLeft(e,t,n,i)}},OU=class extends DU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordPartLeft`,precondition:void 0,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:783},weight:100}})}};Pn.registerCommandAlias(`cursorWordPartStartLeft`,`cursorWordPartLeft`);var kU=class extends DU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordPartLeftSelect`,precondition:void 0,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}};Pn.registerCommandAlias(`cursorWordPartStartLeftSelect`,`cursorWordPartLeftSelect`);var AU=class extends XH{_move(e,t,n,r,i){return eu.moveWordPartRight(e,t,n)}},jU=class extends AU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordPartRight`,precondition:void 0,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:785},weight:100}})}},MU=class extends AU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordPartRightSelect`,precondition:void 0,kbOpts:{kbExpr:D.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}};U(new TU),U(new EU),U(new OU),U(new kU),U(new jU),U(new MU),self.MonacoEnvironment={async getWorker(){return new(await(x(()=>import(`./editor.worker-D2ouzCu8.js`),[]))).default}};function NU(e,t){let n=Yl.registerCommand(`offsite.block`,(e,n)=>t(n)),r=e===`stage`?`Stage`:`Unstage`,i={id:e===`stage`?`add`:`remove`},a=[Sn.appendMenuItem(O.DiffEditorHunkToolbar,{command:{id:`offsite.block`,title:`${r} Block`,icon:i},group:`primary`,order:10}),Sn.appendMenuItem(O.DiffEditorSelectionToolbar,{command:{id:`offsite.block`,title:`${r} Selection`,icon:i},group:`primary`,order:10})];return()=>{n.dispose();for(let e of a)e.dispose()}}function PU(e,t,n){let r=t.getValue();for(let i of n.innerChanges.slice().reverse()){let n=i.modifiedRange;r=r.slice(0,t.getOffsetAt({lineNumber:n.startLineNumber,column:n.startColumn}))+e.getValueInRange(i.originalRange)+r.slice(t.getOffsetAt({lineNumber:n.endLineNumber,column:n.endColumn}))}return r}var FU=Ke({themes:[],langs:[]}),IU=new Map([[`tsx`,()=>x(()=>import(`./typescript-fNZ3iur6.js`),__vite__mapDeps([13,8,1,2,3,4]))],[`jsx`,()=>x(()=>import(`./javascript-Dj-Vzbp-.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`json`,()=>x(()=>import(`./javascript-Dj-Vzbp-.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`jsonc`,()=>x(()=>import(`./javascript-Dj-Vzbp-.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`shellscript`,()=>x(()=>import(`./shell-CC2rA5mh.js`),[])],[`docker`,()=>x(()=>import(`./dockerfile-DZFCIeNp.js`),[])],[`c`,()=>x(()=>import(`./cpp-C7h46wYY.js`),[])],[`objective-cpp`,()=>x(()=>import(`./cpp-C7h46wYY.js`),[])],[`vue`,()=>x(()=>import(`./html-BwGTVsqZ.js`),__vite__mapDeps([6,1,2,3,4]))],[`svelte`,()=>x(()=>import(`./html-BwGTVsqZ.js`),__vite__mapDeps([6,1,2,3,4]))]]);async function LU(e){let t=d(e),n=Xe.find(e=>e.id===t||e.aliases?.includes(t)===!0);if(n===void 0)return{id:`plaintext`,name:`Plain Text`};let r=await FU;if(!r.getLoadedLanguages().includes(n.id)){if(await r.loadLanguage(n.import),!Hc.getLanguages().some(e=>e.id===n.id)){Hc.register({id:n.id});let e=IU.get(n.id);e!==void 0&&Hc.setLanguageConfiguration(n.id,(await e()).conf)}await RU()}return{id:n.id,name:n.name}}async function RU(){let e=Se(),t=Ge.find(t=>t.id===e.codeTheme);if(t===void 0)throw Error(`unknown code theme ${e.codeTheme}`);let n=(await t.import()).default,r=await FU;await r.loadTheme({...n,colors:{...n.colors,"editor.background":e.background}}),pp(r,Uu),Yl.setTheme(e.codeTheme)}function zU(e){return{fontFamily:e.font.family,fontSize:e.font.size,lineHeight:e.font.lineHeight,fontLigatures:e.font.ligatures?e.font.features===``||e.font.features:!1,cursorStyle:e.cursor.style===`bar`?`line`:e.cursor.style,cursorBlinking:e.cursor.blink?`expand`:`solid`,tabSize:e.tabSize,insertSpaces:!0,detectIndentation:!1,trimAutoWhitespace:!1,wordWrap:e.wordWrap?`on`:`off`,wrappingStrategy:`advanced`,minimap:{enabled:!1},stickyScroll:{enabled:!1},overviewRulerBorder:!1,padding:{top:3,bottom:48},cursorSurroundingLines:2,copyWithSyntaxHighlighting:!1,accessibilitySupport:`off`,guides:{bracketPairs:!0,bracketPairsHorizontal:!1,highlightActiveBracketPair:!0,highlightActiveIndentation:!0},dragAndDrop:!1,glyphMargin:!1,useTabStops:!1,selectionHighlight:!1,emptySelectionClipboard:!1,renderWhitespace:`selection`,smartSelect:{selectLeadingAndTrailingWhitespace:!1},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},scrollBeyondLastLine:!1,smoothScrolling:!0,hover:{above:!1},find:{cursorMoveOnType:!1},acceptSuggestionOnCommitCharacter:!1,suggestSelection:`first`,suggest:{localityBonus:!0,insertMode:`replace`,snippetsPreventQuickSuggestions:!1},quickSuggestions:{comments:`on`,strings:`on`,other:`on`},quickSuggestionsDelay:0}}async function BU(e){await document.fonts.load(`${e.font.size}px ${e.font.family}`),Yl.remeasureFonts()}function VU(e){return(0,X.jsx)(Ce,{open:e.open,onOpenChange:t=>{t||e.onCancel()},children:(0,X.jsxs)(Me,{children:[(0,X.jsxs)(Ne,{children:[(0,X.jsx)(_e,{children:e.paths.length===1?`Do you want to save the changes you made to ${sp(e.paths[0])}?`:`Do you want to save the changes to the following ${e.paths.length} files?`}),(0,X.jsxs)(ge,{children:[e.paths.length>1&&`${e.paths.map(sp).join(`, `)}. `,`Your changes will be lost if you don't save them.`]})]}),(0,X.jsxs)(De,{children:[(0,X.jsx)(Oe,{children:`Cancel`}),(0,X.jsx)(he,{variant:`outline`,onClick:()=>e.onFinish(!1),children:`Don't Save`}),(0,X.jsx)(he,{onClick:()=>e.onFinish(!0),children:e.paths.length===1?`Save`:`Save All`})]})]})})}function HU(e){let[t,n]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{let t=e.editor;if(t===null)return;n(UU(t));let r=[t.onDidChangeCursorSelection(()=>n(UU(t))),t.onDidChangeModel(()=>n(UU(t))),t.onDidChangeModelOptions(()=>n(UU(t)))];return()=>{for(let e of r)e.dispose()}},[e.editor]),(0,X.jsxs)(`div`,{className:`bg-sidebar border-sidebar-border text-muted-foreground flex h-[22px] shrink-0 items-center justify-end gap-4 border-t px-3 text-xs whitespace-nowrap`,children:[e.children,e.language!==null&&t!==null&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{children:[`Ln `,t.line,`, Col `,t.column,t.selected>0&&` (${t.selected} selected)`]}),(0,X.jsxs)(`span`,{children:[t.spaces?`Spaces`:`Tab Size`,`: `,t.tabSize]}),(0,X.jsx)(`span`,{children:`UTF-8`}),(0,X.jsx)(`span`,{children:t.eol}),(0,X.jsx)(`span`,{children:e.language})]})]})}function UU(e){let t=e.getModel(),n=e.getSelection();if(t===null||n===null)return null;let r=t.getOptions();return{line:n.positionLineNumber,column:n.positionColumn,selected:t.getValueLengthInRange(n),tabSize:r.tabSize,spaces:r.insertSpaces,eol:t.getEndOfLineSequence()===Yl.EndOfLineSequence.LF?`LF`:`CRLF`}}function WU(e){let t=GU(e.spec),n=t?.kind??null,r=(0,Y.useEffectEvent)(n=>{let r=e.spec,i=e.original,a=e.modified;if(r===void 0||t===null||i===null||a===null)throw Error(`This diff has no blocks to stage`);e.onPerform(()=>ve(e.machine,`git.run`,{projectId:e.projectId,repo:r.repo,action:{kind:`stageContent`,path:t.path,content:t.kind===`stage`?n.originalWithModifiedChanges:PU(i,a,n.mapping)}}))});(0,Y.useEffect)(()=>{if(n!==null)return NU(n,r)},[n])}function GU(e){return e?.left?.kind===`git`&&e.left.ref===``&&e.right.kind===`worktree`?{kind:`stage`,path:e.left.path}:e?.left?.kind===`git`&&e.right.kind===`git`&&e.right.ref===``?{kind:`unstage`,path:e.right.path}:null}var KU={M:`Modified`,T:`Type Changed`,A:`Added`,D:`Deleted`,R:`Renamed`,C:`Copied`,U:`Untracked`,"!":`Conflict`},qU={M:`text-warning`,T:`text-warning`,A:`text-success`,D:`text-destructive`,R:`text-success`,C:`text-success`,U:`text-success`,"!":`text-destructive`};function JU(e,t){return e===``?t:`${e}/${t}`}function YU(e){return e.slice(0,7)}function XU(e,t,n){let r=JU(e,n.path),i={kind:`git`,ref:``,path:n.path};function a(t,n,i){return{id:`${t}:${r}`,repo:e,path:r,label:`${sp(r)} (${t})`,left:n,right:i}}return t===`merge`?a(`Working Tree`,null,{kind:`worktree`}):t===`staged`&&n.status===`A`?a(`Index`,null,i):t===`staged`&&n.status===`D`?a(`Deleted`,null,{kind:`git`,ref:`HEAD`,path:n.path}):t===`staged`?a(`Index`,{kind:`git`,ref:`HEAD`,path:n.from??n.path},i):n.status===`U`?a(`Untracked`,null,{kind:`worktree`}):n.status===`A`?a(`Intent to Add`,null,{kind:`worktree`}):n.status===`D`?a(`Deleted`,null,i):a(`Working Tree`,i,{kind:`worktree`})}function ZU(e,t){return{id:`File:${t}`,repo:e,path:t,label:sp(t),left:null,right:{kind:`worktree`}}}function QU(e,t){let n=JU(e,t.path);return{id:`HEAD:${n}`,repo:e,path:n,label:`${sp(n)} (HEAD)`,left:null,right:{kind:`git`,ref:`HEAD`,path:t.from??t.path}}}function $U(e,t,n){let r=JU(e,n.path),i=t.parents.at(0)??null;return{id:`${t.hash}:${r}`,repo:e,path:r,label:`${sp(r)} (${i===null?`empty`:YU(i)} ↔ ${YU(t.hash)})`,left:i===null||n.status===`A`?{kind:`empty`}:{kind:`git`,ref:i,path:n.from??n.path},right:n.status===`D`?{kind:`empty`}:{kind:`git`,ref:t.hash,path:n.path}}}function eW(e,t){return[...e].sort((e,n)=>t===`name`?sp(e.path).localeCompare(sp(n.path))||e.path.localeCompare(n.path):t===`status`&&e.status.localeCompare(n.status)||e.path.localeCompare(n.path))}function tW(e,t){let n={folders:new Map,files:[]};for(let t of e){let e=n,r=op(t.path);for(let t of r===``?[]:r.split(`/`)){let n=e.folders.get(t)??{folders:new Map,files:[]};e.folders.set(t,n),e=n}e.files.push(t)}return nW(n,``,t)}function nW(e,t,n){return[...[...e.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(e=>{let r=e[0],i=e[1];for(;i.files.length===0&&i.folders.size===1;){let e=[...i.folders][0];r=`${r}/${e[0]}`,i=e[1]}let a=t===``?r:`${t}/${r}`,o=nW(i,a,n);return{kind:`folder`,path:a,label:r,children:o,resources:o.flatMap(e=>e.kind===`file`?[e.resource]:e.resources)}}),...eW(e.files,n).map(e=>({kind:`file`,resource:e}))]}var rW=new WeakSet;function iW(e){let[t,n]=(0,Y.useState)(()=>e.saved.tabs.map(e=>({spec:e.spec,document:{status:`loading`}}))),[r,a]=(0,Y.useState)(e.saved.active),[o,s]=(0,Y.useState)(null),c=t.filter(e=>e.document.status===`text`&&e.document.dirty),l=o?.kind===`tab`?t.filter(e=>e.spec.id===o.id):c;(0,Y.useEffect)(()=>{let e=new Set(t.flatMap(e=>e.document.status===`text`?[e.document.modified,e.document.original]:[]));for(let t of Yl.getModels())e.has(t)||t.dispose()},[t]),(0,Y.useEffect)(()=>()=>{for(let e of Yl.getModels())e.dispose()},[]);async function u(t,n){if(n.kind===`empty`)return``;if(n.kind===`git`)return ve(e.machine,`git.show`,{projectId:e.projectId,repo:t.repo,ref:n.ref,path:n.path});let r=await ve(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return r.kind===`text`?r.content:null}function d(e){return Promise.all([e.left===null?``:u(e,e.left),u(e,e.right)])}function f(e,t){n(n=>n.map(n=>n.spec.id===e?{...n,document:t}:n))}async function p(t){try{if(t.left===null&&t.right.kind===`worktree`){let n=await ve(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return n.kind===`image`?{status:`image`,src:`data:${n.mediaType};base64,${n.data}`}:n.kind===`large`?{status:`large`,size:n.size,limit:n.limit}:n.kind===`binary`?{status:`binary`}:await m(t,``,n.content)}let n=await d(t);return n[0]===null||n[1]===null?{status:`binary`}:await m(t,n[0],n[1])}catch(e){return{status:`error`,message:i(e)}}}async function m(e,t,r){let i=await LU(e.path),a=e.left===null?null:Yl.createModel(t,i.id),o=Yl.createModel(r,i.id);return o.onDidChangeContent(()=>{rW.has(o)||n(e=>{let t=e.find(e=>e.document.status===`text`&&e.document.modified===o);if(t===void 0||t.document.status!==`text`)return e;let n=o.getAlternativeVersionId()!==t.document.saved;return t.document.dirty===n?e:e.map(e=>e===t?{...t,document:{...t.document,dirty:n}}:e)})}),{status:`text`,original:a,modified:o,language:i.name,saved:o.getAlternativeVersionId(),dirty:!1}}async function h(e){let r=t.find(t=>t.spec.id===e);if(r?.document.status!==`text`||r.document.dirty)return;let a=r.document,o=a.modified.getAlternativeVersionId();try{let t=await d(r.spec);if(a.modified.isDisposed()||a.modified.getAlternativeVersionId()!==o)return;if(t[0]===null||t[1]===null){f(e,{status:`binary`});return}a.original!==null&&aW(a.original,t[0]),rW.add(a.modified),aW(a.modified,t[1]),rW.delete(a.modified);let i=a.modified.getAlternativeVersionId();i!==o&&n(e=>e.map(e=>e.document.status===`text`&&e.document.modified===a.modified?{...e,document:{...e.document,saved:i}}:e))}catch(t){f(e,{status:`error`,message:i(t)})}}async function g(e){a(e.id),!t.some(t=>t.spec.id===e.id)&&(n([...t,{spec:e,document:{status:`loading`}}]),await _(e))}async function _(e){let t=await p(e);n(n=>n.map(n=>n.spec.id===e.id&&n.document.status===`loading`?{...n,document:t}:n))}async function v(r){let i=t.find(e=>e.spec.id===r);if(i?.document.status!==`text`||i.spec.right.kind!==`worktree`)return!0;let a=i.document.modified,o=a.getAlternativeVersionId();try{await ve(e.machine,`files.write`,{projectId:e.projectId,path:i.spec.path,content:a.getValue()})}catch(e){return xe(e),!1}return n(e=>e.map(e=>e.document.status===`text`&&e.document.modified===a?{...e,document:{...e.document,saved:o,dirty:a.getAlternativeVersionId()!==o}}:e)),e.onSaved(),!0}function y(e){let i=t.filter(t=>!e(t.spec));n(i);let o=t.findIndex(e=>e.spec.id===r);o!==-1&&e(t[o].spec)&&a(i.at(Math.min(o,i.length-1))?.spec.id??null)}function b(e,i){function o(t){return t===e?i:t.startsWith(`${e}/`)?`${i}${t.slice(e.length)}`:t}let s=t.map(e=>e.spec.id===ZU(e.spec.repo,e.spec.path).id?{...e,spec:ZU(e.spec.repo,o(e.spec.path))}:e);n(s);let c=t.findIndex(e=>e.spec.id===r);c!==-1&&a(s[c].spec.id)}function ee(e){y(t=>t.right.kind===`worktree`&&(t.path===e||t.path.startsWith(`${e}/`)))}function te(e){c.some(t=>t.spec.id===e)?s({kind:`tab`,id:e}):y(t=>t.id===e)}function ne(){c.length>0?s({kind:`dialog`}):e.onClose()}async function re(t){o!==null&&(s(null),!(t&&(await Promise.all(l.map(e=>v(e.spec.id)))).includes(!1))&&(o.kind===`tab`&&y(e=>e.id===o.id),o.kind===`dialog`&&e.onClose()))}let ie=(0,Y.useEffectEvent)(()=>{for(let t of e.saved.tabs)_(t.spec)});return(0,Y.useEffect)(()=>ie(),[]),{tabs:t,active:r,setActive:a,dirty:c,closing:o,setClosing:s,closingTabs:l,open:g,reload:h,save:v,close:te,renamed:b,deleted:ee,requestClose:ne,finish:re}}function aW(e,t){let n=e.getValue(),r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r++;let i=0;for(;i<n.length-r&&i<t.length-r&&n[n.length-1-i]===t[t.length-1-i];)i++;(r!==n.length||r!==t.length)&&e.applyEdits([{range:md.fromPositions(e.getPositionAt(r),e.getPositionAt(n.length-i)),text:t.slice(r,t.length-i)}])}function oW(e){return(0,X.jsxs)(u,{children:[(0,X.jsxs)(ne,{className:`hover:bg-accent data-[state=open]:bg-accent mr-auto ml-1 flex h-6 min-w-0 cursor-pointer items-center gap-1 rounded-sm px-1 text-[11px] font-bold tracking-wide uppercase outline-none`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.view===`explorer`?`Explorer`:`Source Control`}),(0,X.jsx)(Le,{icon:je,className:`size-3.5 shrink-0`})]}),(0,X.jsx)(se,{align:`start`,className:`bg-popover! w-44`,children:(0,X.jsxs)(f,{value:e.view,onValueChange:t=>{(t===`explorer`||t===`scm`)&&e.onView(t)},children:[(0,X.jsx)(re,{value:`explorer`,children:`Explorer`}),(0,X.jsx)(re,{value:`scm`,children:`Source Control`})]})})]})}function sW(e){return(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 pl-1.5`,children:[(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Open File`,"aria-label":`Open File`,onClick:e.onOpenFile,children:(0,X.jsx)(Le,{icon:Gf,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Previous Change`,"aria-label":`Previous Change`,onClick:e.onPrevious,children:(0,X.jsx)(Le,{icon:h,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Next Change`,"aria-label":`Next Change`,onClick:e.onNext,children:(0,X.jsx)(Le,{icon:b,className:`size-4`})}),(0,X.jsxs)(u,{children:[(0,X.jsx)(ne,{asChild:!0,children:(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,children:(0,X.jsx)(Le,{icon:ee,className:`size-4`})})}),(0,X.jsxs)(se,{align:`end`,className:`bg-popover! w-80`,children:[(0,X.jsx)(Pe,{checked:e.settings.inline,onCheckedChange:t=>e.onSettings({inline:t}),children:`Inline View`}),(0,X.jsx)(Pe,{checked:e.settings.whitespace,onCheckedChange:t=>e.onSettings({whitespace:t}),children:`Show Leading/Trailing Whitespace Differences`}),(0,X.jsx)(Pe,{checked:e.settings.collapse,onCheckedChange:t=>e.onSettings({collapse:t}),children:`Collapse Unchanged Regions`})]})]})]})}function cW(e){let t=e.repo;return(0,X.jsxs)(`div`,{className:`mr-auto -ml-1.5 flex h-full items-center`,children:[(0,X.jsxs)(`button`,{type:`button`,title:`${t.branch??`HEAD`} (Git) - Checkout Branch/Tag...`,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onCheckout,children:[(0,X.jsx)(Le,{icon:oe,className:`size-3.5`}),t.branch??(t.head===null?`HEAD`:YU(t.head)),t.changes.length>0&&`*`,t.staged.length>0&&`+`,t.merge.length>0&&`!`]}),t.upstream!==null&&(0,X.jsxs)(`button`,{type:`button`,title:`Synchronize Changes`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onSync,children:[(0,X.jsx)(Le,{icon:Xf,className:o(`size-3.5`,e.busy&&`animate-spin`)}),(t.behind>0||t.ahead>0)&&`${t.behind}↓ ${t.ahead}↑`]}),t.upstream===null&&t.branch!==null&&t.remote&&(0,X.jsx)(`button`,{type:`button`,title:`Publish Branch`,"aria-label":`Publish Branch`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onPublish,children:(0,X.jsx)(Le,{icon:l,className:`size-3.5`})})]})}var lW={all:null,amend:!1,then:null};function uW(e){let n=e.repo,r=n.merge.length+n.staged.length+n.changes.length>0,i=!r&&n.branch!==null&&n.upstream===null&&n.remote,a=!r&&n.upstream!==null&&(n.ahead>0||n.behind>0);return(0,X.jsxs)(`div`,{className:o(`grid gap-1.5 pt-1.5 pr-2 pb-1.5`,e.nested?`pl-4`:`pl-2`),children:[(0,X.jsxs)(`div`,{className:`bg-input/40 border-input focus-within:border-primary relative rounded-sm border`,children:[(0,X.jsx)(`textarea`,{rows:7,"aria-label":`Source Control Input`,value:e.message,placeholder:`Message (${t===`⌘`?`⌘Enter`:`Ctrl+Enter`} to commit on "${n.branch??(n.head===null?`HEAD`:YU(n.head))}")`,className:`placeholder:text-muted-foreground block w-full resize-none bg-transparent py-1 pr-7 pl-2 text-[13px] leading-[18px] outline-none`,onChange:t=>e.onMessage(t.target.value),onKeyDown:t=>{(t.metaKey||t.ctrlKey)&&t.key===`Enter`&&(t.preventDefault(),e.onCommit({...lW,then:`push`}))}}),(0,X.jsx)(`button`,{type:`button`,title:e.generating?`Cancel`:`Generate Commit Message`,"aria-label":e.generating?`Cancel`:`Generate Commit Message`,className:`text-muted-foreground hover:text-foreground hover:bg-accent absolute top-[3px] right-[3px] grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:e.generating?e.onCancel:e.onGenerate,children:(0,X.jsx)(Le,{icon:e.generating?Zf:ie,className:`size-3.5`})})]}),i&&(0,X.jsxs)(Ie,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.push`),children:[(0,X.jsx)(Le,{icon:l}),`Publish Branch`]}),a&&(0,X.jsxs)(Ie,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.sync`),children:[(0,X.jsx)(Le,{icon:Xf}),`Sync Changes`,n.behind>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[n.behind,(0,X.jsx)(Le,{icon:b,className:`size-3`})]}),n.ahead>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[n.ahead,(0,X.jsx)(Le,{icon:h,className:`size-3`})]})]}),!i&&!a&&(0,X.jsxs)(`div`,{className:`flex`,children:[(0,X.jsxs)(Ie,{size:`xs`,className:`flex-1 rounded-sm rounded-r-none`,disabled:!r||e.busy,onClick:()=>e.onCommit({...lW,then:`push`}),children:[(0,X.jsx)(Le,{icon:ue}),`Commit & Push`]}),(0,X.jsxs)(u,{children:[(0,X.jsx)(ne,{asChild:!0,children:(0,X.jsx)(Ie,{size:`xs`,className:`rounded-sm rounded-l-none px-1 before:absolute before:inset-y-1 before:-left-px before:w-px before:bg-white/10`,disabled:!r||e.busy,title:`More Actions...`,"aria-label":`More Commit Actions`,children:(0,X.jsx)(Le,{icon:je})})}),(0,X.jsxs)(se,{align:`end`,className:`bg-popover! w-48`,children:[(0,X.jsx)(p,{onSelect:()=>e.onCommit(lW),children:`Commit`}),(0,X.jsx)(p,{onSelect:()=>e.onCommit({...lW,amend:!0}),children:`Commit (Amend)`}),(0,X.jsx)(p,{onSelect:()=>e.onCommit({...lW,then:`push`}),children:`Commit & Push`}),(0,X.jsx)(p,{onSelect:()=>e.onCommit({...lW,then:`sync`}),children:`Commit & Sync`})]})]})]})]})}var dW=[{id:`merge`,title:`Merge Changes`},{id:`staged`,title:`Staged Changes`},{id:`changes`,title:`Changes`}];function fW(e){let[t,n]=(0,Y.useState)([]),[r,i]=(0,Y.useState)(null),a=Ae(),s=e.repo;function c(e){n(t.includes(e)?t.filter(t=>t!==e):[...t,e])}function l(t,n,r){let i=r===`group`?`All Changes`:`Changes`;return(0,X.jsxs)(X.Fragment,{children:[r===`file`&&n[0].status!==`D`&&(0,X.jsx)(mW,{title:`Open File`,icon:Gf,onClick:()=>e.onOpen(ZU(s.path,JU(s.path,n[0].path)))}),t===`changes`&&(0,X.jsx)(mW,{title:`Discard ${i}`,icon:$f,onClick:()=>e.onDiscard(n)}),t===`staged`&&(0,X.jsx)(mW,{title:`Unstage ${i}`,icon:Re,onClick:()=>e.onUnstage(n)}),t!==`staged`&&(0,X.jsx)(mW,{title:t===`merge`&&r===`group`?`Stage All Merge Changes`:`Stage ${i}`,icon:ze,onClick:()=>e.onStage(n)})]})}function u(t,n,r){let a=XU(s.path,t,n),c=JU(s.path,n.path);return(0,X.jsxs)(`div`,{"data-resource":!0,role:`button`,tabIndex:0,title:`${e.root}/${c} • ${KU[n.status]}`,className:o(`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,a.id===e.active&&`bg-sidebar-row-active`),style:{paddingLeft:20+r*8},onClick:()=>e.onOpen(a),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(a)},onContextMenu:()=>i({group:t,resource:n}),children:[(0,X.jsx)(Ve,{path:n.path}),(0,X.jsx)(`span`,{className:o(`min-w-0 shrink-0 truncate`,qU[n.status],n.status===`D`&&`line-through`),children:sp(n.path)}),!e.tree&&(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:op(n.path)}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(t,[n],`file`)}),(0,X.jsx)(`span`,{className:o(`w-3.5 text-center text-xs`,qU[n.status]),children:n.status})]})]},`${t}:${n.path}`)}function d(e,n,r){return n.map(n=>{if(n.kind===`file`)return u(e,n.resource,r);let i=`${s.path}:${e}:${n.path}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:n.path,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+r*8},onClick:()=>c(i),onKeyDown:e=>{e.key===`Enter`&&c(i)},children:[(0,X.jsx)(pW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.label}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(e,n.resources,`folder`)})]}),a&&d(e,n.children,r+1)]},i)})}return(0,X.jsxs)(y,{children:[(0,X.jsx)(ae,{asChild:!0,children:(0,X.jsx)(`div`,{onContextMenu:e=>{(!(e.target instanceof Element)||e.target.closest(`[data-resource]`)===null)&&e.preventDefault()},children:dW.map(n=>{let r=s[n.id];if(r.length===0)return null;let i=`${s.path}:${n.id}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+e.depth*8},onClick:()=>c(i),onKeyDown:e=>{e.key===`Enter`&&c(i)},children:[(0,X.jsx)(pW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.title}),(0,X.jsx)(`span`,{className:`hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(n.id,r,`group`)}),(0,X.jsx)(`span`,{className:`bg-muted text-foreground grid h-4.5 min-w-4.5 shrink-0 place-items-center rounded-full px-1 text-[11px] tabular-nums`,children:r.length})]}),a&&(e.tree?d(n.id,tW(r,e.sort),e.depth+1):eW(r,e.sort).map(t=>u(n.id,t,e.depth+1)))]},n.id)})})}),r!==null&&(0,X.jsxs)(fe,{className:`min-w-52`,children:[(0,X.jsx)(de,{onSelect:()=>e.onOpen(XU(s.path,r.group,r.resource)),children:`Open Changes`}),r.resource.status!==`D`&&(0,X.jsx)(de,{onSelect:()=>e.onOpen(ZU(s.path,JU(s.path,r.resource.path))),children:`Open File`}),r.resource.status!==`U`&&r.resource.status!==`A`&&(0,X.jsx)(de,{onSelect:()=>e.onOpen(QU(s.path,r.resource)),children:`Open File (HEAD)`}),(0,X.jsx)(pe,{}),r.group===`staged`&&(0,X.jsx)(de,{onSelect:()=>e.onUnstage([r.resource]),children:`Unstage Changes`}),r.group!==`staged`&&(0,X.jsx)(de,{onSelect:()=>e.onStage([r.resource]),children:`Stage Changes`}),r.group===`changes`&&(0,X.jsx)(de,{onSelect:()=>e.onDiscard([r.resource]),children:`Discard Changes`}),r.resource.status===`U`&&(0,X.jsx)(de,{onSelect:()=>e.onIgnore([r.resource]),children:`Add to .gitignore`}),(0,X.jsx)(pe,{}),(0,X.jsx)(de,{onSelect:()=>void a.copy(`${e.root}/${JU(s.path,r.resource.path)}`),children:`Copy Path`}),(0,X.jsx)(de,{onSelect:()=>void a.copy(JU(s.path,r.resource.path)),children:`Copy Relative Path`})]})]})}function pW(e){return(0,X.jsx)(Le,{icon:ce,"aria-hidden":!0,className:o(`text-muted-foreground size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)})}function mW(e){return(0,X.jsx)(`button`,{type:`button`,title:e.title,"aria-label":e.title,className:`text-foreground hover:bg-accent grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:t=>{t.stopPropagation(),e.onClick()},children:(0,X.jsx)(Le,{icon:e.icon,className:`size-4`})})}var hW=50,gW=11,_W=22,vW=[`#59A4F9`,`#FFB000`,`#DC267F`,`#994F00`,`#40B0A6`,`#B66DFF`];function yW(e){let[t,n]=(0,Y.useState)(null),[a,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(hW),[f,p]=(0,Y.useState)(0),[h,g]=(0,Y.useState)([]),[_,v]=(0,Y.useState)({}),y=e.repos.find(e=>e.path===t)??e.repos.at(0),b=y?.path??null,ee=y?.head??null,te=y?.upstream??null,ne=y?.behind??0;(0,Y.useEffect)(()=>{if(b===null||ee===null){s([]);return}let t=!0;return ve(e.machine,`git.history`,{projectId:e.projectId,repo:b,limit:u}).then(e=>{t&&(s(e),l(null))},e=>{t&&l(i(e))}),()=>{t=!1}},[e.machine,e.projectId,b,ee,te,ne,u,f]);async function re(t){if(h.includes(t.hash))g(h.filter(e=>e!==t.hash));else if(g([...h,t.hash]),y!==void 0&&_[t.hash]===void 0)try{let n=await ve(e.machine,`git.commitFiles`,{projectId:e.projectId,repo:y.path,hash:t.hash,parent:t.parents.at(0)??null});v(e=>({...e,[t.hash]:n}))}catch(e){xe(e)}}let ie=wW(a??[]);return(0,X.jsxs)(`div`,{className:o(`border-sidebar-border relative flex shrink-0 flex-col border-t`,e.open&&`min-h-20`),style:e.open?{height:e.height}:void 0,children:[e.open&&(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,className:`hover:bg-primary absolute inset-x-0 -top-0.5 z-10 h-1 cursor-row-resize touch-none transition-colors delay-100`,onPointerDown:t=>{let n=t.currentTarget.parentElement?.parentElement;if(n==null)return;let i=n.getBoundingClientRect();r(t,t=>e.onHeight(Math.min(Math.max(i.bottom-t.clientY,80),i.height-120)))}}),(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row text-sidebar-foreground flex h-[22px] shrink-0 cursor-pointer items-center gap-0.5 pr-2 pl-0.5 outline-none select-none`,onClick:e.onToggle,onKeyDown:t=>{t.key===`Enter`&&e.onToggle()},children:[(0,X.jsx)(Le,{icon:ce,"aria-hidden":!0,className:o(`size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-bold tracking-wide uppercase`,children:`Graph`}),e.repos.length>1&&(0,X.jsx)(`select`,{"aria-label":`Repository`,value:y?.path??``,className:`bg-sidebar text-muted-foreground max-w-28 cursor-pointer truncate text-xs outline-none`,onClick:e=>e.stopPropagation(),onChange:e=>{n(e.target.value),g([]),d(hW)},children:e.repos.map(e=>(0,X.jsx)(`option`,{value:e.path,children:e.path===``?`.`:e.path},e.path))}),e.open&&y!==void 0&&(0,X.jsxs)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex`,children:[(0,X.jsx)(mW,{title:`Fetch From All Remotes`,icon:Uf,onClick:()=>e.onFetch(y)}),(0,X.jsx)(mW,{title:`Refresh`,icon:m,onClick:()=>p(f+1)})]})]}),e.open&&(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[c!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:c}),c===null&&ie.length===0&&a!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:`No commits yet.`}),c===null&&y!==void 0&&ie.map(t=>{let n=t.commit,r=h.includes(n.hash);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${n.author}, ${new Date(n.date).toLocaleString()}\n\n${n.subject}\n\n${YU(n.hash)}`,className:`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,onClick:()=>void re(n),onKeyDown:e=>{e.key===`Enter`&&re(n)},children:[(0,X.jsx)(bW,{row:t,child:!1}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.subject}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 shrink-[2] truncate text-xs`,children:n.author}),(0,X.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:n.refs.map(e=>xW(e,y))})]}),r&&(_[n.hash]??[]).map(r=>{let i=$U(y.path,n,r);return(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${r.path} • ${KU[r.status]}`,className:o(`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,i.id===e.active&&`bg-sidebar-row-active`),onClick:()=>e.onOpen(i),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(i)},children:[(0,X.jsx)(bW,{row:t,child:!0}),(0,X.jsx)(Ve,{path:r.path}),(0,X.jsx)(`span`,{className:o(`min-w-0 shrink-0 truncate`,qU[r.status],r.status===`D`&&`line-through`),children:sp(r.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:op(r.path)}),(0,X.jsx)(`span`,{className:o(`ml-auto w-3.5 shrink-0 text-center text-xs`,qU[r.status]),children:r.status})]},r.path)})]},n.hash)}),a!==null&&a.length===u&&(0,X.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground w-full cursor-pointer px-4 py-1 text-left text-xs`,onClick:()=>d(u+hW),children:`Load More…`})]})]})}function bW(e){let t=e.row,n=_W/2,r=SW(t.lane);return e.child?(0,X.jsx)(`svg`,{"aria-hidden":!0,width:gW*(t.width+1),height:_W,className:`shrink-0`,children:t.after.map(e=>(0,X.jsx)(`line`,{x1:SW(e),x2:SW(e),y1:0,y2:_W,stroke:CW(e),strokeWidth:1},e))}):(0,X.jsxs)(`svg`,{"aria-hidden":!0,width:gW*(t.width+1),height:_W,className:`shrink-0`,children:[t.through.map(e=>(0,X.jsx)(`line`,{x1:SW(e),x2:SW(e),y1:0,y2:_W,stroke:CW(e),strokeWidth:1},`through-${e}`)),t.up.map(e=>(0,X.jsx)(`path`,{d:`M ${SW(e)} 0 Q ${SW(e)} ${n} ${r} ${n}`,fill:`none`,stroke:CW(e),strokeWidth:1},`up-${e}`)),t.down.map(e=>(0,X.jsx)(`path`,{d:`M ${r} ${n} Q ${SW(e)} ${n} ${SW(e)} ${_W}`,fill:`none`,stroke:CW(e),strokeWidth:1},`down-${e}`)),(0,X.jsx)(`circle`,{cx:r,cy:n,r:t.commit.parents.length>1?3.5:4,fill:t.commit.parents.length>1?`var(--sidebar)`:CW(t.lane),stroke:CW(t.lane),strokeWidth:t.commit.parents.length>1?2:0})]})}function xW(e,t){if(e.endsWith(`/HEAD`))return null;let n=e===`HEAD`||e.startsWith(`HEAD -> `),r=e.startsWith(`tag: `),i=e===t.upstream,a=e.replace(/^HEAD -> /,``).replace(/^tag: /,``);return(0,X.jsxs)(`span`,{title:a,className:o(`inline-flex h-4 max-w-32 items-center gap-0.5 rounded-full px-1.5 text-[11px] font-medium`,n&&`text-background bg-[#59A4F9]`,i&&`text-background bg-[#B180D7]`,!n&&!i&&`bg-muted text-foreground`),children:[(0,X.jsx)(Le,{icon:r?Qf:i?le:oe,className:`size-3 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:a})]},e)}function SW(e){return gW*(e+1)}function CW(e){return vW[e%vW.length]}function wW(e){let t=[];return e.map(e=>{let n=t,r=n.indexOf(e.hash),i=n.indexOf(null),a=r===-1?i===-1?n.length:i:r,o=n.map(t=>t===e.hash?null:t);o[a]=e.parents.at(0)??null;let s=e.parents.length>0?[a]:[];for(let t of e.parents.slice(1)){let e=o.indexOf(t);if(e!==-1){s.push(e);continue}let n=o.indexOf(null),r=n===-1?o.length:n;o[r]=t,s.push(r)}for(;o.length>0&&o.at(-1)===null;)o.pop();return t=o,{commit:e,lane:a,up:n.flatMap((t,n)=>t===e.hash?[n]:[]),through:n.flatMap((t,n)=>t!==null&&t!==e.hash?[n]:[]),down:s,after:o.flatMap((e,t)=>e===null?[]:[t]),width:Math.max(n.length,o.length,a+1)}})}function TW(e){let t=e.repo;function n(t,n){return(0,X.jsx)(p,{onSelect:()=>e.onCommit({...lW,...n}),children:t})}return(0,X.jsxs)(u,{children:[(0,X.jsx)(ne,{asChild:!0,children:(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Le,{icon:ee,className:`size-4`})})}),(0,X.jsxs)(se,{align:`end`,className:`bg-popover! w-56`,children:[(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`View & Sort`}),(0,X.jsxs)(we,{className:`w-44`,children:[(0,X.jsxs)(f,{value:e.settings.tree?`tree`:`list`,onValueChange:t=>e.onSettings({tree:t===`tree`}),children:[(0,X.jsx)(re,{value:`list`,children:`View as List`}),(0,X.jsx)(re,{value:`tree`,children:`View as Tree`})]}),(0,X.jsx)(Te,{}),(0,X.jsxs)(f,{value:e.settings.sort,onValueChange:t=>{(t===`name`||t===`path`||t===`status`)&&e.onSettings({sort:t})},children:[(0,X.jsx)(re,{value:`name`,children:`Sort by Name`}),(0,X.jsx)(re,{value:`path`,children:`Sort by Path`}),(0,X.jsx)(re,{value:`status`,children:`Sort by Status`})]})]})]}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(p,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(p,{onSelect:e.onCheckout,children:`Checkout to...`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(Te,{}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Commit`}),(0,X.jsxs)(we,{className:`w-52`,children:[n(`Commit`,{}),n(`Commit Staged`,{all:!1}),n(`Commit All`,{all:!0}),(0,X.jsx)(p,{disabled:t.head===null,onSelect:e.onUndo,children:`Undo Last Commit`}),(0,X.jsx)(Te,{}),n(`Commit (Amend)`,{amend:!0}),n(`Commit Staged (Amend)`,{all:!1,amend:!0}),n(`Commit All (Amend)`,{all:!0,amend:!0})]})]}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Changes`}),(0,X.jsxs)(we,{className:`w-52`,children:[(0,X.jsx)(p,{onSelect:()=>e.onStage([...t.merge,...t.changes]),children:`Stage All Changes`}),(0,X.jsx)(p,{onSelect:()=>e.onUnstage(t.staged),children:`Unstage All Changes`}),(0,X.jsx)(p,{disabled:t.changes.length===0,onSelect:()=>e.onDiscard(t.changes),children:`Discard All Changes`})]})]}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Pull, Push`}),(0,X.jsxs)(we,{className:`w-52`,children:[(0,X.jsx)(p,{onSelect:()=>e.onRemote(`git.sync`),children:`Sync`}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`pull`,rebase:!0}),children:`Pull (Rebase)`}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`fetch`,prune:!0,all:!1}),children:`Fetch (Prune)`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!0}),children:`Fetch From All Remotes`})]})]}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Branch`}),(0,X.jsxs)(we,{className:`w-52`,children:[(0,X.jsx)(p,{onSelect:e.onCheckout,children:`Create Branch...`}),(0,X.jsx)(p,{disabled:t.branch===null||t.upstream!==null,onSelect:()=>e.onRemote(`git.push`),children:`Publish Branch...`})]})]}),(0,X.jsxs)(c,{children:[(0,X.jsx)(te,{children:`Stash`}),(0,X.jsxs)(we,{className:`w-56`,children:[(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`stash`,mode:`tracked`}),children:`Stash`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`stash`,mode:`untracked`}),children:`Stash (Include Untracked)`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`stash`,mode:`staged`}),children:`Stash Staged`}),(0,X.jsx)(Te,{}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`unstash`,pop:!1}),children:`Apply Latest Stash`}),(0,X.jsx)(p,{onSelect:()=>e.onRun({kind:`unstash`,pop:!0}),children:`Pop Latest Stash`})]})]})]})]})}function EW(e){let[t,n]=(0,Y.useState)([]),r=(0,Y.useRef)(new Map),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=e.repos??[],l=c.length===1?c[0]:null,u=e.settings;function d(e){return u.messages[e.path]??``}function f(t,n){return e.onPerform(()=>ve(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:n}))}function p(t,n){return e.onPerform(()=>ve(e.machine,n,{projectId:e.projectId,repo:t.path}))}async function h(t,n){let r=d(t).trim();if(r===``&&!n.amend){xe(`Please provide a commit message.`);return}let i=t.changes.length+t.merge.length>0;if(n.all===null&&!n.amend&&t.staged.length===0){if(!i){xe(`There are no changes to commit.`);return}if(!u.smartCommit){a({repo:t,options:n});return}}let o=n.all??(t.staged.length===0&&!n.amend&&i);await e.onPerform(async()=>{await ve(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:{kind:`commit`,message:r,all:o,amend:n.amend}}),e.onMessage(t.path,``),n.then!==null&&await ve(e.machine,n.then===`push`?`git.push`:`git.sync`,{projectId:e.projectId,repo:t.path})})}async function g(t){let i={};r.current.set(t.path,i),n(e=>[...e,t.path]);try{let n=await ve(e.machine,`git.message`,{projectId:e.projectId,repo:t.path,staged:t.staged.length>0});r.current.get(t.path)===i&&e.onMessage(t.path,n)}catch(e){r.current.get(t.path)===i&&xe(e)}finally{r.current.get(t.path)===i&&_(t)}}function _(e){r.current.delete(e.path),n(t=>t.filter(t=>t!==e.path))}function v(t){e.onPerform(async()=>{e.onMessage(t.path,await ve(e.machine,`git.undoCommit`,{projectId:e.projectId,repo:t.path}))})}function y(e,t){f(e,{kind:`unstage`,paths:t.flatMap(e=>e.from===null?[e.path]:[e.path,e.from])})}function b(e,t){f(e,{kind:`stage`,paths:t.map(e=>e.path)})}function ee(t){return(0,X.jsx)(TW,{repo:t,settings:u,onSettings:e.onSettings,onCommit:e=>void h(t,e),onUndo:()=>v(t),onRun:e=>void f(t,e),onRemote:e=>void p(t,e),onStage:e=>b(t,e),onUnstage:e=>y(t,e),onDiscard:e=>s({repo:t,resources:e}),onCheckout:()=>e.onCheckout(t)})}let te=o?.resources??[],ne=te.filter(e=>e.status===`U`);return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border relative flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:u.tree?`View as List`:`View as Tree`,"aria-label":u.tree?`View as List`:`View as Tree`,onClick:()=>e.onSettings({tree:!u.tree}),children:(0,X.jsx)(Le,{icon:u.tree?Yf:Jf,className:`size-4`})}),l!==null&&(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Commit`,"aria-label":`Commit`,disabled:e.busy,onClick:()=>void h(l,lW),children:(0,X.jsx)(Le,{icon:ue,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Refresh`,"aria-label":`Refresh`,onClick:e.onRefresh,children:(0,X.jsx)(Le,{icon:m,className:`size-4`})}),l!==null&&ee(l),(e.busy||t.length>0)&&(0,X.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 overflow-hidden`,children:(0,X.jsx)(`span`,{className:`bg-primary block h-full w-[2%] animate-[progress_4s_linear_infinite]`})})]}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[e.error!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:e.error}),e.error===null&&e.repos===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),e.error===null&&e.repos?.length===0&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`The folder currently open doesn't have a git repository.`}),c.map(n=>(0,X.jsxs)(`div`,{children:[l===null&&(0,X.jsxs)(`div`,{className:`group/row text-sidebar-foreground flex h-[22px] items-center gap-1.5 pr-1 pl-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`truncate font-semibold`,children:n.path===``?e.name:sp(n.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:n.branch??(n.head===null?``:YU(n.head))}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex`,children:(0,X.jsx)(mW,{title:`Commit`,icon:ue,onClick:()=>void h(n,lW)})}),ee(n)]}),(0,X.jsx)(uW,{repo:n,message:d(n),generating:t.includes(n.path),busy:e.busy,nested:l===null,onMessage:t=>e.onMessage(n.path,t),onGenerate:()=>void g(n),onCancel:()=>_(n),onCommit:e=>void h(n,e),onRemote:e=>void p(n,e)}),(0,X.jsx)(fW,{repo:n,root:e.root,tree:u.tree,sort:u.sort,depth:+(l===null),active:e.active,onOpen:e.onOpen,onStage:e=>b(n,e),onUnstage:e=>y(n,e),onDiscard:e=>s({repo:n,resources:e}),onIgnore:e=>void f(n,{kind:`ignore`,paths:e.map(e=>e.path)})})]},n.path))]}),c.length>0&&(0,X.jsx)(yW,{machine:e.machine,projectId:e.projectId,repos:c,open:u.graph,height:u.graphHeight,active:e.active,onToggle:()=>e.onSettings({graph:!u.graph}),onHeight:t=>e.onSettings({graphHeight:t}),onOpen:e.onOpen,onFetch:e=>void f(e,{kind:`fetch`,prune:!1,all:!0})}),(0,X.jsx)(Ce,{open:i!==null,onOpenChange:e=>{e||a(null)},children:(0,X.jsxs)(Me,{children:[(0,X.jsxs)(Ne,{children:[(0,X.jsx)(_e,{children:`There are no staged changes to commit.`}),(0,X.jsx)(ge,{children:`Would you like to stage all your changes and commit them directly?`})]}),(0,X.jsxs)(De,{children:[(0,X.jsx)(Oe,{children:`Cancel`}),(0,X.jsx)(he,{variant:`outline`,onClick:()=>{i!==null&&(e.onSettings({smartCommit:!0}),h(i.repo,{...i.options,all:!0}))},children:`Always`}),(0,X.jsx)(he,{onClick:()=>{i!==null&&h(i.repo,{...i.options,all:!0})},children:`Yes`})]})]})}),(0,X.jsx)(Ce,{open:o!==null,onOpenChange:e=>{e||s(null)},children:(0,X.jsxs)(Me,{children:[(0,X.jsxs)(Ne,{children:[(0,X.jsx)(_e,{children:te.length>1?`Are you sure you want to discard ALL changes in ${te.length} files?`:ne.length===1?`Are you sure you want to DELETE the following untracked file: '${sp(te[0].path)}'?`:`Are you sure you want to discard changes in '${sp(te.at(0)?.path??``)}'?`}),(0,X.jsxs)(ge,{children:[te.length>1&&`This is IRREVERSIBLE! Your current working set will be FOREVER LOST if you proceed.`,te.length===1&&ne.length===1&&`This is IRREVERSIBLE! This file will be FOREVER LOST if you proceed.`]})]}),(0,X.jsxs)(De,{children:[(0,X.jsx)(Oe,{children:`Cancel`}),(0,X.jsx)(he,{variant:`destructive`,onClick:()=>{o!==null&&f(o.repo,{kind:`discard`,tracked:te.filter(e=>e.status!==`U`).map(e=>e.path),untracked:ne.map(e=>e.path)})},children:te.length>1?`Discard All ${te.length} Files`:ne.length===1?`Delete File`:`Discard File`})]})]})})]})}var DW=3e3;function OW(e){let[t,n]=(0,Y.useState)(null),[r,a]=(0,Y.useState)(null),o=(0,Y.useEffectEvent)(e.onLoaded);return(0,Y.useEffect)(()=>{let t=!0,r=!1;async function c(){if(!r){r=!0;try{let r=await ve(e.machine,`git.changes`,{projectId:e.projectId});if(!t)return;a(null),n(e=>s(e,r)?e:r),o()}catch(e){t&&a(i(e))}finally{r=!1}}}function l(){document.hidden||c()}c();let u=window.setInterval(l,DW);return window.addEventListener(`focus`,l),()=>{t=!1,window.clearInterval(u),window.removeEventListener(`focus`,l)}},[e.machine,e.projectId,e.version]),{repos:t,error:r}}var kW=(0,Y.lazy)(async()=>({default:(await x(async()=>{let{ZoomableImage:e}=await import(`./zoomable-image-C5zI0AEw.js`);return{ZoomableImage:e}},__vite__mapDeps([16,17,2,18,19,20,21]))).ZoomableImage}));function AW(e){let t=me(t=>ke(t,e.machine,e.projectId)),n=be(),i=me(e=>e.prefs.editor),[a]=(0,Y.useState)(()=>tp(e.machine,e.projectId)),[s]=(0,Y.useState)(()=>new Map(a.tabs.map(e=>[e.spec.id,e.view]))),[c,l]=(0,Y.useState)(()=>({...a.settings,width:Math.min(a.settings.width,window.innerWidth*.6)})),[u,d]=(0,Y.useState)(a.expanded),[f,p]=(0,Y.useState)(0),[m,h]=(0,Y.useState)(0),[g,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(null),[ee,te]=(0,Y.useState)(null),ne=(0,Y.useRef)(null),re=(0,Y.useCallback)(e=>{if(e===null)return;let t=Yl.create(e,{automaticLayout:!0,model:null});return b(t),()=>t.dispose()},[]),ie=(0,Y.useCallback)(e=>{if(e===null)return;let t=Yl.createDiffEditor(e,{automaticLayout:!0,originalEditable:!1,experimental:{showMoves:!0},useInlineViewWhenSpaceIsLimited:!0});return te(t),()=>t.dispose()},[]),ae=(0,Y.useCallback)(()=>p(e=>e+1),[]),oe=iW({machine:e.machine,projectId:e.projectId,saved:a,onSaved:ae,onClose:()=>{Ee(),e.onClose()}}),se=oe.active;function ce(){se!==null&&oe.reload(se)}let le=OW({machine:e.machine,projectId:e.projectId,version:f,onLoaded:ce}),ue=le.repos,de=oe.tabs.find(e=>e.spec.id===se),fe=de?.document.status===`text`?de.document:null,pe=fe?.original??null,he=fe?.modified??null,ge=de?.spec.right.kind===`worktree`,_e=ue?.find(e=>e.path===de?.spec.repo)??ue?.at(0)??null;(0,Y.useEffect)(()=>{RU().catch(xe)},[n]),(0,Y.useEffect)(()=>{y?.updateOptions(zU(i)),ee?.updateOptions(zU(i)),BU(i).catch(xe)},[y,ee,i]),(0,Y.useEffect)(()=>{ee?.updateOptions({renderSideBySide:!c.inline,ignoreTrimWhitespace:!c.whitespace,hideUnchangedRegions:{enabled:c.collapse}})},[ee,c.inline,c.whitespace,c.collapse]),(0,Y.useEffect)(()=>{if(y===null||ee===null||(ne.current!==null&&s.set(ne.current.id,ne.current.editor.saveViewState()),ne.current=null,y.setModel(pe===null?he:null),ee.setModel(pe===null||he===null?null:{original:pe,modified:he}),he===null||se===null))return;let e=pe===null?y:ee.getModifiedEditor();e.updateOptions({readOnly:!ge}),ee.updateOptions({readOnly:!ge}),e.restoreViewState(s.get(se)??null),e.focus(),ne.current={id:se,editor:e}},[y,ee,pe,he,se,ge,s]);let Se=(0,Y.useEffectEvent)(ce);(0,Y.useEffect)(()=>Se(),[se]),WU({machine:e.machine,projectId:e.projectId,spec:de?.spec,original:pe,modified:he,onPerform:we});function Ce(e){window.innerWidth<640&&Te({sidebar:!1}),oe.open(e)}async function we(e){h(e=>e+1);try{await e()}catch(e){xe(e)}finally{h(e=>e-1),ae()}}function Te(e){l(t=>({...t,...e}))}function Ee(){ne.current!==null&&s.set(ne.current.id,ne.current.editor.saveViewState()),np(e.machine,e.projectId,{tabs:oe.tabs.map(e=>({spec:e.spec,view:s.get(e.spec.id)??null})),active:se,expanded:u,settings:c})}(0,Y.useEffect)(Ee);let De=(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Toggle Primary Side Bar`,"aria-label":`Toggle Primary Side Bar`,"aria-pressed":c.sidebar,onClick:()=>Te({sidebar:!c.sidebar}),children:(0,X.jsx)(Le,{icon:_,className:`size-4`})}),Oe=(0,X.jsxs)(X.Fragment,{children:[De,(0,X.jsx)(oW,{view:c.view,onView:e=>Te({view:e})})]});return(0,X.jsx)(We,{open:!0,onOpenChange:()=>oe.requestClose(),children:(0,X.jsxs)(He,{"aria-describedby":void 0,showCloseButton:!1,className:`top-0 left-0 flex h-dvh w-dvw max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none border-0 p-0 sm:max-w-none`,onEscapeKeyDown:e=>e.preventDefault(),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),se!==null&&oe.save(se)),(e.metaKey||e.ctrlKey)&&e.key===`w`&&(e.preventDefault(),se!==null&&oe.close(se))},children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:o(`border-sidebar-border relative shrink-0 border-r`,!c.sidebar&&`hidden`),style:{width:c.width},children:[c.view===`explorer`&&(0,X.jsx)(ip,{machine:e.machine,projectId:e.projectId,root:t?.path??``,header:Oe,expanded:u,onExpanded:d,active:de?.spec.path??null,onOpen:e=>Ce(ZU(``,e)),onRenamed:oe.renamed,onDeleted:oe.deleted}),c.view===`scm`&&(0,X.jsx)(EW,{machine:e.machine,projectId:e.projectId,name:t?.name??``,root:t?.path??``,header:Oe,repos:ue,error:le.error,busy:m>0,settings:c,onSettings:Te,onMessage:(e,t)=>l(n=>({...n,messages:{...n.messages,[e]:t}})),active:se,onOpen:Ce,onRefresh:ae,onPerform:we,onCheckout:v}),(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`hover:bg-primary absolute inset-y-0 -right-0.5 z-10 w-1 cursor-col-resize touch-none transition-colors delay-100`,onPointerDown:e=>r(e,e=>Te({width:Math.min(Math.max(e.clientX,200),window.innerWidth-240)}))})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-9 shrink-0 items-center shadow-[inset_0_-1px_0_var(--sidebar-border)]`,children:[!c.sidebar&&(0,X.jsx)(`div`,{className:`shrink-0 px-1.5`,children:De}),(0,X.jsx)(Ue,{className:`sr-only`,children:`Editor`}),(0,X.jsx)(cp,{tabs:oe.tabs.map(e=>({id:e.spec.id,path:e.spec.path,label:e.spec.label})),active:se,dirty:oe.dirty.map(e=>e.spec.id),onSelect:oe.setActive,onClose:oe.close}),de!==void 0&&pe!==null&&(0,X.jsx)(sW,{settings:c,onSettings:Te,onOpenFile:()=>Ce(ZU(de.spec.repo,de.spec.path)),onPrevious:()=>ee?.goToDiff(`previous`),onNext:()=>ee?.goToDiff(`next`)}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,className:`mx-1.5 shrink-0`,title:`Close`,"aria-label":`Close`,onClick:oe.requestClose,children:(0,X.jsx)(Le,{icon:Be,className:`size-4`})})]}),(0,X.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,X.jsx)(`div`,{ref:re,className:o(`absolute inset-0`,(he===null||pe!==null)&&`hidden`)}),(0,X.jsx)(`div`,{ref:ie,className:o(`absolute inset-0`,(he===null||pe===null)&&`hidden`)}),de===void 0&&(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:c.view===`explorer`?`Open a file from the explorer to start editing.`:`Select a change to see its diff.`}),de?.document.status===`image`&&(0,X.jsx)(Y.Suspense,{children:(0,X.jsx)(kW,{src:de.document.src,alt:de.spec.path})}),de?.document.status===`large`&&(0,X.jsxs)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:[`This file is `,jW(de.document.size),`, too large to open in the editor (limit `,jW(de.document.limit),`).`]}),de?.document.status===`binary`&&(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:`The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding.`}),de?.document.status===`error`&&(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:de.document.message})]})]})]}),(0,X.jsx)(HU,{editor:he===null?null:pe===null?y:ee?.getModifiedEditor()??null,language:fe?.language??null,children:_e!==null&&(0,X.jsx)(cW,{repo:_e,busy:m>0,onCheckout:()=>v(_e),onSync:()=>void we(()=>ve(e.machine,`git.sync`,{projectId:e.projectId,repo:_e.path})),onPublish:()=>void we(()=>ve(e.machine,`git.push`,{projectId:e.projectId,repo:_e.path}))})}),(0,X.jsx)(ep,{}),(0,X.jsx)(VU,{open:oe.closing!==null,paths:oe.closingTabs.map(e=>e.spec.path),onCancel:()=>oe.setClosing(null),onFinish:e=>void oe.finish(e)}),g!==null&&(0,X.jsx)(ye,{machine:e.machine,projectId:e.projectId,repo:{...g,changed:g.merge.length+g.staged.length+g.changes.length},onRefresh:ae,onClose:()=>v(null)})]})})}function jW(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}export{AW as EditorDialog};