turtlecode 0.1.1 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/assets/{_basePickBy-BcOvpC5b.js → _basePickBy-Cbr9kF3W.js} +1 -1
- package/assets/assets/{_baseUniq-D9AKNI-S.js → _baseUniq-90p3K5mX.js} +1 -1
- package/assets/assets/{arc-ClcBVsDq.js → arc-zwceMo7E.js} +1 -1
- package/assets/assets/{architectureDiagram-2XIMDMQ5-CRV28Qi0.js → architectureDiagram-2XIMDMQ5-DTVoAXan.js} +1 -1
- package/assets/assets/{auth-callback-D7CK9pHp.js → auth-callback-DDriykxK.js} +1 -1
- package/assets/assets/{blockDiagram-WCTKOSBZ-CL-sI8NU.js → blockDiagram-WCTKOSBZ-BSWFoRB4.js} +1 -1
- package/assets/assets/{c4Diagram-IC4MRINW-AFG5p1yt.js → c4Diagram-IC4MRINW-DMGytLY0.js} +1 -1
- package/assets/assets/channel-Dt5bKHJY.js +1 -0
- package/assets/assets/{chunk-4BX2VUAB-CgNy2Qqu.js → chunk-4BX2VUAB-DK5USEsv.js} +1 -1
- package/assets/assets/{chunk-55IACEB6-Bsz0SHtO.js → chunk-55IACEB6-Dwuz2gci.js} +1 -1
- package/assets/assets/{chunk-FMBD7UC4-BRuwu34q.js → chunk-FMBD7UC4-D3Ar5GCw.js} +1 -1
- package/assets/assets/{chunk-JSJVCQXG-Bt0GkrjS.js → chunk-JSJVCQXG-BsqvZqFi.js} +1 -1
- package/assets/assets/{chunk-KX2RTZJC-BiUvn-D7.js → chunk-KX2RTZJC-BEGDcj79.js} +1 -1
- package/assets/assets/{chunk-NQ4KR5QH-DH4YUQE9.js → chunk-NQ4KR5QH-DIhUZLGW.js} +1 -1
- package/assets/assets/{chunk-QZHKN3VN-CrLB363X.js → chunk-QZHKN3VN-BayZzXcy.js} +1 -1
- package/assets/assets/{chunk-VVM5DH6Z-D2vG_ZPx.js → chunk-VVM5DH6Z-CUl6IXI5.js} +1 -1
- package/assets/assets/{chunk-WL4C6EOR-913dgDB-.js → chunk-WL4C6EOR-vhjolSEq.js} +1 -1
- package/assets/assets/classDiagram-VBA2DB6C-DnXPRHLd.js +1 -0
- package/assets/assets/classDiagram-v2-RAHNMMFH-DnXPRHLd.js +1 -0
- package/assets/assets/clone-CbaHYGYw.js +1 -0
- package/assets/assets/{connection-popover-D2MEtT6z.js → connection-popover-CEFQbPWK.js} +1 -1
- package/assets/assets/{context-popover-C1ZDT4aK.js → context-popover-CKXEgeIh.js} +1 -1
- package/assets/assets/{cose-bilkent-S5V4N54A-DRWnwV5H.js → cose-bilkent-S5V4N54A--B-DQXvI.js} +1 -1
- package/assets/assets/{cssMode-DX-s2EC8.js → cssMode-CWSvB3aC.js} +1 -1
- package/assets/assets/{dagre-KLK3FWXG-CN4ule0l.js → dagre-KLK3FWXG-DY0eSi8o.js} +1 -1
- package/assets/assets/{diagram-E7M64L7V-docJyJu4.js → diagram-E7M64L7V-CbCSS_sV.js} +1 -1
- package/assets/assets/{diagram-IFDJBPK2-ChVpZldk.js → diagram-IFDJBPK2-NUrmqese.js} +1 -1
- package/assets/assets/{diagram-P4PSJMXO-Bf1-kRnd.js → diagram-P4PSJMXO-CbqxmMLJ.js} +1 -1
- package/assets/assets/{dialog-clone-project-B1wF7jYQ.js → dialog-clone-project-BRaGZzJN.js} +1 -1
- package/assets/assets/{dialog-connect-provider-Ot6Qr5dL.js → dialog-connect-provider-DpPISveC.js} +2 -2
- package/assets/assets/{dialog-create-project-BUc4DxX6.js → dialog-create-project-a3Uo_guc.js} +1 -1
- package/assets/assets/{dialog-edit-project-BrkjzrGe.js → dialog-edit-project-CgJu_xty.js} +1 -1
- package/assets/assets/{dialog-fork-CyeKjf0e.js → dialog-fork-CmIIdrc_.js} +1 -1
- package/assets/assets/{dialog-manage-models-CoiwPdu-.js → dialog-manage-models-YoikGlYY.js} +1 -1
- package/assets/assets/{dialog-select-directory-K0nOY5Ky.js → dialog-select-directory-D7DAqsnF.js} +3 -3
- package/assets/assets/{dialog-select-file-Dx0Bny2E.js → dialog-select-file-DfsyN5Rc.js} +1 -1
- package/assets/assets/{dialog-select-mcp-ehJzhdpz.js → dialog-select-mcp-BURynziq.js} +1 -1
- package/assets/assets/{dialog-select-model-unpaid-IVl97Sa_.js → dialog-select-model-unpaid-DKgrX02q.js} +2 -2
- package/assets/assets/{dialog-select-provider-CBq6hNDx.js → dialog-select-provider-0ixbAs1U.js} +1 -1
- package/assets/assets/{dialog-select-server-DA5hATxx.js → dialog-select-server-DgqWEODB.js} +1 -1
- package/assets/assets/{dialog-settings-BoOPbXZp.js → dialog-settings-BZpXHdr7.js} +1 -1
- package/assets/assets/{erDiagram-INFDFZHY-kDj6gvOH.js → erDiagram-INFDFZHY-C-XwpEYU.js} +1 -1
- package/assets/assets/{file-icon-DVEMs7Sx.js → file-icon-lmIpAi7j.js} +1 -1
- package/assets/assets/{flowDiagram-PKNHOUZH-CsQeJUub.js → flowDiagram-PKNHOUZH-CNyRmJrg.js} +1 -1
- package/assets/assets/{freemarker2-B_-gEFnj.js → freemarker2-aAsBprVy.js} +1 -1
- package/assets/assets/{ganttDiagram-A5KZAMGK-D1W7NciY.js → ganttDiagram-A5KZAMGK-VDRJPysM.js} +1 -1
- package/assets/assets/{ghostty-web-BQl0ls6m.js → ghostty-web-CDoiu3Yc.js} +1 -1
- package/assets/assets/{gitGraphDiagram-K3NZZRJ6-D4eeLV-l.js → gitGraphDiagram-K3NZZRJ6-yqJaE10b.js} +1 -1
- package/assets/assets/{graph-KGuLNbW2.js → graph-Blkyeyzn.js} +1 -1
- package/assets/assets/{handlebars-DlnQtQmF.js → handlebars-B9y9KVva.js} +1 -1
- package/assets/assets/{home-BnHPimua.js → home-Dl-ohVE3.js} +1 -1
- package/assets/assets/{html-DrjCwvQg.js → html-B4yimBtZ.js} +1 -1
- package/assets/assets/{htmlMode-C1xX0YwN.js → htmlMode-XkoEE1Us.js} +1 -1
- package/assets/assets/{index-DTxAHLat.css → index-9-q5x_AZ.css} +1 -1
- package/assets/assets/{index-DKwABhnu.js → index-Dxo83Gsl.js} +4 -4
- package/assets/assets/{infoDiagram-LFFYTUFH-DsQ9EVx0.js → infoDiagram-LFFYTUFH-C1FkzzLJ.js} +1 -1
- package/assets/assets/{ishikawaDiagram-PHBUUO56-MzetUfFK.js → ishikawaDiagram-PHBUUO56-SVTYyzMy.js} +1 -1
- package/assets/assets/{javascript-CBQQIA5q.js → javascript-xyQKZDGW.js} +1 -1
- package/assets/assets/{jobs-popover-DQmVz-e0.js → jobs-popover-BAyLs5rR.js} +1 -1
- package/assets/assets/{journeyDiagram-4ABVD52K-BkKgSN_9.js → journeyDiagram-4ABVD52K-CftC00L0.js} +1 -1
- package/assets/assets/{jsonMode-B2Ye6w7y.js → jsonMode-PsmTZD9i.js} +1 -1
- package/assets/assets/{kanban-definition-K7BYSVSG-DIJz6AsI.js → kanban-definition-K7BYSVSG-D8rVztxr.js} +1 -1
- package/assets/assets/{layout-BZKpv2Gr.js → layout-DKRzsYmw.js} +1 -1
- package/assets/assets/{liquid-CQXVmj19.js → liquid-B5YkEln-.js} +1 -1
- package/assets/assets/{list-DPJi0fzr.js → list-IrfozpgY.js} +1 -1
- package/assets/assets/{mdx-QuCI1OJC.js → mdx-IAVXqYJ2.js} +1 -1
- package/assets/assets/{mermaid.core-bhqKFRxj.js → mermaid.core-D7ns-Nfl.js} +5 -5
- package/assets/assets/{mindmap-definition-YRQLILUH-CVv44i-B.js → mindmap-definition-YRQLILUH-Bzur0Tav.js} +1 -1
- package/assets/assets/{pieDiagram-SKSYHLDU-2ekrtn6z.js → pieDiagram-SKSYHLDU-BquIe11C.js} +1 -1
- package/assets/assets/{python-Bx2b-xP4.js → python-BcPmedha.js} +1 -1
- package/assets/assets/{quadrantDiagram-337W2JSQ-BoTofVsV.js → quadrantDiagram-337W2JSQ-DfIw-PhP.js} +1 -1
- package/assets/assets/{razor-2zgukQRj.js → razor-Dae0nPVH.js} +1 -1
- package/assets/assets/{requirementDiagram-Z7DCOOCP-LSodooxy.js → requirementDiagram-Z7DCOOCP-Cjlz-DEQ.js} +1 -1
- package/assets/assets/{sankeyDiagram-WA2Y5GQK-DUXSSMar.js → sankeyDiagram-WA2Y5GQK-bGfKg-Gi.js} +1 -1
- package/assets/assets/{select-BbwOgh1Q.js → select-COPHquWP.js} +1 -1
- package/assets/assets/{sequenceDiagram-2WXFIKYE-C01qZdHR.js → sequenceDiagram-2WXFIKYE-B5qLrUGE.js} +1 -1
- package/assets/assets/{server-row-mRVGCgvL.js → server-row-D1rDT8vK.js} +1 -1
- package/assets/assets/{session-BXKBDkSI.js → session-kVY7vYXa.js} +15 -15
- package/assets/assets/{stateDiagram-RAJIS63D-BuPj1Py4.js → stateDiagram-RAJIS63D-BEP_JgCk.js} +1 -1
- package/assets/assets/stateDiagram-v2-FVOUBMTO-DEd6U9Bm.js +1 -0
- package/assets/assets/{status-popover-body-9YRn8z8W.js → status-popover-body-BDnY5y5A.js} +2 -2
- package/assets/assets/{switch-CHySmW8J.js → switch-CDJuR31O.js} +1 -1
- package/assets/assets/{tabs-CKNlwTKd.js → tabs-IESTlWqJ.js} +1 -1
- package/assets/assets/{tag-C4xikCZp.js → tag-DjGMdUtp.js} +1 -1
- package/assets/assets/{timeline-definition-YZTLITO2-CPcDqVYw.js → timeline-definition-YZTLITO2-D6uWycI3.js} +1 -1
- package/assets/assets/{treemap-KZPCXAKY-Bin819KW.js → treemap-KZPCXAKY-DH-YINf4.js} +1 -1
- package/assets/assets/{trellis-Csm7WAqm.js → trellis-CGL9IdAb.js} +7 -7
- package/assets/assets/{trellis-badge-demo-nxtlIRoh.js → trellis-badge-demo-R0tqETOm.js} +1 -1
- package/assets/assets/{trellis-op-icon-CzIuo5X7.js → trellis-op-icon-7bLDDzgi.js} +1 -1
- package/assets/assets/{tsMode-qOM514sL.js → tsMode-C8IFzmUX.js} +1 -1
- package/assets/assets/{typescript-XOJMwr_m.js → typescript-BRzjXkWD.js} +1 -1
- package/assets/assets/{vennDiagram-LZ73GAT5-BDAdfrV5.js → vennDiagram-LZ73GAT5-CTkGiV8C.js} +1 -1
- package/assets/assets/{xml-BIwomT_0.js → xml-DwrPHn8a.js} +1 -1
- package/assets/assets/{xychartDiagram-JWTSCODW-Be2x0vdX.js → xychartDiagram-JWTSCODW-DYfMOVBa.js} +1 -1
- package/assets/assets/{yaml-BZMZa-4Z.js → yaml-D5NhyUmN.js} +1 -1
- package/assets/index.html +2 -2
- package/bin/cli.mjs +43 -3
- package/package.json +6 -2
- package/assets/assets/channel-BXqEQVGi.js +0 -1
- package/assets/assets/classDiagram-VBA2DB6C-gcpKg8SN.js +0 -1
- package/assets/assets/classDiagram-v2-RAHNMMFH-gcpKg8SN.js +0 -1
- package/assets/assets/clone-oMsF326O.js +0 -1
- package/assets/assets/stateDiagram-v2-FVOUBMTO-CjYACBI3.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-
|
|
2
|
-
import{a as fH,i as St,a4 as T3,cI as gH,a2 as N3,H as I3,O as Co,P as Yd,aH as zb,dc as pH,dd as mH,de as _H,df as bH,_ as fe,v as M3,l as K,m as X,S as Re,n as oa,I as zn,q as on,x as cl,y as aa,aD as lr,dg as wH,aC as Z2,t as de,h as $t,B as Eo,bm as CH,o as Sl,z as vH,cs as yH,bx as SH,c5 as xH,j as o_,ch as Ro,aJ as kH,f as A3,aE as LH,cK as R3,A as EH,s as Or,V as a_,F as Yi,dh as vC,Q as la,cZ as DH,c$ as TH,di as NH,bZ as ux,C as IH,dj as MH}from"./index-DKwABhnu.js";import{S as AH}from"./select-BbwOgh1Q.js";import{s as _o,g as X2,t as RH,j as Q2,T as ly,k as cy}from"./transform-BwXaE9hv.js";import{T as OH}from"./trellis-op-icon-CzIuo5X7.js";function PH(n){let e;for(;e=n.sourceEvent;)n=e;return n}function za(n,e){if(n=PH(n),e===void 0&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var i=t.createSVGPoint();return i.x=n.clientX,i.y=n.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var s=e.getBoundingClientRect();return[n.clientX-s.left-e.clientLeft,n.clientY-s.top-e.clientTop]}}return[n.pageX,n.pageY]}const FH={passive:!1},tm={capture:!0,passive:!1};function dy(n){n.stopImmediatePropagation()}function zu(n){n.preventDefault(),n.stopImmediatePropagation()}function O3(n){var e=n.document.documentElement,t=_o(n).on("dragstart.drag",zu,tm);"onselectstart"in e?t.on("selectstart.drag",zu,tm):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function P3(n,e){var t=n.document.documentElement,i=_o(n).on("dragstart.drag",null);e&&(i.on("click.drag",zu,tm),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in t?i.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}const K_=n=>()=>n;function fx(n,{sourceEvent:e,subject:t,target:i,identifier:s,active:r,x:o,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}fx.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function BH(n){return!n.ctrlKey&&!n.button}function VH(){return this.parentNode}function WH(n,e){return e??{x:n.x,y:n.y}}function HH(){return navigator.maxTouchPoints||"ontouchstart"in this}function zH(){var n=BH,e=VH,t=WH,i=HH,s={},r=X2("start","drag","end"),o=0,a,l,c,d,h=0;function u(C){C.on("mousedown.drag",f).filter(i).on("touchstart.drag",m).on("touchmove.drag",_,FH).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(C,y){if(!(d||!n.call(this,C,y))){var S=v(this,e.call(this,C,y),C,y,"mouse");S&&(_o(C.view).on("mousemove.drag",g,tm).on("mouseup.drag",p,tm),O3(C.view),dy(C),c=!1,a=C.clientX,l=C.clientY,S("start",C))}}function g(C){if(zu(C),!c){var y=C.clientX-a,S=C.clientY-l;c=y*y+S*S>h}s.mouse("drag",C)}function p(C){_o(C.view).on("mousemove.drag mouseup.drag",null),P3(C.view,c),zu(C),s.mouse("end",C)}function m(C,y){if(n.call(this,C,y)){var S=C.changedTouches,x=e.call(this,C,y),L=S.length,E,O;for(E=0;E<L;++E)(O=v(this,x,C,y,S[E].identifier,S[E]))&&(dy(C),O("start",C,S[E]))}}function _(C){var y=C.changedTouches,S=y.length,x,L;for(x=0;x<S;++x)(L=s[y[x].identifier])&&(zu(C),L("drag",C,y[x]))}function w(C){var y=C.changedTouches,S=y.length,x,L;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),x=0;x<S;++x)(L=s[y[x].identifier])&&(dy(C),L("end",C,y[x]))}function v(C,y,S,x,L,E){var O=r.copy(),M=za(E||S,y),P,V,D;if((D=t.call(C,new fx("beforestart",{sourceEvent:S,target:u,identifier:L,active:o,x:M[0],y:M[1],dx:0,dy:0,dispatch:O}),x))!=null)return P=D.x-M[0]||0,V=D.y-M[1]||0,function B(A,$,Y){var G=M,ie;switch(A){case"start":s[L]=B,ie=o++;break;case"end":delete s[L],--o;case"drag":M=za(Y||$,y),ie=o;break}O.call(A,C,new fx(A,{sourceEvent:$,subject:D,target:u,identifier:L,active:ie,x:M[0]+P,y:M[1]+V,dx:M[0]-G[0],dy:M[1]-G[1],dispatch:O}),x)}}return u.filter=function(C){return arguments.length?(n=typeof C=="function"?C:K_(!!C),u):n},u.container=function(C){return arguments.length?(e=typeof C=="function"?C:K_(C),u):e},u.subject=function(C){return arguments.length?(t=typeof C=="function"?C:K_(C),u):t},u.touchable=function(C){return arguments.length?(i=typeof C=="function"?C:K_(!!C),u):i},u.on=function(){var C=r.on.apply(r,arguments);return C===r?u:C},u.clickDistance=function(C){return arguments.length?(h=(C=+C)*C,u):Math.sqrt(h)},u}var $H=1e-12;function QI(n){return((n=Math.exp(n))+1/n)/2}function UH(n){return((n=Math.exp(n))-1/n)/2}function jH(n){return((n=Math.exp(2*n))-1)/(n+1)}const KH=(function n(e,t,i){function s(r,o){var a=r[0],l=r[1],c=r[2],d=o[0],h=o[1],u=o[2],f=d-a,g=h-l,p=f*f+g*g,m,_;if(p<$H)_=Math.log(u/c)/e,m=function(x){return[a+x*f,l+x*g,c*Math.exp(e*x*_)]};else{var w=Math.sqrt(p),v=(u*u-c*c+i*p)/(2*c*t*w),C=(u*u-c*c-i*p)/(2*u*t*w),y=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(C*C+1)-C);_=(S-y)/e,m=function(x){var L=x*_,E=QI(y),O=c/(t*w)*(E*jH(e*L+y)-UH(y));return[a+O*f,l+O*g,c*E/QI(e*L+y)]}}return m.duration=_*1e3*e/Math.SQRT2,m}return s.rho=function(r){var o=Math.max(.001,+r),a=o*o,l=a*a;return n(o,a,l)},s})(Math.SQRT2,2,4);function qH(n,e){var t,i=1;n==null&&(n=0),e==null&&(e=0);function s(){var r,o=t.length,a,l=0,c=0;for(r=0;r<o;++r)a=t[r],l+=a.x,c+=a.y;for(l=(l/o-n)*i,c=(c/o-e)*i,r=0;r<o;++r)a=t[r],a.x-=l,a.y-=c}return s.initialize=function(r){t=r},s.x=function(r){return arguments.length?(n=+r,s):n},s.y=function(r){return arguments.length?(e=+r,s):e},s.strength=function(r){return arguments.length?(i=+r,s):i},s}function GH(n){const e=+this._x.call(null,n),t=+this._y.call(null,n);return F3(this.cover(e,t),e,t,n)}function F3(n,e,t,i){if(isNaN(e)||isNaN(t))return n;var s,r=n._root,o={data:i},a=n._x0,l=n._y0,c=n._x1,d=n._y1,h,u,f,g,p,m,_,w;if(!r)return n._root=o,n;for(;r.length;)if((p=e>=(h=(a+c)/2))?a=h:c=h,(m=t>=(u=(l+d)/2))?l=u:d=u,s=r,!(r=r[_=m<<1|p]))return s[_]=o,n;if(f=+n._x.call(null,r.data),g=+n._y.call(null,r.data),e===f&&t===g)return o.next=r,s?s[_]=o:n._root=o,n;do s=s?s[_]=new Array(4):n._root=new Array(4),(p=e>=(h=(a+c)/2))?a=h:c=h,(m=t>=(u=(l+d)/2))?l=u:d=u;while((_=m<<1|p)===(w=(g>=u)<<1|f>=h));return s[w]=r,s[_]=o,n}function YH(n){var e,t,i=n.length,s,r,o=new Array(i),a=new Array(i),l=1/0,c=1/0,d=-1/0,h=-1/0;for(t=0;t<i;++t)isNaN(s=+this._x.call(null,e=n[t]))||isNaN(r=+this._y.call(null,e))||(o[t]=s,a[t]=r,s<l&&(l=s),s>d&&(d=s),r<c&&(c=r),r>h&&(h=r));if(l>d||c>h)return this;for(this.cover(l,c).cover(d,h),t=0;t<i;++t)F3(this,o[t],a[t],n[t]);return this}function ZH(n,e){if(isNaN(n=+n)||isNaN(e=+e))return this;var t=this._x0,i=this._y0,s=this._x1,r=this._y1;if(isNaN(t))s=(t=Math.floor(n))+1,r=(i=Math.floor(e))+1;else{for(var o=s-t||1,a=this._root,l,c;t>n||n>=s||i>e||e>=r;)switch(c=(e<i)<<1|n<t,l=new Array(4),l[c]=a,a=l,o*=2,c){case 0:s=t+o,r=i+o;break;case 1:t=s-o,r=i+o;break;case 2:s=t+o,i=r-o;break;case 3:t=s-o,i=r-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=t,this._y0=i,this._x1=s,this._y1=r,this}function XH(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function QH(n){return arguments.length?this.cover(+n[0][0],+n[0][1]).cover(+n[1][0],+n[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function ys(n,e,t,i,s){this.node=n,this.x0=e,this.y0=t,this.x1=i,this.y1=s}function JH(n,e,t){var i,s=this._x0,r=this._y0,o,a,l,c,d=this._x1,h=this._y1,u=[],f=this._root,g,p;for(f&&u.push(new ys(f,s,r,d,h)),t==null?t=1/0:(s=n-t,r=e-t,d=n+t,h=e+t,t*=t);g=u.pop();)if(!(!(f=g.node)||(o=g.x0)>d||(a=g.y0)>h||(l=g.x1)<s||(c=g.y1)<r))if(f.length){var m=(o+l)/2,_=(a+c)/2;u.push(new ys(f[3],m,_,l,c),new ys(f[2],o,_,m,c),new ys(f[1],m,a,l,_),new ys(f[0],o,a,m,_)),(p=(e>=_)<<1|n>=m)&&(g=u[u.length-1],u[u.length-1]=u[u.length-1-p],u[u.length-1-p]=g)}else{var w=n-+this._x.call(null,f.data),v=e-+this._y.call(null,f.data),C=w*w+v*v;if(C<t){var y=Math.sqrt(t=C);s=n-y,r=e-y,d=n+y,h=e+y,i=f.data}}return i}function ez(n){if(isNaN(d=+this._x.call(null,n))||isNaN(h=+this._y.call(null,n)))return this;var e,t=this._root,i,s,r,o=this._x0,a=this._y0,l=this._x1,c=this._y1,d,h,u,f,g,p,m,_;if(!t)return this;if(t.length)for(;;){if((g=d>=(u=(o+l)/2))?o=u:l=u,(p=h>=(f=(a+c)/2))?a=f:c=f,e=t,!(t=t[m=p<<1|g]))return this;if(!t.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(i=e,_=m)}for(;t.data!==n;)if(s=t,!(t=t.next))return this;return(r=t.next)&&delete t.next,s?(r?s.next=r:delete s.next,this):e?(r?e[m]=r:delete e[m],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(i?i[_]=t:this._root=t),this):(this._root=r,this)}function tz(n){for(var e=0,t=n.length;e<t;++e)this.remove(n[e]);return this}function iz(){return this._root}function nz(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function sz(n){var e=[],t,i=this._root,s,r,o,a,l;for(i&&e.push(new ys(i,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!n(i=t.node,r=t.x0,o=t.y0,a=t.x1,l=t.y1)&&i.length){var c=(r+a)/2,d=(o+l)/2;(s=i[3])&&e.push(new ys(s,c,d,a,l)),(s=i[2])&&e.push(new ys(s,r,d,c,l)),(s=i[1])&&e.push(new ys(s,c,o,a,d)),(s=i[0])&&e.push(new ys(s,r,o,c,d))}return this}function rz(n){var e=[],t=[],i;for(this._root&&e.push(new ys(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var s=i.node;if(s.length){var r,o=i.x0,a=i.y0,l=i.x1,c=i.y1,d=(o+l)/2,h=(a+c)/2;(r=s[0])&&e.push(new ys(r,o,a,d,h)),(r=s[1])&&e.push(new ys(r,d,a,l,h)),(r=s[2])&&e.push(new ys(r,o,h,d,c)),(r=s[3])&&e.push(new ys(r,d,h,l,c))}t.push(i)}for(;i=t.pop();)n(i.node,i.x0,i.y0,i.x1,i.y1);return this}function oz(n){return n[0]}function az(n){return arguments.length?(this._x=n,this):this._x}function lz(n){return n[1]}function cz(n){return arguments.length?(this._y=n,this):this._y}function J2(n,e,t){var i=new eD(e??oz,t??lz,NaN,NaN,NaN,NaN);return n==null?i:i.addAll(n)}function eD(n,e,t,i,s,r){this._x=n,this._y=e,this._x0=t,this._y0=i,this._x1=s,this._y1=r,this._root=void 0}function JI(n){for(var e={data:n.data},t=e;n=n.next;)t=t.next={data:n.data};return e}var As=J2.prototype=eD.prototype;As.copy=function(){var n=new eD(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,i;if(!e)return n;if(!e.length)return n._root=JI(e),n;for(t=[{source:e,target:n._root=new Array(4)}];e=t.pop();)for(var s=0;s<4;++s)(i=e.source[s])&&(i.length?t.push({source:i,target:e.target[s]=new Array(4)}):e.target[s]=JI(i));return n};As.add=GH;As.addAll=YH;As.cover=ZH;As.data=XH;As.extent=QH;As.find=JH;As.remove=ez;As.removeAll=tz;As.root=iz;As.size=nz;As.visit=sz;As.visitAfter=rz;As.x=az;As.y=cz;function Zd(n){return function(){return n}}function cc(n){return(n()-.5)*1e-6}function dz(n){return n.x+n.vx}function hz(n){return n.y+n.vy}function uz(n){var e,t,i,s=1,r=1;typeof n!="function"&&(n=Zd(n==null?1:+n));function o(){for(var c,d=e.length,h,u,f,g,p,m,_=0;_<r;++_)for(h=J2(e,dz,hz).visitAfter(a),c=0;c<d;++c)u=e[c],p=t[u.index],m=p*p,f=u.x+u.vx,g=u.y+u.vy,h.visit(w);function w(v,C,y,S,x){var L=v.data,E=v.r,O=p+E;if(L){if(L.index>u.index){var M=f-L.x-L.vx,P=g-L.y-L.vy,V=M*M+P*P;V<O*O&&(M===0&&(M=cc(i),V+=M*M),P===0&&(P=cc(i),V+=P*P),V=(O-(V=Math.sqrt(V)))/V*s,u.vx+=(M*=V)*(O=(E*=E)/(m+E)),u.vy+=(P*=V)*O,L.vx-=M*(O=1-O),L.vy-=P*O)}return}return C>f+O||S<f-O||y>g+O||x<g-O}}function a(c){if(c.data)return c.r=t[c.data.index];for(var d=c.r=0;d<4;++d)c[d]&&c[d].r>c.r&&(c.r=c[d].r)}function l(){if(e){var c,d=e.length,h;for(t=new Array(d),c=0;c<d;++c)h=e[c],t[h.index]=+n(h,c,e)}}return o.initialize=function(c,d){e=c,i=d,l()},o.iterations=function(c){return arguments.length?(r=+c,o):r},o.strength=function(c){return arguments.length?(s=+c,o):s},o.radius=function(c){return arguments.length?(n=typeof c=="function"?c:Zd(+c),l(),o):n},o}function fz(n){return n.index}function eM(n,e){var t=n.get(e);if(!t)throw new Error("node not found: "+e);return t}function gz(n){var e=fz,t=h,i,s=Zd(30),r,o,a,l,c,d=1;n==null&&(n=[]);function h(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function u(m){for(var _=0,w=n.length;_<d;++_)for(var v=0,C,y,S,x,L,E,O;v<w;++v)C=n[v],y=C.source,S=C.target,x=S.x+S.vx-y.x-y.vx||cc(c),L=S.y+S.vy-y.y-y.vy||cc(c),E=Math.sqrt(x*x+L*L),E=(E-r[v])/E*m*i[v],x*=E,L*=E,S.vx-=x*(O=l[v]),S.vy-=L*O,y.vx+=x*(O=1-O),y.vy+=L*O}function f(){if(o){var m,_=o.length,w=n.length,v=new Map(o.map((y,S)=>[e(y,S,o),y])),C;for(m=0,a=new Array(_);m<w;++m)C=n[m],C.index=m,typeof C.source!="object"&&(C.source=eM(v,C.source)),typeof C.target!="object"&&(C.target=eM(v,C.target)),a[C.source.index]=(a[C.source.index]||0)+1,a[C.target.index]=(a[C.target.index]||0)+1;for(m=0,l=new Array(w);m<w;++m)C=n[m],l[m]=a[C.source.index]/(a[C.source.index]+a[C.target.index]);i=new Array(w),g(),r=new Array(w),p()}}function g(){if(o)for(var m=0,_=n.length;m<_;++m)i[m]=+t(n[m],m,n)}function p(){if(o)for(var m=0,_=n.length;m<_;++m)r[m]=+s(n[m],m,n)}return u.initialize=function(m,_){o=m,c=_,f()},u.links=function(m){return arguments.length?(n=m,f(),u):n},u.id=function(m){return arguments.length?(e=m,u):e},u.iterations=function(m){return arguments.length?(d=+m,u):d},u.strength=function(m){return arguments.length?(t=typeof m=="function"?m:Zd(+m),g(),u):t},u.distance=function(m){return arguments.length?(s=typeof m=="function"?m:Zd(+m),p(),u):s},u}const pz=1664525,mz=1013904223,tM=4294967296;function _z(){let n=1;return()=>(n=(pz*n+mz)%tM)/tM}function bz(n){return n.x}function wz(n){return n.y}var Cz=10,vz=Math.PI*(3-Math.sqrt(5));function yz(n){var e,t=1,i=.001,s=1-Math.pow(i,1/300),r=0,o=.6,a=new Map,l=RH(h),c=X2("tick","end"),d=_z();n==null&&(n=[]);function h(){u(),c.call("tick",e),t<i&&(l.stop(),c.call("end",e))}function u(p){var m,_=n.length,w;p===void 0&&(p=1);for(var v=0;v<p;++v)for(t+=(r-t)*s,a.forEach(function(C){C(t)}),m=0;m<_;++m)w=n[m],w.fx==null?w.x+=w.vx*=o:(w.x=w.fx,w.vx=0),w.fy==null?w.y+=w.vy*=o:(w.y=w.fy,w.vy=0);return e}function f(){for(var p=0,m=n.length,_;p<m;++p){if(_=n[p],_.index=p,_.fx!=null&&(_.x=_.fx),_.fy!=null&&(_.y=_.fy),isNaN(_.x)||isNaN(_.y)){var w=Cz*Math.sqrt(.5+p),v=p*vz;_.x=w*Math.cos(v),_.y=w*Math.sin(v)}(isNaN(_.vx)||isNaN(_.vy))&&(_.vx=_.vy=0)}}function g(p){return p.initialize&&p.initialize(n,d),p}return f(),e={tick:u,restart:function(){return l.restart(h),e},stop:function(){return l.stop(),e},nodes:function(p){return arguments.length?(n=p,f(),a.forEach(g),e):n},alpha:function(p){return arguments.length?(t=+p,e):t},alphaMin:function(p){return arguments.length?(i=+p,e):i},alphaDecay:function(p){return arguments.length?(s=+p,e):+s},alphaTarget:function(p){return arguments.length?(r=+p,e):r},velocityDecay:function(p){return arguments.length?(o=1-p,e):1-o},randomSource:function(p){return arguments.length?(d=p,a.forEach(g),e):d},force:function(p,m){return arguments.length>1?(m==null?a.delete(p):a.set(p,g(m)),e):a.get(p)},find:function(p,m,_){var w=0,v=n.length,C,y,S,x,L;for(_==null?_=1/0:_*=_,w=0;w<v;++w)x=n[w],C=p-x.x,y=m-x.y,S=C*C+y*y,S<_&&(L=x,_=S);return L},on:function(p,m){return arguments.length>1?(c.on(p,m),e):c.on(p)}}}function Sz(){var n,e,t,i,s=Zd(-30),r,o=1,a=1/0,l=.81;function c(f){var g,p=n.length,m=J2(n,bz,wz).visitAfter(h);for(i=f,g=0;g<p;++g)e=n[g],m.visit(u)}function d(){if(n){var f,g=n.length,p;for(r=new Array(g),f=0;f<g;++f)p=n[f],r[p.index]=+s(p,f,n)}}function h(f){var g=0,p,m,_=0,w,v,C;if(f.length){for(w=v=C=0;C<4;++C)(p=f[C])&&(m=Math.abs(p.value))&&(g+=p.value,_+=m,w+=m*p.x,v+=m*p.y);f.x=w/_,f.y=v/_}else{p=f,p.x=p.data.x,p.y=p.data.y;do g+=r[p.data.index];while(p=p.next)}f.value=g}function u(f,g,p,m){if(!f.value)return!0;var _=f.x-e.x,w=f.y-e.y,v=m-g,C=_*_+w*w;if(v*v/l<C)return C<a&&(_===0&&(_=cc(t),C+=_*_),w===0&&(w=cc(t),C+=w*w),C<o&&(C=Math.sqrt(o*C)),e.vx+=_*f.value*i/C,e.vy+=w*f.value*i/C),!0;if(f.length||C>=a)return;(f.data!==e||f.next)&&(_===0&&(_=cc(t),C+=_*_),w===0&&(w=cc(t),C+=w*w),C<o&&(C=Math.sqrt(o*C)));do f.data!==e&&(v=r[f.data.index]*i/C,e.vx+=_*v,e.vy+=w*v);while(f=f.next)}return c.initialize=function(f,g){n=f,t=g,d()},c.strength=function(f){return arguments.length?(s=typeof f=="function"?f:Zd(+f),d(),c):s},c.distanceMin=function(f){return arguments.length?(o=f*f,c):Math.sqrt(o)},c.distanceMax=function(f){return arguments.length?(a=f*f,c):Math.sqrt(a)},c.theta=function(f){return arguments.length?(l=f*f,c):Math.sqrt(l)},c}const q_=n=>()=>n;function xz(n,{sourceEvent:e,target:t,transform:i,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function hy(n){n.stopImmediatePropagation()}function mg(n){n.preventDefault(),n.stopImmediatePropagation()}function kz(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function Lz(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function iM(){return this.__zoom||Q2}function Ez(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Dz(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tz(n,e,t){var i=n.invertX(e[0][0])-t[0][0],s=n.invertX(e[1][0])-t[1][0],r=n.invertY(e[0][1])-t[0][1],o=n.invertY(e[1][1])-t[1][1];return n.translate(s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s),o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o))}function Nz(){var n=kz,e=Lz,t=Tz,i=Ez,s=Dz,r=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=KH,c=X2("start","zoom","end"),d,h,u,f=500,g=150,p=0,m=10;function _(D){D.property("__zoom",iM).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(D,B,A,$){var Y=D.selection?D.selection():D;Y.property("__zoom",iM),D!==Y?y(D,B,A,$):Y.interrupt().each(function(){S(this,arguments).event($).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},_.scaleBy=function(D,B,A,$){_.scaleTo(D,function(){var Y=this.__zoom.k,G=typeof B=="function"?B.apply(this,arguments):B;return Y*G},A,$)},_.scaleTo=function(D,B,A,$){_.transform(D,function(){var Y=e.apply(this,arguments),G=this.__zoom,ie=A==null?C(Y):typeof A=="function"?A.apply(this,arguments):A,le=G.invert(ie),De=typeof B=="function"?B.apply(this,arguments):B;return t(v(w(G,De),ie,le),Y,o)},A,$)},_.translateBy=function(D,B,A,$){_.transform(D,function(){return t(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof A=="function"?A.apply(this,arguments):A),e.apply(this,arguments),o)},null,$)},_.translateTo=function(D,B,A,$,Y){_.transform(D,function(){var G=e.apply(this,arguments),ie=this.__zoom,le=$==null?C(G):typeof $=="function"?$.apply(this,arguments):$;return t(Q2.translate(le[0],le[1]).scale(ie.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof A=="function"?-A.apply(this,arguments):-A),G,o)},$,Y)};function w(D,B){return B=Math.max(r[0],Math.min(r[1],B)),B===D.k?D:new ly(B,D.x,D.y)}function v(D,B,A){var $=B[0]-A[0]*D.k,Y=B[1]-A[1]*D.k;return $===D.x&&Y===D.y?D:new ly(D.k,$,Y)}function C(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function y(D,B,A,$){D.on("start.zoom",function(){S(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event($).end()}).tween("zoom",function(){var Y=this,G=arguments,ie=S(Y,G).event($),le=e.apply(Y,G),De=A==null?C(le):typeof A=="function"?A.apply(Y,G):A,Pe=Math.max(le[1][0]-le[0][0],le[1][1]-le[0][1]),qe=Y.__zoom,Be=typeof B=="function"?B.apply(Y,G):B,mt=l(qe.invert(De).concat(Pe/qe.k),Be.invert(De).concat(Pe/Be.k));return function(ai){if(ai===1)ai=Be;else{var Mt=mt(ai),Qn=Pe/Mt[2];ai=new ly(Qn,De[0]-Mt[0]*Qn,De[1]-Mt[1]*Qn)}ie.zoom(null,ai)}})}function S(D,B,A){return!A&&D.__zooming||new x(D,B)}function x(D,B){this.that=D,this.args=B,this.active=0,this.sourceEvent=null,this.extent=e.apply(D,B),this.taps=0}x.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,B){return this.mouse&&D!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var B=_o(this.that).datum();c.call(D,this.that,new xz(D,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:c}),B)}};function L(D,...B){if(!n.apply(this,arguments))return;var A=S(this,B).event(D),$=this.__zoom,Y=Math.max(r[0],Math.min(r[1],$.k*Math.pow(2,i.apply(this,arguments)))),G=za(D);if(A.wheel)(A.mouse[0][0]!==G[0]||A.mouse[0][1]!==G[1])&&(A.mouse[1]=$.invert(A.mouse[0]=G)),clearTimeout(A.wheel);else{if($.k===Y)return;A.mouse=[G,$.invert(G)],cy(this),A.start()}mg(D),A.wheel=setTimeout(ie,g),A.zoom("mouse",t(v(w($,Y),A.mouse[0],A.mouse[1]),A.extent,o));function ie(){A.wheel=null,A.end()}}function E(D,...B){if(u||!n.apply(this,arguments))return;var A=D.currentTarget,$=S(this,B,!0).event(D),Y=_o(D.view).on("mousemove.zoom",De,!0).on("mouseup.zoom",Pe,!0),G=za(D,A),ie=D.clientX,le=D.clientY;O3(D.view),hy(D),$.mouse=[G,this.__zoom.invert(G)],cy(this),$.start();function De(qe){if(mg(qe),!$.moved){var Be=qe.clientX-ie,mt=qe.clientY-le;$.moved=Be*Be+mt*mt>p}$.event(qe).zoom("mouse",t(v($.that.__zoom,$.mouse[0]=za(qe,A),$.mouse[1]),$.extent,o))}function Pe(qe){Y.on("mousemove.zoom mouseup.zoom",null),P3(qe.view,$.moved),mg(qe),$.event(qe).end()}}function O(D,...B){if(n.apply(this,arguments)){var A=this.__zoom,$=za(D.changedTouches?D.changedTouches[0]:D,this),Y=A.invert($),G=A.k*(D.shiftKey?.5:2),ie=t(v(w(A,G),$,Y),e.apply(this,B),o);mg(D),a>0?_o(this).transition().duration(a).call(y,ie,$,D):_o(this).call(_.transform,ie,$,D)}}function M(D,...B){if(n.apply(this,arguments)){var A=D.touches,$=A.length,Y=S(this,B,D.changedTouches.length===$).event(D),G,ie,le,De;for(hy(D),ie=0;ie<$;++ie)le=A[ie],De=za(le,this),De=[De,this.__zoom.invert(De),le.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==De[2]&&(Y.touch1=De,Y.taps=0):(Y.touch0=De,G=!0,Y.taps=1+!!d);d&&(d=clearTimeout(d)),G&&(Y.taps<2&&(h=De[0],d=setTimeout(function(){d=null},f)),cy(this),Y.start())}}function P(D,...B){if(this.__zooming){var A=S(this,B).event(D),$=D.changedTouches,Y=$.length,G,ie,le,De;for(mg(D),G=0;G<Y;++G)ie=$[G],le=za(ie,this),A.touch0&&A.touch0[2]===ie.identifier?A.touch0[0]=le:A.touch1&&A.touch1[2]===ie.identifier&&(A.touch1[0]=le);if(ie=A.that.__zoom,A.touch1){var Pe=A.touch0[0],qe=A.touch0[1],Be=A.touch1[0],mt=A.touch1[1],ai=(ai=Be[0]-Pe[0])*ai+(ai=Be[1]-Pe[1])*ai,Mt=(Mt=mt[0]-qe[0])*Mt+(Mt=mt[1]-qe[1])*Mt;ie=w(ie,Math.sqrt(ai/Mt)),le=[(Pe[0]+Be[0])/2,(Pe[1]+Be[1])/2],De=[(qe[0]+mt[0])/2,(qe[1]+mt[1])/2]}else if(A.touch0)le=A.touch0[0],De=A.touch0[1];else return;A.zoom("touch",t(v(ie,le,De),A.extent,o))}}function V(D,...B){if(this.__zooming){var A=S(this,B).event(D),$=D.changedTouches,Y=$.length,G,ie;for(hy(D),u&&clearTimeout(u),u=setTimeout(function(){u=null},f),G=0;G<Y;++G)ie=$[G],A.touch0&&A.touch0[2]===ie.identifier?delete A.touch0:A.touch1&&A.touch1[2]===ie.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(ie=za(ie,this),Math.hypot(h[0]-ie[0],h[1]-ie[1])<m)){var le=_o(this).on("dblclick.zoom");le&&le.apply(this,arguments)}}}return _.wheelDelta=function(D){return arguments.length?(i=typeof D=="function"?D:q_(+D),_):i},_.filter=function(D){return arguments.length?(n=typeof D=="function"?D:q_(!!D),_):n},_.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:q_(!!D),_):s},_.extent=function(D){return arguments.length?(e=typeof D=="function"?D:q_([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),_):e},_.scaleExtent=function(D){return arguments.length?(r[0]=+D[0],r[1]=+D[1],_):[r[0],r[1]]},_.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(D){return arguments.length?(t=D,_):t},_.duration=function(D){return arguments.length?(a=+D,_):a},_.interpolate=function(D){return arguments.length?(l=D,_):l},_.on=function(){var D=c.on.apply(c,arguments);return D===c?_:D},_.clickDistance=function(D){return arguments.length?(p=(D=+D)*D,_):Math.sqrt(p)},_.tapDistance=function(D){return arguments.length?(m=+D,_):m},_}const Iz=()=>{const n=T3(),e=St(()=>`${n.dir}${n.id?"/"+n.id:""}`);return{params:n,sessionKey:e}},Mz=()=>{const n=fH(),{params:e,sessionKey:t}=Iz();return{params:e,sessionKey:t,tabs:St(()=>n.tabs(t)),view:St(()=>n.view(t))}},{use:Az,provider:Hxe}=gH({name:"Preview",gate:!1,init:()=>{const n=T3(),e=N3(),[t,i]=I3({services:[],loading:!1,setting:!1}),s=St(()=>`?directory=${encodeURIComponent(e.directory)}`),r=async()=>{i("loading",!0);try{const w=await e.fetch(`${e.url}/preview/services${s()}`);if(w.ok){const v=await w.json();zb(()=>{i("services",v),i("loading",!1)})}else i("loading",!1)}catch{i("loading",!1)}},o=async w=>{const v=t.services.findIndex(C=>C.name===w);v>=0&&i("services",v,"status","starting");try{const C=await e.fetch(`${e.url}/preview/services/${w}/start${s()}`,{method:"POST"});if(C.ok){const y=await C.json();v>=0?i("services",v,y):i("services",t.services.length,y)}}catch{v>=0&&i("services",v,"status","error")}},a=async w=>{try{await e.fetch(`${e.url}/preview/services/${w}/stop${s()}`,{method:"POST"});const v=t.services.findIndex(C=>C.name===w);v>=0&&i("services",v,"status","stopped")}catch{}},l=async()=>{for(const w of t.services)w.status==="stopped"&&await o(w.name)},c=async()=>{for(const w of t.services)(w.status==="running"||w.status==="starting")&&await a(w.name)},d=async()=>{try{const w=await e.fetch(`${e.url}/preview/infer${s()}`,{method:"POST"});if(w.ok)return await w.json()}catch{}return[]},h=async()=>{i("setting",!0);try{const w=await e.fetch(`${e.url}/preview/setup${s()}`,{method:"POST"});if(!w.ok)return{ok:!1};const v=await w.json(),C=v.services.length>0;return zb(()=>{i("services",v.services),i("active",v.services[0]?.name)}),await l(),await r(),{ok:C,file:v.file,services:v.services}}catch{return{ok:!1}}finally{i("setting",!1)}},u=w=>i("active",w),f=St(()=>t.services.filter(w=>w.status==="running")),g=St(()=>t.services.length>0);Co(()=>{(async()=>(await r(),await l()))()});const p=e.event.on("pty.exited",()=>{r()});Yd(p);const m=e.event.on("ui.navigate",w=>{const v=w.properties;v.sessionID&&v.sessionID!==n.id||v.preview?.name&&(async()=>(await r(),i("active",v.preview.name)))()});Yd(m);let _;return Co(()=>{f().length>0?_||(_=setInterval(()=>void r(),5e3)):_&&(clearInterval(_),_=void 0)}),Yd(()=>{_&&clearInterval(_)}),{services:()=>t.services,active:()=>t.active??t.services[0]?.name,loading:()=>t.loading,setting:()=>t.setting,running:f,configured:g,start:o,stop:a,startAll:l,stopAll:c,refresh:r,infer:d,setup:h,setActive:u}}});function Pn(n){this.content=n}Pn.prototype={constructor:Pn,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var i=t&&t!=n?this.remove(t):this,s=i.find(n),r=i.content.slice();return s==-1?r.push(t||n,e):(r[s+1]=e,t&&(r[s]=t)),new Pn(r)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Pn(t)},addToStart:function(n,e){return new Pn([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Pn(t)},addBefore:function(n,e,t){var i=this.remove(e),s=i.content.slice(),r=i.find(n);return s.splice(r==-1?s.length:r,0,e,t),new Pn(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Pn.from(n),n.size?new Pn(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Pn.from(n),n.size?new Pn(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Pn.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Pn.from=function(n){if(n instanceof Pn)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Pn(e)};function B3(n,e,t){for(let i=0;;i++){if(i==n.childCount||i==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(i),r=e.child(i);if(s==r){t+=s.nodeSize;continue}if(!s.sameMarkup(r))return t;if(s.isText&&s.text!=r.text){for(let o=0;s.text[o]==r.text[o];o++)t++;return t}if(s.content.size||r.content.size){let o=B3(s.content,r.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function V3(n,e,t,i){for(let s=n.childCount,r=e.childCount;;){if(s==0||r==0)return s==r?null:{a:t,b:i};let o=n.child(--s),a=e.child(--r),l=o.nodeSize;if(o==a){t-=l,i-=l;continue}if(!o.sameMarkup(a))return{a:t,b:i};if(o.isText&&o.text!=a.text){let c=0,d=Math.min(o.text.length,a.text.length);for(;c<d&&o.text[o.text.length-c-1]==a.text[a.text.length-c-1];)c++,t--,i--;return{a:t,b:i}}if(o.content.size||a.content.size){let c=V3(o.content,a.content,t-1,i-1);if(c)return c}t-=l,i-=l}}class ce{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,t,i,s=0,r){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&i(l,s+a,r||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,t-d),i,s+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,i,s){let r="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&i&&(o?o=!1:r+=i),r+=c},0),r}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,i=e.firstChild,s=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(i)&&(s[s.length-1]=t.withText(t.text+i.text),r=1);r<e.content.length;r++)s.push(e.content[r]);return new ce(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let i=[],s=0;if(t>e)for(let r=0,o=0;o<t;r++){let a=this.content[r],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),i.push(a),s+=a.nodeSize),o=l}return new ce(i,s)}cutByIndex(e,t){return e==t?ce.empty:e==0&&t==this.content.length?this:new ce(this.content.slice(e,t))}replaceChild(e,t){let i=this.content[e];if(i==t)return this;let s=this.content.slice(),r=this.size+t.nodeSize-i.nodeSize;return s[e]=t,new ce(s,r)}addToStart(e){return new ce([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ce(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,i=0;t<this.content.length;t++){let s=this.content[t];e(s,i,t),i+=s.nodeSize}}findDiffStart(e,t=0){return B3(this,e,t)}findDiffEnd(e,t=this.size,i=e.size){return V3(this,e,t,i)}findIndex(e){if(e==0)return G_(0,e);if(e==this.size)return G_(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,i=0;;t++){let s=this.child(t),r=i+s.nodeSize;if(r>=e)return r==e?G_(t+1,r):G_(t,i);i=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return ce.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ce(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ce.empty;let t,i=0;for(let s=0;s<e.length;s++){let r=e[s];i+=r.nodeSize,s&&r.isText&&e[s-1].sameMarkup(r)?(t||(t=e.slice(0,s)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new ce(t||e,i)}static from(e){if(!e)return ce.empty;if(e instanceof ce)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ce([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ce.empty=new ce([],0);const uy={index:0,offset:0};function G_(n,e){return uy.index=n,uy.offset=e,uy}function $b(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!$b(n[i],e[i]))return!1}else{for(let i in n)if(!(i in e)||!$b(n[i],e[i]))return!1;for(let i in e)if(!(i in n))return!1}return!0}let gi=class gx{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,i=!1;for(let s=0;s<e.length;s++){let r=e[s];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,s));else{if(r.type.excludes(this.type))return e;!i&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),i=!0),t&&t.push(r)}}return t||(t=e.slice()),i||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&$b(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let i=e.marks[t.type];if(!i)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=i.create(t.attrs);return i.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return gx.none;if(e instanceof gx)return[e];let t=e.slice();return t.sort((i,s)=>i.type.rank-s.type.rank),t}};gi.none=[];class Ub extends Error{}class ye{constructor(e,t,i){this.content=e,this.openStart=t,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let i=H3(this.content,e+this.openStart,t);return i&&new ye(i,this.openStart,this.openEnd)}removeBetween(e,t){return new ye(W3(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return ye.empty;let i=t.openStart||0,s=t.openEnd||0;if(typeof i!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ye(ce.fromJSON(e,t.content),i,s)}static maxOpen(e,t=!0){let i=0,s=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)i++;for(let r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)s++;return new ye(e,i,s)}}ye.empty=new ye(ce.empty,0,0);function W3(n,e,t){let{index:i,offset:s}=n.findIndex(e),r=n.maybeChild(i),{index:o,offset:a}=n.findIndex(t);if(s==e||r.isText){if(a!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(i!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(i,r.copy(W3(r.content,e-s-1,t-s-1)))}function H3(n,e,t,i){let{index:s,offset:r}=n.findIndex(e),o=n.maybeChild(s);if(r==e||o.isText)return i&&!i.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=H3(o.content,e-r-1,t,o);return a&&n.replaceChild(s,o.copy(a))}function Rz(n,e,t){if(t.openStart>n.depth)throw new Ub("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Ub("Inconsistent open depths");return z3(n,e,t,0)}function z3(n,e,t,i){let s=n.index(i),r=n.node(i);if(s==e.index(i)&&i<n.depth-t.openStart){let o=z3(n,e,t,i+1);return r.copy(r.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==i&&e.depth==i){let o=n.parent,a=o.content;return Qd(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Oz(t,n);return Qd(r,U3(n,o,a,e,i))}else return Qd(r,jb(n,e,i))}function $3(n,e){if(!e.type.compatibleContent(n.type))throw new Ub("Cannot join "+e.type.name+" onto "+n.type.name)}function px(n,e,t){let i=n.node(t);return $3(i,e.node(t)),i}function Xd(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function fp(n,e,t,i){let s=(e||n).node(t),r=0,o=e?e.index(t):s.childCount;n&&(r=n.index(t),n.depth>t?r++:n.textOffset&&(Xd(n.nodeAfter,i),r++));for(let a=r;a<o;a++)Xd(s.child(a),i);e&&e.depth==t&&e.textOffset&&Xd(e.nodeBefore,i)}function Qd(n,e){return n.type.checkContent(e),n.copy(e)}function U3(n,e,t,i,s){let r=n.depth>s&&px(n,e,s+1),o=i.depth>s&&px(t,i,s+1),a=[];return fp(null,n,s,a),r&&o&&e.index(s)==t.index(s)?($3(r,o),Xd(Qd(r,U3(n,e,t,i,s+1)),a)):(r&&Xd(Qd(r,jb(n,e,s+1)),a),fp(e,t,s,a),o&&Xd(Qd(o,jb(t,i,s+1)),a)),fp(i,null,s,a),new ce(a)}function jb(n,e,t){let i=[];if(fp(null,n,t,i),n.depth>t){let s=px(n,e,t+1);Xd(Qd(s,jb(n,e,t+1)),i)}return fp(e,null,t,i),new ce(i)}function Oz(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let r=t-1;r>=0;r--)s=e.node(r).copy(ce.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class im{constructor(e,t,i){this.pos=e,this.path=t,this.parentOffset=i,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let i=this.pos-this.path[this.path.length-1],s=e.child(t);return i?e.child(t).cut(i):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let i=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let r=0;r<e;r++)s+=i.child(r).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return gi.none;if(this.textOffset)return e.child(t).marks;let i=e.maybeChild(t-1),s=e.maybeChild(t);if(!i){let a=i;i=s,s=a}let r=i.marks;for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].removeFromSet(r));return r}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let i=t.marks,s=e.parent.maybeChild(e.index());for(var r=0;r<i.length;r++)i[r].type.spec.inclusive===!1&&(!s||!i[r].isInSet(s.marks))&&(i=i[r--].removeFromSet(i));return i}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new Kb(this,e,i);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let i=[],s=0,r=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(r),c=r-l;if(i.push(o,a,s+l),!c||(o=o.child(a),o.isText))break;r=c-1,s+=l+1}return new im(t,i,r)}static resolveCached(e,t){let i=nM.get(e);if(i)for(let r=0;r<i.elts.length;r++){let o=i.elts[r];if(o.pos==t)return o}else nM.set(e,i=new Pz);let s=i.elts[i.i]=im.resolve(e,t);return i.i=(i.i+1)%Fz,s}}class Pz{constructor(){this.elts=[],this.i=0}}const Fz=12,nM=new WeakMap;class Kb{constructor(e,t,i){this.$from=e,this.$to=t,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Bz=Object.create(null);let Sc=class mx{constructor(e,t,i,s=gi.none){this.type=e,this.attrs=t,this.marks=s,this.content=i||ce.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,i,s=0){this.content.nodesBetween(e,t,i,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,i,s){return this.content.textBetween(e,t,i,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,i){return this.type==e&&$b(this.attrs,t||e.defaultAttrs||Bz)&&gi.sameSet(this.marks,i||gi.none)}copy(e=null){return e==this.content?this:new mx(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new mx(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,i=!1){if(e==t)return ye.empty;let s=this.resolve(e),r=this.resolve(t),o=i?0:s.sharedDepth(t),a=s.start(o),c=s.node(o).content.cut(s.pos-a,r.pos-a);return new ye(c,s.depth-o,r.depth-o)}replace(e,t,i){return Rz(this.resolve(e),this.resolve(t),i)}nodeAt(e){for(let t=this;;){let{index:i,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(i),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(t),index:t,offset:i};let s=this.content.child(t-1);return{node:s,index:t-1,offset:i-s.nodeSize}}resolve(e){return im.resolveCached(this,e)}resolveNoCache(e){return im.resolve(this,e)}rangeHasMark(e,t,i){let s=!1;return t>e&&this.nodesBetween(e,t,r=>(i.isInSet(r.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),j3(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,i=ce.empty,s=0,r=i.childCount){let o=this.contentMatchAt(e).matchFragment(i,s,r),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=s;l<r;l++)if(!this.type.allowsMarks(i.child(l).marks))return!1;return!0}canReplaceWith(e,t,i,s){if(s&&!this.type.allowsMarks(s))return!1;let r=this.contentMatchAt(e).matchType(i),o=r&&r.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=gi.none;for(let t=0;t<this.marks.length;t++){let i=this.marks[t];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!gi.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let i;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}let s=ce.fromJSON(e,t.content),r=e.nodeType(t.type).create(t.attrs,s,i);return r.type.checkAttrs(r.attrs),r}};Sc.prototype.text=void 0;class qb extends Sc{constructor(e,t,i,s){if(super(e,t,null,s),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):j3(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new qb(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new qb(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function j3(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class fh{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let i=new Vz(e,t);if(i.next==null)return fh.empty;let s=K3(i);i.next&&i.err("Unexpected trailing text");let r=Kz(jz(s));return qz(r,i),r}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,i=e.childCount){let s=this;for(let r=t;s&&r<i;r++)s=s.matchType(e.child(r).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let i=0;i<e.next.length;i++)if(this.next[t].type==e.next[i].type)return!0;return!1}fillBefore(e,t=!1,i=0){let s=[this];function r(o,a){let l=o.matchFragment(e,i);if(l&&(!t||l.validEnd))return ce.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:d,next:h}=o.next[c];if(!(d.isText||d.hasRequiredAttrs())&&s.indexOf(h)==-1){s.push(h);let u=r(h,a.concat(d));if(u)return u}}return null}return r(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let s=i.shift(),r=s.match;if(r.matchType(e)){let o=[];for(let a=s;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<r.next.length;o++){let{type:a,next:l}=r.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!s.type||l.validEnd)&&(i.push({match:a.contentMatch,type:a,via:s}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(i){e.push(i);for(let s=0;s<i.next.length;s++)e.indexOf(i.next[s].next)==-1&&t(i.next[s].next)}return t(this),e.map((i,s)=>{let r=s+(i.validEnd?"*":" ")+" ";for(let o=0;o<i.next.length;o++)r+=(o?", ":"")+i.next[o].type.name+"->"+e.indexOf(i.next[o].next);return r}).join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-aAsBprVy.js","assets/index-Dxo83Gsl.js","assets/index-9-q5x_AZ.css","assets/select-COPHquWP.js","assets/chunk-VVM5DH6Z-CUl6IXI5.js","assets/transform-BwXaE9hv.js","assets/trellis-op-icon-7bLDDzgi.js","assets/handlebars-B9y9KVva.js","assets/html-B4yimBtZ.js","assets/javascript-xyQKZDGW.js","assets/typescript-BRzjXkWD.js","assets/liquid-B5YkEln-.js","assets/mdx-IAVXqYJ2.js","assets/python-BcPmedha.js","assets/razor-Dae0nPVH.js","assets/xml-DwrPHn8a.js","assets/yaml-D5NhyUmN.js","assets/cssMode-CWSvB3aC.js","assets/htmlMode-XkoEE1Us.js","assets/jsonMode-PsmTZD9i.js","assets/tsMode-C8IFzmUX.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as fH,i as St,a4 as T3,cI as gH,a2 as N3,H as I3,O as Co,P as Yd,aH as zb,dc as pH,dd as mH,de as _H,df as bH,_ as fe,v as M3,l as K,m as X,S as Re,n as oa,I as zn,q as on,x as cl,y as aa,aD as lr,dg as wH,aC as Z2,t as de,h as $t,B as Eo,bm as CH,o as Sl,z as vH,cs as yH,bx as SH,c5 as xH,j as o_,ch as Ro,aJ as kH,f as A3,aE as LH,cK as R3,A as EH,s as Or,V as a_,F as Yi,dh as vC,Q as la,cZ as DH,c$ as TH,di as NH,bZ as ux,C as IH,dj as MH}from"./index-Dxo83Gsl.js";import{S as AH}from"./select-COPHquWP.js";import{s as _o,g as X2,t as RH,j as Q2,T as ly,k as cy}from"./transform-BwXaE9hv.js";import{T as OH}from"./trellis-op-icon-7bLDDzgi.js";function PH(n){let e;for(;e=n.sourceEvent;)n=e;return n}function za(n,e){if(n=PH(n),e===void 0&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var i=t.createSVGPoint();return i.x=n.clientX,i.y=n.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var s=e.getBoundingClientRect();return[n.clientX-s.left-e.clientLeft,n.clientY-s.top-e.clientTop]}}return[n.pageX,n.pageY]}const FH={passive:!1},tm={capture:!0,passive:!1};function dy(n){n.stopImmediatePropagation()}function zu(n){n.preventDefault(),n.stopImmediatePropagation()}function O3(n){var e=n.document.documentElement,t=_o(n).on("dragstart.drag",zu,tm);"onselectstart"in e?t.on("selectstart.drag",zu,tm):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function P3(n,e){var t=n.document.documentElement,i=_o(n).on("dragstart.drag",null);e&&(i.on("click.drag",zu,tm),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in t?i.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}const K_=n=>()=>n;function fx(n,{sourceEvent:e,subject:t,target:i,identifier:s,active:r,x:o,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}fx.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function BH(n){return!n.ctrlKey&&!n.button}function VH(){return this.parentNode}function WH(n,e){return e??{x:n.x,y:n.y}}function HH(){return navigator.maxTouchPoints||"ontouchstart"in this}function zH(){var n=BH,e=VH,t=WH,i=HH,s={},r=X2("start","drag","end"),o=0,a,l,c,d,h=0;function u(C){C.on("mousedown.drag",f).filter(i).on("touchstart.drag",m).on("touchmove.drag",_,FH).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(C,y){if(!(d||!n.call(this,C,y))){var S=v(this,e.call(this,C,y),C,y,"mouse");S&&(_o(C.view).on("mousemove.drag",g,tm).on("mouseup.drag",p,tm),O3(C.view),dy(C),c=!1,a=C.clientX,l=C.clientY,S("start",C))}}function g(C){if(zu(C),!c){var y=C.clientX-a,S=C.clientY-l;c=y*y+S*S>h}s.mouse("drag",C)}function p(C){_o(C.view).on("mousemove.drag mouseup.drag",null),P3(C.view,c),zu(C),s.mouse("end",C)}function m(C,y){if(n.call(this,C,y)){var S=C.changedTouches,x=e.call(this,C,y),L=S.length,E,O;for(E=0;E<L;++E)(O=v(this,x,C,y,S[E].identifier,S[E]))&&(dy(C),O("start",C,S[E]))}}function _(C){var y=C.changedTouches,S=y.length,x,L;for(x=0;x<S;++x)(L=s[y[x].identifier])&&(zu(C),L("drag",C,y[x]))}function w(C){var y=C.changedTouches,S=y.length,x,L;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),x=0;x<S;++x)(L=s[y[x].identifier])&&(dy(C),L("end",C,y[x]))}function v(C,y,S,x,L,E){var O=r.copy(),M=za(E||S,y),P,V,D;if((D=t.call(C,new fx("beforestart",{sourceEvent:S,target:u,identifier:L,active:o,x:M[0],y:M[1],dx:0,dy:0,dispatch:O}),x))!=null)return P=D.x-M[0]||0,V=D.y-M[1]||0,function B(A,$,Y){var G=M,ie;switch(A){case"start":s[L]=B,ie=o++;break;case"end":delete s[L],--o;case"drag":M=za(Y||$,y),ie=o;break}O.call(A,C,new fx(A,{sourceEvent:$,subject:D,target:u,identifier:L,active:ie,x:M[0]+P,y:M[1]+V,dx:M[0]-G[0],dy:M[1]-G[1],dispatch:O}),x)}}return u.filter=function(C){return arguments.length?(n=typeof C=="function"?C:K_(!!C),u):n},u.container=function(C){return arguments.length?(e=typeof C=="function"?C:K_(C),u):e},u.subject=function(C){return arguments.length?(t=typeof C=="function"?C:K_(C),u):t},u.touchable=function(C){return arguments.length?(i=typeof C=="function"?C:K_(!!C),u):i},u.on=function(){var C=r.on.apply(r,arguments);return C===r?u:C},u.clickDistance=function(C){return arguments.length?(h=(C=+C)*C,u):Math.sqrt(h)},u}var $H=1e-12;function QI(n){return((n=Math.exp(n))+1/n)/2}function UH(n){return((n=Math.exp(n))-1/n)/2}function jH(n){return((n=Math.exp(2*n))-1)/(n+1)}const KH=(function n(e,t,i){function s(r,o){var a=r[0],l=r[1],c=r[2],d=o[0],h=o[1],u=o[2],f=d-a,g=h-l,p=f*f+g*g,m,_;if(p<$H)_=Math.log(u/c)/e,m=function(x){return[a+x*f,l+x*g,c*Math.exp(e*x*_)]};else{var w=Math.sqrt(p),v=(u*u-c*c+i*p)/(2*c*t*w),C=(u*u-c*c-i*p)/(2*u*t*w),y=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(C*C+1)-C);_=(S-y)/e,m=function(x){var L=x*_,E=QI(y),O=c/(t*w)*(E*jH(e*L+y)-UH(y));return[a+O*f,l+O*g,c*E/QI(e*L+y)]}}return m.duration=_*1e3*e/Math.SQRT2,m}return s.rho=function(r){var o=Math.max(.001,+r),a=o*o,l=a*a;return n(o,a,l)},s})(Math.SQRT2,2,4);function qH(n,e){var t,i=1;n==null&&(n=0),e==null&&(e=0);function s(){var r,o=t.length,a,l=0,c=0;for(r=0;r<o;++r)a=t[r],l+=a.x,c+=a.y;for(l=(l/o-n)*i,c=(c/o-e)*i,r=0;r<o;++r)a=t[r],a.x-=l,a.y-=c}return s.initialize=function(r){t=r},s.x=function(r){return arguments.length?(n=+r,s):n},s.y=function(r){return arguments.length?(e=+r,s):e},s.strength=function(r){return arguments.length?(i=+r,s):i},s}function GH(n){const e=+this._x.call(null,n),t=+this._y.call(null,n);return F3(this.cover(e,t),e,t,n)}function F3(n,e,t,i){if(isNaN(e)||isNaN(t))return n;var s,r=n._root,o={data:i},a=n._x0,l=n._y0,c=n._x1,d=n._y1,h,u,f,g,p,m,_,w;if(!r)return n._root=o,n;for(;r.length;)if((p=e>=(h=(a+c)/2))?a=h:c=h,(m=t>=(u=(l+d)/2))?l=u:d=u,s=r,!(r=r[_=m<<1|p]))return s[_]=o,n;if(f=+n._x.call(null,r.data),g=+n._y.call(null,r.data),e===f&&t===g)return o.next=r,s?s[_]=o:n._root=o,n;do s=s?s[_]=new Array(4):n._root=new Array(4),(p=e>=(h=(a+c)/2))?a=h:c=h,(m=t>=(u=(l+d)/2))?l=u:d=u;while((_=m<<1|p)===(w=(g>=u)<<1|f>=h));return s[w]=r,s[_]=o,n}function YH(n){var e,t,i=n.length,s,r,o=new Array(i),a=new Array(i),l=1/0,c=1/0,d=-1/0,h=-1/0;for(t=0;t<i;++t)isNaN(s=+this._x.call(null,e=n[t]))||isNaN(r=+this._y.call(null,e))||(o[t]=s,a[t]=r,s<l&&(l=s),s>d&&(d=s),r<c&&(c=r),r>h&&(h=r));if(l>d||c>h)return this;for(this.cover(l,c).cover(d,h),t=0;t<i;++t)F3(this,o[t],a[t],n[t]);return this}function ZH(n,e){if(isNaN(n=+n)||isNaN(e=+e))return this;var t=this._x0,i=this._y0,s=this._x1,r=this._y1;if(isNaN(t))s=(t=Math.floor(n))+1,r=(i=Math.floor(e))+1;else{for(var o=s-t||1,a=this._root,l,c;t>n||n>=s||i>e||e>=r;)switch(c=(e<i)<<1|n<t,l=new Array(4),l[c]=a,a=l,o*=2,c){case 0:s=t+o,r=i+o;break;case 1:t=s-o,r=i+o;break;case 2:s=t+o,i=r-o;break;case 3:t=s-o,i=r-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=t,this._y0=i,this._x1=s,this._y1=r,this}function XH(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function QH(n){return arguments.length?this.cover(+n[0][0],+n[0][1]).cover(+n[1][0],+n[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function ys(n,e,t,i,s){this.node=n,this.x0=e,this.y0=t,this.x1=i,this.y1=s}function JH(n,e,t){var i,s=this._x0,r=this._y0,o,a,l,c,d=this._x1,h=this._y1,u=[],f=this._root,g,p;for(f&&u.push(new ys(f,s,r,d,h)),t==null?t=1/0:(s=n-t,r=e-t,d=n+t,h=e+t,t*=t);g=u.pop();)if(!(!(f=g.node)||(o=g.x0)>d||(a=g.y0)>h||(l=g.x1)<s||(c=g.y1)<r))if(f.length){var m=(o+l)/2,_=(a+c)/2;u.push(new ys(f[3],m,_,l,c),new ys(f[2],o,_,m,c),new ys(f[1],m,a,l,_),new ys(f[0],o,a,m,_)),(p=(e>=_)<<1|n>=m)&&(g=u[u.length-1],u[u.length-1]=u[u.length-1-p],u[u.length-1-p]=g)}else{var w=n-+this._x.call(null,f.data),v=e-+this._y.call(null,f.data),C=w*w+v*v;if(C<t){var y=Math.sqrt(t=C);s=n-y,r=e-y,d=n+y,h=e+y,i=f.data}}return i}function ez(n){if(isNaN(d=+this._x.call(null,n))||isNaN(h=+this._y.call(null,n)))return this;var e,t=this._root,i,s,r,o=this._x0,a=this._y0,l=this._x1,c=this._y1,d,h,u,f,g,p,m,_;if(!t)return this;if(t.length)for(;;){if((g=d>=(u=(o+l)/2))?o=u:l=u,(p=h>=(f=(a+c)/2))?a=f:c=f,e=t,!(t=t[m=p<<1|g]))return this;if(!t.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(i=e,_=m)}for(;t.data!==n;)if(s=t,!(t=t.next))return this;return(r=t.next)&&delete t.next,s?(r?s.next=r:delete s.next,this):e?(r?e[m]=r:delete e[m],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(i?i[_]=t:this._root=t),this):(this._root=r,this)}function tz(n){for(var e=0,t=n.length;e<t;++e)this.remove(n[e]);return this}function iz(){return this._root}function nz(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function sz(n){var e=[],t,i=this._root,s,r,o,a,l;for(i&&e.push(new ys(i,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!n(i=t.node,r=t.x0,o=t.y0,a=t.x1,l=t.y1)&&i.length){var c=(r+a)/2,d=(o+l)/2;(s=i[3])&&e.push(new ys(s,c,d,a,l)),(s=i[2])&&e.push(new ys(s,r,d,c,l)),(s=i[1])&&e.push(new ys(s,c,o,a,d)),(s=i[0])&&e.push(new ys(s,r,o,c,d))}return this}function rz(n){var e=[],t=[],i;for(this._root&&e.push(new ys(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var s=i.node;if(s.length){var r,o=i.x0,a=i.y0,l=i.x1,c=i.y1,d=(o+l)/2,h=(a+c)/2;(r=s[0])&&e.push(new ys(r,o,a,d,h)),(r=s[1])&&e.push(new ys(r,d,a,l,h)),(r=s[2])&&e.push(new ys(r,o,h,d,c)),(r=s[3])&&e.push(new ys(r,d,h,l,c))}t.push(i)}for(;i=t.pop();)n(i.node,i.x0,i.y0,i.x1,i.y1);return this}function oz(n){return n[0]}function az(n){return arguments.length?(this._x=n,this):this._x}function lz(n){return n[1]}function cz(n){return arguments.length?(this._y=n,this):this._y}function J2(n,e,t){var i=new eD(e??oz,t??lz,NaN,NaN,NaN,NaN);return n==null?i:i.addAll(n)}function eD(n,e,t,i,s,r){this._x=n,this._y=e,this._x0=t,this._y0=i,this._x1=s,this._y1=r,this._root=void 0}function JI(n){for(var e={data:n.data},t=e;n=n.next;)t=t.next={data:n.data};return e}var As=J2.prototype=eD.prototype;As.copy=function(){var n=new eD(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,i;if(!e)return n;if(!e.length)return n._root=JI(e),n;for(t=[{source:e,target:n._root=new Array(4)}];e=t.pop();)for(var s=0;s<4;++s)(i=e.source[s])&&(i.length?t.push({source:i,target:e.target[s]=new Array(4)}):e.target[s]=JI(i));return n};As.add=GH;As.addAll=YH;As.cover=ZH;As.data=XH;As.extent=QH;As.find=JH;As.remove=ez;As.removeAll=tz;As.root=iz;As.size=nz;As.visit=sz;As.visitAfter=rz;As.x=az;As.y=cz;function Zd(n){return function(){return n}}function cc(n){return(n()-.5)*1e-6}function dz(n){return n.x+n.vx}function hz(n){return n.y+n.vy}function uz(n){var e,t,i,s=1,r=1;typeof n!="function"&&(n=Zd(n==null?1:+n));function o(){for(var c,d=e.length,h,u,f,g,p,m,_=0;_<r;++_)for(h=J2(e,dz,hz).visitAfter(a),c=0;c<d;++c)u=e[c],p=t[u.index],m=p*p,f=u.x+u.vx,g=u.y+u.vy,h.visit(w);function w(v,C,y,S,x){var L=v.data,E=v.r,O=p+E;if(L){if(L.index>u.index){var M=f-L.x-L.vx,P=g-L.y-L.vy,V=M*M+P*P;V<O*O&&(M===0&&(M=cc(i),V+=M*M),P===0&&(P=cc(i),V+=P*P),V=(O-(V=Math.sqrt(V)))/V*s,u.vx+=(M*=V)*(O=(E*=E)/(m+E)),u.vy+=(P*=V)*O,L.vx-=M*(O=1-O),L.vy-=P*O)}return}return C>f+O||S<f-O||y>g+O||x<g-O}}function a(c){if(c.data)return c.r=t[c.data.index];for(var d=c.r=0;d<4;++d)c[d]&&c[d].r>c.r&&(c.r=c[d].r)}function l(){if(e){var c,d=e.length,h;for(t=new Array(d),c=0;c<d;++c)h=e[c],t[h.index]=+n(h,c,e)}}return o.initialize=function(c,d){e=c,i=d,l()},o.iterations=function(c){return arguments.length?(r=+c,o):r},o.strength=function(c){return arguments.length?(s=+c,o):s},o.radius=function(c){return arguments.length?(n=typeof c=="function"?c:Zd(+c),l(),o):n},o}function fz(n){return n.index}function eM(n,e){var t=n.get(e);if(!t)throw new Error("node not found: "+e);return t}function gz(n){var e=fz,t=h,i,s=Zd(30),r,o,a,l,c,d=1;n==null&&(n=[]);function h(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function u(m){for(var _=0,w=n.length;_<d;++_)for(var v=0,C,y,S,x,L,E,O;v<w;++v)C=n[v],y=C.source,S=C.target,x=S.x+S.vx-y.x-y.vx||cc(c),L=S.y+S.vy-y.y-y.vy||cc(c),E=Math.sqrt(x*x+L*L),E=(E-r[v])/E*m*i[v],x*=E,L*=E,S.vx-=x*(O=l[v]),S.vy-=L*O,y.vx+=x*(O=1-O),y.vy+=L*O}function f(){if(o){var m,_=o.length,w=n.length,v=new Map(o.map((y,S)=>[e(y,S,o),y])),C;for(m=0,a=new Array(_);m<w;++m)C=n[m],C.index=m,typeof C.source!="object"&&(C.source=eM(v,C.source)),typeof C.target!="object"&&(C.target=eM(v,C.target)),a[C.source.index]=(a[C.source.index]||0)+1,a[C.target.index]=(a[C.target.index]||0)+1;for(m=0,l=new Array(w);m<w;++m)C=n[m],l[m]=a[C.source.index]/(a[C.source.index]+a[C.target.index]);i=new Array(w),g(),r=new Array(w),p()}}function g(){if(o)for(var m=0,_=n.length;m<_;++m)i[m]=+t(n[m],m,n)}function p(){if(o)for(var m=0,_=n.length;m<_;++m)r[m]=+s(n[m],m,n)}return u.initialize=function(m,_){o=m,c=_,f()},u.links=function(m){return arguments.length?(n=m,f(),u):n},u.id=function(m){return arguments.length?(e=m,u):e},u.iterations=function(m){return arguments.length?(d=+m,u):d},u.strength=function(m){return arguments.length?(t=typeof m=="function"?m:Zd(+m),g(),u):t},u.distance=function(m){return arguments.length?(s=typeof m=="function"?m:Zd(+m),p(),u):s},u}const pz=1664525,mz=1013904223,tM=4294967296;function _z(){let n=1;return()=>(n=(pz*n+mz)%tM)/tM}function bz(n){return n.x}function wz(n){return n.y}var Cz=10,vz=Math.PI*(3-Math.sqrt(5));function yz(n){var e,t=1,i=.001,s=1-Math.pow(i,1/300),r=0,o=.6,a=new Map,l=RH(h),c=X2("tick","end"),d=_z();n==null&&(n=[]);function h(){u(),c.call("tick",e),t<i&&(l.stop(),c.call("end",e))}function u(p){var m,_=n.length,w;p===void 0&&(p=1);for(var v=0;v<p;++v)for(t+=(r-t)*s,a.forEach(function(C){C(t)}),m=0;m<_;++m)w=n[m],w.fx==null?w.x+=w.vx*=o:(w.x=w.fx,w.vx=0),w.fy==null?w.y+=w.vy*=o:(w.y=w.fy,w.vy=0);return e}function f(){for(var p=0,m=n.length,_;p<m;++p){if(_=n[p],_.index=p,_.fx!=null&&(_.x=_.fx),_.fy!=null&&(_.y=_.fy),isNaN(_.x)||isNaN(_.y)){var w=Cz*Math.sqrt(.5+p),v=p*vz;_.x=w*Math.cos(v),_.y=w*Math.sin(v)}(isNaN(_.vx)||isNaN(_.vy))&&(_.vx=_.vy=0)}}function g(p){return p.initialize&&p.initialize(n,d),p}return f(),e={tick:u,restart:function(){return l.restart(h),e},stop:function(){return l.stop(),e},nodes:function(p){return arguments.length?(n=p,f(),a.forEach(g),e):n},alpha:function(p){return arguments.length?(t=+p,e):t},alphaMin:function(p){return arguments.length?(i=+p,e):i},alphaDecay:function(p){return arguments.length?(s=+p,e):+s},alphaTarget:function(p){return arguments.length?(r=+p,e):r},velocityDecay:function(p){return arguments.length?(o=1-p,e):1-o},randomSource:function(p){return arguments.length?(d=p,a.forEach(g),e):d},force:function(p,m){return arguments.length>1?(m==null?a.delete(p):a.set(p,g(m)),e):a.get(p)},find:function(p,m,_){var w=0,v=n.length,C,y,S,x,L;for(_==null?_=1/0:_*=_,w=0;w<v;++w)x=n[w],C=p-x.x,y=m-x.y,S=C*C+y*y,S<_&&(L=x,_=S);return L},on:function(p,m){return arguments.length>1?(c.on(p,m),e):c.on(p)}}}function Sz(){var n,e,t,i,s=Zd(-30),r,o=1,a=1/0,l=.81;function c(f){var g,p=n.length,m=J2(n,bz,wz).visitAfter(h);for(i=f,g=0;g<p;++g)e=n[g],m.visit(u)}function d(){if(n){var f,g=n.length,p;for(r=new Array(g),f=0;f<g;++f)p=n[f],r[p.index]=+s(p,f,n)}}function h(f){var g=0,p,m,_=0,w,v,C;if(f.length){for(w=v=C=0;C<4;++C)(p=f[C])&&(m=Math.abs(p.value))&&(g+=p.value,_+=m,w+=m*p.x,v+=m*p.y);f.x=w/_,f.y=v/_}else{p=f,p.x=p.data.x,p.y=p.data.y;do g+=r[p.data.index];while(p=p.next)}f.value=g}function u(f,g,p,m){if(!f.value)return!0;var _=f.x-e.x,w=f.y-e.y,v=m-g,C=_*_+w*w;if(v*v/l<C)return C<a&&(_===0&&(_=cc(t),C+=_*_),w===0&&(w=cc(t),C+=w*w),C<o&&(C=Math.sqrt(o*C)),e.vx+=_*f.value*i/C,e.vy+=w*f.value*i/C),!0;if(f.length||C>=a)return;(f.data!==e||f.next)&&(_===0&&(_=cc(t),C+=_*_),w===0&&(w=cc(t),C+=w*w),C<o&&(C=Math.sqrt(o*C)));do f.data!==e&&(v=r[f.data.index]*i/C,e.vx+=_*v,e.vy+=w*v);while(f=f.next)}return c.initialize=function(f,g){n=f,t=g,d()},c.strength=function(f){return arguments.length?(s=typeof f=="function"?f:Zd(+f),d(),c):s},c.distanceMin=function(f){return arguments.length?(o=f*f,c):Math.sqrt(o)},c.distanceMax=function(f){return arguments.length?(a=f*f,c):Math.sqrt(a)},c.theta=function(f){return arguments.length?(l=f*f,c):Math.sqrt(l)},c}const q_=n=>()=>n;function xz(n,{sourceEvent:e,target:t,transform:i,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function hy(n){n.stopImmediatePropagation()}function mg(n){n.preventDefault(),n.stopImmediatePropagation()}function kz(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function Lz(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function iM(){return this.__zoom||Q2}function Ez(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Dz(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tz(n,e,t){var i=n.invertX(e[0][0])-t[0][0],s=n.invertX(e[1][0])-t[1][0],r=n.invertY(e[0][1])-t[0][1],o=n.invertY(e[1][1])-t[1][1];return n.translate(s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s),o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o))}function Nz(){var n=kz,e=Lz,t=Tz,i=Ez,s=Dz,r=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=KH,c=X2("start","zoom","end"),d,h,u,f=500,g=150,p=0,m=10;function _(D){D.property("__zoom",iM).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(D,B,A,$){var Y=D.selection?D.selection():D;Y.property("__zoom",iM),D!==Y?y(D,B,A,$):Y.interrupt().each(function(){S(this,arguments).event($).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},_.scaleBy=function(D,B,A,$){_.scaleTo(D,function(){var Y=this.__zoom.k,G=typeof B=="function"?B.apply(this,arguments):B;return Y*G},A,$)},_.scaleTo=function(D,B,A,$){_.transform(D,function(){var Y=e.apply(this,arguments),G=this.__zoom,ie=A==null?C(Y):typeof A=="function"?A.apply(this,arguments):A,le=G.invert(ie),De=typeof B=="function"?B.apply(this,arguments):B;return t(v(w(G,De),ie,le),Y,o)},A,$)},_.translateBy=function(D,B,A,$){_.transform(D,function(){return t(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof A=="function"?A.apply(this,arguments):A),e.apply(this,arguments),o)},null,$)},_.translateTo=function(D,B,A,$,Y){_.transform(D,function(){var G=e.apply(this,arguments),ie=this.__zoom,le=$==null?C(G):typeof $=="function"?$.apply(this,arguments):$;return t(Q2.translate(le[0],le[1]).scale(ie.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof A=="function"?-A.apply(this,arguments):-A),G,o)},$,Y)};function w(D,B){return B=Math.max(r[0],Math.min(r[1],B)),B===D.k?D:new ly(B,D.x,D.y)}function v(D,B,A){var $=B[0]-A[0]*D.k,Y=B[1]-A[1]*D.k;return $===D.x&&Y===D.y?D:new ly(D.k,$,Y)}function C(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function y(D,B,A,$){D.on("start.zoom",function(){S(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event($).end()}).tween("zoom",function(){var Y=this,G=arguments,ie=S(Y,G).event($),le=e.apply(Y,G),De=A==null?C(le):typeof A=="function"?A.apply(Y,G):A,Pe=Math.max(le[1][0]-le[0][0],le[1][1]-le[0][1]),qe=Y.__zoom,Be=typeof B=="function"?B.apply(Y,G):B,mt=l(qe.invert(De).concat(Pe/qe.k),Be.invert(De).concat(Pe/Be.k));return function(ai){if(ai===1)ai=Be;else{var Mt=mt(ai),Qn=Pe/Mt[2];ai=new ly(Qn,De[0]-Mt[0]*Qn,De[1]-Mt[1]*Qn)}ie.zoom(null,ai)}})}function S(D,B,A){return!A&&D.__zooming||new x(D,B)}function x(D,B){this.that=D,this.args=B,this.active=0,this.sourceEvent=null,this.extent=e.apply(D,B),this.taps=0}x.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,B){return this.mouse&&D!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var B=_o(this.that).datum();c.call(D,this.that,new xz(D,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:c}),B)}};function L(D,...B){if(!n.apply(this,arguments))return;var A=S(this,B).event(D),$=this.__zoom,Y=Math.max(r[0],Math.min(r[1],$.k*Math.pow(2,i.apply(this,arguments)))),G=za(D);if(A.wheel)(A.mouse[0][0]!==G[0]||A.mouse[0][1]!==G[1])&&(A.mouse[1]=$.invert(A.mouse[0]=G)),clearTimeout(A.wheel);else{if($.k===Y)return;A.mouse=[G,$.invert(G)],cy(this),A.start()}mg(D),A.wheel=setTimeout(ie,g),A.zoom("mouse",t(v(w($,Y),A.mouse[0],A.mouse[1]),A.extent,o));function ie(){A.wheel=null,A.end()}}function E(D,...B){if(u||!n.apply(this,arguments))return;var A=D.currentTarget,$=S(this,B,!0).event(D),Y=_o(D.view).on("mousemove.zoom",De,!0).on("mouseup.zoom",Pe,!0),G=za(D,A),ie=D.clientX,le=D.clientY;O3(D.view),hy(D),$.mouse=[G,this.__zoom.invert(G)],cy(this),$.start();function De(qe){if(mg(qe),!$.moved){var Be=qe.clientX-ie,mt=qe.clientY-le;$.moved=Be*Be+mt*mt>p}$.event(qe).zoom("mouse",t(v($.that.__zoom,$.mouse[0]=za(qe,A),$.mouse[1]),$.extent,o))}function Pe(qe){Y.on("mousemove.zoom mouseup.zoom",null),P3(qe.view,$.moved),mg(qe),$.event(qe).end()}}function O(D,...B){if(n.apply(this,arguments)){var A=this.__zoom,$=za(D.changedTouches?D.changedTouches[0]:D,this),Y=A.invert($),G=A.k*(D.shiftKey?.5:2),ie=t(v(w(A,G),$,Y),e.apply(this,B),o);mg(D),a>0?_o(this).transition().duration(a).call(y,ie,$,D):_o(this).call(_.transform,ie,$,D)}}function M(D,...B){if(n.apply(this,arguments)){var A=D.touches,$=A.length,Y=S(this,B,D.changedTouches.length===$).event(D),G,ie,le,De;for(hy(D),ie=0;ie<$;++ie)le=A[ie],De=za(le,this),De=[De,this.__zoom.invert(De),le.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==De[2]&&(Y.touch1=De,Y.taps=0):(Y.touch0=De,G=!0,Y.taps=1+!!d);d&&(d=clearTimeout(d)),G&&(Y.taps<2&&(h=De[0],d=setTimeout(function(){d=null},f)),cy(this),Y.start())}}function P(D,...B){if(this.__zooming){var A=S(this,B).event(D),$=D.changedTouches,Y=$.length,G,ie,le,De;for(mg(D),G=0;G<Y;++G)ie=$[G],le=za(ie,this),A.touch0&&A.touch0[2]===ie.identifier?A.touch0[0]=le:A.touch1&&A.touch1[2]===ie.identifier&&(A.touch1[0]=le);if(ie=A.that.__zoom,A.touch1){var Pe=A.touch0[0],qe=A.touch0[1],Be=A.touch1[0],mt=A.touch1[1],ai=(ai=Be[0]-Pe[0])*ai+(ai=Be[1]-Pe[1])*ai,Mt=(Mt=mt[0]-qe[0])*Mt+(Mt=mt[1]-qe[1])*Mt;ie=w(ie,Math.sqrt(ai/Mt)),le=[(Pe[0]+Be[0])/2,(Pe[1]+Be[1])/2],De=[(qe[0]+mt[0])/2,(qe[1]+mt[1])/2]}else if(A.touch0)le=A.touch0[0],De=A.touch0[1];else return;A.zoom("touch",t(v(ie,le,De),A.extent,o))}}function V(D,...B){if(this.__zooming){var A=S(this,B).event(D),$=D.changedTouches,Y=$.length,G,ie;for(hy(D),u&&clearTimeout(u),u=setTimeout(function(){u=null},f),G=0;G<Y;++G)ie=$[G],A.touch0&&A.touch0[2]===ie.identifier?delete A.touch0:A.touch1&&A.touch1[2]===ie.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(ie=za(ie,this),Math.hypot(h[0]-ie[0],h[1]-ie[1])<m)){var le=_o(this).on("dblclick.zoom");le&&le.apply(this,arguments)}}}return _.wheelDelta=function(D){return arguments.length?(i=typeof D=="function"?D:q_(+D),_):i},_.filter=function(D){return arguments.length?(n=typeof D=="function"?D:q_(!!D),_):n},_.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:q_(!!D),_):s},_.extent=function(D){return arguments.length?(e=typeof D=="function"?D:q_([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),_):e},_.scaleExtent=function(D){return arguments.length?(r[0]=+D[0],r[1]=+D[1],_):[r[0],r[1]]},_.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(D){return arguments.length?(t=D,_):t},_.duration=function(D){return arguments.length?(a=+D,_):a},_.interpolate=function(D){return arguments.length?(l=D,_):l},_.on=function(){var D=c.on.apply(c,arguments);return D===c?_:D},_.clickDistance=function(D){return arguments.length?(p=(D=+D)*D,_):Math.sqrt(p)},_.tapDistance=function(D){return arguments.length?(m=+D,_):m},_}const Iz=()=>{const n=T3(),e=St(()=>`${n.dir}${n.id?"/"+n.id:""}`);return{params:n,sessionKey:e}},Mz=()=>{const n=fH(),{params:e,sessionKey:t}=Iz();return{params:e,sessionKey:t,tabs:St(()=>n.tabs(t)),view:St(()=>n.view(t))}},{use:Az,provider:Hxe}=gH({name:"Preview",gate:!1,init:()=>{const n=T3(),e=N3(),[t,i]=I3({services:[],loading:!1,setting:!1}),s=St(()=>`?directory=${encodeURIComponent(e.directory)}`),r=async()=>{i("loading",!0);try{const w=await e.fetch(`${e.url}/preview/services${s()}`);if(w.ok){const v=await w.json();zb(()=>{i("services",v),i("loading",!1)})}else i("loading",!1)}catch{i("loading",!1)}},o=async w=>{const v=t.services.findIndex(C=>C.name===w);v>=0&&i("services",v,"status","starting");try{const C=await e.fetch(`${e.url}/preview/services/${w}/start${s()}`,{method:"POST"});if(C.ok){const y=await C.json();v>=0?i("services",v,y):i("services",t.services.length,y)}}catch{v>=0&&i("services",v,"status","error")}},a=async w=>{try{await e.fetch(`${e.url}/preview/services/${w}/stop${s()}`,{method:"POST"});const v=t.services.findIndex(C=>C.name===w);v>=0&&i("services",v,"status","stopped")}catch{}},l=async()=>{for(const w of t.services)w.status==="stopped"&&await o(w.name)},c=async()=>{for(const w of t.services)(w.status==="running"||w.status==="starting")&&await a(w.name)},d=async()=>{try{const w=await e.fetch(`${e.url}/preview/infer${s()}`,{method:"POST"});if(w.ok)return await w.json()}catch{}return[]},h=async()=>{i("setting",!0);try{const w=await e.fetch(`${e.url}/preview/setup${s()}`,{method:"POST"});if(!w.ok)return{ok:!1};const v=await w.json(),C=v.services.length>0;return zb(()=>{i("services",v.services),i("active",v.services[0]?.name)}),await l(),await r(),{ok:C,file:v.file,services:v.services}}catch{return{ok:!1}}finally{i("setting",!1)}},u=w=>i("active",w),f=St(()=>t.services.filter(w=>w.status==="running")),g=St(()=>t.services.length>0);Co(()=>{(async()=>(await r(),await l()))()});const p=e.event.on("pty.exited",()=>{r()});Yd(p);const m=e.event.on("ui.navigate",w=>{const v=w.properties;v.sessionID&&v.sessionID!==n.id||v.preview?.name&&(async()=>(await r(),i("active",v.preview.name)))()});Yd(m);let _;return Co(()=>{f().length>0?_||(_=setInterval(()=>void r(),5e3)):_&&(clearInterval(_),_=void 0)}),Yd(()=>{_&&clearInterval(_)}),{services:()=>t.services,active:()=>t.active??t.services[0]?.name,loading:()=>t.loading,setting:()=>t.setting,running:f,configured:g,start:o,stop:a,startAll:l,stopAll:c,refresh:r,infer:d,setup:h,setActive:u}}});function Pn(n){this.content=n}Pn.prototype={constructor:Pn,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var i=t&&t!=n?this.remove(t):this,s=i.find(n),r=i.content.slice();return s==-1?r.push(t||n,e):(r[s+1]=e,t&&(r[s]=t)),new Pn(r)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Pn(t)},addToStart:function(n,e){return new Pn([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Pn(t)},addBefore:function(n,e,t){var i=this.remove(e),s=i.content.slice(),r=i.find(n);return s.splice(r==-1?s.length:r,0,e,t),new Pn(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Pn.from(n),n.size?new Pn(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Pn.from(n),n.size?new Pn(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Pn.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Pn.from=function(n){if(n instanceof Pn)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Pn(e)};function B3(n,e,t){for(let i=0;;i++){if(i==n.childCount||i==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(i),r=e.child(i);if(s==r){t+=s.nodeSize;continue}if(!s.sameMarkup(r))return t;if(s.isText&&s.text!=r.text){for(let o=0;s.text[o]==r.text[o];o++)t++;return t}if(s.content.size||r.content.size){let o=B3(s.content,r.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function V3(n,e,t,i){for(let s=n.childCount,r=e.childCount;;){if(s==0||r==0)return s==r?null:{a:t,b:i};let o=n.child(--s),a=e.child(--r),l=o.nodeSize;if(o==a){t-=l,i-=l;continue}if(!o.sameMarkup(a))return{a:t,b:i};if(o.isText&&o.text!=a.text){let c=0,d=Math.min(o.text.length,a.text.length);for(;c<d&&o.text[o.text.length-c-1]==a.text[a.text.length-c-1];)c++,t--,i--;return{a:t,b:i}}if(o.content.size||a.content.size){let c=V3(o.content,a.content,t-1,i-1);if(c)return c}t-=l,i-=l}}class ce{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,t,i,s=0,r){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&i(l,s+a,r||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,t-d),i,s+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,i,s){let r="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&i&&(o?o=!1:r+=i),r+=c},0),r}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,i=e.firstChild,s=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(i)&&(s[s.length-1]=t.withText(t.text+i.text),r=1);r<e.content.length;r++)s.push(e.content[r]);return new ce(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let i=[],s=0;if(t>e)for(let r=0,o=0;o<t;r++){let a=this.content[r],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),i.push(a),s+=a.nodeSize),o=l}return new ce(i,s)}cutByIndex(e,t){return e==t?ce.empty:e==0&&t==this.content.length?this:new ce(this.content.slice(e,t))}replaceChild(e,t){let i=this.content[e];if(i==t)return this;let s=this.content.slice(),r=this.size+t.nodeSize-i.nodeSize;return s[e]=t,new ce(s,r)}addToStart(e){return new ce([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ce(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,i=0;t<this.content.length;t++){let s=this.content[t];e(s,i,t),i+=s.nodeSize}}findDiffStart(e,t=0){return B3(this,e,t)}findDiffEnd(e,t=this.size,i=e.size){return V3(this,e,t,i)}findIndex(e){if(e==0)return G_(0,e);if(e==this.size)return G_(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,i=0;;t++){let s=this.child(t),r=i+s.nodeSize;if(r>=e)return r==e?G_(t+1,r):G_(t,i);i=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return ce.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ce(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ce.empty;let t,i=0;for(let s=0;s<e.length;s++){let r=e[s];i+=r.nodeSize,s&&r.isText&&e[s-1].sameMarkup(r)?(t||(t=e.slice(0,s)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new ce(t||e,i)}static from(e){if(!e)return ce.empty;if(e instanceof ce)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ce([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ce.empty=new ce([],0);const uy={index:0,offset:0};function G_(n,e){return uy.index=n,uy.offset=e,uy}function $b(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!$b(n[i],e[i]))return!1}else{for(let i in n)if(!(i in e)||!$b(n[i],e[i]))return!1;for(let i in e)if(!(i in n))return!1}return!0}let gi=class gx{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,i=!1;for(let s=0;s<e.length;s++){let r=e[s];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,s));else{if(r.type.excludes(this.type))return e;!i&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),i=!0),t&&t.push(r)}}return t||(t=e.slice()),i||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&$b(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let i=e.marks[t.type];if(!i)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=i.create(t.attrs);return i.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return gx.none;if(e instanceof gx)return[e];let t=e.slice();return t.sort((i,s)=>i.type.rank-s.type.rank),t}};gi.none=[];class Ub extends Error{}class ye{constructor(e,t,i){this.content=e,this.openStart=t,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let i=H3(this.content,e+this.openStart,t);return i&&new ye(i,this.openStart,this.openEnd)}removeBetween(e,t){return new ye(W3(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return ye.empty;let i=t.openStart||0,s=t.openEnd||0;if(typeof i!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ye(ce.fromJSON(e,t.content),i,s)}static maxOpen(e,t=!0){let i=0,s=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)i++;for(let r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)s++;return new ye(e,i,s)}}ye.empty=new ye(ce.empty,0,0);function W3(n,e,t){let{index:i,offset:s}=n.findIndex(e),r=n.maybeChild(i),{index:o,offset:a}=n.findIndex(t);if(s==e||r.isText){if(a!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(i!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(i,r.copy(W3(r.content,e-s-1,t-s-1)))}function H3(n,e,t,i){let{index:s,offset:r}=n.findIndex(e),o=n.maybeChild(s);if(r==e||o.isText)return i&&!i.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=H3(o.content,e-r-1,t,o);return a&&n.replaceChild(s,o.copy(a))}function Rz(n,e,t){if(t.openStart>n.depth)throw new Ub("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Ub("Inconsistent open depths");return z3(n,e,t,0)}function z3(n,e,t,i){let s=n.index(i),r=n.node(i);if(s==e.index(i)&&i<n.depth-t.openStart){let o=z3(n,e,t,i+1);return r.copy(r.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==i&&e.depth==i){let o=n.parent,a=o.content;return Qd(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Oz(t,n);return Qd(r,U3(n,o,a,e,i))}else return Qd(r,jb(n,e,i))}function $3(n,e){if(!e.type.compatibleContent(n.type))throw new Ub("Cannot join "+e.type.name+" onto "+n.type.name)}function px(n,e,t){let i=n.node(t);return $3(i,e.node(t)),i}function Xd(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function fp(n,e,t,i){let s=(e||n).node(t),r=0,o=e?e.index(t):s.childCount;n&&(r=n.index(t),n.depth>t?r++:n.textOffset&&(Xd(n.nodeAfter,i),r++));for(let a=r;a<o;a++)Xd(s.child(a),i);e&&e.depth==t&&e.textOffset&&Xd(e.nodeBefore,i)}function Qd(n,e){return n.type.checkContent(e),n.copy(e)}function U3(n,e,t,i,s){let r=n.depth>s&&px(n,e,s+1),o=i.depth>s&&px(t,i,s+1),a=[];return fp(null,n,s,a),r&&o&&e.index(s)==t.index(s)?($3(r,o),Xd(Qd(r,U3(n,e,t,i,s+1)),a)):(r&&Xd(Qd(r,jb(n,e,s+1)),a),fp(e,t,s,a),o&&Xd(Qd(o,jb(t,i,s+1)),a)),fp(i,null,s,a),new ce(a)}function jb(n,e,t){let i=[];if(fp(null,n,t,i),n.depth>t){let s=px(n,e,t+1);Xd(Qd(s,jb(n,e,t+1)),i)}return fp(e,null,t,i),new ce(i)}function Oz(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let r=t-1;r>=0;r--)s=e.node(r).copy(ce.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class im{constructor(e,t,i){this.pos=e,this.path=t,this.parentOffset=i,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let i=this.pos-this.path[this.path.length-1],s=e.child(t);return i?e.child(t).cut(i):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let i=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let r=0;r<e;r++)s+=i.child(r).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return gi.none;if(this.textOffset)return e.child(t).marks;let i=e.maybeChild(t-1),s=e.maybeChild(t);if(!i){let a=i;i=s,s=a}let r=i.marks;for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].removeFromSet(r));return r}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let i=t.marks,s=e.parent.maybeChild(e.index());for(var r=0;r<i.length;r++)i[r].type.spec.inclusive===!1&&(!s||!i[r].isInSet(s.marks))&&(i=i[r--].removeFromSet(i));return i}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new Kb(this,e,i);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let i=[],s=0,r=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(r),c=r-l;if(i.push(o,a,s+l),!c||(o=o.child(a),o.isText))break;r=c-1,s+=l+1}return new im(t,i,r)}static resolveCached(e,t){let i=nM.get(e);if(i)for(let r=0;r<i.elts.length;r++){let o=i.elts[r];if(o.pos==t)return o}else nM.set(e,i=new Pz);let s=i.elts[i.i]=im.resolve(e,t);return i.i=(i.i+1)%Fz,s}}class Pz{constructor(){this.elts=[],this.i=0}}const Fz=12,nM=new WeakMap;class Kb{constructor(e,t,i){this.$from=e,this.$to=t,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Bz=Object.create(null);let Sc=class mx{constructor(e,t,i,s=gi.none){this.type=e,this.attrs=t,this.marks=s,this.content=i||ce.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,i,s=0){this.content.nodesBetween(e,t,i,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,i,s){return this.content.textBetween(e,t,i,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,i){return this.type==e&&$b(this.attrs,t||e.defaultAttrs||Bz)&&gi.sameSet(this.marks,i||gi.none)}copy(e=null){return e==this.content?this:new mx(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new mx(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,i=!1){if(e==t)return ye.empty;let s=this.resolve(e),r=this.resolve(t),o=i?0:s.sharedDepth(t),a=s.start(o),c=s.node(o).content.cut(s.pos-a,r.pos-a);return new ye(c,s.depth-o,r.depth-o)}replace(e,t,i){return Rz(this.resolve(e),this.resolve(t),i)}nodeAt(e){for(let t=this;;){let{index:i,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(i),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(t),index:t,offset:i};let s=this.content.child(t-1);return{node:s,index:t-1,offset:i-s.nodeSize}}resolve(e){return im.resolveCached(this,e)}resolveNoCache(e){return im.resolve(this,e)}rangeHasMark(e,t,i){let s=!1;return t>e&&this.nodesBetween(e,t,r=>(i.isInSet(r.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),j3(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,i=ce.empty,s=0,r=i.childCount){let o=this.contentMatchAt(e).matchFragment(i,s,r),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=s;l<r;l++)if(!this.type.allowsMarks(i.child(l).marks))return!1;return!0}canReplaceWith(e,t,i,s){if(s&&!this.type.allowsMarks(s))return!1;let r=this.contentMatchAt(e).matchType(i),o=r&&r.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=gi.none;for(let t=0;t<this.marks.length;t++){let i=this.marks[t];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!gi.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let i;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}let s=ce.fromJSON(e,t.content),r=e.nodeType(t.type).create(t.attrs,s,i);return r.type.checkAttrs(r.attrs),r}};Sc.prototype.text=void 0;class qb extends Sc{constructor(e,t,i,s){if(super(e,t,null,s),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):j3(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new qb(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new qb(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function j3(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class fh{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let i=new Vz(e,t);if(i.next==null)return fh.empty;let s=K3(i);i.next&&i.err("Unexpected trailing text");let r=Kz(jz(s));return qz(r,i),r}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,i=e.childCount){let s=this;for(let r=t;s&&r<i;r++)s=s.matchType(e.child(r).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let i=0;i<e.next.length;i++)if(this.next[t].type==e.next[i].type)return!0;return!1}fillBefore(e,t=!1,i=0){let s=[this];function r(o,a){let l=o.matchFragment(e,i);if(l&&(!t||l.validEnd))return ce.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:d,next:h}=o.next[c];if(!(d.isText||d.hasRequiredAttrs())&&s.indexOf(h)==-1){s.push(h);let u=r(h,a.concat(d));if(u)return u}}return null}return r(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let s=i.shift(),r=s.match;if(r.matchType(e)){let o=[];for(let a=s;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<r.next.length;o++){let{type:a,next:l}=r.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!s.type||l.validEnd)&&(i.push({match:a.contentMatch,type:a,via:s}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(i){e.push(i);for(let s=0;s<i.next.length;s++)e.indexOf(i.next[s].next)==-1&&t(i.next[s].next)}return t(this),e.map((i,s)=>{let r=s+(i.validEnd?"*":" ")+" ";for(let o=0;o<i.next.length;o++)r+=(o?", ":"")+i.next[o].type.name+"->"+e.indexOf(i.next[o].next);return r}).join(`
|
|
3
3
|
`)}}fh.empty=new fh(!0);class Vz{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function K3(n){let e=[];do e.push(Wz(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Wz(n){let e=[];do e.push(Hz(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Hz(n){let e=Uz(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=zz(n,e);else break;return e}function sM(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function zz(n,e){let t=sM(n),i=t;return n.eat(",")&&(n.next!="}"?i=sM(n):i=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:i,expr:e}}function $z(n,e){let t=n.nodeTypes,i=t[e];if(i)return[i];let s=[];for(let r in t){let o=t[r];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function Uz(n){if(n.eat("(")){let e=K3(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=$z(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function jz(n){let e=[[]];return s(r(n,0),t()),e;function t(){return e.push([])-1}function i(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function s(o,a){o.forEach(l=>l.to=a)}function r(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(r(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=r(o.exprs[l],a);if(l==o.exprs.length-1)return c;s(c,a=t())}else if(o.type=="star"){let l=t();return i(a,l),s(r(o.expr,l),l),[i(l)]}else if(o.type=="plus"){let l=t();return s(r(o.expr,a),l),s(r(o.expr,l),l),[i(l)]}else{if(o.type=="opt")return[i(a)].concat(r(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let d=t();s(r(o.expr,l),d),l=d}if(o.max==-1)s(r(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let d=t();i(l,d),s(r(o.expr,l),d),l=d}return[i(l)]}else{if(o.type=="name")return[i(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function q3(n,e){return e-n}function rM(n,e){let t=[];return i(e),t.sort(q3);function i(s){let r=n[s];if(r.length==1&&!r[0].term)return i(r[0].to);t.push(s);for(let o=0;o<r.length;o++){let{term:a,to:l}=r[o];!a&&t.indexOf(l)==-1&&i(l)}}}function Kz(n){let e=Object.create(null);return t(rM(n,0));function t(i){let s=[];i.forEach(o=>{n[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<s.length;d++)s[d][0]==a&&(c=s[d][1]);rM(n,l).forEach(d=>{c||s.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let r=e[i.join(",")]=new fh(i.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let a=s[o][1].sort(q3);r.next.push({type:s[o][0],next:e[a.join(",")]||t(a)})}return r}}function qz(n,e){for(let t=0,i=[n];t<i.length;t++){let s=i[t],r=!s.validEnd,o=[];for(let a=0;a<s.next.length;a++){let{type:l,next:c}=s.next[a];o.push(l.name),r&&!(l.isText||l.hasRequiredAttrs())&&(r=!1),i.indexOf(c)==-1&&i.push(c)}r&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function G3(n){let e=Object.create(null);for(let t in n){let i=n[t];if(!i.hasDefault)return null;e[t]=i.default}return e}function Y3(n,e){let t=Object.create(null);for(let i in n){let s=e&&e[i];if(s===void 0){let r=n[i];if(r.hasDefault)s=r.default;else throw new RangeError("No value supplied for attribute "+i)}t[i]=s}return t}function Z3(n,e,t,i){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let r=n[s];r.validate&&r.validate(e[s])}}function X3(n,e){let t=Object.create(null);if(e)for(let i in e)t[i]=new Yz(n,i,e[i]);return t}let oM=class Q3{constructor(e,t,i){this.name=e,this.schema=t,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=X3(e,i.attrs),this.defaultAttrs=G3(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==fh.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Y3(this.attrs,e)}create(e=null,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Sc(this,this.computeAttrs(e),ce.from(t),gi.setFrom(i))}createChecked(e=null,t,i){return t=ce.from(t),this.checkContent(t),new Sc(this,this.computeAttrs(e),t,gi.setFrom(i))}createAndFill(e=null,t,i){if(e=this.computeAttrs(e),t=ce.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),r=s&&s.fillBefore(ce.empty,!0);return r?new Sc(this,e,t.append(r),gi.setFrom(i)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Z3(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:gi.none:e}static compile(e,t){let i=Object.create(null);e.forEach((r,o)=>i[r]=new Q3(r,t,o));let s=t.spec.topNode||"doc";if(!i[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let r in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function Gz(n,e,t){let i=t.split("|");return s=>{let r=s===null?"null":typeof s;if(i.indexOf(r)<0)throw new RangeError(`Expected value of type ${i} for attribute ${e} on type ${n}, got ${r}`)}}class Yz{constructor(e,t,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?Gz(e,t,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class yC{constructor(e,t,i,s){this.name=e,this.rank=t,this.schema=i,this.spec=s,this.attrs=X3(e,s.attrs),this.excluded=null;let r=G3(this.attrs);this.instance=r?new gi(this,r):null}create(e=null){return!e&&this.instance?this.instance:new gi(this,Y3(this.attrs,e))}static compile(e,t){let i=Object.create(null),s=0;return e.forEach((r,o)=>i[r]=new yC(r,s++,t,o)),i}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Z3(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class J3{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Pn.from(e.nodes),t.marks=Pn.from(e.marks||{}),this.nodes=oM.compile(this.spec.nodes,this),this.marks=yC.compile(this.spec.marks,this);let i=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let r=this.nodes[s],o=r.spec.content||"",a=r.spec.marks;if(r.contentMatch=i[o]||(i[o]=fh.parse(o,this.nodes)),r.inlineContent=r.contentMatch.inlineContent,r.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!r.isInline||!r.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=r}r.markSet=a=="_"?null:a?aM(this,a.split(" ")):a==""||!r.inlineContent?[]:null}for(let s in this.marks){let r=this.marks[s],o=r.spec.excludes;r.excluded=o==null?[r]:o==""?[]:aM(this,o.split(" "))}this.nodeFromJSON=s=>Sc.fromJSON(this,s),this.markFromJSON=s=>gi.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,i,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof oM){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,i,s)}text(e,t){let i=this.nodes.text;return new qb(i,i.defaultAttrs,e,gi.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function aM(n,e){let t=[];for(let i=0;i<e.length;i++){let s=e[i],r=n.marks[s],o=r;if(r)t.push(r);else for(let a in n.marks){let l=n.marks[a];(s=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return t}function Zz(n){return n.tag!=null}function Xz(n){return n.style!=null}let $u=class _x{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let i=this.matchedStyles=[];t.forEach(s=>{if(Zz(s))this.tags.push(s);else if(Xz(s)){let r=/[^=]*/.exec(s.style)[0];i.indexOf(r)<0&&i.push(r),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let r=e.nodes[s.node];return r.contentMatch.matchType(r)})}parse(e,t={}){let i=new cM(this,t,!1);return i.addAll(e,gi.none,t.from,t.to),i.finish()}parseSlice(e,t={}){let i=new cM(this,t,!0);return i.addAll(e,gi.none,t.from,t.to),ye.maxOpen(i.finish())}matchTag(e,t,i){for(let s=i?this.tags.indexOf(i)+1:0;s<this.tags.length;s++){let r=this.tags[s];if(e$(e,r.tag)&&(r.namespace===void 0||e.namespaceURI==r.namespace)&&(!r.context||t.matchesContext(r.context))){if(r.getAttrs){let o=r.getAttrs(e);if(o===!1)continue;r.attrs=o||void 0}return r}}}matchStyle(e,t,i,s){for(let r=s?this.styles.indexOf(s)+1:0;r<this.styles.length;r++){let o=this.styles[r],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!i.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function i(s){let r=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<r)break}t.splice(o,0,s)}for(let s in e.marks){let r=e.marks[s].spec.parseDOM;r&&r.forEach(o=>{i(o=dM(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let r=e.nodes[s].spec.parseDOM;r&&r.forEach(o=>{i(o=dM(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new _x(e,_x.schemaRules(e)))}};const e7={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Qz={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},t7={ol:!0,ul:!0},nm=1,bx=2,gp=4;function lM(n,e,t){return e!=null?(e?nm:0)|(e==="full"?bx:0):n&&n.whitespace=="pre"?nm|bx:t&~gp}class Y_{constructor(e,t,i,s,r,o){this.type=e,this.attrs=t,this.marks=i,this.solid=s,this.options=o,this.content=[],this.activeMarks=gi.none,this.match=r||(o&gp?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ce.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let i=this.type.contentMatch,s;return(s=i.findWrapping(e.type))?(this.match=i,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&nm)){let i=this.content[this.content.length-1],s;if(i&&i.isText&&(s=/[ \t\r\n\u000c]+$/.exec(i.text))){let r=i;i.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-s[0].length))}}let t=ce.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ce.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!e7.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class cM{constructor(e,t,i){this.parser=e,this.options=t,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let s=t.topNode,r,o=lM(null,t.preserveWhitespace,0)|(i?gp:0);s?r=new Y_(s.type,s.attrs,gi.none,!0,t.topMatch||s.type.contentMatch,o):i?r=new Y_(null,null,gi.none,!0,null,o):r=new Y_(e.schema.topNodeType,null,gi.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let i=e.nodeValue,s=this.top,r=s.options&bx?"full":this.localPreserveWS||(s.options&nm)>0,{schema:o}=this.parser;if(r==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(i)){if(r)if(r==="full")i=i.replace(/\r\n?/g,`
|
|
4
4
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=i.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(o.text(a[l]),t,!/\S/.test(a[l]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let a=s.content[s.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(i=i.slice(1))}i&&this.insertNode(o.text(i),t,!/\S/.test(i)),this.findInText(e)}else this.findInside(e)}addElement(e,t,i){let s=this.localPreserveWS,r=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;t7.hasOwnProperty(o)&&this.parser.normalizeLists&&Jz(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,i));e:if(l?l.ignore:Qz.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(e7.hasOwnProperty(o))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),c=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let h=l&&l.skip?t:this.readStyles(e,t);h&&this.addAll(e,h),c&&this.sync(r),this.needsBlock=d}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
5
5
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let i=e.style;if(i&&i.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let r=this.parser.matchedStyles[s],o=i.getPropertyValue(r);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(r,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(c=>!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,i,s){let r,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),i,e.nodeName=="BR")||this.leafFallback(e,i);else{let l=this.enter(o,t.attrs||null,i,t.preserveWhitespace);l&&(r=!0,i=l)}else{let l=this.parser.schema.marks[t.mark];i=i.concat(l.create(t.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,i,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,i,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,i),this.findAround(e,l,!1)}r&&this.sync(a)&&this.open--}addAll(e,t,i,s){let r=i||0;for(let o=i?e.childNodes[i]:e.firstChild,a=s==null?null:e.childNodes[s];o!=a;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o,t);this.findAtPoint(e,r)}findPlace(e,t,i){let s,r;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!s||s.length>c.length+a)&&(s=c,r=l,!c.length))break;if(l.solid){if(i)break;a+=2}}if(!s)return null;this.sync(r);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,i){if(e.isInline&&this.needsBlock&&!this.top.type){let r=this.textblockFromContext();r&&(t=this.enterInner(r,null,t))}let s=this.findPlace(e,t,i);if(s){this.closeExtra();let r=this.top;r.match&&(r.match=r.match.matchType(e.type));let o=gi.none;for(let a of s.concat(e.marks))(r.type?r.type.allowsMarkType(a.type):hM(a.type,e.type))&&(o=a.addToSet(o));return r.content.push(e.mark(o)),!0}return!1}enter(e,t,i,s){let r=this.findPlace(e.create(t),i,!1);return r&&(r=this.enterInner(e,t,i,!0,s)),r}enterInner(e,t,i,s=!1,r){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=lM(e,r,o.options);o.options&gp&&o.content.length==0&&(a|=gp);let l=gi.none;return i=i.filter(c=>(o.type?o.type.allowsMarkType(c.type):hM(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Y_(e,t,l,s,null,a)),this.open++,i}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=nm)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let i=this.nodes[t].content;for(let s=i.length-1;s>=0;s--)e+=i[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,i){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(i?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),i=this.options.context,s=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),r=-(i?i.depth+1:0)+(s?0:1),o=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=r;l--)if(o(a-1,l))return!0;return!1}else{let d=l>0||l==0&&s?this.nodes[l].type:i&&l>=r?i.node(l-r).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let t in this.parser.schema.nodes){let i=this.parser.schema.nodes[t];if(i.isTextblock&&i.defaultAttrs)return i}}}function Jz(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let i=e.nodeType==1?e.nodeName.toLowerCase():null;i&&t7.hasOwnProperty(i)&&t?(t.appendChild(e),e=t):i=="li"?t=e:i&&(t=null)}}function e$(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function dM(n){let e={};for(let t in n)e[t]=n[t];return e}function hM(n,e){let t=e.schema.nodes;for(let i in t){let s=t[i];if(!s.allowsMarkType(n))continue;let r=[],o=a=>{r.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||r.indexOf(d)<0&&o(d))return!0}};if(o(s.contentMatch))return!0}}class Ah{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},i){i||(i=fy(t).createDocumentFragment());let s=i,r=[];return e.forEach(o=>{if(r.length||o.marks.length){let a=0,l=0;for(;a<r.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(r[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<r.length;)s=r.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],d=this.serializeMark(c,o.isInline,t);d&&(r.push([c,s]),s.appendChild(d.dom),s=d.contentDOM||d.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),i}serializeNodeInner(e,t){let{dom:i,contentDOM:s}=rb(fy(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return i}serializeNode(e,t={}){let i=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let r=this.serializeMark(e.marks[s],e.isInline,t);r&&((r.contentDOM||r.dom).appendChild(i),i=r.dom)}return i}serializeMark(e,t,i={}){let s=this.marks[e.type.name];return s&&rb(fy(i),s(e,t),null,e.attrs)}static renderSpec(e,t,i=null,s){return rb(e,t,i,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ah(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=uM(e.nodes);return t.text||(t.text=i=>i.text),t}static marksFromSchema(e){return uM(e.marks)}}function uM(n){let e={};for(let t in n){let i=n[t].spec.toDOM;i&&(e[t]=i)}return e}function fy(n){return n.document||window.document}const fM=new WeakMap;function t$(n){let e=fM.get(n);return e===void 0&&fM.set(n,e=i$(n)),e}function i$(n){let e=null;function t(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")e||(e=[]),e.push(i);else for(let s=0;s<i.length;s++)t(i[s]);else for(let s in i)t(i[s])}return t(n),e}function rb(n,e,t,i){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],r;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(r=t$(i))&&r.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let a,l=t?n.createElementNS(t,s):n.createElement(s),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let h in c)if(c[h]!=null){let u=h.indexOf(" ");u>0?l.setAttributeNS(h.slice(0,u),h.slice(u+1),c[h]):h=="style"&&l.style?l.style.cssText=c[h]:l.setAttribute(h,c[h])}}for(let h=d;h<e.length;h++){let u=e[h];if(u===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:g}=rb(n,u,t,i);if(l.appendChild(f),g){if(a)throw new RangeError("Multiple content holes");a=g}}}return{dom:l,contentDOM:a}}const i7=65535,n7=Math.pow(2,16);function n$(n,e){return n+e*n7}function gM(n){return n&i7}function s$(n){return(n-(n&i7))/n7}const s7=1,r7=2,ob=4,o7=8;class wx{constructor(e,t,i){this.pos=e,this.delInfo=t,this.recover=i}get deleted(){return(this.delInfo&o7)>0}get deletedBefore(){return(this.delInfo&(s7|ob))>0}get deletedAfter(){return(this.delInfo&(r7|ob))>0}get deletedAcross(){return(this.delInfo&ob)>0}}class cr{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&cr.empty)return cr.empty}recover(e){let t=0,i=gM(e);if(!this.inverted)for(let s=0;s<i;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[i*3]+t+s$(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,i){let s=0,r=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?s:0);if(l>e)break;let c=this.ranges[a+r],d=this.ranges[a+o],h=l+c;if(e<=h){let u=c?e==l?-1:e==h?1:t:t,f=l+s+(u<0?0:d);if(i)return f;let g=e==(t<0?l:h)?null:n$(a/3,e-l),p=e==l?r7:e==h?s7:ob;return(t<0?e!=l:e!=h)&&(p|=o7),new wx(f,p,g)}s+=d-c}return i?e+s:new wx(e+s,0,null)}touches(e,t){let i=0,s=gM(t),r=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+r],d=l+c;if(e<=d&&a==s*3)return!0;i+=this.ranges[a+o]-c}return!1}forEach(e){let t=this.inverted?2:1,i=this.inverted?1:2;for(let s=0,r=0;s<this.ranges.length;s+=3){let o=this.ranges[s],a=o-(this.inverted?r:0),l=o+(this.inverted?0:r),c=this.ranges[s+t],d=this.ranges[s+i];e(a,a+c,l,l+d),r+=d-c}}invert(){return new cr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?cr.empty:new cr(e<0?[0,-e,0]:[0,0,e])}}cr.empty=new cr([]);class sm{constructor(e,t,i=0,s=e?e.length:0){this.mirror=t,this.from=i,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new sm(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,i=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?i+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,i=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?i-s-1:void 0)}}invert(){let e=new sm;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let i=this.from;i<this.to;i++)e=this._maps[i].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,i){let s=0;for(let r=this.from;r<this.to;r++){let o=this._maps[r],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(r);if(l!=null&&l>r&&l<this.to){r=l,e=this._maps[l].recover(a.recover);continue}}s|=a.delInfo,e=a.pos}return i?e:new wx(e,s,null)}}const gy=Object.create(null);class ps{getMap(){return cr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=gy[t.stepType];if(!i)throw new RangeError(`No step type ${t.stepType} defined`);return i.fromJSON(e,t)}static jsonID(e,t){if(e in gy)throw new RangeError("Duplicate use of step JSON ID "+e);return gy[e]=t,t.prototype.jsonID=e,t}}class an{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new an(e,null)}static fail(e){return new an(null,e)}static fromReplace(e,t,i,s){try{return an.ok(e.replace(t,i,s))}catch(r){if(r instanceof Ub)return an.fail(r.message);throw r}}}function tD(n,e,t){let i=[];for(let s=0;s<n.childCount;s++){let r=n.child(s);r.content.size&&(r=r.copy(tD(r.content,e,r))),r.isInline&&(r=e(r,t,s)),i.push(r)}return ce.fromArray(i)}class dc extends ps{constructor(e,t,i){super(),this.from=e,this.to=t,this.mark=i}apply(e){let t=e.slice(this.from,this.to),i=e.resolve(this.from),s=i.node(i.sharedDepth(this.to)),r=new ye(tD(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return an.fromReplace(e,this.from,this.to,r)}invert(){return new vo(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new dc(t.pos,i.pos,this.mark)}merge(e){return e instanceof dc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new dc(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new dc(t.from,t.to,e.markFromJSON(t.mark))}}ps.jsonID("addMark",dc);class vo extends ps{constructor(e,t,i){super(),this.from=e,this.to=t,this.mark=i}apply(e){let t=e.slice(this.from,this.to),i=new ye(tD(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return an.fromReplace(e,this.from,this.to,i)}invert(){return new dc(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new vo(t.pos,i.pos,this.mark)}merge(e){return e instanceof vo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new vo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new vo(t.from,t.to,e.markFromJSON(t.mark))}}ps.jsonID("removeMark",vo);class hc extends ps{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return an.fail("No node at mark step's position");let i=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return an.fromReplace(e,this.pos,this.pos+1,new ye(ce.from(i),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let i=this.mark.addToSet(t.marks);if(i.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(i))return new hc(this.pos,t.marks[s]);return new hc(this.pos,this.mark)}}return new gh(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new hc(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new hc(t.pos,e.markFromJSON(t.mark))}}ps.jsonID("addNodeMark",hc);class gh extends ps{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return an.fail("No node at mark step's position");let i=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return an.fromReplace(e,this.pos,this.pos+1,new ye(ce.from(i),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new hc(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new gh(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new gh(t.pos,e.markFromJSON(t.mark))}}ps.jsonID("removeNodeMark",gh);class rn extends ps{constructor(e,t,i,s=!1){super(),this.from=e,this.to=t,this.slice=i,this.structure=s}apply(e){return this.structure&&Cx(e,this.from,this.to)?an.fail("Structure replace would overwrite content"):an.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new cr([this.from,this.to-this.from,this.slice.size])}invert(e){return new rn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),i=this.from==this.to&&rn.MAP_BIAS<0?t:e.mapResult(this.from,1);return i.deletedAcross&&t.deletedAcross?null:new rn(i.pos,Math.max(i.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof rn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?ye.empty:new ye(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new rn(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?ye.empty:new ye(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new rn(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new rn(t.from,t.to,ye.fromJSON(e,t.slice),!!t.structure)}}rn.MAP_BIAS=1;ps.jsonID("replace",rn);class Dn extends ps{constructor(e,t,i,s,r,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=i,this.gapTo=s,this.slice=r,this.insert=o,this.structure=a}apply(e){if(this.structure&&(Cx(e,this.from,this.gapFrom)||Cx(e,this.gapTo,this.to)))return an.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return an.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,t.content);return i?an.fromReplace(e,this.from,this.to,i):an.fail("Content does not fit in gap")}getMap(){return new cr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Dn(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),r=this.to==this.gapTo?i.pos:e.map(this.gapTo,1);return t.deletedAcross&&i.deletedAcross||s<t.pos||r>i.pos?null:new Dn(t.pos,i.pos,s,r,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Dn(t.from,t.to,t.gapFrom,t.gapTo,ye.fromJSON(e,t.slice),t.insert,!!t.structure)}}ps.jsonID("replaceAround",Dn);function Cx(n,e,t){let i=n.resolve(e),s=t-e,r=i.depth;for(;s>0&&r>0&&i.indexAfter(r)==i.node(r).childCount;)r--,s--;if(s>0){let o=i.node(r).maybeChild(i.indexAfter(r));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function r$(n,e,t,i){let s=[],r=[],o,a;n.doc.nodesBetween(e,t,(l,c,d)=>{if(!l.isInline)return;let h=l.marks;if(!i.isInSet(h)&&d.type.allowsMarkType(i.type)){let u=Math.max(c,e),f=Math.min(c+l.nodeSize,t),g=i.addToSet(h);for(let p=0;p<h.length;p++)h[p].isInSet(g)||(o&&o.to==u&&o.mark.eq(h[p])?o.to=f:s.push(o=new vo(u,f,h[p])));a&&a.to==u?a.to=f:r.push(a=new dc(u,f,i))}}),s.forEach(l=>n.step(l)),r.forEach(l=>n.step(l))}function o$(n,e,t,i){let s=[],r=0;n.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;r++;let l=null;if(i instanceof yC){let c=o.marks,d;for(;d=i.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else i?i.isInSet(o.marks)&&(l=[i]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,t);for(let d=0;d<l.length;d++){let h=l[d],u;for(let f=0;f<s.length;f++){let g=s[f];g.step==r-1&&h.eq(s[f].style)&&(u=g)}u?(u.to=c,u.step=r):s.push({style:h,from:Math.max(a,e),to:c,step:r})}}}),s.forEach(o=>n.step(new vo(o.from,o.to,o.style)))}function iD(n,e,t,i=t.contentMatch,s=!0){let r=n.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<r.childCount;l++){let c=r.child(l),d=a+c.nodeSize,h=i.matchType(c.type);if(!h)o.push(new rn(a,d,ye.empty));else{i=h;for(let u=0;u<c.marks.length;u++)t.allowsMarkType(c.marks[u].type)||n.step(new vo(a,d,c.marks[u]));if(s&&c.isText&&t.whitespace!="pre"){let u,f=/\r?\n|\r/g,g;for(;u=f.exec(c.text);)g||(g=new ye(ce.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new rn(a+u.index,a+u.index+u[0].length,g))}}a=d}if(!i.validEnd){let l=i.fillBefore(ce.empty,!0);n.replace(a,a,new ye(l,0,0))}for(let l=o.length-1;l>=0;l--)n.step(o[l])}function a$(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function qf(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let i=n.depth,s=0,r=0;;--i){let o=n.$from.node(i),a=n.$from.index(i)+s,l=n.$to.indexAfter(i)-r;if(i<n.depth&&o.canReplace(a,l,t))return i;if(i==0||o.type.spec.isolating||!a$(o,a,l))break;a&&(s=1),l<o.childCount&&(r=1)}return null}function l$(n,e,t){let{$from:i,$to:s,depth:r}=e,o=i.before(r+1),a=s.after(r+1),l=o,c=a,d=ce.empty,h=0;for(let g=r,p=!1;g>t;g--)p||i.index(g)>0?(p=!0,d=ce.from(i.node(g).copy(d)),h++):l--;let u=ce.empty,f=0;for(let g=r,p=!1;g>t;g--)p||s.after(g+1)<s.end(g)?(p=!0,u=ce.from(s.node(g).copy(u)),f++):c++;n.step(new Dn(l,c,o,a,new ye(d.append(u),h,f),d.size-h,!0))}function nD(n,e,t=null,i=n){let s=c$(n,e),r=s&&d$(i,e);return r?s.map(pM).concat({type:e,attrs:t}).concat(r.map(pM)):null}function pM(n){return{type:n,attrs:null}}function c$(n,e){let{parent:t,startIndex:i,endIndex:s}=n,r=t.contentMatchAt(i).findWrapping(e);if(!r)return null;let o=r.length?r[0]:e;return t.canReplaceWith(i,s,o)?r:null}function d$(n,e){let{parent:t,startIndex:i,endIndex:s}=n,r=t.child(i),o=e.contentMatch.findWrapping(r.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=i;l&&c<s;c++)l=l.matchType(t.child(c).type);return!l||!l.validEnd?null:o}function h$(n,e,t){let i=ce.empty;for(let o=t.length-1;o>=0;o--){if(i.size){let a=t[o].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=ce.from(t[o].type.create(t[o].attrs,i))}let s=e.start,r=e.end;n.step(new Dn(s,r,s,r,new ye(i,0,0),t.length,!0))}function u$(n,e,t,i,s){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let r=n.steps.length;n.doc.nodesBetween(e,t,(o,a)=>{let l=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(i,l)&&f$(n.doc,n.mapping.slice(r).map(a),i)){let c=null;if(i.schema.linebreakReplacement){let f=i.whitespace=="pre",g=!!i.contentMatch.matchType(i.schema.linebreakReplacement);f&&!g?c=!1:!f&&g&&(c=!0)}c===!1&&l7(n,o,a,r),iD(n,n.mapping.slice(r).map(a,1),i,void 0,c===null);let d=n.mapping.slice(r),h=d.map(a,1),u=d.map(a+o.nodeSize,1);return n.step(new Dn(h,u,h+1,u-1,new ye(ce.from(i.create(l,null,o.marks)),0,0),1,!0)),c===!0&&a7(n,o,a,r),!1}})}function a7(n,e,t,i){e.forEach((s,r)=>{if(s.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(s.text);){let l=n.mapping.slice(i).map(t+1+r+o.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function l7(n,e,t,i){e.forEach((s,r)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(i).map(t+1+r);n.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -825,27 +825,27 @@ ${e.toString()}`}}class qw{constructor(e=new rg,t=!1,i,s=xpe){this._services=e,t
|
|
|
825
825
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
826
826
|
* Released under the MIT license
|
|
827
827
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
828
|
-
*-----------------------------------------------------------------------------*/var RCe=Object.defineProperty,OCe=Object.getOwnPropertyDescriptor,PCe=Object.getOwnPropertyNames,FCe=Object.prototype.hasOwnProperty,BCe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of PCe(e))!FCe.call(n,s)&&s!==t&&RCe(n,s,{get:()=>e[s],enumerable:!(i=OCe(e,s))||i.enumerable});return n},VCe=(n,e,t)=>(BCe(n,e,"default"),t),dp={};VCe(dp,V_);var VW={},cx={},WCe=class WW{static getOrCreate(e){return cx[e]||(cx[e]=new WW(e)),cx[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,VW[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function we(n){const e=n.id;VW[e]=n,dp.languages.register(n);const t=WCe.getOrCreate(e);dp.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),dp.languages.onLanguageEncountered(e,async()=>{const i=await t.load();dp.languages.setLanguageConfiguration(e,i.conf)})}we({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>fe(()=>import("./abap-BrgZPUOV.js"),[])});we({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>fe(()=>import("./apex-DyP6w7ZV.js"),[])});we({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>fe(()=>import("./azcli-BaLxmfj-.js"),[])});we({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>fe(()=>import("./bat-CFOPXBzS.js"),[])});we({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>fe(()=>import("./bicep-BfEKNvv3.js"),[])});we({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>fe(()=>import("./cameligo-BFG1Mk7z.js"),[])});we({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>fe(()=>import("./clojure-DTECt2xU.js"),[])});we({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>fe(()=>import("./coffee-CDGzqUPQ.js"),[])});we({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>fe(()=>import("./cpp-CLLBncYj.js"),[])});we({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>fe(()=>import("./cpp-CLLBncYj.js"),[])});we({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>fe(()=>import("./csharp-dUCx_-0o.js"),[])});we({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>fe(()=>import("./csp-5Rap-vPy.js"),[])});we({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>fe(()=>import("./css-D3h14YRZ.js"),[])});we({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>fe(()=>import("./cypher-DrQuvNYM.js"),[])});we({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>fe(()=>import("./dart-CFKIUWau.js"),[])});we({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>fe(()=>import("./dockerfile-Zznr-cwX.js"),[])});we({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>fe(()=>import("./ecl-Ce3n6wWz.js"),[])});we({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>fe(()=>import("./elixir-deUWdS0T.js"),[])});we({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>fe(()=>import("./flow9-i9-g7ZhI.js"),[])});we({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>fe(()=>import("./fsharp-CzKuDChf.js"),[])});we({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>fe(()=>import("./freemarker2-B_-gEFnj.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAutoInterpolationDollar)});we({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>fe(()=>import("./freemarker2-B_-gEFnj.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAngleInterpolationDollar)});we({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>fe(()=>import("./freemarker2-B_-gEFnj.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagBracketInterpolationDollar)});we({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>fe(()=>import("./freemarker2-B_-gEFnj.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAngleInterpolationBracket)});we({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>fe(()=>import("./freemarker2-B_-gEFnj.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagBracketInterpolationBracket)});we({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>fe(()=>import("./freemarker2-B_-gEFnj.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAutoInterpolationDollar)});we({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>fe(()=>import("./freemarker2-B_-gEFnj.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAutoInterpolationBracket)});we({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>fe(()=>import("./go-Cphgjts3.js"),[])});we({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>fe(()=>import("./graphql-Cg7bfA9N.js"),[])});we({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>fe(()=>import("./handlebars-DlnQtQmF.js"),__vite__mapDeps([7,1,2,3,4,5,6]))});we({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>fe(()=>import("./hcl-0cvrggvQ.js"),[])});we({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:()=>fe(()=>import("./html-DrjCwvQg.js"),__vite__mapDeps([8,1,2,3,4,5,6]))});we({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>fe(()=>import("./ini-Drc7WvVn.js"),[])});we({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>fe(()=>import("./java-B_fMsGYe.js"),[])});we({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>fe(()=>import("./javascript-CBQQIA5q.js"),__vite__mapDeps([9,10,1,2,3,4,5,6]))});we({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>fe(()=>import("./julia-Bqgm2twL.js"),[])});we({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>fe(()=>import("./kotlin-BSkB5QuD.js"),[])});we({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>fe(()=>import("./less-BsTHnhdd.js"),[])});we({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>fe(()=>import("./lexon-YWi4-JPR.js"),[])});we({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>fe(()=>import("./lua-nf6ki56Z.js"),[])});we({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>fe(()=>import("./liquid-CQXVmj19.js"),__vite__mapDeps([11,1,2,3,4,5,6]))});we({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>fe(()=>import("./m3-Cpb6xl2v.js"),[])});we({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>fe(()=>import("./markdown-DSZPf7rp.js"),[])});we({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>fe(()=>import("./mdx-QuCI1OJC.js"),__vite__mapDeps([12,1,2,3,4,5,6]))});we({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>fe(()=>import("./mips-B_c3zf-v.js"),[])});we({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>fe(()=>import("./msdax-rUNN04Wq.js"),[])});we({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>fe(()=>import("./mysql-DDwshQtU.js"),[])});we({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>fe(()=>import("./objective-c-B5zXfXm9.js"),[])});we({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>fe(()=>import("./pascal-CXOwvkN_.js"),[])});we({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>fe(()=>import("./pascaligo-Bc-ZgV77.js"),[])});we({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>fe(()=>import("./perl-CwNk8-XU.js"),[])});we({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>fe(()=>import("./pgsql-tGk8EFnU.js"),[])});we({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>fe(()=>import("./php-CpIb_Oan.js"),[])});we({id:"pla",extensions:[".pla"],loader:()=>fe(()=>import("./pla-B03wrqEc.js"),[])});we({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>fe(()=>import("./postiats-BKlk5iyT.js"),[])});we({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>fe(()=>import("./powerquery-Bhzvs7bI.js"),[])});we({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>fe(()=>import("./powershell-Dd3NCNK9.js"),[])});we({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>fe(()=>import("./protobuf-COyEY5Pt.js"),[])});we({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>fe(()=>import("./pug-BaJupSGV.js"),[])});we({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>fe(()=>import("./python-Bx2b-xP4.js"),__vite__mapDeps([13,1,2,3,4,5,6]))});we({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>fe(()=>import("./qsharp-DXyYeYxl.js"),[])});we({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>fe(()=>import("./r-CdQndTaG.js"),[])});we({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>fe(()=>import("./razor-2zgukQRj.js"),__vite__mapDeps([14,1,2,3,4,5,6]))});we({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>fe(()=>import("./redis-CVwtpugi.js"),[])});we({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>fe(()=>import("./redshift-25W9uPmb.js"),[])});we({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>fe(()=>import("./restructuredtext-DfzH4Xui.js"),[])});we({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>fe(()=>import("./ruby-Cp1zYvxS.js"),[])});we({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>fe(()=>import("./rust-D5C2fndG.js"),[])});we({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>fe(()=>import("./sb-CDntyWJ8.js"),[])});we({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:()=>fe(()=>import("./scala-BoFRg7Ot.js"),[])});we({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>fe(()=>import("./scheme-Bio4gycK.js"),[])});we({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>fe(()=>import("./scss-4Ik7cdeQ.js"),[])});we({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>fe(()=>import("./shell-CX-rkNHf.js"),[])});we({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>fe(()=>import("./solidity-Tw7wswEv.js"),[])});we({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>fe(()=>import("./sophia-C5WLch3f.js"),[])});we({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>fe(()=>import("./sparql-DHaeiCBh.js"),[])});we({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>fe(()=>import("./sql-CCSDG5nI.js"),[])});we({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>fe(()=>import("./st-pnP8ivHi.js"),[])});we({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>fe(()=>import("./swift-DwJ7jVG9.js"),[])});we({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>fe(()=>import("./systemverilog-B9Xyijhd.js"),[])});we({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>fe(()=>import("./systemverilog-B9Xyijhd.js"),[])});we({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>fe(()=>import("./tcl-DnHyzjbg.js"),[])});we({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>fe(()=>import("./twig-CPajHgWi.js"),[])});we({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>fe(()=>import("./typescript-XOJMwr_m.js"),__vite__mapDeps([10,1,2,3,4,5,6]))});we({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>fe(()=>import("./typespec-D-MeaMDU.js"),[])});we({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>fe(()=>import("./vb-DgyLZaXg.js"),[])});we({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>fe(()=>import("./wgsl-DYQUnd45.js"),[])});we({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:()=>fe(()=>import("./xml-BIwomT_0.js"),__vite__mapDeps([15,1,2,3,4,5,6]))});we({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>fe(()=>import("./yaml-BZMZa-4Z.js"),__vite__mapDeps([16,1,2,3,4,5,6]))});/*!-----------------------------------------------------------------------------
|
|
828
|
+
*-----------------------------------------------------------------------------*/var RCe=Object.defineProperty,OCe=Object.getOwnPropertyDescriptor,PCe=Object.getOwnPropertyNames,FCe=Object.prototype.hasOwnProperty,BCe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of PCe(e))!FCe.call(n,s)&&s!==t&&RCe(n,s,{get:()=>e[s],enumerable:!(i=OCe(e,s))||i.enumerable});return n},VCe=(n,e,t)=>(BCe(n,e,"default"),t),dp={};VCe(dp,V_);var VW={},cx={},WCe=class WW{static getOrCreate(e){return cx[e]||(cx[e]=new WW(e)),cx[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,VW[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function we(n){const e=n.id;VW[e]=n,dp.languages.register(n);const t=WCe.getOrCreate(e);dp.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),dp.languages.onLanguageEncountered(e,async()=>{const i=await t.load();dp.languages.setLanguageConfiguration(e,i.conf)})}we({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>fe(()=>import("./abap-BrgZPUOV.js"),[])});we({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>fe(()=>import("./apex-DyP6w7ZV.js"),[])});we({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>fe(()=>import("./azcli-BaLxmfj-.js"),[])});we({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>fe(()=>import("./bat-CFOPXBzS.js"),[])});we({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>fe(()=>import("./bicep-BfEKNvv3.js"),[])});we({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>fe(()=>import("./cameligo-BFG1Mk7z.js"),[])});we({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>fe(()=>import("./clojure-DTECt2xU.js"),[])});we({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>fe(()=>import("./coffee-CDGzqUPQ.js"),[])});we({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>fe(()=>import("./cpp-CLLBncYj.js"),[])});we({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>fe(()=>import("./cpp-CLLBncYj.js"),[])});we({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>fe(()=>import("./csharp-dUCx_-0o.js"),[])});we({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>fe(()=>import("./csp-5Rap-vPy.js"),[])});we({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>fe(()=>import("./css-D3h14YRZ.js"),[])});we({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>fe(()=>import("./cypher-DrQuvNYM.js"),[])});we({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>fe(()=>import("./dart-CFKIUWau.js"),[])});we({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>fe(()=>import("./dockerfile-Zznr-cwX.js"),[])});we({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>fe(()=>import("./ecl-Ce3n6wWz.js"),[])});we({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>fe(()=>import("./elixir-deUWdS0T.js"),[])});we({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>fe(()=>import("./flow9-i9-g7ZhI.js"),[])});we({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>fe(()=>import("./fsharp-CzKuDChf.js"),[])});we({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>fe(()=>import("./freemarker2-aAsBprVy.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAutoInterpolationDollar)});we({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>fe(()=>import("./freemarker2-aAsBprVy.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAngleInterpolationDollar)});we({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>fe(()=>import("./freemarker2-aAsBprVy.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagBracketInterpolationDollar)});we({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>fe(()=>import("./freemarker2-aAsBprVy.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAngleInterpolationBracket)});we({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>fe(()=>import("./freemarker2-aAsBprVy.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagBracketInterpolationBracket)});we({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>fe(()=>import("./freemarker2-aAsBprVy.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAutoInterpolationDollar)});we({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>fe(()=>import("./freemarker2-aAsBprVy.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>n.TagAutoInterpolationBracket)});we({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>fe(()=>import("./go-Cphgjts3.js"),[])});we({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>fe(()=>import("./graphql-Cg7bfA9N.js"),[])});we({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>fe(()=>import("./handlebars-B9y9KVva.js"),__vite__mapDeps([7,1,2,3,4,5,6]))});we({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>fe(()=>import("./hcl-0cvrggvQ.js"),[])});we({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:()=>fe(()=>import("./html-B4yimBtZ.js"),__vite__mapDeps([8,1,2,3,4,5,6]))});we({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>fe(()=>import("./ini-Drc7WvVn.js"),[])});we({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>fe(()=>import("./java-B_fMsGYe.js"),[])});we({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>fe(()=>import("./javascript-xyQKZDGW.js"),__vite__mapDeps([9,10,1,2,3,4,5,6]))});we({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>fe(()=>import("./julia-Bqgm2twL.js"),[])});we({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>fe(()=>import("./kotlin-BSkB5QuD.js"),[])});we({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>fe(()=>import("./less-BsTHnhdd.js"),[])});we({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>fe(()=>import("./lexon-YWi4-JPR.js"),[])});we({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>fe(()=>import("./lua-nf6ki56Z.js"),[])});we({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>fe(()=>import("./liquid-B5YkEln-.js"),__vite__mapDeps([11,1,2,3,4,5,6]))});we({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>fe(()=>import("./m3-Cpb6xl2v.js"),[])});we({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>fe(()=>import("./markdown-DSZPf7rp.js"),[])});we({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>fe(()=>import("./mdx-IAVXqYJ2.js"),__vite__mapDeps([12,1,2,3,4,5,6]))});we({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>fe(()=>import("./mips-B_c3zf-v.js"),[])});we({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>fe(()=>import("./msdax-rUNN04Wq.js"),[])});we({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>fe(()=>import("./mysql-DDwshQtU.js"),[])});we({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>fe(()=>import("./objective-c-B5zXfXm9.js"),[])});we({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>fe(()=>import("./pascal-CXOwvkN_.js"),[])});we({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>fe(()=>import("./pascaligo-Bc-ZgV77.js"),[])});we({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>fe(()=>import("./perl-CwNk8-XU.js"),[])});we({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>fe(()=>import("./pgsql-tGk8EFnU.js"),[])});we({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>fe(()=>import("./php-CpIb_Oan.js"),[])});we({id:"pla",extensions:[".pla"],loader:()=>fe(()=>import("./pla-B03wrqEc.js"),[])});we({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>fe(()=>import("./postiats-BKlk5iyT.js"),[])});we({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>fe(()=>import("./powerquery-Bhzvs7bI.js"),[])});we({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>fe(()=>import("./powershell-Dd3NCNK9.js"),[])});we({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>fe(()=>import("./protobuf-COyEY5Pt.js"),[])});we({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>fe(()=>import("./pug-BaJupSGV.js"),[])});we({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>fe(()=>import("./python-BcPmedha.js"),__vite__mapDeps([13,1,2,3,4,5,6]))});we({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>fe(()=>import("./qsharp-DXyYeYxl.js"),[])});we({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>fe(()=>import("./r-CdQndTaG.js"),[])});we({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>fe(()=>import("./razor-Dae0nPVH.js"),__vite__mapDeps([14,1,2,3,4,5,6]))});we({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>fe(()=>import("./redis-CVwtpugi.js"),[])});we({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>fe(()=>import("./redshift-25W9uPmb.js"),[])});we({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>fe(()=>import("./restructuredtext-DfzH4Xui.js"),[])});we({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>fe(()=>import("./ruby-Cp1zYvxS.js"),[])});we({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>fe(()=>import("./rust-D5C2fndG.js"),[])});we({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>fe(()=>import("./sb-CDntyWJ8.js"),[])});we({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:()=>fe(()=>import("./scala-BoFRg7Ot.js"),[])});we({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>fe(()=>import("./scheme-Bio4gycK.js"),[])});we({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>fe(()=>import("./scss-4Ik7cdeQ.js"),[])});we({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>fe(()=>import("./shell-CX-rkNHf.js"),[])});we({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>fe(()=>import("./solidity-Tw7wswEv.js"),[])});we({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>fe(()=>import("./sophia-C5WLch3f.js"),[])});we({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>fe(()=>import("./sparql-DHaeiCBh.js"),[])});we({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>fe(()=>import("./sql-CCSDG5nI.js"),[])});we({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>fe(()=>import("./st-pnP8ivHi.js"),[])});we({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>fe(()=>import("./swift-DwJ7jVG9.js"),[])});we({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>fe(()=>import("./systemverilog-B9Xyijhd.js"),[])});we({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>fe(()=>import("./systemverilog-B9Xyijhd.js"),[])});we({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>fe(()=>import("./tcl-DnHyzjbg.js"),[])});we({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>fe(()=>import("./twig-CPajHgWi.js"),[])});we({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>fe(()=>import("./typescript-BRzjXkWD.js"),__vite__mapDeps([10,1,2,3,4,5,6]))});we({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>fe(()=>import("./typespec-D-MeaMDU.js"),[])});we({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>fe(()=>import("./vb-DgyLZaXg.js"),[])});we({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>fe(()=>import("./wgsl-DYQUnd45.js"),[])});we({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:()=>fe(()=>import("./xml-DwrPHn8a.js"),__vite__mapDeps([15,1,2,3,4,5,6]))});we({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>fe(()=>import("./yaml-D5NhyUmN.js"),__vite__mapDeps([16,1,2,3,4,5,6]))});/*!-----------------------------------------------------------------------------
|
|
829
829
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
830
830
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
831
831
|
* Released under the MIT license
|
|
832
832
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
833
|
-
*-----------------------------------------------------------------------------*/var HCe=Object.defineProperty,zCe=Object.getOwnPropertyDescriptor,$Ce=Object.getOwnPropertyNames,UCe=Object.prototype.hasOwnProperty,jCe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of $Ce(e))!UCe.call(n,s)&&s!==t&&HCe(n,s,{get:()=>e[s],enumerable:!(i=zCe(e,s))||i.enumerable});return n},KCe=(n,e,t)=>(jCe(n,e,"default"),t),lg={};KCe(lg,V_);var $I=class{constructor(e,t,i){this._onDidChange=new lg.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},UI={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},jI={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},HW=new $I("css",UI,jI),zW=new $I("scss",UI,jI),$W=new $I("less",UI,jI);lg.languages.css={cssDefaults:HW,lessDefaults:$W,scssDefaults:zW};function KI(){return fe(()=>import("./cssMode-
|
|
833
|
+
*-----------------------------------------------------------------------------*/var HCe=Object.defineProperty,zCe=Object.getOwnPropertyDescriptor,$Ce=Object.getOwnPropertyNames,UCe=Object.prototype.hasOwnProperty,jCe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of $Ce(e))!UCe.call(n,s)&&s!==t&&HCe(n,s,{get:()=>e[s],enumerable:!(i=zCe(e,s))||i.enumerable});return n},KCe=(n,e,t)=>(jCe(n,e,"default"),t),lg={};KCe(lg,V_);var $I=class{constructor(e,t,i){this._onDidChange=new lg.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},UI={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},jI={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},HW=new $I("css",UI,jI),zW=new $I("scss",UI,jI),$W=new $I("less",UI,jI);lg.languages.css={cssDefaults:HW,lessDefaults:$W,scssDefaults:zW};function KI(){return fe(()=>import("./cssMode-CWSvB3aC.js"),__vite__mapDeps([17,1,2,3,4,5,6]))}lg.languages.onLanguage("less",()=>{KI().then(n=>n.setupMode($W))});lg.languages.onLanguage("scss",()=>{KI().then(n=>n.setupMode(zW))});lg.languages.onLanguage("css",()=>{KI().then(n=>n.setupMode(HW))});/*!-----------------------------------------------------------------------------
|
|
834
834
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
835
835
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
836
836
|
* Released under the MIT license
|
|
837
837
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
838
|
-
*-----------------------------------------------------------------------------*/var qCe=Object.defineProperty,GCe=Object.getOwnPropertyDescriptor,YCe=Object.getOwnPropertyNames,ZCe=Object.prototype.hasOwnProperty,XCe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of YCe(e))!ZCe.call(n,s)&&s!==t&&qCe(n,s,{get:()=>e[s],enumerable:!(i=GCe(e,s))||i.enumerable});return n},QCe=(n,e,t)=>(XCe(n,e,"default"),t),Jv={};QCe(Jv,V_);var JCe=class{constructor(e,t,i){this._onDidChange=new Jv.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},eve={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},ey={format:eve,suggest:{},data:{useDefaultDataProvider:!0}};function ty(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===em,documentFormattingEdits:n===em,documentRangeFormattingEdits:n===em}}var em="html",h3="handlebars",u3="razor",UW=iy(em,ey,ty(em)),tve=UW.defaults,jW=iy(h3,ey,ty(h3)),ive=jW.defaults,KW=iy(u3,ey,ty(u3)),nve=KW.defaults;Jv.languages.html={htmlDefaults:tve,razorDefaults:nve,handlebarDefaults:ive,htmlLanguageService:UW,handlebarLanguageService:jW,razorLanguageService:KW,registerHTMLLanguageService:iy};function sve(){return fe(()=>import("./htmlMode-
|
|
838
|
+
*-----------------------------------------------------------------------------*/var qCe=Object.defineProperty,GCe=Object.getOwnPropertyDescriptor,YCe=Object.getOwnPropertyNames,ZCe=Object.prototype.hasOwnProperty,XCe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of YCe(e))!ZCe.call(n,s)&&s!==t&&qCe(n,s,{get:()=>e[s],enumerable:!(i=GCe(e,s))||i.enumerable});return n},QCe=(n,e,t)=>(XCe(n,e,"default"),t),Jv={};QCe(Jv,V_);var JCe=class{constructor(e,t,i){this._onDidChange=new Jv.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},eve={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},ey={format:eve,suggest:{},data:{useDefaultDataProvider:!0}};function ty(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===em,documentFormattingEdits:n===em,documentRangeFormattingEdits:n===em}}var em="html",h3="handlebars",u3="razor",UW=iy(em,ey,ty(em)),tve=UW.defaults,jW=iy(h3,ey,ty(h3)),ive=jW.defaults,KW=iy(u3,ey,ty(u3)),nve=KW.defaults;Jv.languages.html={htmlDefaults:tve,razorDefaults:nve,handlebarDefaults:ive,htmlLanguageService:UW,handlebarLanguageService:jW,razorLanguageService:KW,registerHTMLLanguageService:iy};function sve(){return fe(()=>import("./htmlMode-XkoEE1Us.js"),__vite__mapDeps([18,1,2,3,4,5,6]))}function iy(n,e=ey,t=ty(n)){const i=new JCe(n,e,t);let s;const r=Jv.languages.onLanguage(n,async()=>{s=(await sve()).setupMode(i)});return{defaults:i,dispose(){r.dispose(),s?.dispose(),s=void 0}}}/*!-----------------------------------------------------------------------------
|
|
839
839
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
840
840
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
841
841
|
* Released under the MIT license
|
|
842
842
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
843
|
-
*-----------------------------------------------------------------------------*/var rve=Object.defineProperty,ove=Object.getOwnPropertyDescriptor,ave=Object.getOwnPropertyNames,lve=Object.prototype.hasOwnProperty,cve=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ave(e))!lve.call(n,s)&&s!==t&&rve(n,s,{get:()=>e[s],enumerable:!(i=ove(e,s))||i.enumerable});return n},dve=(n,e,t)=>(cve(n,e,"default"),t),W_={};dve(W_,V_);var hve=class{constructor(e,t,i){this._onDidChange=new W_.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},uve={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},fve={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},qW=new hve("json",uve,fve),gve=()=>GW().then(n=>n.getWorker());W_.languages.json={jsonDefaults:qW,getWorker:gve};function GW(){return fe(()=>import("./jsonMode-
|
|
843
|
+
*-----------------------------------------------------------------------------*/var rve=Object.defineProperty,ove=Object.getOwnPropertyDescriptor,ave=Object.getOwnPropertyNames,lve=Object.prototype.hasOwnProperty,cve=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ave(e))!lve.call(n,s)&&s!==t&&rve(n,s,{get:()=>e[s],enumerable:!(i=ove(e,s))||i.enumerable});return n},dve=(n,e,t)=>(cve(n,e,"default"),t),W_={};dve(W_,V_);var hve=class{constructor(e,t,i){this._onDidChange=new W_.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},uve={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},fve={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},qW=new hve("json",uve,fve),gve=()=>GW().then(n=>n.getWorker());W_.languages.json={jsonDefaults:qW,getWorker:gve};function GW(){return fe(()=>import("./jsonMode-PsmTZD9i.js"),__vite__mapDeps([19,1,2,3,4,5,6]))}W_.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});W_.languages.onLanguage("json",()=>{GW().then(n=>n.setupMode(qW))});/*!-----------------------------------------------------------------------------
|
|
844
844
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
845
845
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
846
846
|
* Released under the MIT license
|
|
847
847
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
848
|
-
*-----------------------------------------------------------------------------*/var pve=Object.defineProperty,mve=Object.getOwnPropertyDescriptor,_ve=Object.getOwnPropertyNames,bve=Object.prototype.hasOwnProperty,wve=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of _ve(e))!bve.call(n,s)&&s!==t&&pve(n,s,{get:()=>e[s],enumerable:!(i=mve(e,s))||i.enumerable});return n},Cve=(n,e,t)=>(wve(n,e,"default"),t),vve="5.4.5",jf={};Cve(jf,V_);var YW=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(YW||{}),ZW=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(ZW||{}),XW=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(XW||{}),QW=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(QW||{}),JW=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(JW||{}),eH=class{constructor(n,e,t,i,s){this._onDidChange=new jf.Emitter,this._onDidExtraLibsChange=new jf.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[t];s&&s.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let s=1;this._removedExtraLibs[t]&&(s=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},yve=vve,tH={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},iH=new eH({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},tH),nH=new eH({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},tH),Sve=()=>ny().then(n=>n.getTypeScriptWorker()),xve=()=>ny().then(n=>n.getJavaScriptWorker());jf.languages.typescript={ModuleKind:YW,JsxEmit:ZW,NewLineKind:XW,ScriptTarget:QW,ModuleResolutionKind:JW,typescriptVersion:yve,typescriptDefaults:iH,javascriptDefaults:nH,getTypeScriptWorker:Sve,getJavaScriptWorker:xve};function ny(){return fe(()=>import("./tsMode-qOM514sL.js"),__vite__mapDeps([20,1,2,3,4,5,6]))}jf.languages.onLanguage("typescript",()=>ny().then(n=>n.setupTypeScript(iH)));jf.languages.onLanguage("javascript",()=>ny().then(n=>n.setupJavaScript(nH)));const kve={0:" ",1:"u",2:"r"},f3=65535,fo=16777215,g3=4278190080;class dx{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<<i)!==0}set(e,t){const i=e/32|0,s=e%32,r=this._states[i];t?this._states[i]=r|1<<s:this._states[i]=r&~(1<<s)}}class Ks{constructor(e,t,i){if(e.length!==t.length||e.length>f3)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new dx(e.length),this._userDefinedStates=new dx(e.length),this._recoveredStates=new dx(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=i&&this.getEndLineNumber(r)>=s};for(let i=0,s=this._startIndexes.length;i<s;i++){const r=this._startIndexes[i],o=this._endIndexes[i];if(r>fo||o>fo)throw new Error("startLineNumber or endLineNumber must not exceed "+fo);for(;e.length>0&&!t(r,o);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=r+((a&255)<<24),this._endIndexes[i]=o+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&fo}getEndLineNumber(e){return this._endIndexes[e]&fo}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s<this._types.length;s++)this._types[s]===e&&(this.setCollapsed(s,t),i=!0);return i}toRegion(e){return new Lve(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&g3)>>>24)+((this._endIndexes[e]&g3)>>>16);return t===f3?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){const s=Math.floor((t+i)/2);e<this.getStartLineNumber(s)?i=s:t=s+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${kve[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&fo,endLineNumber:this._endIndexes[e]&fo,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),s=new Uint32Array(t);let r=[],o=!1;for(let l=0;l<t;l++){const c=e[l];i[l]=c.startLineNumber,s[l]=c.endLineNumber,r.push(c.type),c.type&&(o=!0)}o||(r=void 0);const a=new Ks(i,s,r);for(let l=0;l<t;l++)e[l].isCollapsed&&a.setCollapsed(l,!0),a.setSource(l,e[l].source);return a}static sanitizeAndMerge(e,t,i,s){i=i??Number.MAX_VALUE;const r=(m,_)=>Array.isArray(m)?(w=>w<_?m[w]:void 0):(w=>w<_?m.toFoldRange(w):void 0),o=r(e,e.length),a=r(t,t.length);let l=0,c=0,d=o(0),h=a(0);const u=[];let f,g=0;const p=[];for(;d||h;){let m;if(h&&(!d||d.startLineNumber>=h.startLineNumber))d&&d.startLineNumber===h.startLineNumber?(h.source===1?m=h:(m=d,m.isCollapsed=h.isCollapsed&&(d.endLineNumber===h.endLineNumber||!s?.startsInside(d.startLineNumber+1,d.endLineNumber+1)),m.source=0),d=o(++l)):(m=h,h.isCollapsed&&h.source===0&&(m.source=2)),h=a(++c);else{let _=c,w=h;for(;;){if(!w||w.startLineNumber>d.endLineNumber){m=d;break}if(w.source===1&&w.endLineNumber>d.endLineNumber)break;w=a(++_)}d=o(++l)}if(m){for(;f&&f.endLineNumber<m.startLineNumber;)f=u.pop();m.endLineNumber>m.startLineNumber&&m.startLineNumber>g&&m.endLineNumber<=i&&(!f||f.endLineNumber>=m.endLineNumber)&&(p.push(m),g=m.startLineNumber,f&&u.push(f),f=m)}}return p}}class Lve{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class Eve{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new W,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Ks(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,r=-1,o=-1;const a=l=>{for(;s<l;){const c=this._regions.getEndLineNumber(s),d=this._regions.isCollapsed(s);if(c<=r){const h=this.regions.getSource(s)!==0;i.changeDecorationOptions(this._editorDecorationIds[s],this._decorationProvider.getDecorationOption(d,c<=o,h))}d&&c>o&&(o=c),s++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const h=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,h),r=Math.max(r,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const r of e)if(!(r.startLineNumber>s.endLineNumber||s.startLineNumber>r.endLineNumber))return!0;return!1};for(let s=0;s<this._regions.length;s++){const r=this._regions.toFoldRange(s);(r.source===0||!i(r))&&t.push(r)}this.updatePost(Ks.fromFoldRanges(t))}update(e,t){const i=this._currentFoldedOrManualRanges(t),s=Ks.sanitizeAndMerge(e,i,this._textModel.getLineCount(),t);this.updatePost(Ks.fromFoldRanges(s))}updatePost(e){const t=[];let i=-1;for(let s=0,r=e.length;s<r;s++){const o=e.getStartLineNumber(s),a=e.getEndLineNumber(s),l=e.isCollapsed(s),c=e.getSource(s)!==0,d={startLineNumber:o,startColumn:this._textModel.getLineMaxColumn(o),endLineNumber:a,endColumn:this._textModel.getLineMaxColumn(a)+1};t.push({range:d,options:this._decorationProvider.getDecorationOption(l,a<=i,c)}),l&&a>i&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,s=this._regions.length;i<s;i++){let r=this.regions.isCollapsed(i);const o=this.regions.getSource(i);if(r||o!==0){const a=this._regions.toFoldRange(i),l=this._textModel.getDecorationRange(this._editorDecorationIds[i]);l&&(r&&e?.startsInside(l.startLineNumber+1,l.endLineNumber)&&(r=!1),t.push({startLineNumber:l.startLineNumber,endLineNumber:l.endLineNumber,type:a.type,isCollapsed:r,source:o}))}}return t}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let s=0,r=e.length;s<r;s++){const o=e[s];if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const a=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const r of e){if(r.startLineNumber>=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const o=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);(!r.checksum||o===r.checksum)&&t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:void 0,isCollapsed:r.isCollapsed??!0,source:r.source??0})}const s=Ks.sanitizeAndMerge(this._regions,t,i);this.updatePost(Ks.fromFoldRanges(s))}_getLinesChecksum(e,t){return mT(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),r=1;for(;s>=0;){const o=this._regions.toRegion(s);(!t||t(o,r))&&i.push(o),r++,s=o.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const o=[];for(let a=s,l=this._regions.length;a<l;a++){const c=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<r){for(;o.length>0&&!c.containedBy(o[o.length-1]);)o.pop();o.push(c),t(c,o.length)&&i.push(c)}else break}}else for(let o=s,a=this._regions.length;o<a;o++){const l=this._regions.toRegion(o);if(this._regions.getStartLineNumber(o)<r)(!t||t(l))&&i.push(l);else break}return i}}function sH(n,e,t){const i=[];for(const s of t){const r=n.getRegionAtLine(s);if(r){const o=!r.isCollapsed;if(i.push(r),e>1){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==o&&c<e);i.push(...a)}}}n.toggleCollapseState(i)}function cg(n,e,t=Number.MAX_VALUE,i){const s=[];if(i&&i.length>0)for(const r of i){const o=n.getRegionAtLine(r);if(o&&(o.isCollapsed!==e&&s.push(o),t>1)){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==e&&c<t);s.push(...a)}}else{const r=n.getRegionsInside(null,(o,a)=>o.isCollapsed!==e&&a<t);s.push(...r)}n.toggleCollapseState(s)}function rH(n,e,t,i){const s=[];for(const r of i){const o=n.getAllRegionsAtLine(r,(a,l)=>a.isCollapsed!==e&&l<=t);s.push(...o)}n.toggleCollapseState(s)}function Dve(n,e,t){const i=[];for(const s of t){const r=n.getAllRegionsAtLine(s,o=>o.isCollapsed!==e);r.length>0&&i.push(r[0])}n.toggleCollapseState(i)}function Tve(n,e,t,i){const s=(o,a)=>a===e&&o.isCollapsed!==t&&!i.some(l=>o.containsLine(l)),r=n.getRegionsInside(null,s);n.toggleCollapseState(r)}function oH(n,e,t){const i=[];for(const o of t){const a=n.getAllRegionsAtLine(o,void 0);a.length>0&&i.push(a[0])}const s=o=>i.every(a=>!a.containedBy(o)&&!o.containedBy(a))&&o.isCollapsed!==e,r=n.getRegionsInside(null,s);n.toggleCollapseState(r)}function qI(n,e,t){const i=n.textModel,s=n.regions,r=[];for(let o=s.length-1;o>=0;o--)if(t!==s.isCollapsed(o)){const a=s.getStartLineNumber(o);e.test(i.getLineContent(a))&&r.push(s.toRegion(o))}n.toggleCollapseState(r)}function GI(n,e,t){const i=n.regions,s=[];for(let r=i.length-1;r>=0;r--)t!==i.isCollapsed(r)&&e===i.getType(r)&&s.push(i.toRegion(r));n.toggleCollapseState(s)}function Nve(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function Ive(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<n)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function Mve(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class Ave{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new W,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Lh(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,r=Number.MAX_VALUE,o=-1;const a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;const l=a.getStartLineNumber(i)+1,c=a.getEndLineNumber(i);r<=l&&c<=o||(!e&&s<this._hiddenRanges.length&&this._hiddenRanges[s].startLineNumber===l&&this._hiddenRanges[s].endLineNumber===c?(t.push(this._hiddenRanges[s]),s++):(e=!0,t.push(new F(l,1,c,1))),r=l,o=c)}(this._hasLineChanges||e||s<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return p3(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const r=o=>((!s||!Rve(o,s))&&(s=p3(this._hiddenRanges,o)),s?s.startLineNumber-1:null);for(let o=0,a=e.length;o<a;o++){let l=e[o];const c=r(l.startLineNumber);c&&(l=l.setStartPosition(c,i.getLineMaxColumn(c)),t=!0);const d=r(l.endLineNumber);d&&(l=l.setEndPosition(d,i.getLineMaxColumn(d)),t=!0),e[o]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function Rve(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function p3(n,e){const t=tw(n,i=>e<i.startLineNumber)-1;return t>=0&&n[t].endLineNumber>=e?n[t]:null}const Ove=5e3,Pve="indent";class aH{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=Pve}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(Vve(this.editorModel,i,s,this.foldingRangesLimit))}}let Fve=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>fo||t>fo)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let r=this._length-1,o=0;r>=0;r--,o++)i[o]=this._startIndexes[r],s[o]=this._endIndexes[r];return new Ks(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;l<this._indentOccurrences.length;l++){const c=this._indentOccurrences[l];if(c){if(c+i>t){s=l;break}i+=c}}const r=e.getOptions().tabSize,o=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],h=e.getLineContent(d),u=NN(h,r);(u<s||u===s&&i++<t)&&(o[c]=d,a[c]=this._endIndexes[l],c++)}return new Ks(o,a)}}};const Bve={limit:Ove,update:()=>{}};function Vve(n,e,t,i=Bve){const s=n.getOptions().tabSize,r=new Fve(i);let o;t&&(o=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),h=NN(d,s);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=c);continue}let f;if(o&&(f=d.match(o)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,u=a[g],r.insertFirst(c,u.line,h),u.line=c,u.indent=h,u.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const g=u.endAbove-1;g-c>=1&&r.insertFirst(c,g,h)}u.indent===h?u.endAbove=c:a.push({indent:h,endAbove:c,line:c})}return r.toIndentRanges(n)}const Wve=N("editor.foldBackground",{light:Ke(pc,.3),dark:Ke(pc,.3),hcDark:null,hcLight:null},b("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);N("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},b("collapsedTextColor","Color of the collapsed text after the first line of a folded range."));N("editorGutter.foldingControlForeground",lw,b("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const q2=eo("folding-expanded",ue.chevronDown,b("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),G2=eo("folding-collapsed",ue.chevronRight,b("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),m3=eo("folding-manual-collapsed",G2,b("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),_3=eo("folding-manual-expanded",q2,b("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),hx={color:md(Wve),position:1},gu=b("linesCollapsed","Click to expand the range."),sb=b("linesExpanded","Click to collapse the range.");class Ws{static{this.COLLAPSED_VISUAL_DECORATION=Rt.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:gu,firstLineDecorationClassName:Ue.asClassName(G2)})}static{this.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Rt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:hx,isWholeLine:!0,linesDecorationsTooltip:gu,firstLineDecorationClassName:Ue.asClassName(G2)})}static{this.MANUALLY_COLLAPSED_VISUAL_DECORATION=Rt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:gu,firstLineDecorationClassName:Ue.asClassName(m3)})}static{this.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Rt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:hx,isWholeLine:!0,linesDecorationsTooltip:gu,firstLineDecorationClassName:Ue.asClassName(m3)})}static{this.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Rt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:gu})}static{this.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Rt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:hx,isWholeLine:!0,linesDecorationsTooltip:gu})}static{this.EXPANDED_VISUAL_DECORATION=Rt.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ue.asClassName(q2),linesDecorationsTooltip:sb})}static{this.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Rt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Ue.asClassName(q2),linesDecorationsTooltip:sb})}static{this.MANUALLY_EXPANDED_VISUAL_DECORATION=Rt.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ue.asClassName(_3),linesDecorationsTooltip:sb})}static{this.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Rt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Ue.asClassName(_3),linesDecorationsTooltip:sb})}static{this.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Rt.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0})}static{this.HIDDEN_RANGE_DECORATION=Rt.register({description:"folding-hidden-range-decoration",stickiness:1})}constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ws.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ws.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ws.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ws.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ws.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ws.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ws.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ws.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ws.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ws.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ws.MANUALLY_EXPANDED_VISUAL_DECORATION:Ws.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}const Hve={},zve="syntax";class lH{constructor(e,t,i,s,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=r,this.id=zve,this.disposables=new be,r&&this.disposables.add(r);for(const o of t)typeof o.onDidChange=="function"&&this.disposables.add(o.onDidChange(i))}compute(e){return $ve(this.providers,this.editorModel,e).then(t=>t?jve(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function $ve(n,e,t){let i=null;const s=n.map((r,o)=>Promise.resolve(r.provideFoldingRanges(e,Hve,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:o,kind:c.kind})}},zC));return Promise.all(s).then(r=>i)}class Uve{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>fo||t>fo)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=s,this._types[r]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;s<this._length;s++)t[s]=this._startIndexes[s],i[s]=this._endIndexes[s];return new Ks(t,i,this._types)}else{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let a=0;a<this._nestingLevelCounts.length;a++){const l=this._nestingLevelCounts[a];if(l){if(l+t>e){i=a;break}t+=l}}const s=new Uint32Array(e),r=new Uint32Array(e),o=[];for(let a=0,l=0;a<this._length;a++){const c=this._nestingLevels[a];(c<i||c===i&&t++<e)&&(s[l]=this._startIndexes[a],r[l]=this._endIndexes[a],o[l]=this._types[a],l++)}return new Ks(s,r,o)}}}function jve(n,e){const t=n.sort((o,a)=>{let l=o.start-a.start;return l===0&&(l=o.rank-a.rank),l}),i=new Uve(e);let s;const r=[];for(const o of t)if(!s)s=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else if(o.start>s.start)if(o.end<=s.end)r.push(s),s=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else{if(o.start>s.end){do s=r.pop();while(s&&o.start>s.end);s&&r.push(s),s=o}i.add(o.start,o.end,o.kind&&o.kind.value,r.length)}return i.toIndentRanges()}var Kve=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},$g=function(n,e){return function(t,i){e(t,i,n)}},hp;const un=new _e("foldingEnabled",!1);let Kf=class extends J{static{hp=this}static{this.ID="editor.contrib.folding"}static get(e){return e.getContribution(hp.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return hp._foldingRangeSelector?.(i,t)??i}constructor(e,t,i,s,r,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new be),this.editor=e,this._foldingLimitReporter=new qve(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=r.for(o.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ws(e),this.foldingDecorationProvider.showFoldingControls=a.get(111),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=un.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(111)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(111),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new Eve(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new Ave(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Jf(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Nn(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new aH(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=hp.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new lH(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Yc,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=fT(r=>i.compute(r));return s.then(r=>{if(r&&s===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=r.setCollapsedAllOfType($s.Imports.value,!0);c&&(o=Qm.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(r,Gve(a)),o?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(Ct(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const r of i){const o=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(o)&&s.push(...t.getAllRegionsAtLine(o,a=>a.isCollapsed&&o>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,Ct)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const s=e.target.detail,r=e.target.element.offsetLeft;if(s.offsetX-r<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,r=e.target.range;if(!r||r.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const a=o.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=u=>!u.containedBy(o)&&!o.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&c.push(u);c.length===0&&(c=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(o))h.isCollapsed===a&&c.push(h);(a||!d||c.length===0)&&c.push(o)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Kf=hp=Kve([$g(1,ut),$g(2,yr),$g(3,Qr),$g(4,k6),$g(5,xt)],Kf);class qve{constructor(e){this.editor=e,this._onDidChange=new W,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Cn extends AT{runEditorCommand(e,t,i){const s=e.get(yr),r=Kf.get(t);if(!r)return;const o=r.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(a=>{if(a){this.invoke(r,a,t,i,s);const l=t.getSelection();l&&r.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function Gve(n){return!n||n.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of n){const s=i.startLineNumber;if(s>=e&&s<=t)return!0}return!1}}}function cH(n){if(!Un(n)){if(!Hn(n))return!1;const e=n;if(!Un(e.levels)&&!Oc(e.levels)||!Un(e.direction)&&!ks(e.direction)||!Un(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Oc)))return!1}return!0}class Yve extends Cn{constructor(){super({id:"editor.unfold",label:b("unfoldAction.label","Unfold"),alias:"Unfold",precondition:un,kbOpts:{kbExpr:oe.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument:
|
|
848
|
+
*-----------------------------------------------------------------------------*/var pve=Object.defineProperty,mve=Object.getOwnPropertyDescriptor,_ve=Object.getOwnPropertyNames,bve=Object.prototype.hasOwnProperty,wve=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of _ve(e))!bve.call(n,s)&&s!==t&&pve(n,s,{get:()=>e[s],enumerable:!(i=mve(e,s))||i.enumerable});return n},Cve=(n,e,t)=>(wve(n,e,"default"),t),vve="5.4.5",jf={};Cve(jf,V_);var YW=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(YW||{}),ZW=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(ZW||{}),XW=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(XW||{}),QW=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(QW||{}),JW=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(JW||{}),eH=class{constructor(n,e,t,i,s){this._onDidChange=new jf.Emitter,this._onDidExtraLibsChange=new jf.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[t];s&&s.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let s=1;this._removedExtraLibs[t]&&(s=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},yve=vve,tH={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},iH=new eH({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},tH),nH=new eH({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},tH),Sve=()=>ny().then(n=>n.getTypeScriptWorker()),xve=()=>ny().then(n=>n.getJavaScriptWorker());jf.languages.typescript={ModuleKind:YW,JsxEmit:ZW,NewLineKind:XW,ScriptTarget:QW,ModuleResolutionKind:JW,typescriptVersion:yve,typescriptDefaults:iH,javascriptDefaults:nH,getTypeScriptWorker:Sve,getJavaScriptWorker:xve};function ny(){return fe(()=>import("./tsMode-C8IFzmUX.js"),__vite__mapDeps([20,1,2,3,4,5,6]))}jf.languages.onLanguage("typescript",()=>ny().then(n=>n.setupTypeScript(iH)));jf.languages.onLanguage("javascript",()=>ny().then(n=>n.setupJavaScript(nH)));const kve={0:" ",1:"u",2:"r"},f3=65535,fo=16777215,g3=4278190080;class dx{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<<i)!==0}set(e,t){const i=e/32|0,s=e%32,r=this._states[i];t?this._states[i]=r|1<<s:this._states[i]=r&~(1<<s)}}class Ks{constructor(e,t,i){if(e.length!==t.length||e.length>f3)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new dx(e.length),this._userDefinedStates=new dx(e.length),this._recoveredStates=new dx(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=i&&this.getEndLineNumber(r)>=s};for(let i=0,s=this._startIndexes.length;i<s;i++){const r=this._startIndexes[i],o=this._endIndexes[i];if(r>fo||o>fo)throw new Error("startLineNumber or endLineNumber must not exceed "+fo);for(;e.length>0&&!t(r,o);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=r+((a&255)<<24),this._endIndexes[i]=o+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&fo}getEndLineNumber(e){return this._endIndexes[e]&fo}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s<this._types.length;s++)this._types[s]===e&&(this.setCollapsed(s,t),i=!0);return i}toRegion(e){return new Lve(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&g3)>>>24)+((this._endIndexes[e]&g3)>>>16);return t===f3?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){const s=Math.floor((t+i)/2);e<this.getStartLineNumber(s)?i=s:t=s+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${kve[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&fo,endLineNumber:this._endIndexes[e]&fo,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),s=new Uint32Array(t);let r=[],o=!1;for(let l=0;l<t;l++){const c=e[l];i[l]=c.startLineNumber,s[l]=c.endLineNumber,r.push(c.type),c.type&&(o=!0)}o||(r=void 0);const a=new Ks(i,s,r);for(let l=0;l<t;l++)e[l].isCollapsed&&a.setCollapsed(l,!0),a.setSource(l,e[l].source);return a}static sanitizeAndMerge(e,t,i,s){i=i??Number.MAX_VALUE;const r=(m,_)=>Array.isArray(m)?(w=>w<_?m[w]:void 0):(w=>w<_?m.toFoldRange(w):void 0),o=r(e,e.length),a=r(t,t.length);let l=0,c=0,d=o(0),h=a(0);const u=[];let f,g=0;const p=[];for(;d||h;){let m;if(h&&(!d||d.startLineNumber>=h.startLineNumber))d&&d.startLineNumber===h.startLineNumber?(h.source===1?m=h:(m=d,m.isCollapsed=h.isCollapsed&&(d.endLineNumber===h.endLineNumber||!s?.startsInside(d.startLineNumber+1,d.endLineNumber+1)),m.source=0),d=o(++l)):(m=h,h.isCollapsed&&h.source===0&&(m.source=2)),h=a(++c);else{let _=c,w=h;for(;;){if(!w||w.startLineNumber>d.endLineNumber){m=d;break}if(w.source===1&&w.endLineNumber>d.endLineNumber)break;w=a(++_)}d=o(++l)}if(m){for(;f&&f.endLineNumber<m.startLineNumber;)f=u.pop();m.endLineNumber>m.startLineNumber&&m.startLineNumber>g&&m.endLineNumber<=i&&(!f||f.endLineNumber>=m.endLineNumber)&&(p.push(m),g=m.startLineNumber,f&&u.push(f),f=m)}}return p}}class Lve{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class Eve{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new W,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Ks(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,r=-1,o=-1;const a=l=>{for(;s<l;){const c=this._regions.getEndLineNumber(s),d=this._regions.isCollapsed(s);if(c<=r){const h=this.regions.getSource(s)!==0;i.changeDecorationOptions(this._editorDecorationIds[s],this._decorationProvider.getDecorationOption(d,c<=o,h))}d&&c>o&&(o=c),s++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const h=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,h),r=Math.max(r,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const r of e)if(!(r.startLineNumber>s.endLineNumber||s.startLineNumber>r.endLineNumber))return!0;return!1};for(let s=0;s<this._regions.length;s++){const r=this._regions.toFoldRange(s);(r.source===0||!i(r))&&t.push(r)}this.updatePost(Ks.fromFoldRanges(t))}update(e,t){const i=this._currentFoldedOrManualRanges(t),s=Ks.sanitizeAndMerge(e,i,this._textModel.getLineCount(),t);this.updatePost(Ks.fromFoldRanges(s))}updatePost(e){const t=[];let i=-1;for(let s=0,r=e.length;s<r;s++){const o=e.getStartLineNumber(s),a=e.getEndLineNumber(s),l=e.isCollapsed(s),c=e.getSource(s)!==0,d={startLineNumber:o,startColumn:this._textModel.getLineMaxColumn(o),endLineNumber:a,endColumn:this._textModel.getLineMaxColumn(a)+1};t.push({range:d,options:this._decorationProvider.getDecorationOption(l,a<=i,c)}),l&&a>i&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,s=this._regions.length;i<s;i++){let r=this.regions.isCollapsed(i);const o=this.regions.getSource(i);if(r||o!==0){const a=this._regions.toFoldRange(i),l=this._textModel.getDecorationRange(this._editorDecorationIds[i]);l&&(r&&e?.startsInside(l.startLineNumber+1,l.endLineNumber)&&(r=!1),t.push({startLineNumber:l.startLineNumber,endLineNumber:l.endLineNumber,type:a.type,isCollapsed:r,source:o}))}}return t}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let s=0,r=e.length;s<r;s++){const o=e[s];if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const a=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const r of e){if(r.startLineNumber>=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const o=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);(!r.checksum||o===r.checksum)&&t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:void 0,isCollapsed:r.isCollapsed??!0,source:r.source??0})}const s=Ks.sanitizeAndMerge(this._regions,t,i);this.updatePost(Ks.fromFoldRanges(s))}_getLinesChecksum(e,t){return mT(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),r=1;for(;s>=0;){const o=this._regions.toRegion(s);(!t||t(o,r))&&i.push(o),r++,s=o.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const o=[];for(let a=s,l=this._regions.length;a<l;a++){const c=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<r){for(;o.length>0&&!c.containedBy(o[o.length-1]);)o.pop();o.push(c),t(c,o.length)&&i.push(c)}else break}}else for(let o=s,a=this._regions.length;o<a;o++){const l=this._regions.toRegion(o);if(this._regions.getStartLineNumber(o)<r)(!t||t(l))&&i.push(l);else break}return i}}function sH(n,e,t){const i=[];for(const s of t){const r=n.getRegionAtLine(s);if(r){const o=!r.isCollapsed;if(i.push(r),e>1){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==o&&c<e);i.push(...a)}}}n.toggleCollapseState(i)}function cg(n,e,t=Number.MAX_VALUE,i){const s=[];if(i&&i.length>0)for(const r of i){const o=n.getRegionAtLine(r);if(o&&(o.isCollapsed!==e&&s.push(o),t>1)){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==e&&c<t);s.push(...a)}}else{const r=n.getRegionsInside(null,(o,a)=>o.isCollapsed!==e&&a<t);s.push(...r)}n.toggleCollapseState(s)}function rH(n,e,t,i){const s=[];for(const r of i){const o=n.getAllRegionsAtLine(r,(a,l)=>a.isCollapsed!==e&&l<=t);s.push(...o)}n.toggleCollapseState(s)}function Dve(n,e,t){const i=[];for(const s of t){const r=n.getAllRegionsAtLine(s,o=>o.isCollapsed!==e);r.length>0&&i.push(r[0])}n.toggleCollapseState(i)}function Tve(n,e,t,i){const s=(o,a)=>a===e&&o.isCollapsed!==t&&!i.some(l=>o.containsLine(l)),r=n.getRegionsInside(null,s);n.toggleCollapseState(r)}function oH(n,e,t){const i=[];for(const o of t){const a=n.getAllRegionsAtLine(o,void 0);a.length>0&&i.push(a[0])}const s=o=>i.every(a=>!a.containedBy(o)&&!o.containedBy(a))&&o.isCollapsed!==e,r=n.getRegionsInside(null,s);n.toggleCollapseState(r)}function qI(n,e,t){const i=n.textModel,s=n.regions,r=[];for(let o=s.length-1;o>=0;o--)if(t!==s.isCollapsed(o)){const a=s.getStartLineNumber(o);e.test(i.getLineContent(a))&&r.push(s.toRegion(o))}n.toggleCollapseState(r)}function GI(n,e,t){const i=n.regions,s=[];for(let r=i.length-1;r>=0;r--)t!==i.isCollapsed(r)&&e===i.getType(r)&&s.push(i.toRegion(r));n.toggleCollapseState(s)}function Nve(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function Ive(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<n)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function Mve(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class Ave{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new W,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Lh(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,r=Number.MAX_VALUE,o=-1;const a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;const l=a.getStartLineNumber(i)+1,c=a.getEndLineNumber(i);r<=l&&c<=o||(!e&&s<this._hiddenRanges.length&&this._hiddenRanges[s].startLineNumber===l&&this._hiddenRanges[s].endLineNumber===c?(t.push(this._hiddenRanges[s]),s++):(e=!0,t.push(new F(l,1,c,1))),r=l,o=c)}(this._hasLineChanges||e||s<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return p3(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const r=o=>((!s||!Rve(o,s))&&(s=p3(this._hiddenRanges,o)),s?s.startLineNumber-1:null);for(let o=0,a=e.length;o<a;o++){let l=e[o];const c=r(l.startLineNumber);c&&(l=l.setStartPosition(c,i.getLineMaxColumn(c)),t=!0);const d=r(l.endLineNumber);d&&(l=l.setEndPosition(d,i.getLineMaxColumn(d)),t=!0),e[o]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function Rve(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function p3(n,e){const t=tw(n,i=>e<i.startLineNumber)-1;return t>=0&&n[t].endLineNumber>=e?n[t]:null}const Ove=5e3,Pve="indent";class aH{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=Pve}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(Vve(this.editorModel,i,s,this.foldingRangesLimit))}}let Fve=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>fo||t>fo)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let r=this._length-1,o=0;r>=0;r--,o++)i[o]=this._startIndexes[r],s[o]=this._endIndexes[r];return new Ks(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;l<this._indentOccurrences.length;l++){const c=this._indentOccurrences[l];if(c){if(c+i>t){s=l;break}i+=c}}const r=e.getOptions().tabSize,o=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],h=e.getLineContent(d),u=NN(h,r);(u<s||u===s&&i++<t)&&(o[c]=d,a[c]=this._endIndexes[l],c++)}return new Ks(o,a)}}};const Bve={limit:Ove,update:()=>{}};function Vve(n,e,t,i=Bve){const s=n.getOptions().tabSize,r=new Fve(i);let o;t&&(o=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),h=NN(d,s);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=c);continue}let f;if(o&&(f=d.match(o)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,u=a[g],r.insertFirst(c,u.line,h),u.line=c,u.indent=h,u.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const g=u.endAbove-1;g-c>=1&&r.insertFirst(c,g,h)}u.indent===h?u.endAbove=c:a.push({indent:h,endAbove:c,line:c})}return r.toIndentRanges(n)}const Wve=N("editor.foldBackground",{light:Ke(pc,.3),dark:Ke(pc,.3),hcDark:null,hcLight:null},b("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);N("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},b("collapsedTextColor","Color of the collapsed text after the first line of a folded range."));N("editorGutter.foldingControlForeground",lw,b("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const q2=eo("folding-expanded",ue.chevronDown,b("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),G2=eo("folding-collapsed",ue.chevronRight,b("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),m3=eo("folding-manual-collapsed",G2,b("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),_3=eo("folding-manual-expanded",q2,b("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),hx={color:md(Wve),position:1},gu=b("linesCollapsed","Click to expand the range."),sb=b("linesExpanded","Click to collapse the range.");class Ws{static{this.COLLAPSED_VISUAL_DECORATION=Rt.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:gu,firstLineDecorationClassName:Ue.asClassName(G2)})}static{this.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Rt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:hx,isWholeLine:!0,linesDecorationsTooltip:gu,firstLineDecorationClassName:Ue.asClassName(G2)})}static{this.MANUALLY_COLLAPSED_VISUAL_DECORATION=Rt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:gu,firstLineDecorationClassName:Ue.asClassName(m3)})}static{this.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Rt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:hx,isWholeLine:!0,linesDecorationsTooltip:gu,firstLineDecorationClassName:Ue.asClassName(m3)})}static{this.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Rt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:gu})}static{this.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Rt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:hx,isWholeLine:!0,linesDecorationsTooltip:gu})}static{this.EXPANDED_VISUAL_DECORATION=Rt.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ue.asClassName(q2),linesDecorationsTooltip:sb})}static{this.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Rt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Ue.asClassName(q2),linesDecorationsTooltip:sb})}static{this.MANUALLY_EXPANDED_VISUAL_DECORATION=Rt.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ue.asClassName(_3),linesDecorationsTooltip:sb})}static{this.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Rt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Ue.asClassName(_3),linesDecorationsTooltip:sb})}static{this.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Rt.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0})}static{this.HIDDEN_RANGE_DECORATION=Rt.register({description:"folding-hidden-range-decoration",stickiness:1})}constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ws.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ws.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ws.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ws.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ws.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ws.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ws.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ws.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ws.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ws.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ws.MANUALLY_EXPANDED_VISUAL_DECORATION:Ws.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}const Hve={},zve="syntax";class lH{constructor(e,t,i,s,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=r,this.id=zve,this.disposables=new be,r&&this.disposables.add(r);for(const o of t)typeof o.onDidChange=="function"&&this.disposables.add(o.onDidChange(i))}compute(e){return $ve(this.providers,this.editorModel,e).then(t=>t?jve(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function $ve(n,e,t){let i=null;const s=n.map((r,o)=>Promise.resolve(r.provideFoldingRanges(e,Hve,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:o,kind:c.kind})}},zC));return Promise.all(s).then(r=>i)}class Uve{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>fo||t>fo)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=s,this._types[r]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;s<this._length;s++)t[s]=this._startIndexes[s],i[s]=this._endIndexes[s];return new Ks(t,i,this._types)}else{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let a=0;a<this._nestingLevelCounts.length;a++){const l=this._nestingLevelCounts[a];if(l){if(l+t>e){i=a;break}t+=l}}const s=new Uint32Array(e),r=new Uint32Array(e),o=[];for(let a=0,l=0;a<this._length;a++){const c=this._nestingLevels[a];(c<i||c===i&&t++<e)&&(s[l]=this._startIndexes[a],r[l]=this._endIndexes[a],o[l]=this._types[a],l++)}return new Ks(s,r,o)}}}function jve(n,e){const t=n.sort((o,a)=>{let l=o.start-a.start;return l===0&&(l=o.rank-a.rank),l}),i=new Uve(e);let s;const r=[];for(const o of t)if(!s)s=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else if(o.start>s.start)if(o.end<=s.end)r.push(s),s=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else{if(o.start>s.end){do s=r.pop();while(s&&o.start>s.end);s&&r.push(s),s=o}i.add(o.start,o.end,o.kind&&o.kind.value,r.length)}return i.toIndentRanges()}var Kve=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},$g=function(n,e){return function(t,i){e(t,i,n)}},hp;const un=new _e("foldingEnabled",!1);let Kf=class extends J{static{hp=this}static{this.ID="editor.contrib.folding"}static get(e){return e.getContribution(hp.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return hp._foldingRangeSelector?.(i,t)??i}constructor(e,t,i,s,r,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new be),this.editor=e,this._foldingLimitReporter=new qve(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=r.for(o.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ws(e),this.foldingDecorationProvider.showFoldingControls=a.get(111),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=un.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(111)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(111),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new Eve(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new Ave(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Jf(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Nn(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new aH(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=hp.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new lH(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Yc,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=fT(r=>i.compute(r));return s.then(r=>{if(r&&s===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=r.setCollapsedAllOfType($s.Imports.value,!0);c&&(o=Qm.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(r,Gve(a)),o?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(Ct(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const r of i){const o=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(o)&&s.push(...t.getAllRegionsAtLine(o,a=>a.isCollapsed&&o>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,Ct)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const s=e.target.detail,r=e.target.element.offsetLeft;if(s.offsetX-r<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,r=e.target.range;if(!r||r.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const a=o.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=u=>!u.containedBy(o)&&!o.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&c.push(u);c.length===0&&(c=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(o))h.isCollapsed===a&&c.push(h);(a||!d||c.length===0)&&c.push(o)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Kf=hp=Kve([$g(1,ut),$g(2,yr),$g(3,Qr),$g(4,k6),$g(5,xt)],Kf);class qve{constructor(e){this.editor=e,this._onDidChange=new W,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Cn extends AT{runEditorCommand(e,t,i){const s=e.get(yr),r=Kf.get(t);if(!r)return;const o=r.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(a=>{if(a){this.invoke(r,a,t,i,s);const l=t.getSelection();l&&r.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function Gve(n){return!n||n.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of n){const s=i.startLineNumber;if(s>=e&&s<=t)return!0}return!1}}}function cH(n){if(!Un(n)){if(!Hn(n))return!1;const e=n;if(!Un(e.levels)&&!Oc(e.levels)||!Un(e.direction)&&!ks(e.direction)||!Un(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Oc)))return!1}return!0}class Yve extends Cn{constructor(){super({id:"editor.unfold",label:b("unfoldAction.label","Unfold"),alias:"Unfold",precondition:un,kbOpts:{kbExpr:oe.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument:
|
|
849
849
|
* 'levels': Number of levels to unfold. If not set, defaults to 1.
|
|
850
850
|
* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
|
|
851
851
|
* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.
|