n8n-editor-ui
Version:
Workflow Editor UI for n8n
1 lines • 665 kB
JavaScript
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.13.4"}}catch(e){}}(),System.register(["./chunk-legacy-TXBRODOR.js","./vue.runtime.esm-bundler-legacy-IafOlCW8.js","./_MapCache-legacy-DwgdC8YO.js","./src-legacy-Dwzr7bD0.js","./_plugin-vue_export-helper-legacy-DEZAmQqp.js","./users.store-legacy-OKuN0qAC.js","./constants-legacy-DNCca_FT.js","./_baseOrderBy-legacy-PsQY_Pvh.js","./useClipboard-legacy-D5bRgqfO.js","./assistant.store-legacy-kpq6KUPM.js","./chatPanel.store-legacy-BXT37O-E.js","./NDVEmptyState-legacy-CfqV96iU.js","./externalSecrets.ee.store-legacy-C6uyA9v4.js","./uniqBy-legacy-DmwIYJPs.js","./usePinnedData-legacy-CxgKkO-J.js","./RunDataHtml-legacy-DYuZnk8K.js","./useRunWorkflow-legacy-D--lDsti.js","./useInjectWorkflowId-legacy-Bqd7CF__.js","./vue-json-pretty-legacy-C9tMykq1.js","./collaboration.store-legacy-Cbihou7P.js","./useExecutionHelpers-legacy-L8nz8vaT.js"],(function(e,t){var i,n,o,r,s,a,l,c,h,d,u,p,f,m,g,O,v,b,y,x,w,k,S,Q,$,T,P,_,C,M,Z,R,A,E,D,L,X,N,j,z,q,I,W,V,Y,B,U,G,H,F,K,J,ee,te,ie,ne,oe,re,se,ae,le,ce,he,de,ue,pe,fe,me,ge,Oe,ve,be,ye,xe,we,ke,Se,Qe,$e,Te,Pe,_e,Ce,Me,Ze,Re,Ae,Ee,De,Le,Xe,Ne,je,ze,qe,Ie,We,Ve,Ye,Be,Ue,Ge,He,Fe,Ke,Je,et,tt,it,nt,ot,rt,st,at,lt,ct,ht,dt,ut,pt,ft,mt,gt,Ot,vt,bt,yt,xt,wt,kt,St,Qt,$t,Tt,Pt,_t,Ct,Mt,Zt,Rt,At,Et,Dt,Lt,Xt,Nt,jt,zt,qt,It,Wt,Vt,Yt,Bt,Ut,Gt,Ht,Ft,Kt,Jt,ei,ti,ii,ni,oi,ri,si,ai,li,ci,hi,di,ui,pi,fi,mi,gi,Oi,vi,bi,yi,xi,wi,ki,Si,Qi,$i,Ti,Pi,_i,Ci,Mi,Zi,Ri,Ai,Ei,Di,Li,Xi,Ni,ji,zi,qi,Ii,Wi,Vi,Yi,Bi,Ui,Gi,Hi,Fi,Ki,Ji,en,tn,nn,on,rn,sn,an,ln,cn,hn,dn,un,pn,fn,mn,gn,On,vn,bn,yn,xn,wn,kn,Sn,Qn,$n,Tn,Pn,_n,Cn,Mn,Zn,Rn,An,En,Dn,Ln,Xn,Nn,jn,zn,qn,In,Wn,Vn,Yn,Bn,Un,Gn,Hn,Fn,Kn,Jn,eo,to,io,no,oo,ro,so,ao,lo,co,ho,uo,po,fo,mo,go,Oo,vo,bo,yo,xo,wo,ko,So,Qo,$o,To,Po,_o,Co,Mo,Zo,Ro,Ao,Eo,Do,Lo,Xo,No,jo,zo,qo,Io,Wo,Vo,Yo,Bo,Uo,Go,Ho,Fo,Ko,Jo,er,tr,ir,nr,or,rr,sr,ar,lr,cr,hr,dr,ur,pr,fr,mr,gr,Or,vr,br,yr,xr,wr,kr,Sr,Qr,$r,Tr,Pr,_r,Cr,Mr,Zr,Rr,Ar,Er,Dr,Lr,Xr,Nr,jr,zr,qr,Ir,Wr,Vr,Yr,Br,Ur,Gr,Hr,Fr,Kr,Jr,es,ts,is,ns,os,rs,ss,as,ls,cs,hs,ds,us,ps,fs,ms,gs,Os,vs,bs,ys,xs,ws,ks,Ss,Qs,$s,Ts,Ps,_s,Cs,Ms,Zs,Rs,As,Es,Ds,Ls,Xs,Ns,js,zs,qs,Is,Ws,Vs,Ys,Bs,Us,Gs,Hs,Fs,Ks,Js,ea,ta,ia,na,oa,ra,sa,aa,la,ca,ha,da,ua,pa,fa,ma,ga,Oa,va,ba,ya,xa,wa,ka,Sa,Qa,$a,Ta,Pa,_a,Ca,Ma,Za,Ra,Aa,Ea,Da,La,Xa,Na,ja,za,qa,Ia,Wa,Va,Ya,Ba,Ua,Ga,Ha,Fa,Ka,Ja,el,tl,il,nl,ol,rl,sl,al,ll,cl,hl,dl,ul,pl,fl,ml,gl,Ol,vl,bl,yl,xl,wl,kl,Sl,Ql,$l,Tl,Pl,_l,Cl,Ml,Zl,Rl,Al,El,Dl,Ll,Xl,Nl,jl,zl,ql,Il,Wl,Vl,Yl,Bl,Ul,Gl,Hl,Fl,Kl,Jl,ec,tc,ic,nc,oc,rc,sc,ac,lc,cc,hc,dc,uc,pc,fc,mc,gc,Oc,vc,bc,yc,xc,wc,kc,Sc,Qc,$c,Tc,Pc,_c,Cc,Mc,Zc,Rc,Ac,Ec,Dc,Lc,Xc,Nc,jc,zc,qc,Ic,Wc,Vc,Yc,Bc,Uc,Gc,Hc,Fc,Kc,Jc,eh,th,ih,nh,oh,rh,sh,ah,lh,ch,hh,dh,uh,ph,fh,mh,gh,Oh,vh,bh,yh,xh,wh,kh,Sh,Qh,$h,Th,Ph,_h,Ch,Mh,Zh,Rh,Ah,Eh,Dh,Lh,Xh,Nh,jh,zh,qh,Ih,Wh,Vh,Yh,Bh,Uh,Gh,Hh,Fh,Kh,Jh,ed,td,id,nd,od,rd,sd,ad,ld,cd,hd,dd,ud,pd,fd,md,gd,Od,vd,bd,yd,xd,wd,kd,Sd,Qd,$d,Td,Pd,_d,Cd,Md,Zd,Rd,Ad,Ed,Dd,Ld,Xd,Nd,jd,zd,qd,Id,Wd,Vd,Yd,Bd,Ud,Gd,Hd,Fd,Kd,Jd,eu,tu,iu,nu,ou,ru,su,au,lu,cu,hu,du,uu,pu,fu,mu,gu,Ou,vu,bu,yu,xu,wu,ku,Su,Qu,$u,Tu,Pu,_u,Cu,Mu,Zu,Ru,Au,Eu,Du,Lu,Xu,Nu,ju,zu,qu,Iu,Wu,Vu,Yu,Bu,Uu,Gu,Hu,Fu,Ku,Ju,ep,tp,ip,np,op,rp,sp,ap,lp,cp,hp,dp,up,pp,fp,mp,gp,Op,vp,bp,yp,xp,wp,kp,Sp,Qp,$p,Tp,Pp,_p,Cp,Mp,Zp,Rp,Ap,Ep,Dp,Lp,Xp,Np,jp,zp,qp,Ip,Wp,Vp,Yp,Bp,Up,Gp,Hp,Fp,Kp,Jp,ef,tf,nf,of,rf,sf,af,lf,cf,hf,df,uf,pf,ff,mf,gf,Of,vf,bf,yf,xf,wf,kf,Sf,Qf,$f,Tf,Pf,_f,Cf,Mf,Zf,Rf,Af,Ef,Df,Lf,Xf,Nf,jf,zf,qf,If,Wf,Vf,Yf,Bf,Uf,Gf,Hf,Ff,Kf,Jf,em,tm,im,nm,om,rm,sm,am,lm,cm,hm,dm,um,pm,fm,mm,gm,Om,vm,bm,ym,xm,wm,km,Sm,Qm,$m,Tm,Pm,_m,Cm,Mm,Zm,Rm,Am,Em,Dm,Lm,Xm,Nm,jm,zm,qm,Im,Wm,Vm,Ym,Bm,Um,Gm,Hm,Fm,Km,Jm,eg,tg,ig,ng,og,rg,sg,ag,lg,cg,hg,dg,ug,pg,fg,mg,gg,Og,vg,bg,yg,xg,wg,kg,Sg,Qg,$g,Tg,Pg,_g,Cg,Mg,Zg,Rg,Ag,Eg,Dg,Lg,Xg,Ng,jg,zg,qg,Ig,Wg,Vg,Yg,Bg,Ug,Gg,Hg,Fg,Kg,Jg,eO,tO,iO,nO,oO,rO,sO,aO,lO,cO,hO,dO,uO,pO,fO,mO,gO,OO,vO,bO,yO,xO,wO;function kO(e){if(e<768)return!1;for(let t=0,i=Zt.length;;){let n=t+i>>1;if(e<Zt[n])i=n;else{if(!(e>=Rt[n]))return!0;t=n+1}if(t==i)return!1}}function SO(e){return e>=127462&&e<=127487}function QO(e,t,i=!0,n=!0){return(i?$O:TO)(e,t,n)}function $O(e,t,i){if(t==e.length)return t;t&&_O(e.charCodeAt(t))&&CO(e.charCodeAt(t-1))&&t--;let n=PO(e,t);for(t+=MO(n);t<e.length;){let o=PO(e,t);if(n==At||o==At||i&&kO(o))t+=MO(o),n=o;else{if(!SO(o))break;{let i=0,n=t-2;for(;n>=0&&SO(PO(e,n));)i++,n-=2;if(i%2==0)break;t+=2}}}return t}function TO(e,t,i){for(;t>0;){let n=$O(e,t-2,i);if(n<t)return n;t--}return 0}function PO(e,t){let i=e.charCodeAt(t);if(!CO(i)||t+1==e.length)return i;let n=e.charCodeAt(t+1);return _O(n)?n-56320+(i-55296<<10)+65536:i}function _O(e){return e>=56320&&e<57344}function CO(e){return e>=55296&&e<56320}function MO(e){return e<65536?1:2}function ZO(e,t,i=0,n=1e9){for(let o=0,r=0,s=!0;r<e.length&&o<=n;r++){let a=e[r],l=o+a.length;l>=i&&(l>n&&(a=a.slice(0,n-o)),o<i&&(a=a.slice(i-o)),s?(t[t.length-1]+=a,s=!1):t.push(a)),o=l+1}return t}function RO(e,t,i){return ZO(e,[""],t,i)}function AO(e,t,i){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,i))]}function EO(e,t,i=!0,n=!0){return QO(e,t,i,n)}function DO(e,t){let i=e.charCodeAt(t);if(!((n=i)>=55296&&n<56320&&t+1!=e.length))return i;var n;let o=e.charCodeAt(t+1);return function(e){return e>=56320&&e<57344}(o)?o-56320+(i-55296<<10)+65536:i}function LO(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function XO(e){return e<65536?1:2}function NO(e,t,i,n=!1){if(0==t&&i<=0)return;let o=e.length-2;o>=0&&i<=0&&i==e[o+1]?e[o]+=t:o>=0&&0==t&&0==e[o]?e[o+1]+=i:n?(e[o]+=t,e[o+1]+=i):e.push(t,i)}function jO(e,t,i){if(0==i.length)return;let n=t.length-2>>1;if(n<e.length)e[e.length-1]=e[e.length-1].append(i);else{for(;e.length<n;)e.push(Et.empty);e.push(i)}}function zO(e,t,i){let n=e.inserted;for(let o=0,r=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)o+=a,r+=a;else{let c=o,h=r,d=Et.empty;for(;c+=a,h+=l,l&&n&&(d=d.append(n[s-2>>1])),!(i||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(o,c,r,h,d),o=c,r=h}}}function qO(e,t,i,n=!1){let o=[],r=n?[]:null,s=new Yt(e),a=new Yt(t);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);NO(o,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||l==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!i))){let e=a.len;for(NO(o,a.ins,-1);e;){let t=Math.min(s.len,e);s.ins>=0&&l<s.i&&s.len<=t&&(NO(o,0,s.ins),r&&jO(r,o,s.text),l=s.i),s.forward(t),e-=t}a.next()}else{if(!(s.ins>=0)){if(s.done&&a.done)return r?Vt.createSet(o,r):Wt.create(o);throw new Error("Mismatched change set lengths")}{let e=0,t=s.len;for(;t;)if(-1==a.ins){let i=Math.min(t,a.len);e+=i,t-=i,a.forward(i)}else{if(!(0==a.ins&&a.len<t))break;t-=a.len,a.next()}NO(o,e,l<s.i?s.ins:0),r&&l<s.i&&jO(r,o,s.text),l=s.i,s.forward(s.len-t)}}}}function IO(e,t,i=!1){let n=[],o=i?[]:null,r=new Yt(e),s=new Yt(t);for(let a=!1;;){if(r.done&&s.done)return o?Vt.createSet(n,o):Wt.create(n);if(0==r.ins)NO(n,r.len,0,a),r.next();else if(0!=s.len||s.done){if(r.done||s.done)throw new Error("Mismatched change set lengths");{let e=Math.min(r.len2,s.len),t=n.length;if(-1==r.ins){let t=-1==s.ins?-1:s.off?0:s.ins;NO(n,e,t,a),o&&t&&jO(o,n,s.text)}else-1==s.ins?(NO(n,r.off?0:r.len,e,a),o&&jO(o,n,r.textBit(e))):(NO(n,r.off?0:r.len,s.off?0:s.ins,a),o&&!s.off&&jO(o,n,s.text));a=(r.ins>e||s.ins>=0&&s.len>e)&&(a||n.length>t),r.forward2(e),s.forward(e)}}else NO(n,0,s.ins,a),o&&jO(o,n,s.text),s.next()}}function WO(e,t){for(let i of e.ranges)if(i.to>t)throw new RangeError("Selection points outside of document")}function VO(e,t){return e==t||e.length==t.length&&e.every(((e,i)=>e===t[i]))}function YO(e,t,i){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1;return!0}function BO(e,t){let i=!1;for(let n of t)1&HO(e,n)&&(i=!0);return i}function UO(e,t,i){let n=i.map((t=>e[t.id])),o=i.map((e=>e.type)),r=n.filter((e=>!(1&e))),s=e[t.id]>>1;function a(e){let i=[];for(let t=0;t<n.length;t++){let r=FO(e,n[t]);if(2==o[t])for(let e of r)i.push(e);else i.push(r)}return t.combine(i)}return{create(e){for(let t of n)HO(e,t);return e.values[s]=a(e),1},update(e,i){if(!BO(e,r))return 0;let n=a(e);return t.compare(n,e.values[s])?0:(e.values[s]=n,1)},reconfigure(e,o){let r=BO(e,n),l=o.config.facets[t.id],c=o.facet(t);if(l&&!r&&VO(i,l))return e.values[s]=c,0;let h=a(e);return t.compare(h,c)?(e.values[s]=c,0):(e.values[s]=h,1)}}}function GO(e){return t=>new ii(t,e)}function HO(e,t){if(1&t)return 2;let i=t>>1,n=e.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;e.status[i]=4;let o=e.computeSlot(e,e.config.dynamicSlots[i]);return e.status[i]=2|o}function FO(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}function KO(e,t){let i=[];for(let n=0,o=0;;){let r,s;if(n<e.length&&(o==t.length||t[o]>=e[n]))r=e[n++],s=e[n++];else{if(!(o<t.length))return i;r=t[o++],s=t[o++]}!i.length||i[i.length-1]<r?i.push(r,s):i[i.length-1]<s&&(i[i.length-1]=s)}}function JO(e,t,i){var n;let o,r,s;return i?(o=t.changes,r=Vt.empty(t.changes.length),s=e.changes.compose(t.changes)):(o=t.changes.map(e.changes),r=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(o)),{changes:s,selection:t.selection?t.selection.map(r):null===(n=e.selection)||void 0===n?void 0:n.map(o),effects:gi.mapEffects(e.effects,o).concat(gi.mapEffects(t.effects,r)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function ev(e,t,i){let n=t.selection,o=iv(t.annotations);return t.userEvent&&(o=o.concat(Oi.userEvent.of(t.userEvent))),{changes:t.changes instanceof Vt?t.changes:Vt.of(t.changes||[],i,e.facet(li)),selection:n&&(n instanceof Ut?n:Ut.single(n.anchor,n.head)),effects:iv(t.effects),annotations:o,scrollIntoView:!!t.scrollIntoView}}function tv(e,t,i){let n=ev(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(i=!1);for(let r=1;r<t.length;r++){!1===t[r].filter&&(i=!1);let o=!!t[r].sequential;n=JO(n,ev(e,t[r],o?n.changes.newLength:e.doc.length),o)}let o=Oi.create(e,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return function(e){let t=e.startState,i=t.facet(di),n=e;for(let o=i.length-1;o>=0;o--){let r=i[o](e);r&&Object.keys(r).length&&(n=JO(n,ev(t,r,e.changes.newLength),!0))}return n==e?e:Oi.create(t,e.changes,e.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(e){let t=e.startState,i=!0;for(let o of t.facet(ci)){let t=o(e);if(!1===t){i=!1;break}Array.isArray(t)&&(i=!0===i?t:KO(i,t))}if(!0!==i){let n,o;if(!1===i)o=e.changes.invertedDesc,n=Vt.empty(t.doc.length);else{let t=e.changes.filter(i);n=t.changes,o=t.filtered.mapDesc(t.changes).invertedDesc}e=Oi.create(t,n,e.selection&&e.selection.map(o),gi.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let n=t.facet(hi);for(let o=n.length-1;o>=0;o--){let i=n[o](e);e=i instanceof Oi?i:Array.isArray(i)&&1==i.length&&i[0]instanceof Oi?i[0]:tv(t,iv(i),!1)}return e}(o):o)}function iv(e){return null==e?vi:Array.isArray(e)?e:[e]}function nv(e){return t=>{if(!/\S/.test(t))return bi.Space;if(function(e){if(xi)return xi.test(e);for(let t=0;t<e.length;t++){let i=e[t];if(/\w/.test(i)||i>""&&(i.toUpperCase()!=i.toLowerCase()||yi.test(i)))return!0}return!1}(t))return bi.Word;for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>-1)return bi.Word;return bi.Other}}function ov(e,t,i={}){let n={};for(let o of e)for(let e of Object.keys(o)){let t=o[e],r=n[e];if(void 0===r)n[e]=t;else if(r===t||void 0===t);else{if(!Object.hasOwnProperty.call(i,e))throw new Error("Config merge conflict for field "+e);n[e]=i[e](r,t)}}for(let o in t)void 0===n[o]&&(n[o]=t[o]);return n}function rv(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}function sv(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}function av(e,t,i){let n=new Map;for(let r of e)for(let e=0;e<r.chunk.length;e++)r.chunk[e].maxPoint<=0&&n.set(r.chunk[e],r.chunkPos[e]);let o=new Set;for(let r of t)for(let e=0;e<r.chunk.length;e++){let t=n.get(r.chunk[e]);null==t||(i?i.mapPos(t):t)!=r.chunkPos[e]||(null==i?void 0:i.touchesRange(t,t+r.chunk[e].length))||o.add(r.chunk[e])}return o}function lv(e,t){for(let i=e[t];;){let n=1+(t<<1);if(n>=e.length)break;let o=e[n];if(n+1<e.length&&o.compare(e[n+1])>=0&&(o=e[n+1],n++),i.compare(o)<0)break;e[n]=i,e[t]=o,t=n}}function cv(e,t,i,n,o,r){e.goto(t),i.goto(n);let s=n+o,a=n,l=n-t,c=!!r.boundChange;for(let h=!1;;){let t=e.to+l-i.to,n=t||e.endSide-i.endSide,o=n<0?e.to+l:i.to,d=Math.min(o,s);if(e.point||i.point?(e.point&&i.point&&rv(e.point,i.point)&&hv(e.activeForPoint(e.to),i.activeForPoint(i.to))||r.comparePoint(a,d,e.point,i.point),h=!1):(h&&r.boundChange(a),d>a&&!hv(e.active,i.active)&&r.compareRange(a,d,e.active,i.active),c&&d<s&&(t||e.openEnd(o)!=i.openEnd(o))&&(h=!0)),o>s)break;a=o,n<=0&&e.next(),n>=0&&i.next()}}function hv(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!=t[i]&&!rv(e[i],t[i]))return!1;return!0}function dv(e,t){for(let i=t,n=e.length-1;i<n;i++)e[i]=e[i+1];e.pop()}function uv(e,t,i){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=i}function pv(e,t){let i=-1,n=1e9;for(let o=0;o<t.length;o++)(t[o]-n||e[o].endSide-e[i].endSide)<0&&(i=o,n=t[o]);return i}function fv(e,t,i=e.length){let n=0;for(let o=0;o<i&&o<e.length;)9==e.charCodeAt(o)?(n+=t-n%t,o++):(n++,o=EO(e,o));return n}function mv(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var o=i[n];"string"==typeof o?e.setAttribute(n,o):null!=o&&(e[n]=o)}t++}for(;t<arguments.length;t++)gv(e,arguments[t]);return e}function gv(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var i=0;i<t.length;i++)gv(e,t[i])}}function Ov(e,t){for(let i in e)"class"==i&&t.class?t.class+=" "+e.class:"style"==i&&t.style?t.style+=";"+e.style:t[i]=e[i];return t}function vv(e,t,i){if(e==t)return!0;e||(e=nn),t||(t=nn);let n=Object.keys(e),o=Object.keys(t);if(n.length-(i&&n.indexOf(i)>-1?1:0)!=o.length-(i&&o.indexOf(i)>-1?1:0))return!1;for(let r of n)if(r!=i&&(-1==o.indexOf(r)||e[r]!==t[r]))return!1;return!0}function bv(e,t,i){let n=!1;if(t)for(let o in t)i&&o in i||(n=!0,"style"==o?e.style.cssText="":e.removeAttribute(o));if(i)for(let o in i)t&&t[o]==i[o]||(n=!0,"style"==o?e.style.cssText=i[o]:e.setAttribute(o,i[o]));return n}function yv(e){let t=Object.create(null);for(let i=0;i<e.attributes.length;i++){let n=e.attributes[i];t[n.name]=n.value}return t}function xv(e,t=!1){let{inclusiveStart:i,inclusiveEnd:n}=e;return null==i&&(i=e.inclusive),null==n&&(n=e.inclusive),{start:null!=i?i:t,end:null!=n?n:t}}function wv(e,t,i,n=0){let o=i.length-1;o>=0&&i[o]+n>=e?i[o]=Math.max(i[o],t):i.push(e,t)}function kv(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Sv(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function Qv(e,t){if(!t.anchorNode)return!1;try{return Sv(e,t.anchorNode)}catch(i){return!1}}function $v(e){return 3==e.nodeType?Dv(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function Tv(e,t,i,n){return!!i&&(Cv(e,t,i,n,-1)||Cv(e,t,i,n,1))}function Pv(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function _v(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Cv(e,t,i,n,o){for(;;){if(e==i&&t==n)return!0;if(t==(o<0?0:Mv(e))){if("DIV"==e.nodeName)return!1;let i=e.parentNode;if(!i||1!=i.nodeType)return!1;t=Pv(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(o<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=o<0?Mv(e):0}}}function Mv(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Zv(e,t){let i=t?e.left:e.right;return{left:i,right:i,top:e.top,bottom:e.bottom}}function Rv(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function Av(e,t){let i=t.width/e.offsetWidth,n=t.height/e.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.width-e.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.height-e.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function Ev(e){if(e.setActive)return e.setActive();if(un)return e.focus(un);let t=[];for(let i=e;i&&(t.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(e.focus(null==un?{get preventScroll(){return un={preventScroll:!0},!0}}:void 0),!un){un=!1;for(let e=0;e<t.length;){let i=t[e++],n=t[e++],o=t[e++];i.scrollTop!=n&&(i.scrollTop=n),i.scrollLeft!=o&&(i.scrollLeft=o)}}}function Dv(e,t,i=t){let n=pn||(pn=document.createRange());return n.setEnd(e,i),n.setStart(e,t),n}function Lv(e,t,i,n){let o={key:t,code:t,keyCode:i,which:i,cancelable:!0};n&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=n);let r=new KeyboardEvent("keydown",o);r.synthetic=!0,e.dispatchEvent(r);let s=new KeyboardEvent("keyup",o);return s.synthetic=!0,e.dispatchEvent(s),r.defaultPrevented||s.defaultPrevented}function Xv(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Nv(e,t){for(let i=e,n=t;;){if(3==i.nodeType&&n>0)return{node:i,offset:n};if(1==i.nodeType&&n>0){if("false"==i.contentEditable)return null;i=i.childNodes[n-1],n=Mv(i)}else{if(!i.parentNode||_v(i))return null;n=Pv(i),i=i.parentNode}}}function jv(e,t){for(let i=e,n=t;;){if(3==i.nodeType&&n<i.nodeValue.length)return{node:i,offset:n};if(1==i.nodeType&&n<i.childNodes.length){if("false"==i.contentEditable)return null;i=i.childNodes[n],n=0}else{if(!i.parentNode||_v(i))return null;n=Pv(i)+1,i=i.parentNode}}}function zv(e){let t=[];for(let i=0;i<e.length;i++)t.push(1<<+e[i]);return t}function qv(e){return e<=247?vn[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?bn[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}function Iv(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let n=e[i],o=t[i];if(n.from!=o.from||n.to!=o.to||n.direction!=o.direction||!Iv(n.inner,o.inner))return!1}return!0}function Wv(e,t,i,n,o,r,s){let a=n%2?2:1;if(n%2==o%2)for(let l=t,c=0;l<i;){let t=!0,h=!1;if(c==r.length||l<r[c].from){let e=Sn[l];e!=a&&(t=!1,h=16==e)}let d=t||1!=a?null:[],u=t?n:n+1,p=l;e:for(;;)if(c<r.length&&p==r[c].from){if(h)break e;let f=r[c];if(!t)for(let e=f.to,t=c+1;;){if(e==i)break e;if(!(t<r.length&&r[t].from==e)){if(Sn[e]==a)break e;break}e=r[t++].to}c++,d?d.push(f):(f.from>l&&s.push(new kn(l,f.from,u)),Vv(e,f.direction==gn!=!(u%2)?n+1:n,o,f.inner,f.from,f.to,s),l=f.to),p=f.to}else{if(p==i||(t?Sn[p]!=a:Sn[p]==a))break;p++}d?Wv(e,l,p,n+1,o,d,s):l<p&&s.push(new kn(l,p,u)),l=p}else for(let l=i,c=r.length;l>t;){let i=!0,h=!1;if(!c||l>r[c-1].to){let e=Sn[l-1];e!=a&&(i=!1,h=16==e)}let d=i||1!=a?null:[],u=i?n:n+1,p=l;e:for(;;)if(c&&p==r[c-1].to){if(h)break e;let f=r[--c];if(!i)for(let e=f.from,i=c;;){if(e==t)break e;if(!i||r[i-1].to!=e){if(Sn[e-1]==a)break e;break}e=r[--i].from}d?d.push(f):(f.to<l&&s.push(new kn(f.to,l,u)),Vv(e,f.direction==gn!=!(u%2)?n+1:n,o,f.inner,f.from,f.to,s),l=f.from),p=f.from}else{if(p==t||(i?Sn[p-1]!=a:Sn[p-1]==a))break;p--}d?Wv(e,p,l,n+1,o,d,s):p<l&&s.push(new kn(p,l,u)),l=p}}function Vv(e,t,i,n,o,r,s){let a=t%2?2:1;!function(e,t,i,n,o){for(let r=0;r<=n.length;r++){let s=r?n[r-1].to:t,a=r<n.length?n[r].from:i,l=r?256:o;for(let t=s,i=l,n=l;t<a;t++){let o=qv(e.charCodeAt(t));512==o?o=i:8==o&&4==n&&(o=16),Sn[t]=4==o?2:o,7&o&&(n=o),i=o}for(let e=s,t=l,n=l;e<a;e++){let o=Sn[e];if(128==o)e<a-1&&t==Sn[e+1]&&24&t?o=Sn[e]=t:Sn[e]=256;else if(64==o){let o=e+1;for(;o<a&&64==Sn[o];)o++;let r=e&&8==t||o<i&&8==Sn[o]?1==n?1:8:256;for(let t=e;t<o;t++)Sn[t]=r;e=o-1}else 8==o&&1==n&&(Sn[e]=1);t=o,7&o&&(n=o)}}}(e,o,r,n,a),function(e,t,i,n,o){let r=1==o?2:1;for(let s=0,a=0,l=0;s<=n.length;s++){let c=s?n[s-1].to:t,h=s<n.length?n[s].from:i;for(let t,i,n,s=c;s<h;s++)if(i=yn[t=e.charCodeAt(s)])if(i<0){for(let e=a-3;e>=0;e-=3)if(xn[e+1]==-i){let t=xn[e+2],i=2&t?o:4&t?1&t?r:o:0;i&&(Sn[s]=Sn[xn[e]]=i),a=e;break}}else{if(189==xn.length)break;xn[a++]=s,xn[a++]=t,xn[a++]=l}else if(2==(n=Sn[s])||1==n){let e=n==o;l=e?0:1;for(let t=a-3;t>=0;t-=3){let i=xn[t+2];if(2&i)break;if(e)xn[t+2]|=2;else{if(4&i)break;xn[t+2]|=4}}}}}(e,o,r,n,a),function(e,t,i,n){for(let o=0,r=n;o<=i.length;o++){let s=o?i[o-1].to:e,a=o<i.length?i[o].from:t;for(let l=s;l<a;){let s=Sn[l];if(256==s){let s=l+1;for(;;)if(s==a){if(o==i.length)break;s=i[o++].to,a=o<i.length?i[o].from:t}else{if(256!=Sn[s])break;s++}let c=1==r,h=c==(1==(s<t?Sn[s]:n))?c?1:2:n;for(let t=s,n=o,r=n?i[n-1].to:e;t>l;)t==r&&(t=i[--n].from,r=n?i[n-1].to:e),Sn[--t]=h;l=s}else r=s,l++}}}(o,r,n,a),Wv(e,o,r,t,i,n,s)}function Yv(e){return[new kn(0,e,0)]}function Bv(e,t,i,n,o){var r;let s=n.head-e.from,a=kn.find(t,s,null!==(r=n.bidiLevel)&&void 0!==r?r:-1,n.assoc),l=t[a],c=l.side(o,i);if(s==c){let e=a+=o?1:-1;if(e<0||e>=t.length)return null;l=t[a=e],s=l.side(!o,i),c=l.side(o,i)}let h=EO(e.text,s,l.forward(o,i));(h<l.from||h>l.to)&&(h=c),Qn=e.text.slice(Math.min(s,h),Math.max(s,h));let d=a==(o?t.length-1:0)?null:t[a+(o?1:-1)];return d&&h==c&&d.level+(o?0:1)<l.level?Ut.cursor(d.side(!o,i)+e.from,d.forward(o,i)?1:-1,d.level):Ut.cursor(h+e.from,l.forward(o,i)?-1:1,l.level)}function Uv(e,t,i){for(let n=t;n<i;n++){let t=qv(e.charCodeAt(n));if(1==t)return gn;if(2==t||4==t)return On}return gn}function Gv(e,t,i){let n=e.facet(_n);n.length?n[0](t):window.onerror&&window.onerror(String(t),i,void 0,void 0,t)||(i?console.error(i+":",t):console.error(t))}function Hv(e,t){let i=e.state.facet(Kn);if(!i.length)return i;let n=i.map((t=>t instanceof Function?t(e):t)),o=[];return $i.spans(n,t.from,t.to,{point(){},span(e,i,n,r){let s=e-t.from,a=i-t.from,l=o;for(let o=n.length-1;o>=0;o--,r--){let e,i=n[o].spec.bidiIsolate;if(null==i&&(i=Uv(t.text,s,a)),r>0&&l.length&&(e=l[l.length-1]).to==s&&e.direction==i)e.to=a,l=e.inner;else{let e={from:s,to:a,direction:i,inner:[]};l.push(e),l=e.inner}}}}),o}function Fv(e){let t=0,i=0,n=0,o=0;for(let r of e.state.facet(Jn)){let s=r(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(i=Math.max(i,s.right)),null!=s.top&&(n=Math.max(n,s.top)),null!=s.bottom&&(o=Math.max(o,s.bottom)))}return{left:t,right:i,top:n,bottom:o}}function Kv(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}function Jv(e,t){let i=e.coordsIn(0,1),n=t.coordsIn(0,1);return i&&n&&n.top<i.bottom}function eb(e,t){let i=e=>{for(let n of e.children)if((t?n.isText():n.length)||i(n))return!0;return!1};return i(e)}function tb(e){let t=oo.get(e);return t&&t.setDOM(e.cloneNode()),e}function ib(e,t){let i=null==t?void 0:t.get(e);if(1!=i){null==i&&e.destroy();for(let i of e.children)ib(i,t)}}function nb(e,t){let i=e.observer.selectionRange;if(!i.focusNode)return null;let n=Nv(i.focusNode,i.focusOffset),o=jv(i.focusNode,i.focusOffset),r=n||o;if(o&&n&&o.node!=n.node){let t=oo.get(o.node);if(!t||t.isText()&&t.text!=o.node.nodeValue)r=o;else if(e.docView.lastCompositionAfterCursor){let e=oo.get(n.node);!e||e.isText()&&e.text!=n.node.nodeValue||(r=o)}}if(e.docView.lastCompositionAfterCursor=r!=n,!r)return null;let s=t-r.offset;return{from:s,to:s+r.node.nodeValue.length,node:r.node}}function ob(e,t,i,n,o){let r=Math.round((n-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&i.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;r+=Math.floor((o-i.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(i.from,i.to);return i.from+function(e,t,i,n){for(let o=0,r=0;;){if(r>=t)return o;if(o==e.length)break;r+=9==e.charCodeAt(o)?i-r%i:1,o=EO(e,o)}return!0===n?-1:e.length}(s,r,e.state.tabSize)}function rb(e,t,i){let n=e.lineBlockAt(t);if(Array.isArray(n.type)){let e;for(let o of n.type){if(o.from>t)break;if(!(o.to<t)){if(o.from<t&&o.to>t)return o;e&&(o.type!=rn.Text||e.type==o.type&&!(i<0?o.from<t:o.to>t))||(e=o)}}return e||n}return n}function sb(e,t,i,n){let o=e.state.doc.lineAt(t.head),r=e.bidiSpans(o),s=e.textDirectionAt(o.from);for(let a=t,l=null;;){let t=Bv(o,r,s,a,i),c=Qn;if(!t){if(o.number==(i?e.state.doc.lines:1))return a;c="\n",o=e.state.doc.line(o.number+(i?1:-1)),r=e.bidiSpans(o),t=e.visualLineSide(o,!i)}if(l){if(!l(c))return a}else{if(!n)return t;l=n(c)}a=t}}function ab(e,t,i){for(;;){let n=0;for(let o of e)o.between(t-1,t+1,((e,o,r)=>{if(t>e&&t<o){let r=n||i||(t-e<o-t?-1:1);t=r<0?e:o,n=r}}));if(!n)return t}}function lb(e,t){let i=null;for(let n=0;n<t.ranges.length;n++){let o=t.ranges[n],r=null;if(o.empty){let t=ab(e,o.from,0);t!=o.from&&(r=Ut.cursor(t,-1))}else{let t=ab(e,o.from,-1),i=ab(e,o.to,1);t==o.from&&i==o.to||(r=Ut.range(o.from==o.anchor?t:i,o.from==o.head?t:i))}r&&(i||(i=t.ranges.slice()),i[n]=r)}return i?Ut.create(i,t.mainIndex):t}function cb(e,t,i){let n=ab(e.state.facet(Fn).map((t=>t(e))),i.from,t.head>i.from?-1:1);return n==i.from?i:Ut.cursor(n,n<i.from?1:-1)}function hb(e,t,i,n){let o,r=e.contentDOM.getBoundingClientRect(),s=r.top+e.viewState.paddingTop,{x:a,y:l}=t,c=l-s;for(;;){if(c<0)return new Po(0,1);if(c>e.viewState.docHeight)return new Po(e.state.doc.length,-1);if(o=e.elementAtHeight(c),null==n)break;if(o.type==rn.Text){let t=e.docView.coordsAt(n<0?o.from:o.to,n);if(t&&(n<0?t.top<=c+s:t.bottom>=c+s))break}let t=e.viewState.heightOracle.textHeight/2;c=n>0?o.bottom+t:o.top-t}if(e.viewport.from>=o.to||e.viewport.to<=o.from){if(i)return null;if(o.type==rn.Text){let t=ob(e,r,o,a,l);return new Po(t,t==o.from?1:-1)}}if(o.type!=rn.Text)return c<(o.top+o.bottom)/2?new Po(o.from,1):new Po(o.to,-1);let h=e.docView.lineAt(o.from,2);return h&&h.length==o.length||(h=e.docView.lineAt(o.from,-2)),db(e,h,o.from,a,l)}function db(e,t,i,n,o){let r=-1,s=null,a=1e9,l=1e9,c=o,h=o,d=(e,t)=>{for(let i=0;i<e.length;i++){let d=e[i];if(d.top==d.bottom)continue;let u=d.left>n?d.left-n:d.right<n?n-d.right:0,p=d.top>o?d.top-o:d.bottom<o?o-d.bottom:0;d.top<=h&&d.bottom>=c&&(c=Math.min(d.top,c),h=Math.max(d.bottom,h),p=0),(r<0||(p-l||u-a)<0)&&(r>=0&&l&&a<u&&s.top<=h-2&&s.bottom>=c+2?l=0:(r=t,a=u,l=p,s=d))}};if(t.isText()){for(let e=0;e<t.length;){let i=EO(t.text,e);if(d(Dv(t.dom,e,i).getClientRects(),e),!a&&!l)break;e=i}return n>(s.left+s.right)/2==(ub(e,r+i)==mn.LTR)?new Po(i+EO(t.text,r),-1):new Po(i+r,1)}{if(!t.length)return new Po(i,1);for(let e=0;e<t.children.length;e++){let i=t.children[e];if(!(48&i.flags||(d((1==i.dom.nodeType?i.dom:Dv(i.dom,0,i.length)).getClientRects(),e),a||l)))break}let c=t.children[r],h=t.posBefore(c,i);return c.isComposite()||c.isText()?db(e,c,h,Math.max(s.left,Math.min(s.right,n)),o):n>(s.left+s.right)/2==(ub(e,r+i)==mn.LTR)?new Po(h+c.length,-1):new Po(h,1)}}function ub(e,t){let i=e.state.doc.lineAt(t);return e.bidiSpans(i)[kn.find(e.bidiSpans(i),t-i.from,-1,1)].dir}function pb(e,t,i){for(;;){if(!t||i<Mv(t))return!1;if(t==e)return!0;i=Pv(t)+1,t=t.parentNode}}function fb(e,t){let i;for(;e!=t&&e;e=e.nextSibling){let t=oo.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(i||(i=[])).push(t)}if(i)for(let n of i){let e=n.overrideDOMText;if(null==e?void 0:e.length)return!1}return!0}function mb(e,t,i,n){if(e.isComposite()){let o=-1,r=-1,s=-1,a=-1;for(let l=0,c=n,h=n;l<e.children.length;l++){let n=e.children[l],d=c+n.length;if(c<t&&d>i)return mb(n,t,i,c);if(d>=t&&-1==o&&(o=l,r=c),c>i&&n.dom.parentNode==e.dom){s=l,a=h;break}h=d,c=d+n.breakAfter}return{from:r,to:a<0?n+e.length:a,startDOM:(o?e.children[o-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:s<e.children.length&&s>=0?e.children[s].dom:null}}return e.isText()?{from:n,to:n+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function gb(e,t){let i,{newSel:n}=t,o=e.state.selection.main,r=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:n,to:s}=t.bounds,a=o.from,l=null;(8===r||tn.android&&t.text.length<s-n)&&(a=o.to,l="end");let c=vb(e.state.doc.sliceString(n,s,_o),t.text,a-n,l);c&&(tn.chrome&&13==r&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==_o+_o&&c.toB--,i={from:n+c.from,to:n+c.toA,insert:Et.of(t.text.slice(c.from,c.toB).split(_o))})}else n&&(!e.hasFocus&&e.state.facet(zn)||n.main.eq(o))&&(n=null);if(!i&&!n)return!1;if(!i&&t.typeOver&&!o.empty&&n&&n.main.empty?i={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,o.to)}:(tn.mac||tn.android)&&i&&i.from==i.to&&i.from==o.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(n&&2==i.insert.length&&(n=Ut.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:Et.of([i.insert.toString().replace("."," ")])}):i&&i.from>=o.from&&i.to<=o.to&&(i.from!=o.from||i.to!=o.to)&&o.to-o.from-(i.to-i.from)<=4?i={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,i.from).append(i.insert).append(e.state.doc.slice(i.to,o.to))}:e.state.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?i={from:o.from,to:o.to,insert:e.state.toText(e.inputState.insertingText)}:tn.chrome&&i&&i.from==i.to&&i.from==o.head&&"\n "==i.insert.toString()&&e.lineWrapping&&(n&&(n=Ut.single(n.main.anchor-1,n.main.head-1)),i={from:o.from,to:o.to,insert:Et.of([" "])}),i)return Ob(e,i,n,r);if(n&&!n.main.eq(o)){let t=!1,i="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),i=e.inputState.lastSelectionOrigin,"select.pointer"==i&&(n=lb(e.state.facet(Fn).map((t=>t(e))),n))),e.dispatch({selection:n,scrollIntoView:t,userEvent:i}),!0}return!1}function Ob(e,t,i,n=-1){if(tn.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(tn.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&Lv(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==n&&t.insert.length<t.to-t.from&&t.to>o.head)&&Lv(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&Lv(e.contentDOM,"Delete",46)))return!0;let r,s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>r||(r=function(e,t,i){let n,o=e.state,r=o.selection.main,s=-1;if(t.from==t.to&&t.from<r.from||t.from>r.to){let i=t.from<r.from?-1:1,n=i<0?r.from:r.to,a=ab(o.facet(Fn).map((t=>t(e))),n,i);t.from==a&&(s=a)}if(s>-1)n={changes:t,selection:Ut.cursor(t.from+t.insert.length,-1)};else if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let i=r.from<t.from?o.sliceDoc(r.from,t.from):"",s=r.to>t.to?o.sliceDoc(t.to,r.to):"";n=o.replaceSelection(e.state.toText(i+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=o.changes(t),a=i&&i.main.to<=s.newLength?i.main:void 0;if(o.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=r.to+10&&t.to>=r.to-10){let l,c=e.state.sliceDoc(t.from,t.to),h=i&&nb(e,i.main.head);if(h){let e=t.insert.length-(t.to-t.from);l={from:h.from,to:h.to-e}}else l=e.state.doc.lineAt(r.head);let d=r.to-t.to;n=o.changeByRange((i=>{if(i.from==r.from&&i.to==r.to)return{changes:s,range:a||i.map(s)};let n=i.to-d,h=n-c.length;if(e.state.sliceDoc(h,n)!=c||n>=l.from&&h<=l.to)return{range:i};let u=o.changes({from:h,to:n,insert:t.insert}),p=i.to-r.to;return{changes:u,range:a?Ut.range(Math.max(0,a.anchor+p),Math.max(0,a.head+p)):i.map(u)}}))}else n={changes:s,selection:a&&o.selection.replaceRange(a)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),o.update(n,{userEvent:a,scrollIntoView:!0})}(e,t,i));return e.state.facet(Mn).some((i=>i(e,t.from,t.to,s,a)))||e.dispatch(a()),!0}function vb(e,t,i,n){let o=Math.min(e.length,t.length),r=0;for(;r<o&&e.charCodeAt(r)==t.charCodeAt(r);)r++;if(r==o&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;return"end"==n&&(i-=s+Math.max(0,r-Math.min(s,a))-r),s<r&&e.length<t.length?(r-=i<=r&&i>=s?r-i:0,a=r+(a-s),s=r):a<r&&(r-=i<=r&&i>=a?r-i:0,s=r+(s-a),a=r),{from:r,toA:s,toB:a}}function bb(e,t){return(i,n)=>{try{return t.call(e,n,i)}catch(o){Gv(i.state,o)}}}function yb(e){return.7*Math.max(0,e)+8}function xb(e,t,i){for(let n of e.facet(t))i=n(i,e);return i}function wb(e,t){t=xb(e.state,Rn,t);let i,{state:n}=e,o=1,r=n.toText(t),s=r.lines==n.selection.ranges.length;if(null!=Vo&&n.selection.ranges.every((e=>e.empty))&&Vo==r.toString()){let e=-1;i=n.changeByRange((i=>{let a=n.doc.lineAt(i.from);if(a.from==e)return{range:i};e=a.from;let l=n.toText((s?r.line(o++).text:t)+n.lineBreak);return{changes:{from:a.from,insert:l},range:Ut.cursor(i.from+l.length)}}))}else i=s?n.changeByRange((e=>{let t=r.line(o++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Ut.cursor(e.from+t.length)}})):n.replaceSelection(r);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function kb(e,t,i,n){if(1==n)return Ut.cursor(t,i);if(2==n)return function(e,t,i=1){let n=e.charCategorizer(t),o=e.doc.lineAt(t),r=t-o.from;if(0==o.length)return Ut.cursor(t);0==r?i=1:r==o.length&&(i=-1);let s=r,a=r;i<0?s=EO(o.text,r,!1):a=EO(o.text,r);let l=n(o.text.slice(s,a));for(;s>0;){let e=EO(o.text,s,!1);if(n(o.text.slice(e,s))!=l)break;s=e}for(;a<o.length;){let e=EO(o.text,a);if(n(o.text.slice(a,e))!=l)break;a=e}return Ut.range(s+o.from,a+o.from)}(e.state,t,i);{let n=e.docView.lineAt(t,i),o=e.state.doc.lineAt(n?n.posAtEnd:t),r=n?n.posAtStart:o.from,s=n?n.posAtEnd:o.to;return s<e.state.doc.length&&s==o.to&&s++,Ut.range(r,s)}}function Sb(e){if(!zo)return e.detail;let t=qo,i=Wo;return qo=e,Wo=Date.now(),Io=!t||i>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Io+1)%3:1}function Qb(e,t){let i=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),n=Sb(t),o=e.state.selection;return{update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),o=o.map(e.changes))},get(t,r,s){let a,l=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c=kb(e,l.pos,l.assoc,n);if(i.pos!=l.pos&&!r){let t=kb(e,i.pos,i.assoc,n),o=Math.min(t.from,c.from),r=Math.max(t.to,c.to);c=o<c.from?Ut.range(o,r):Ut.range(r,o)}return r?o.replaceRange(o.main.extend(c.from,c.to)):s&&1==n&&o.ranges.length>1&&(a=function(e,t){for(let i=0;i<e.ranges.length;i++){let{from:n,to:o}=e.ranges[i];if(n<=t&&o>=t)return Ut.create(e.ranges.slice(0,i).concat(e.ranges.slice(i+1)),e.mainIndex==i?0:e.mainIndex-(e.mainIndex>i?1:0))}return null}(o,l.pos))?a:s?o.addRange(c):Ut.create([c])}}}function $b(e,t,i,n){if(!(i=xb(e.state,Rn,i)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=e.inputState,s=n&&r&&function(e,t){let i=e.state.facet(Tn);return i.length?i[0](t):tn.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:r.from,to:r.to}:null,a={from:o,insert:i},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(o,-1),head:l.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}function Tb(e,t){let i=[];for(let n of e.facet(Zn)){let o=n(e,t);o&&i.push(o)}return i.length?e.update({effects:i,annotations:Yo.of(!0)}):null}function Pb(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let i=Tb(e.state,t);i?e.dispatch(i):e.update([])}}),10)}function _b(){Go=!1}function Cb(e,t){return e==t?e:(e.constructor!=t.constructor&&(Go=!0),t)}function Mb(e,t){let i,n;null==e[t]&&(i=e[t-1])instanceof rr&&(n=e[t+1])instanceof rr&&e.splice(t-1,3,new rr(i.length+1+n.length))}function Zb(e,t){let i=e.getBoundingClientRect(),n=e.ownerDocument,o=n.defaultView||window,r=Math.max(0,i.left),s=Math.min(o.innerWidth,i.right),a=Math.max(0,i.top),l=Math.min(o.innerHeight,i.bottom);for(let c=e.parentNode;c&&c!=n.body;)if(1==c.nodeType){let t=c,i=window.getComputedStyle(t);if((t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=i.overflow){let i=t.getBoundingClientRect();r=Math.max(r,i.left),s=Math.min(s,i.right),a=Math.max(a,i.top),l=Math.min(c==e.parentNode?o.innerHeight:l,i.bottom)}c="absolute"==i.position||"fixed"==i.position?t.offsetParent:t.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:r-i.left,right:Math.max(r,s)-i.left,top:a-(i.top+t),bottom:Math.max(a,l)-(i.top+t)}}function Rb(e,t){let i=e.getBoundingClientRect();return{left:0,right:i.right-i.left,top:t,bottom:i.bottom-(i.top+t)}}function Ab({total:e,ranges:t},i){if(i<=0)return t[0].from;if(i>=1)return t[t.length-1].to;let n=Math.floor(e*i);for(let o=0;;o++){let{from:e,to:i}=t[o],r=i-e;if(n<=r)return e+n;n-=r}}function Eb(e,t){let i=0;for(let{from:n,to:o}of e.ranges){if(t<=o){i+=t-n;break}i+=o-n}return i/e.total}function Db(e,t){if(1==t.scale)return e;let i=t.toDOM(e.top),n=t.toDOM(e.bottom);return new Ko(e.from,e.length,i,n-i,Array.isArray(e._content)?e._content.map((e=>Db(e,t))):e._content)}function Lb(e,t,i){return new Ai(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]})):e+" "+t})}function Xb(e,t,i){for(;t;){let n=oo.get(t);if(n&&n.parent==e)return n;let o=t.parentNode;t=o!=e.dom?o:i>0?t.nextSibling:t.previousSibling}return null}function Nb(e,t){let i=t.startContainer,n=t.startOffset,o=t.endContainer,r=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return Tv(s.node,s.offset,o,r)&&([i,n,o,r]=[o,r,i,n]),{anchorNode:i,anchorOffset:n,focusNode:o,focusOffset:r}}function jb(e,t,i){for(let n=e.state.facet(t),o=n.length-1;o>=0;o--){let t=n[o],r="function"==typeof t?t(e):t;r&&Ov(r,i)}return i}function zb(e,t,i){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==i&&t.shiftKey&&(e="Shift-"+e),e}function qb(e){let t=e.facet(Zr),i=Rr.get(t);return i||Rr.set(t,i=function(e,t=Cr){let i=Object.create(null),n=Object.create(null),o=(e,t)=>{let i=n[e];if(null==i)n[e]=t;else if(i!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},r=(e,n,r,s,a)=>{var l,c;let h=i[e]||(i[e]=Object.create(null)),d=n.split(/ (?!$)/).map((e=>function(e,t){const i=e.split(/-(?!$)/);let n,o,r,s,a=i[i.length-1];"Space"==a&&(a=" ");for(let l=0;l<i.length-1;++l){const e=i[l];if(/^(cmd|meta|m)$/i.test(e))s=!0;else if(/^a(lt)?$/i.test(e))n=!0;else if(/^(c|ctrl|control)$/i.test(e))o=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);"mac"==t?s=!0:o=!0}}return n&&(a="Alt-"+a),o&&(a="Ctrl-"+a),s&&(a="Meta-"+a),r&&(a="Shift-"+a),a}(e,t)));for(let t=1;t<d.length;t++){let i=d.slice(0,t).join(" ");o(i,!0),h[i]||(h[i]={preventDefault:!0,stopPropagation:!1,run:[t=>{let n=Ar={view:t,prefix:i,scope:e};return setTimeout((()=>{Ar==n&&(Ar=null)}),Er),!0}]})}let u=d.join(" ");o(u,!1);let p=h[u]||(h[u]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=h._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});r&&p.run.push(r),s&&(p.preventDefault=!0),a&&(p.stopPropagation=!0)};for(let s of e){let e=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let t of e){let e=i[t]||(i[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:n}=s;for(let t in e)e[t].run.push((e=>n(e,Dr)))}let n=s[t]||s.key;if(n)for(let t of e)r(t,n,s.run,s.preventDefault,s.stopPropagation),s.shift&&r(t,"Shift-"+n,s.shift,s.preventDefault,s.stopPropagation)}return i}(t.reduce(((e,t)=>e.concat(t)),[]))),i}function Ib(e,t,i,n){Dr=t;let o=function(e){var t=!(qi&&(e.ctrlKey||e.altKey||e.metaKey)||zi&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Xi:Li)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),r=XO(DO(o,0))==o.length&&" "!=o,s="",a=!1,l=!1,c=!1;Ar&&Ar.view==i&&Ar.scope==n&&(s=Ar.prefix+" ",Do.indexOf(t.keyCode)<0&&(l=!0,Ar=null));let h,d,u=new Set,p=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(i)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),l=!0)}return!1},f=e[n];return f&&(p(f[s+zb(o,t,!r)])?a=!0:!r||!(t.altKey||t.metaKey||t.ctrlKey)||tn.windows&&t.ctrlKey&&t.altKey||tn.mac&&t.altKey&&!t.ctrlKey&&!t.metaKey||!(h=Li[t.keyCode])||h==o?r&&t.shiftKey&&p(f[s+zb(o,t,!0)])&&(a=!0):(p(f[s+zb(h,t,!0)])||t.shiftKey&&(d=Xi[t.keyCode])!=o&&d!=h&&p(f[s+zb(d,t,!1)]))&&(a=!0),!a&&p(f._any)&&(a=!0)),l&&(a=!0),a&&c&&t.stopPropagation(),Dr=null,a}function Wb(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==mn.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Vb(e,t,i,n){let o=e.coordsAtPos(t,2*i);if(!o)return n;let r=e.dom.getBoundingClientRect(),s=(o.top+o.bottom)/2,a=e.posAtCoords({x:r.left+1,y:s}),l=e.posAtCoords({x:r.right-1,y:s});return null==a||null==l?n:{from:Math.max(n.from,Math.min(a,l)),to:Math.min(n.to,Math.max(a,l))}}function Yb(e,t,i){if(i.to<=e.viewport.from||i.from>=e.viewport.to)return[];let n=Math.max(i.from,e.viewport.from),o=Math.min(i.to,e.viewport.to),r=e.textDirection==mn.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=Wb(e),c=s.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),d=a.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=a.right-(h?parseInt(h.paddingRight):0),p=rb(e,n,1),f=rb(e,o,-1),m=p.type==rn.Text?p:null,g=f.type==rn.Text?f:null;if(m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=Vb(e,n,1,m)),g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=Vb(e,o,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return v(b(i.from,i.to,m));{let t=m?b(i.from,null,m):y(p,!1),n=g?b(null,i.to,g):y(f,!0),o=[];return(m||p).to<(g||f).from-(m&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<n.top?o.push(O(d,t.bottom,u,n.top)):t.bottom<n.top&&e.elementAtHeight((t.bottom+n.top)/2).type==rn.Text&&(t.bottom=n.top=(t.bottom+n.top)/2),v(t).concat(o).concat(v(n))}function O(e,i,n,o){return new Lr(t,e-l.left,i-l.top,n-e,o-i)}function v({top:e,bottom:t,horizontal:i}){let n=[];for(let o=0;o<i.length;o+=2)n.push(O(i[o],e,i[o+1],t));return n}function b(t,i,n){let o=1e9,s=-1e9,a=[];function l(t,i,l,c,h){let p=e.coordsAtPos(t,t==n.to?-2:2),f=e.coordsAtPos(l,l==n.from?2:-2);p&&f&&(o=Math.min(p.top,f.top,o),s=Math.max(p.bottom,f.bottom,s),h==mn.LTR?a.push(r&&i?d:p.left,r&&c?u:f.right):a.push(!r&&c?d:f.left,!r&&i?u:p.right))}let c=null!=t?t:n.from,h=null!=i?i:n.to;for(let r of e.visibleRanges)if(r.to>c&&r.from<h)for(let n=Math.max(r.from,c),o=Math.min(r.to,h);;){let r=e.state.doc.lineAt(n);for(let s of e.bidiSpans(r)){let e=s.from+r.from,a=s.to+r.from;if(e>=o)break;a>n&&l(Math.max(e,n),null==t&&e<=c,Math.min(a,o),null==i&&a>=h,s.dir)}if(n=r.to+1,n>=o)break}return 0==a.length&&l(c,null==t,h,null==i,e.textDirection),{top:o,bottom:s,horizontal:a}}function y(e,t){let i=a.top+(t?e.top:e.bottom);return{top:i,bottom:i,horizontal:[]}}}function Bb(e){return[Wn.define((t=>new Xr(t,e))),Nr.of(e)]}function Ub(e){return e.startState.facet(jr)!=e.state.facet(jr)}function Gb(e,t){t.style.animationDuration=e.facet(jr).cursorBlinkRate+"ms"}function Hb(){return[Vr,Yr]}function Fb(e,t,i,n,o){t.lastIndex=0;for(let r,s=e.iterRange(i,n),a=i;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;r=t.exec(s.value);)o(a+r.index,r)}function Kb(){return os}function Jb(e={}){return as.of(e)}function ey(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}function ty(e,t){let i=parseInt(e.style.left,10);(isNaN(i)||Math.abs(t-i)>1)&&(e.style.left=t+"px")}function iy(e,t={}){let i=gi.define(),n=Jt.define({create:()=>[],update(e,n){if(e.length&&(t.hideOnChange&&(n.docChanged||n.selection)?e=[]:t.hideOn&&(e=e.filter((e=>!t.hideOn(n,e)))),n.docChanged)){let t=[];for(let i of e){let e=n.changes.mapPos(i.pos,-1,It.TrackDel);if(null!=e){let o=Object.assign(Object.create(null),i);o.pos=e,null!=o.end&&(o.end=n.changes.mapPos(o.end)),t.push(o)}}e=t}for(let t of n.effects)t.is(i)&&(e=t.value),t.is(vs)&&(e=[]);return e},provide:e=>ps.from(e)});return{active:n,extension:[n,Wn.define((o=>new gs(o,e,n,i,t.hoverTime||300))),ms]}}function ny(e,t){let i=e.plugin(cs);if(!i)return null;let n=i.manager.tooltips.indexOf(t);return n<0?null:i.manager.tooltipViews[n]}function oy(e,t){let i=e.plugin(ys),n=i?i.specs.indexOf(t):-1;return n>-1?i.panels[n]:null}function ry(e){let t=e.nextSibling;return e.remove(),t}function sy(e){return[ay(),Ts.of({...$s,...e})]}function ay(e){let t=[_s];return e&&!1===e.fixed&&t.push(Ps.of(!0)),t}function ly(e){return Array.isArray(e)?e:[e]}function cy(e,t,i){for(;e.value&&e.from<=i;)e.from==i&&t.push(e.value),e.next()}function hy(e,t){return e.state.facet(Es).formatNumber(t,e.state)}function dy(e={}){return[Es.of(e),ay(),Ls]}function uy(e){let t=9;for(;t<e;)t=10*t+9;return t}function py(){return Ns}function fy(e,t,i,n){switch(e){case-2:return i<t;case-1:return n>=t&&i<t;case 0:return i<t&&n>t;case 1:return i<=t&&n>t;case 2:return n>t;case 4:return!0}}function my(e,t,i,n){for(var o;e.from==e.to||(i<1?e.from>=t:e.from>t)||(i>-1?e.to<=t:e.to<t);){let t=!n&&e instanceof ta&&e.index<0?null:e.parent;if(!t)return e;e=t}let r=n?0:Hs.IgnoreOverlays;if(n)for(let s=e,a=s.parent;a;s=a,a=s.parent)s instanceof ta&&s.index<0&&(null===(o=a.enter(t,i,r))||void 0===o?void 0:o.from)!=s.from&&(e=a);for(;;){let n=e.enter(t,i,r);if(!n)return e;e=n}}function gy(e,t,i,n){let o=e.cursor(),r=[];if(!o.firstChild())return r;if(null!=i)for(let s=!1;!s;)if(s=o.type.is(i),!o.nextSibling())return r;for(;;){if(null!=n&&o.type.is(n))return r;if(o.type.is(t)&&r.push(o.node),!o.nextSibling())return null==n?r:[]}}function Oy(e,t,i=t.length-1){for(let n=e.parent;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(t[i]&&t[i]!=n.name)return!1;i--}}return!0}function vy(e){if(!e.length)return null;let t=0,i=e[0];for(let r=1;r<e.length;r++){let n=e[r];(n.from>i.from||n.to<i.to)&&(i=n,t=r)}let n=i instanceof ta&&i.index<0?null:i.parent,o=e.slice();return n?o[t]=n:o.splice(t,1),new oa(o,i)}function by(e){return e.children.some((e=>e instanceof Js||!e.type.isAnonymous||by(e)))}function yy(e){var t;let{buffer:i,nodeSet:n,maxBufferLength:o=js,reused:r=[],minRepeatType:s=n.types.length}=e,a=Array.isArray(i)?new Ks(i,i.length):i,l=n.types,c=0,h=0;function d(e,t,i,g,O,v){let{id:b,start:y,end:x,size:w}=a,k=h;for(;w<0;){if(a.next(),-1==w){let t=r[b];return i.push(t),void g.push(y-e)}if(-3==w)return void(c=b);if(-4==w)return void(h=b);throw new RangeError(`Unrecognized record size: ${w}`)}let S,Q,$=l[b],T=y-e;if(x-y<=o&&(Q=function(e,t){let i=a.fork(),n=0,r=0,l=0,c=i.end-o,h={size:0,start:0,skip:0};e:for(let o=i.pos-e;i.pos>o;){let e=i.size;if(i.id==t&&e>=0){h.size=n,h.start=r,h.skip=l,l+=4,n+=4,i.next();continue}let a=i.pos-e;if(e<0||a<o||i.start<c)break;let d=i.id>=s?4:0,u=i.start;for(i.next();i.pos>a;){if(i.size<0){if(-3!=i.size)break e;d+=4}else i.id>=s&&(d+=4);i.next()}r=u,n+=e,l+=d}return(t<0||n==e)&&(h.size=n,h.start=r,h.skip=l),h.size>4?h:void 0}(a.pos-t,O))){let t=new Uint16Array(Q.size-Q.skip),i=a.pos-Q.size,o=t.length;for(;a.pos>i;)o=m(Q.start,t,o);S=new Js(t,x-Q.start,n),T=Q.start-e}else{let e=a.pos-w;a.next();let t=[],i=[],n=b>=s?b:-1,r=0,l=x;for(;a.pos>e;)n>=0&&a.id==n&&a.size>=0?(a.end<=l-o&&(p(t,i,y,r,a.end,l,n,k),r=t.length,l=a.end),a.next()):v>2500?u(y,e,t,i):d(y,e,t,i,n,v+1);if(n>=0&&r>0&&r<t.length&&p(t,i,y,r,y,l,n,k),t.reverse(),i.reverse(),n>-1&&r>0){let e=function(e){return(t,i,n)=>{let o,r,s=0,a=t.length-1;if(a>=0&&(o=t[a])instanceof Fs){if(!a&&o.type==e&&o.length==n)return o;(r=o.prop(Is.lookAhead))&&(s=i[a]+o.length+r)}return f(e,t,i,n,s)}}($);S=wy($,t,i,0,t.length,0,x-y,e,e)}else S=f($,t,i,x-y,k-x)}i.push(S),g.push(T)}function u(e,t,i,r){let s=[],l=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:i,size:n}=a;if(n>4)a.next();else{if(c>-1&&t<c)break;c<0&&(c=i-o),s.push(e,t,i),l++,a.next()}}if(l){let t=new Uint16Array(4*l),o=s[s.length-2];for(let e=s.length-3,i=0;e>=0;e-=3)t[i++]=s[e],t[i++]=s[e+1]-o,t[i++]=s[e+2]-o,t[i++]=i;i.push(new Js(t,s[2]-o,n)),r.push(o-e)}}function p(e,t,i,o,r,s,a,l){let c=[],h=[];for(;e.length>o;)c.push(e.pop()),h.push(t.pop()+i-r);e.push(f(n.types[a],c,h,s-r,l-s)),t.push(r-i)}function f(e,t,i,n,o=0,r){if(c){let e=[Is.contextHash,c];r=r?[e].concat(r):[e]}if(o>25){let e=[Is.lookAhead,o];r=r?[e].concat(r):[e]}return new Fs(e,t,i,n,r)}function m(e,t,i){let{id:n,start:o,end:r,size:l}=a;if(a.next(),l>=0&&n<s){let s=i;if(l>4){let n=a.pos-(l-4);for(;a.pos>n;)i=m(e,t,i)}t[--i]=s,t[--i]=r-e,t[--i]=o-e,t[--i]=n}else-3==l?c=n:-4==l&&(h=n);return i}let g=[],O=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,g,O,-1,0);let v=null!==(t=e.length)&&void 0!==t?t:g.length?O[0]+g[0].length:0;return new Fs(l[e.topID],g.reverse(),O.reverse(),v)}function xy(e,t){if(!e.isAnonymous||t instanceof Js||t.type!=e)return 1;let i=sa.get(t);if(null==i){i=1;for(let n of t.children){if(n.type!=e||!(n instanceof Fs)){i=1;break}i+=xy(e,n)}sa.set(t,i)}return i}function wy(e,t,i,n,o,r,s,a,l){let c=0;for(let p=n;p<o;p++)c+=xy(e,t[p]);let h=Math.ceil(1.5*c/8),d=[],u=[];return function t(i,n,o,s,a){for(let c=o;c<s;){let o=c,p=n[c],f=xy(e,i[c]);for(c++;c<s;c++){let t=xy(e,i[c]);if(f+t>=h)break;f+=t}if(c==o+1){if(f>h){let e=i[o];t(e.children,e.positions,0,e.children.length,n[o]+a);continue}d.push(i[o])}else{let t=n[c-1]+i[c-1].length-p;d.push(wy(e,i,n,o,c,p,t,null,l))}u.push(p+a-r)}}(t,i,n,o,0),(a||l)(d,u,s)}function ky(e){return(t,i,n,o)=>new fa(t,e,i,n,o)}function Sy(e){if(!e.length||e.some((e=>e.from>=e.to)))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}function