@fnndsc/argus 0.49.2 → 0.49.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/assets/{Settings-CynwvVmF.js → Settings-fVKVemQQ.js} +1 -1
  2. package/dist/assets/{Texture-CUE2sZUc.js → Texture-BgODsSgK.js} +1 -1
  3. package/dist/assets/{addVolumesToViewports-jkL6cXhf.js → addVolumesToViewports-BY7KOGfA.js} +1 -1
  4. package/dist/assets/{asciidoc-BQO4iSvH.js → asciidoc-RQ_qptF1.js} +1 -1
  5. package/dist/assets/{cornerstoneEngine-CnL2H_m8.js → cornerstoneEngine-BRNPnIOt.js} +2 -2
  6. package/dist/assets/{documentEngines-nNs3BDQn.js → documentEngines-BYIPThV9.js} +1 -1
  7. package/dist/assets/{field-BxQaoE-X.js → field-B205-Tj-.js} +1 -1
  8. package/dist/assets/{index-Ds1IEeoY.js → index-BdNdXhQP.js} +1 -1
  9. package/dist/assets/{index-6xVu8SR3.js → index-Bqm_Hovd.js} +1 -1
  10. package/dist/assets/{index-C_gVizDw.js → index-Bx9on2--.js} +249 -249
  11. package/dist/assets/{index-DOHGOhd6.js → index-CO9muX7k.js} +1 -1
  12. package/dist/assets/{index-Dm5bSR88.js → index-CdJeDIcL.js} +1 -1
  13. package/dist/assets/{index-C7VOsCCm.js → index-CnRSmWoR.js} +1 -1
  14. package/dist/assets/{index-CmyfI33v.css → index-D8wX84LU.css} +1 -1
  15. package/dist/assets/{index-DDVamRo8.js → index-D9bTQUpC.js} +1 -1
  16. package/dist/assets/{index-vzSVL2TX.js → index-DIFOuWMx.js} +1 -1
  17. package/dist/assets/{index-CwoRnDne.js → index-Da-AnxRT.js} +1 -1
  18. package/dist/assets/{index-Cz2KdzUm.js → index-DfLbMZD1.js} +1 -1
  19. package/dist/assets/{index-BJhuEfhB.js → index-Dio0XCm2.js} +1 -1
  20. package/dist/assets/{index-DijpRmkl.js → index-VyT6mhra.js} +1 -1
  21. package/dist/assets/{index-BKTol-_M.js → index-pW9eskfl.js} +1 -1
  22. package/dist/assets/{index-D40Oznjb.js → index-vz50_mRp.js} +1 -1
  23. package/dist/assets/{niivueEngine-BsToxwze.js → niivueEngine-7YBeiNJD.js} +2 -2
  24. package/dist/assets/{slabScene-B2U0mzjt.js → slabScene-D8umgMl8.js} +1 -1
  25. package/dist/assets/{syntax-D498Iat0.js → syntax-CpKw5ptt.js} +3 -3
  26. package/dist/build.json +1 -1
  27. package/dist/index.html +2 -2
  28. package/dist/notes.json +1 -1
  29. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-C7VOsCCm.js","./_commonjsHelpers-CE1G-McA.js","./index-C_gVizDw.js","./index-CmyfI33v.css"])))=>i.map(i=>d[i]);
2
- import{_ as u,b as a,I as c}from"./index-C_gVizDw.js";import{r as p}from"./refusal-DOpm8I8L.js";const m={gray:"gray",hot:"hot",jet:"jet",cool:"cool"},d={wl:"contrast",pan:"pan",length:"measurement",angle:"angle"};class g{name="niivue";host;path;nv=null;module=null;layout="mpr";tool="wl";colormap="gray";slice=0;slices=0;refused=0;disposed=!1;constructor(s,t){this.host=s,this.path=t}async open(s){const t=document.createElement("canvas");t.className="image-canvas",s.appendChild(t),this.host.readout_set("LOADING"),this.host.progress_set({label:"READING VOLUME",done:0,total:0});const e=performance.now();if(this.module=await u(()=>import("./index-C7VOsCCm.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),this.disposed)return;const i=new this.module.Niivue({isResizeCanvas:!0,logLevel:"error",dragAndDropEnabled:!1,crosshairWidth:.4,crosshairWidthUnit:"percent"});i.onLocationChange=o=>{const r=o,l=r.vox?.[2];l!==void 0&&(this.slice=l+1),this.host.readout_set(`${this.slices>0?`SLICE ${this.slice} OF ${this.slices} · `:""}${r.string??""}`)},await i.attachToCanvas(t);const n=this.path.split("/").pop()??"volume.nii.gz";try{await i.loadVolumes([{url:a(this.host.source.url_resolve(this.path),location.href),name:n}])}catch(o){this.refused=1,this.host.progress_set(null),this.host.readout_set("REFUSED 1 OF 1"),this.host.note(`image: ${this.path}: ${o instanceof Error?o.message:String(o)}`);const r=await p(a(this.host.source.url_resolve(this.path),location.href));this.host.readout_set(`REFUSED 1 OF 1 · ${r}`),this.host.note(`image: ${this.path}: ${r.toLowerCase()}`);return}if(this.host.progress_set(null),this.disposed)return;this.nv=i;const h=i.volumes[0]?.dims;this.slices=h?.[3]??0,i.setSliceType(i.sliceTypeMultiplanar),this.layout="mpr",this.host.readout_set(`${this.slices} SLICES`),this.host.note(`image: ${n} drawn in ${Math.round(performance.now()-e)} ms`),this.host.regard(this.path)}async layout_set(s){return s==="slab"||this.nv===null?!1:(this.nv.setSliceType(s==="single"?this.nv.sliceTypeAxial:s==="mpr"?this.nv.sliceTypeMultiplanar:this.nv.sliceTypeRender),this.layout=s,this.host.readout_set(`${this.slices} SLICES`),!0)}slice_set(s){if(this.nv===null||this.slices===0)return!1;const t=Math.max(1,Math.min(s,this.slices)),e=this.slice>0?this.slice:Math.ceil(this.slices/2);return this.nv.moveCrosshairInVox(0,0,t-e),this.slice=t,!0}wl_set(s,t){const e=this.nv?.volumes[0];return this.nv===null||e===void 0?!1:(e.cal_min=s,e.cal_max=t,this.nv.updateGLVolume(),!0)}colormap_set(s){const t=this.nv?.volumes[0];return this.nv===null||t?.id===void 0?!1:(this.colormap=s,this.nv.setColormap(t.id,m[s]),!0)}toolsOffered_get(){return c}ghost_set(s){return!1}tool_set(s){const t=d[s];return this.nv===null||t===void 0?!1:(this.nv.setDragMode(t),this.tool=s,!0)}annotations_export(){return Promise.resolve(null)}annotations_import(){return Promise.resolve(0)}async slices_fill(){return this.nv!==null}state_get(){return{engine:"niivue",layout:this.layout,slice:this.slice,slices:this.slices,tool:this.tool,primaryTool:this.tool,refused:this.refused,annotations:0,filled:this.nv!==null,colormap:this.colormap}}dispose(){this.disposed=!0,this.nv=null}}export{g as NiivueEngine};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CnRSmWoR.js","./_commonjsHelpers-CE1G-McA.js","./index-Bx9on2--.js","./index-D8wX84LU.css"])))=>i.map(i=>d[i]);
2
+ import{_ as u,b as a,I as c}from"./index-Bx9on2--.js";import{r as p}from"./refusal-DOpm8I8L.js";const m={gray:"gray",hot:"hot",jet:"jet",cool:"cool"},d={wl:"contrast",pan:"pan",length:"measurement",angle:"angle"};class g{name="niivue";host;path;nv=null;module=null;layout="mpr";tool="wl";colormap="gray";slice=0;slices=0;refused=0;disposed=!1;constructor(s,t){this.host=s,this.path=t}async open(s){const t=document.createElement("canvas");t.className="image-canvas",s.appendChild(t),this.host.readout_set("LOADING"),this.host.progress_set({label:"READING VOLUME",done:0,total:0});const e=performance.now();if(this.module=await u(()=>import("./index-CnRSmWoR.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),this.disposed)return;const i=new this.module.Niivue({isResizeCanvas:!0,logLevel:"error",dragAndDropEnabled:!1,crosshairWidth:.4,crosshairWidthUnit:"percent"});i.onLocationChange=o=>{const r=o,l=r.vox?.[2];l!==void 0&&(this.slice=l+1),this.host.readout_set(`${this.slices>0?`SLICE ${this.slice} OF ${this.slices} · `:""}${r.string??""}`)},await i.attachToCanvas(t);const n=this.path.split("/").pop()??"volume.nii.gz";try{await i.loadVolumes([{url:a(this.host.source.url_resolve(this.path),location.href),name:n}])}catch(o){this.refused=1,this.host.progress_set(null),this.host.readout_set("REFUSED 1 OF 1"),this.host.note(`image: ${this.path}: ${o instanceof Error?o.message:String(o)}`);const r=await p(a(this.host.source.url_resolve(this.path),location.href));this.host.readout_set(`REFUSED 1 OF 1 · ${r}`),this.host.note(`image: ${this.path}: ${r.toLowerCase()}`);return}if(this.host.progress_set(null),this.disposed)return;this.nv=i;const h=i.volumes[0]?.dims;this.slices=h?.[3]??0,i.setSliceType(i.sliceTypeMultiplanar),this.layout="mpr",this.host.readout_set(`${this.slices} SLICES`),this.host.note(`image: ${n} drawn in ${Math.round(performance.now()-e)} ms`),this.host.regard(this.path)}async layout_set(s){return s==="slab"||this.nv===null?!1:(this.nv.setSliceType(s==="single"?this.nv.sliceTypeAxial:s==="mpr"?this.nv.sliceTypeMultiplanar:this.nv.sliceTypeRender),this.layout=s,this.host.readout_set(`${this.slices} SLICES`),!0)}slice_set(s){if(this.nv===null||this.slices===0)return!1;const t=Math.max(1,Math.min(s,this.slices)),e=this.slice>0?this.slice:Math.ceil(this.slices/2);return this.nv.moveCrosshairInVox(0,0,t-e),this.slice=t,!0}wl_set(s,t){const e=this.nv?.volumes[0];return this.nv===null||e===void 0?!1:(e.cal_min=s,e.cal_max=t,this.nv.updateGLVolume(),!0)}colormap_set(s){const t=this.nv?.volumes[0];return this.nv===null||t?.id===void 0?!1:(this.colormap=s,this.nv.setColormap(t.id,m[s]),!0)}toolsOffered_get(){return c}ghost_set(s){return!1}tool_set(s){const t=d[s];return this.nv===null||t===void 0?!1:(this.nv.setDragMode(t),this.tool=s,!0)}annotations_export(){return Promise.resolve(null)}annotations_import(){return Promise.resolve(0)}async slices_fill(){return this.nv!==null}state_get(){return{engine:"niivue",layout:this.layout,slice:this.slice,slices:this.slices,tool:this.tool,primaryTool:this.tool,refused:this.refused,annotations:0,filled:this.nv!==null,colormap:this.colormap}}dispose(){this.disposed=!0,this.nv=null}}export{g as NiivueEngine};
@@ -1,4 +1,4 @@
1
- import{m as v,as as _e,R as ft,K as Ge,L as Le,W as ke,N as We,k as de,E as X,t as vt,i as Me,x as ce,F as ht,Z as St,h as dt,D as Tt,al as wt,c as yt,at as Ct,d as Ve,au as xt,y as ue,ak as le,av as ze,j as pe}from"./cornerstoneEngine-CnL2H_m8.js";import{ae as Ne,am as De,an as re,K as B,k as Z,al as $,D as se,U as $e,X as Be,B as Q,J as Et,E as Rt,ak as _t,$ as He,a2 as Mt,Z as Vt,b as Dt,_ as Ke,ao as Bt,ap as be,aq as mt,ar as Te,as as Ot,z as Ut,at as Ft,au as Pt,av as ae,ad as Gt,R as Lt,aw as Y,ah as kt,ai as Wt,C as zt,P as Nt,I as $t,a as Ht}from"./Texture-CUE2sZUc.js";import"./index-C_gVizDw.js";import"./refusal-DOpm8I8L.js";import"./_commonjsHelpers-CE1G-McA.js";import"./__vite-browser-external-D7Ct-6yo.js";function Kt(t){return t}function ye(t){if(t===null||t==="null")return null;if(t==="true")return!0;if(t==="false")return!1;if(!(t===void 0||t==="undefined"))return t[0]==="["&&t[t.length-1]==="]"?t.substring(1,t.length-1).split(",").map(e=>ye(e.trim())):t===""||Number.isNaN(Number(t))?t:Number(t)}function bt(t=!0,e=window.location.search){const r={},s=t?ye:Kt;return new URLSearchParams(e).forEach((n,a)=>{a&&(r[a]=n?s(n):!0)}),r}var It={toNativeType:ye,extractURLParameters:bt},jt={IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025},Ce={States:jt},{vtkErrorMacro:Qt,VOID:Yt}=v;function Xt(t,e,r,s){return t.getRenderWindow().getViews()[0].worldToDisplay(e,r,s,t)}function Zt(t,e,r,s){return t.getRenderWindow().getViews()[0].displayToWorld(e,r,s,t)}var Jt={computeWorldToDisplay:Xt,computeDisplayToWorld:Zt};function qt(t,e){e.classHierarchy.push("vtkInteractorObserver");const r={...t};function s(){for(;e.subscribedEvents.length;)e.subscribedEvents.pop().unsubscribe()}function n(){Ne.handledEvents.forEach(a=>{t[`handle${a}`]&&e.subscribedEvents.push(e._interactor[`on${a}`](o=>e.processEvents?t[`handle${a}`](o):Yt,e.priority))})}t.setInteractor=a=>{a!==e._interactor&&(s(),e._interactor=a,a&&e.enabled&&n(),t.modified())},t.setEnabled=a=>{a!==e.enabled&&(s(),a&&(e._interactor?n():Qt(`
1
+ import{m as v,as as _e,R as ft,K as Ge,L as Le,W as ke,N as We,k as de,E as X,t as vt,i as Me,x as ce,F as ht,Z as St,h as dt,D as Tt,al as wt,c as yt,at as Ct,d as Ve,au as xt,y as ue,ak as le,av as ze,j as pe}from"./cornerstoneEngine-BRNPnIOt.js";import{ae as Ne,am as De,an as re,K as B,k as Z,al as $,D as se,U as $e,X as Be,B as Q,J as Et,E as Rt,ak as _t,$ as He,a2 as Mt,Z as Vt,b as Dt,_ as Ke,ao as Bt,ap as be,aq as mt,ar as Te,as as Ot,z as Ut,at as Ft,au as Pt,av as ae,ad as Gt,R as Lt,aw as Y,ah as kt,ai as Wt,C as zt,P as Nt,I as $t,a as Ht}from"./Texture-BgODsSgK.js";import"./index-Bx9on2--.js";import"./refusal-DOpm8I8L.js";import"./_commonjsHelpers-CE1G-McA.js";import"./__vite-browser-external-D7Ct-6yo.js";function Kt(t){return t}function ye(t){if(t===null||t==="null")return null;if(t==="true")return!0;if(t==="false")return!1;if(!(t===void 0||t==="undefined"))return t[0]==="["&&t[t.length-1]==="]"?t.substring(1,t.length-1).split(",").map(e=>ye(e.trim())):t===""||Number.isNaN(Number(t))?t:Number(t)}function bt(t=!0,e=window.location.search){const r={},s=t?ye:Kt;return new URLSearchParams(e).forEach((n,a)=>{a&&(r[a]=n?s(n):!0)}),r}var It={toNativeType:ye,extractURLParameters:bt},jt={IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025},Ce={States:jt},{vtkErrorMacro:Qt,VOID:Yt}=v;function Xt(t,e,r,s){return t.getRenderWindow().getViews()[0].worldToDisplay(e,r,s,t)}function Zt(t,e,r,s){return t.getRenderWindow().getViews()[0].displayToWorld(e,r,s,t)}var Jt={computeWorldToDisplay:Xt,computeDisplayToWorld:Zt};function qt(t,e){e.classHierarchy.push("vtkInteractorObserver");const r={...t};function s(){for(;e.subscribedEvents.length;)e.subscribedEvents.pop().unsubscribe()}function n(){Ne.handledEvents.forEach(a=>{t[`handle${a}`]&&e.subscribedEvents.push(e._interactor[`on${a}`](o=>e.processEvents?t[`handle${a}`](o):Yt,e.priority))})}t.setInteractor=a=>{a!==e._interactor&&(s(),e._interactor=a,a&&e.enabled&&n(),t.modified())},t.setEnabled=a=>{a!==e.enabled&&(s(),a&&(e._interactor?n():Qt(`
2
2
  The interactor must be set before subscribing to events
3
3
  `)),e.enabled=a,t.modified())},t.computeDisplayToWorld=(a,o,i,u)=>a?e._interactor.getView().displayToWorld(o,i,u,a):null,t.computeWorldToDisplay=(a,o,i,u)=>a?e._interactor.getView().worldToDisplay(o,i,u,a):null,t.setPriority=a=>{r.setPriority(a)&&e._interactor&&(s(),n())}}var At={enabled:!0,priority:0,processEvents:!0,subscribedEvents:[]};function Ie(t,e,r={}){Object.assign(e,At,r),v.obj(t,e),v.event(t,e,"InteractionEvent"),v.event(t,e,"StartInteractionEvent"),v.event(t,e,"EndInteractionEvent"),v.get(t,e,["_interactor","enabled"]),v.setGet(t,e,["priority","processEvents"]),v.moveToProtected(t,e,["interactor"]),qt(t,e)}var en=v.newInstance(Ie,"vtkInteractorObserver"),tn={newInstance:en,extend:Ie,...Jt},{States:N}=Ce,ge={Rotate:N.IS_ROTATE,Pan:N.IS_PAN,Spin:N.IS_SPIN,Dolly:N.IS_DOLLY,CameraPose:N.IS_CAMERA_POSE,WindowLevel:N.IS_WINDOW_LEVEL,Slice:N.IS_SLICE};function nn(t,e){e.classHierarchy.push("vtkInteractorStyle"),Object.keys(ge).forEach(r=>{v.event(t,e,`Start${r}Event`),t[`start${r}`]=()=>{e.state===N.IS_NONE&&(e.state=ge[r],e._interactor.requestAnimation(t),t.invokeStartInteractionEvent({type:"StartInteractionEvent"}),t[`invokeStart${r}Event`]({type:`Start${r}Event`}))},v.event(t,e,`End${r}Event`),t[`end${r}`]=()=>{e.state===ge[r]&&(e.state=N.IS_NONE,e._interactor.cancelAnimation(t),t.invokeEndInteractionEvent({type:"EndInteractionEvent"}),t[`invokeEnd${r}Event`]({type:`End${r}Event`}),e._interactor.render())}}),e.getRenderer=r=>e.focusedRenderer||r.pokedRenderer,t.handleKeyPress=r=>{const s=e._interactor;let n=null;switch(r.key){case"r":case"R":e.getRenderer(r).resetCamera(),s.render();break;case"w":case"W":n=e.getRenderer(r).getActors(),n.forEach(a=>{const o=a.getProperty();o.setRepresentationToWireframe&&o.setRepresentationToWireframe()}),s.render();break;case"s":case"S":n=e.getRenderer(r).getActors(),n.forEach(a=>{const o=a.getProperty();o.setRepresentationToSurface&&o.setRepresentationToSurface()}),s.render();break;case"v":case"V":n=e.getRenderer(r).getActors(),n.forEach(a=>{const o=a.getProperty();o.setRepresentationToPoints&&o.setRepresentationToPoints()}),s.render();break}}}var rn={state:N.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function je(t,e,r={}){Object.assign(e,rn,r),tn.extend(t,e,r),v.setGet(t,e,["focusedRenderer"]),nn(t,e)}var an=v.newInstance(je,"vtkInteractorStyle"),xe={newInstance:an,extend:je,...Ce},{States:W}=Ce;function sn(t,e){e.classHierarchy.push("vtkInteractorStyleTrackballCamera"),t.handleMouseMove=r=>{const s=r.position,n=e.getRenderer(r);switch(e.state){case W.IS_ROTATE:t.handleMouseRotate(n,s),t.invokeInteractionEvent({type:"InteractionEvent"});break;case W.IS_PAN:t.handleMousePan(n,s),t.invokeInteractionEvent({type:"InteractionEvent"});break;case W.IS_DOLLY:e.wheelDolly||(t.handleMouseDolly(n,s),t.invokeInteractionEvent({type:"InteractionEvent"}));break;case W.IS_SPIN:t.handleMouseSpin(n,s),t.invokeInteractionEvent({type:"InteractionEvent"});break}e.previousPosition=s},t.handleButton3D=r=>{if(r&&r.pressed&&r.device===De.RightController&&(r.input===re.Trigger||r.input===re.TrackPad)){t.startCameraPose();return}r&&!r.pressed&&r.device===De.RightController&&(r.input===re.Trigger||r.input===re.TrackPad)&&e.state===W.IS_CAMERA_POSE&&t.endCameraPose()},t.handleMove3D=r=>{e.state===W.IS_CAMERA_POSE&&t.updateCameraPose(r)},t.updateCameraPose=r=>{const s=e.getRenderer(r).getActiveCamera(),n=s.getPhysicalTranslation(),a=.5*.05*s.getPhysicalScale(),o=s.physicalOrientationToWorldDirection([r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w]);s.setPhysicalTranslation(n[0]+o[0]*a,n[1]+o[1]*a,n[2]+o[2]*a)},t.handleLeftButtonPress=r=>{e.previousPosition=r.position,r.shiftKey?r.controlKey||r.altKey?t.startDolly():t.startPan():r.controlKey||r.altKey?t.startSpin():t.startRotate()},t.handleLeftButtonRelease=()=>{switch(e.state){case W.IS_DOLLY:t.endDolly();break;case W.IS_PAN:t.endPan();break;case W.IS_SPIN:t.endSpin();break;case W.IS_ROTATE:t.endRotate();break}},t.handleStartMouseWheel=()=>{e.wheelDolly=!0,t.startDolly()},t.handleEndMouseWheel=()=>{t.endDolly(),e.wheelDolly=!1},t.handleStartPinch=r=>{e.previousScale=r.scale,t.startDolly()},t.handleEndPinch=()=>{t.endDolly()},t.handleStartRotate=r=>{e.previousRotation=r.rotation,t.startRotate()},t.handleEndRotate=()=>{t.endRotate()},t.handleStartPan=r=>{e.previousTranslation=r.translation,t.startPan()},t.handleEndPan=()=>{t.endPan()},t.handlePinch=r=>{t.dollyByFactor(e.getRenderer(r),r.scale/e.previousScale),e.previousScale=r.scale},t.handlePan=r=>{const s=e.getRenderer(r).getActiveCamera();let n=s.getFocalPoint();n=t.computeWorldToDisplay(e.getRenderer(r),n[0],n[1],n[2]);const a=n[2],o=r.translation,i=e.previousTranslation,u=t.computeDisplayToWorld(e.getRenderer(r),n[0]+o[0]-i[0],n[1]+o[1]-i[1],a),p=t.computeDisplayToWorld(e.getRenderer(r),n[0],n[1],a),c=[];c[0]=p[0]-u[0],c[1]=p[1]-u[1],c[2]=p[2]-u[2],n=s.getFocalPoint();const l=s.getPosition();s.setFocalPoint(c[0]+n[0],c[1]+n[1],c[2]+n[2]),s.setPosition(c[0]+l[0],c[1]+l[1],c[2]+l[2]),e._interactor.getLightFollowCamera()&&e.getRenderer(r).updateLightsGeometryToFollowCamera(),s.orthogonalizeViewUp(),e.previousTranslation=r.translation},t.handleRotate=r=>{const s=e.getRenderer(r).getActiveCamera();s.roll(r.rotation-e.previousRotation),s.orthogonalizeViewUp(),e.previousRotation=r.rotation},t.handleMouseRotate=(r,s)=>{if(!e.previousPosition)return;const n=e._interactor,a=s.x-e.previousPosition.x,o=s.y-e.previousPosition.y,i=n.getView().getViewportSize(r);let u=-.1,p=-.1;i[0]&&i[1]&&(u=-20/i[1],p=-20/i[0]);const c=a*p*e.motionFactor,l=o*u*e.motionFactor,g=r.getActiveCamera();!Number.isNaN(c)&&!Number.isNaN(l)&&(g.azimuth(c),g.elevation(l),g.orthogonalizeViewUp()),e.autoAdjustCameraClippingRange&&r.resetCameraClippingRange(),n.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()},t.handleMouseSpin=(r,s)=>{if(!e.previousPosition)return;const n=e._interactor,a=r.getActiveCamera(),o=n.getView().getViewportCenter(r),i=_e(Math.atan2(e.previousPosition.y-o[1],e.previousPosition.x-o[0])),u=_e(Math.atan2(s.y-o[1],s.x-o[0]))-i;Number.isNaN(u)||(a.roll(u),a.orthogonalizeViewUp())},t.handleMousePan=(r,s)=>{if(!e.previousPosition)return;const n=r.getActiveCamera();let a=n.getFocalPoint();a=t.computeWorldToDisplay(r,a[0],a[1],a[2]);const o=a[2],i=t.computeDisplayToWorld(r,s.x,s.y,o),u=t.computeDisplayToWorld(r,e.previousPosition.x,e.previousPosition.y,o),p=[];p[0]=u[0]-i[0],p[1]=u[1]-i[1],p[2]=u[2]-i[2],a=n.getFocalPoint();const c=n.getPosition();n.setFocalPoint(p[0]+a[0],p[1]+a[1],p[2]+a[2]),n.setPosition(p[0]+c[0],p[1]+c[1],p[2]+c[2]),e._interactor.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()},t.handleMouseDolly=(r,s)=>{if(!e.previousPosition)return;const n=s.y-e.previousPosition.y,a=e._interactor.getView().getViewportCenter(r),o=e.motionFactor*n/a[1];t.dollyByFactor(r,1.1**o)},t.handleMouseWheel=r=>{const s=1-r.spinY/e.zoomFactor;t.dollyByFactor(e.getRenderer(r),s)},t.dollyByFactor=(r,s)=>{if(Number.isNaN(s))return;const n=r.getActiveCamera();n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/s):(n.dolly(s),e.autoAdjustCameraClippingRange&&r.resetCameraClippingRange()),e._interactor.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()}}var on={motionFactor:10,zoomFactor:10,wheelDolly:!1};function Qe(t,e,r={}){Object.assign(e,on,r),xe.extend(t,e,r),v.setGet(t,e,["motionFactor","zoomFactor"]),sn(t,e)}var cn=v.newInstance(Qe,"vtkInteractorStyleTrackballCamera"),un={newInstance:cn,extend:Qe},{vtkErrorMacro:ln}=ft,fe=["setBindGroup","setIndexBuffer","setVertexBuffer","draw","drawIndexed"];function pn(t,e){e.classHierarchy.push("vtkWebGPURenderEncoder"),t.begin=r=>{e.drawCallbacks=[],e.handle=r.beginRenderPass(e.description),e.label&&e.handle.pushDebugGroup(e.label)},t.end=()=>{for(let r=0;r<e.drawCallbacks.length;r++){const s=e.drawCallbacks[r],n=s.pipeline;t.setPipeline(n);for(let a=0;a<s.callbacks.length;a++)s.callbacks[a](t)}e.label&&e.handle.popDebugGroup(),e.handle.end(),e.boundPipeline=null},t.setPipeline=r=>{if(e.boundPipeline===r)return;e.handle.setPipeline(r.getHandle());const s=r.getPipelineDescription(),n=s.fragment?.targets;if(e.colorTextureViews.length!==n.length)console.log(`mismatched attachment counts on pipeline ${n.length} while encoder has ${e.colorTextureViews.length}`),console.trace();else for(let a=0;a<e.colorTextureViews.length;a++){const o=e.colorTextureViews[a].getTexture()?.getFormat();o&&o!==n[a].format&&(console.log(`mismatched attachments for attachment ${a} on pipeline ${n[a].format} while encoder has ${o}`),console.trace())}if(!!e.depthTextureView!="depthStencil"in s)console.log("mismatched depth attachments"),console.trace();else if(e.depthTextureView){const a=e.depthTextureView.getTexture()?.getFormat();a&&a!==s.depthStencil.format&&(console.log(`mismatched depth attachments on pipeline ${s.depthStencil.format} while encoder has ${a}`),console.trace())}e.boundPipeline=r},t.replaceShaderCode=r=>{e.replaceShaderCodeFunction(r)},t.setColorTextureView=(r,s)=>{e.colorTextureViews[r]!==s&&(e.colorTextureViews[r]=s)},t.activateBindGroup=r=>{const s=e.boundPipeline.getDevice(),n=e.boundPipeline.getBindGroupLayoutIndex(r.getLabel());if(n<0){ln(`vtkWebGPURenderEncoder: could not find bind group layout ${r.getLabel()}`);return}e.handle.setBindGroup(n,r.getBindGroup(s));const a=s.getBindGroupLayoutDescription(r.getBindGroupLayout(s)),o=s.getBindGroupLayoutDescription(e.boundPipeline.getBindGroupLayout(n));a!==o&&(console.log(`renderEncoder ${e.pipelineHash} mismatched bind group layouts bind group has
4
4
  ${a}
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-6xVu8SR3.js","./index-DDVamRo8.js","./index-C_gVizDw.js","./index-CmyfI33v.css","./index-BJhuEfhB.js","./index-Ds1IEeoY.js","./index-BKTol-_M.js","./index-CwoRnDne.js","./asciidoc-BQO4iSvH.js","./index-DijpRmkl.js"])))=>i.map(i=>d[i]);
2
- import{_ as ee}from"./index-C_gVizDw.js";const Wl=1024;let Hl=0,yt=class{constructor(t,e){this.from=t,this.to=e}};class R{constructor(t={}){this.id=Hl++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=at.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}R.closedBy=new R({deserialize:s=>s.split(" ")});R.openedBy=new R({deserialize:s=>s.split(" ")});R.group=new R({deserialize:s=>s.split(" ")});R.isolate=new R({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});R.contextHash=new R({perNode:!0});R.lookAhead=new R({perNode:!0});R.mounted=new R({perNode:!0});class we{constructor(t,e,i,n=!1){this.tree=t,this.overlay=e,this.parser=i,this.bracketed=n}static get(t){return t&&t.props&&t.props[R.mounted.id]}}const Fl=Object.create(null);class at{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):Fl,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),n=new at(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return n}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(R.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return i=>{for(let n=i.prop(R.group),r=-1;r<(n?n.length:0);r++){let o=e[r<0?i.name:n[r]];if(o)return o}}}}at.none=new at("",Object.create(null),0,8);class rs{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let i of this.types){let n=null;for(let r of t){let o=r(i);if(o){n||(n=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in n&&(l=a.combine(n[a.id],l)),n[a.id]=l}}e.push(n?new at(i.name,n,i.id,i.flags):i)}return new rs(e)}}const ri=new WeakMap,Os=new WeakMap;var V;(function(s){s[s.ExcludeBuffers=1]="ExcludeBuffers",s[s.IncludeAnonymous=2]="IncludeAnonymous",s[s.IgnoreMounts=4]="IgnoreMounts",s[s.IgnoreOverlays=8]="IgnoreOverlays",s[s.EnterBracketed=16]="EnterBracketed"})(V||(V={}));class q{constructor(t,e,i,n,r){if(this.type=t,this.children=e,this.positions=i,this.length=n,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let t=we.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let i of this.children){let n=i.toString();n&&(e&&(e+=","),e+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Pi(this.topNode,t)}cursorAt(t,e=0,i=0){let n=ri.get(this)||this.topNode,r=new Pi(n);return r.moveTo(t,e),ri.set(this,r._tree),r}get topNode(){return new st(this,0,0,null)}resolve(t,e=0){let i=_e(ri.get(this)||this.topNode,t,e,!1);return ri.set(this,i),i}resolveInner(t,e=0){let i=_e(Os.get(this)||this.topNode,t,e,!0);return Os.set(this,i),i}resolveStack(t,e=0){return Kl(this,t,e)}iterate(t){let{enter:e,leave:i,from:n=0,to:r=this.length}=t,o=t.mode||0,l=(o&V.IncludeAnonymous)>0;for(let a=this.cursor(o|V.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:as(at.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,n)=>new q(this.type,e,i,n,this.propValues),t.makeTree||((e,i,n)=>new q(at.none,e,i,n)))}static build(t){return ql(t)}}q.empty=new q(at.none,[],[],0);class os{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new os(this.buffer,this.index)}}class Gt{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return at.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],i=this.buffer[t+3],n=this.set.types[e],r=n.name;if(/\W/.test(r)&&!n.isError&&(r=JSON.stringify(r)),t+=4,i==t)return r;let o=[];for(;t<i;)o.push(this.childString(t)),t=this.buffer[t+3];return r+"("+o.join(",")+")"}findChild(t,e,i,n,r){let{buffer:o}=this,l=-1;for(let a=t;a!=e&&!(Kr(r,n,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(t,e,i){let n=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l<e;){r[a++]=n[l++],r[a++]=n[l++]-i;let h=r[a++]=n[l++]-i;r[a++]=n[l++]-t,o=Math.max(o,h)}return new Gt(r,o,this.set)}}function Kr(s,t,e,i){switch(s){case-2:return e<t;case-1:return i>=t&&e<t;case 0:return e<t&&i>t;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function _e(s,t,e,i){for(var n;s.from==s.to||(e<1?s.from>=t:s.from>t)||(e>-1?s.to<=t:s.to<t);){let o=!i&&s instanceof st&&s.index<0?null:s.parent;if(!o)return s;s=o}let r=i?0:V.IgnoreOverlays;if(i)for(let o=s,l=o.parent;l;o=l,l=o.parent)o instanceof st&&o.index<0&&((n=l.enter(t,e,r))===null||n===void 0?void 0:n.from)!=o.from&&(s=l);for(;;){let o=s.enter(t,e,r);if(!o)return s;s=o}}class qr{cursor(t=0){return new Pi(this,t)}getChild(t,e=null,i=null){let n=Ds(this,t,e,i);return n.length?n[0]:null}getChildren(t,e=null,i=null){return Ds(this,t,e,i)}resolve(t,e=0){return _e(this,t,e,!1)}resolveInner(t,e=0){return _e(this,t,e,!0)}matchContext(t){return xn(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),i=this;for(;e;){let n=e.lastChild;if(!n||n.to!=e.to)break;n.type.isError&&n.from==n.to?(i=e,e=n.prevSibling):e=n}return i}get node(){return this}get next(){return this.parent}}class st extends qr{constructor(t,e,i,n){super(),this._tree=t,this.from=e,this.index=i,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,i,n,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=e>0?l.length:-1;t!=h;t+=e){let f=l[t],c=a[t]+o.from,u;if(!(!(r&V.EnterBracketed&&f instanceof q&&(u=we.get(f))&&!u.overlay&&u.bracketed&&i>=c&&i<=c+f.length)&&!Kr(n,i,c,c+f.length))){if(f instanceof Gt){if(r&V.ExcludeBuffers)continue;let d=f.findChild(0,f.buffer.length,e,i-c,n);if(d>-1)return new Rt(new Vl(o,f,t,c),null,d)}else if(r&V.IncludeAnonymous||!f.type.isAnonymous||ls(f)){let d;if(!(r&V.IgnoreMounts)&&(d=we.get(f))&&!d.overlay)return new st(d.tree,c,t,o);let p=new st(f,c,t,o);return r&V.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(e<0?f.children.length-1:0,e,i,n,r)}}}if(r&V.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,e,i=0){let n;if(!(i&V.IgnoreOverlays)&&(n=we.get(this._tree))&&n.overlay){let r=t-this.from,o=i&V.EnterBracketed&&n.bracketed;for(let{from:l,to:a}of n.overlay)if((e>0||o?l<=r:l<r)&&(e<0||o?a>=r:a>r))return new st(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Ds(s,t,e,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=n.type.is(e),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(t)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function xn(s,t,e=t.length-1){for(let i=s;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class Vl{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class Rt extends qr{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Rt(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,e,i=0){if(i&V.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Rt(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Rt(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Rt(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];t.push(i.slice(n,r,o)),e.push(0)}return new q(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function jr(s){if(!s.length)return null;let t=0,e=s[0];for(let r=1;r<s.length;r++){let o=s[r];(o.from>e.from||o.to<e.to)&&(e=o,t=r)}let i=e instanceof st&&e.index<0?null:e.parent,n=s.slice();return i?n[t]=i:n.splice(t,1),new zl(n,e)}class zl{constructor(t,e){this.heads=t,this.node=e}get next(){return jr(this.heads)}}function Kl(s,t,e){let i=s.resolveInner(t,e),n=null;for(let r=i instanceof st?i:i.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(n||(n=[i])).push(o.resolve(t,e)),r=o}else{let o=we.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let l=new st(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(_e(l,t,e,!1))}}return n?jr(n):i}class Pi{get name(){return this.type.name}constructor(t,e=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=e&~V.EnterBracketed,t instanceof st)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=i+n.buffer[t+1],this.to=i+n.buffer[t+2],!0}yield(t){return t?t instanceof st?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&V.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&V.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&V.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(e.findChild(n,this.index,-1,0,4))}else{let n=e.buffer[this.index+3];if(n<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:n}=this;if(n){if(t>0){if(this.index<n.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(n.buffer.buffer[r+3]<this.index)return!1;({index:e,parent:i}=n)}else({index:e,_parent:i}=this._tree);for(;i;{index:e,_parent:i}=i)if(e>-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&V.IncludeAnonymous||l instanceof Gt||!l.type.isAnonymous||ls(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(let n=this.index,r=this.stack.length;r>=0;){for(let o=t;o;o=o._parent)if(o.index==n){if(n==this.index)return o;e=o,i=r+1;break t}n=this.stack[--r]}for(let n=i;n<this.stack.length;n++)e=new Rt(this.buffer,e,this.stack[n]);return this.bufferNode=new Rt(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let i=0;;){let n=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(n=!0)}for(;;){if(n&&e&&e(this),n=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,n=!0}}}matchContext(t){if(!this.buffer)return xn(this.node.parent,t);let{buffer:e}=this.buffer,{types:i}=e.set;for(let n=t.length-1,r=this.stack.length-1;n>=0;r--){if(r<0)return xn(this._tree,t,n);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}}function ls(s){return s.children.some(t=>t instanceof Gt||!t.type.isAnonymous||ls(t))}function ql(s){var t;let{buffer:e,nodeSet:i,maxBufferLength:n=Wl,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(e)?new os(e,e.length):e,a=i.types,h=0,f=0;function c(C,A,v,I,E,z){let{id:P,start:O,end:F,size:N}=l,j=f,rt=h;if(N<0)if(l.next(),N==-1){let Nt=r[P];v.push(Nt),I.push(O-C);return}else if(N==-3){h=P;return}else if(N==-4){f=P;return}else throw new RangeError(`Unrecognized record size: ${N}`);let ct=a[P],At,Q,pt=O-C;if(F-O<=n&&(Q=m(l.pos-A,E))){let Nt=new Uint16Array(Q.size-Q.skip),gt=l.pos-Q.size,Mt=Nt.length;for(;l.pos>gt;)Mt=y(Q.start,Nt,Mt);At=new Gt(Nt,F-Q.start,i),pt=Q.start-C}else{let Nt=l.pos-N;l.next();let gt=[],Mt=[],te=P>=o?P:-1,de=0,si=F;for(;l.pos>Nt;)te>=0&&l.id==te&&l.size>=0?(l.end<=si-n&&(p(gt,Mt,O,de,l.end,si,te,j,rt),de=gt.length,si=l.end),l.next()):z>2500?u(O,Nt,gt,Mt):c(O,Nt,gt,Mt,te,z+1);if(te>=0&&de>0&&de<gt.length&&p(gt,Mt,O,de,O,si,te,j,rt),gt.reverse(),Mt.reverse(),te>-1&&de>0){let Ts=d(ct,rt);At=as(ct,gt,Mt,0,gt.length,0,F-O,Ts,Ts)}else At=g(ct,gt,Mt,F-O,j-F,rt)}v.push(At),I.push(pt)}function u(C,A,v,I){let E=[],z=0,P=-1;for(;l.pos>A;){let{id:O,start:F,end:N,size:j}=l;if(j>4)l.next();else{if(P>-1&&F<P)break;P<0&&(P=N-n),E.push(O,F,N),z++,l.next()}}if(z){let O=new Uint16Array(z*4),F=E[E.length-2];for(let N=E.length-3,j=0;N>=0;N-=3)O[j++]=E[N],O[j++]=E[N+1]-F,O[j++]=E[N+2]-F,O[j++]=j;v.push(new Gt(O,E[2]-F,i)),I.push(F-C)}}function d(C,A){return(v,I,E)=>{let z=0,P=v.length-1,O,F;if(P>=0&&(O=v[P])instanceof q){if(!P&&O.type==C&&O.length==E)return O;(F=O.prop(R.lookAhead))&&(z=I[P]+O.length+F)}return g(C,v,I,E,z,A)}}function p(C,A,v,I,E,z,P,O,F){let N=[],j=[];for(;C.length>I;)N.push(C.pop()),j.push(A.pop()+v-E);C.push(g(i.types[P],N,j,z-E,O-z,F)),A.push(E-v)}function g(C,A,v,I,E,z,P){if(z){let O=[R.contextHash,z];P=P?[O].concat(P):[O]}if(E>25){let O=[R.lookAhead,E];P=P?[O].concat(P):[O]}return new q(C,A,v,I,P)}function m(C,A){let v=l.fork(),I=0,E=0,z=0,P=v.end-n,O={size:0,start:0,skip:0};t:for(let F=v.pos-C;v.pos>F;){let N=v.size;if(v.id==A&&N>=0){O.size=I,O.start=E,O.skip=z,z+=4,I+=4,v.next();continue}let j=v.pos-N;if(N<0||j<F||v.start<P)break;let rt=v.id>=o?4:0,ct=v.start;for(v.next();v.pos>j;){if(v.size<0)if(v.size==-3||v.size==-4)rt+=4;else break t;else v.id>=o&&(rt+=4);v.next()}E=ct,I+=N,z+=rt}return(A<0||I==C)&&(O.size=I,O.start=E,O.skip=z),O.size>4?O:void 0}function y(C,A,v){let{id:I,start:E,end:z,size:P}=l;if(l.next(),P>=0&&I<o){let O=v;if(P>4){let F=l.pos-(P-4);for(;l.pos>F;)v=y(C,A,v)}A[--v]=O,A[--v]=z-C,A[--v]=E-C,A[--v]=I}else P==-3?h=I:P==-4&&(f=I);return v}let k=[],w=[];for(;l.pos>0;)c(s.start||0,s.bufferStart||0,k,w,-1,0);let B=(t=s.length)!==null&&t!==void 0?t:k.length?w[0]+k[0].length:0;return new q(a[s.topID],k.reverse(),w.reverse(),B)}const Bs=new WeakMap;function vi(s,t){if(!s.isAnonymous||t instanceof Gt||t.type!=s)return 1;let e=Bs.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=s||!(i instanceof q)){e=1;break}e+=vi(s,i)}Bs.set(t,e)}return e}function as(s,t,e,i,n,r,o,l,a){let h=0;for(let p=i;p<n;p++)h+=vi(s,t[p]);let f=Math.ceil(h*1.5/8),c=[],u=[];function d(p,g,m,y,k){for(let w=m;w<y;){let B=w,C=g[w],A=vi(s,p[w]);for(w++;w<y;w++){let v=vi(s,p[w]);if(A+v>=f)break;A+=v}if(w==B+1){if(A>f){let v=p[B];d(v.children,v.positions,0,v.children.length,g[B]+k);continue}c.push(p[B])}else{let v=g[w-1]+p[w-1].length-C;c.push(as(s,p,g,B,w,C,v,null,a))}u.push(C+k-r)}}return d(t,e,i,n,0),(l||a)(c,u,o)}class Ac{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Rt?this.setBuffer(t.context.buffer,t.index,e):t instanceof st&&this.map.set(t.tree,e)}get(t){return t instanceof Rt?this.getBuffer(t.context.buffer,t.index):t instanceof st?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Ft{constructor(t,e,i,n,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let n=[new Ft(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&n.push(r);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,h=0;;l++){let f=l<e.length?e[l]:null,c=f?f.fromA:1e9;if(c-a>=i)for(;o&&o.from<c;){let u=o;if(a>=u.from||c<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,c)-h;u=d>=p?null:new Ft(d,p,u.tree,u.offset+h,l>0,!!f)}if(u&&n.push(u),o.to>c)break;o=r<t.length?t[r++]:null}if(!f)break;a=f.toA,h=f.toA-f.toB}return n}}class _r{startParse(t,e,i){return typeof t=="string"&&(t=new jl(t)),i=i?i.length?i.map(n=>new yt(n.from,n.to)):[new yt(0,0)]:[new yt(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let r=n.advance();if(r)return r}}}class jl{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function Mc(s){return(t,e,i,n)=>new $l(t,s,e,i,n)}class Ps{constructor(t,e,i,n,r,o){this.parser=t,this.parse=e,this.overlay=i,this.bracketed=n,this.target=r,this.from=o}}function Es(s){if(!s.length||s.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class _l{constructor(t,e,i,n,r,o,l,a){this.parser=t,this.predicate=e,this.mounts=i,this.index=n,this.start=r,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const kn=new R({perNode:!0});class $l{constructor(t,e,i,n,r){this.nest=e,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new q(i.type,i.children,i.positions,i.length,i.propValues.concat([[kn,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[R.mounted.id]=new we(e,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].from<t&&(t=Math.min(t,this.inner[e].parse.parsedPos));return t}stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].parse.stopAt(t)}startInner(){let t=new Yl(this.fragments),e=null,i=null,n=new Pi(new st(this.baseTree,this.ranges[0].from,0,null),V.IncludeAnonymous|V.IgnoreMounts);t:for(let r,o;;){let l=!0,a;if(this.stoppedAt!=null&&n.from>=this.stoppedAt)l=!1;else if(t.hasNode(n)){if(e){let h=e.mounts.find(f=>f.frag.from<=n.from&&f.frag.to>=n.to&&f.mount.overlay);if(h)for(let f of h.mount.overlay){let c=f.from+h.pos,u=f.to+h.pos;c>=n.from&&u<=n.to&&!e.ranges.some(d=>d.from<u&&d.to>c)&&e.ranges.push({from:c,to:u})}}l=!1}else if(i&&(o=Ul(i.ranges,n.from,n.to)))l=o!=2;else if(!n.type.isAnonymous&&(r=this.nest(n,this.input))&&(n.from<n.to||!r.overlay)){n.tree||(Gl(n),e&&e.depth++,i&&i.depth++);let h=t.findMounts(n.from,r.parser);if(typeof r.overlay=="function")e=new _l(r.parser,r.overlay,h,this.inner.length,n.from,!!r.bracketed,n.tree,e);else{let f=Is(this.ranges,r.overlay||(n.from<n.to?[new yt(n.from,n.to)]:[]));f.length&&Es(f),(f.length||!r.overlay)&&this.inner.push(new Ps(r.parser,f.length?r.parser.startParse(this.input,Ns(h,f),f):r.parser.startParse(""),r.overlay?r.overlay.map(c=>new yt(c.from-n.from,c.to-n.from)):null,!!r.bracketed,n.tree,f.length?f[0].from:n.from)),r.overlay?f.length&&(i={ranges:f,depth:0,prev:i}):l=!1}}else if(e&&(a=e.predicate(n))&&(a===!0&&(a=new yt(n.from,n.to)),a.from<a.to)){let h=e.ranges.length-1;h>=0&&e.ranges[h].to==a.from?e.ranges[h]={from:e.ranges[h].from,to:a.to}:e.ranges.push(a)}if(l&&n.firstChild())e&&e.depth++,i&&i.depth++;else for(;!n.nextSibling();){if(!n.parent())break t;if(e&&!--e.depth){let h=Is(this.ranges,e.ranges);h.length&&(Es(h),this.inner.splice(e.index,0,new Ps(e.parser,e.parser.startParse(this.input,Ns(e.mounts,h),h),e.ranges.map(f=>new yt(f.from-e.start,f.to-e.start)),e.bracketed,e.target,h[0].from))),e=e.prev}i&&!--i.depth&&(i=i.prev)}}}}function Ul(s,t,e){for(let i of s){if(i.from>=e)break;if(i.to>t)return i.from<=t&&i.to>=e?2:1}return 0}function Rs(s,t,e,i,n,r){if(t<e){let o=s.buffer[t+1];i.push(s.slice(t,e,o)),n.push(o-r)}}function Gl(s){let{node:t}=s,e=[],i=t.context.buffer;do e.push(s.index),s.parent();while(!s.tree);let n=s.tree,r=n.children.indexOf(i),o=n.children[r],l=o.buffer,a=[r];function h(f,c,u,d,p,g){let m=e[g],y=[],k=[];Rs(o,f,m,y,k,d);let w=l[m+1],B=l[m+2];a.push(y.length);let C=g?h(m+4,l[m+3],o.set.types[l[m]],w,B-w,g-1):t.toTree();return y.push(C),k.push(w-d),Rs(o,l[m+3],c,y,k,d),new q(u,y,k,p)}n.children[r]=h(0,l.length,at.none,0,o.length,e.length-1);for(let f of a){let c=s.tree.children[f],u=s.tree.positions[f];s.yield(new st(c,u+s.from,f,s._tree))}}class Ls{constructor(t,e){this.offset=e,this.done=!1,this.cursor=t.cursor(V.IncludeAnonymous|V.IgnoreMounts|V.ExcludeBuffers)}moveTo(t){let{cursor:e}=this,i=t-this.offset;for(;!this.done&&e.from<i;)if(!(e.to>=i&&e.enter(i,1,V.IncludeAnonymous|V.IgnoreOverlays|V.ExcludeBuffers)))if(e.to<=i)e.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(e.children.length&&e.positions[0]==0&&e.children[0]instanceof q)e=e.children[0];else break}return!1}}class Yl{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(e=i.tree.prop(kn))!==null&&e!==void 0?e:i.to,this.inner=new Ls(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=(t=e.tree.prop(kn))!==null&&t!==void 0?t:e.to,this.inner=new Ls(e.tree,-e.offset)}}findMounts(t,e){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(R.mounted);if(o&&o.parser==e)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=r.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:r.from-a.offset,mount:o})}}}return n}}function Is(s,t){let e=null,i=t;for(let n=1,r=0;n<s.length;n++){let o=s[n-1].to,l=s[n].from;for(;r<i.length;r++){let a=i[r];if(a.from>=l)break;a.to<=o||(e||(i=e=t.slice()),a.from<o?(e[r]=new yt(a.from,o),a.to>l&&e.splice(r+1,0,new yt(l,a.to))):a.to>l?e[r--]=new yt(l,a.to):e.splice(r--,1))}}return i}function Xl(s,t,e,i){let n=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let f=n==s.length?1e9:o?s[n].to:s[n].from,c=r==t.length?1e9:l?t[r].to:t[r].from;if(o!=l){let u=Math.max(a,e),d=Math.min(f,c,i);u<d&&h.push(new yt(u,d))}if(a=Math.min(f,c),a==1e9)break;f==a&&(o?(o=!1,n++):o=!0),c==a&&(l?(l=!1,r++):l=!0)}return h}function Ns(s,t){let e=[];for(let{pos:i,mount:n,frag:r}of s){let o=i+(n.overlay?n.overlay[0].from:0),l=o+n.tree.length,a=Math.max(r.from,o),h=Math.min(r.to,l);if(n.overlay){let f=n.overlay.map(u=>new yt(u.from+i,u.to+i)),c=Xl(t,f,a,h);for(let u=0,d=a;;u++){let p=u==c.length,g=p?h:c[u].from;if(g>d&&e.push(new Ft(d,g,n.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=c[u].to}}else e.push(new Ft(a,h,n.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return e}let vn=[],$r=[];(()=>{let s="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,e=0;t<s.length;t++)(t%2?$r:vn).push(e=e+s[t])})();function Jl(s){if(s<768)return!1;for(let t=0,e=vn.length;;){let i=t+e>>1;if(s<vn[i])e=i;else if(s>=$r[i])t=i+1;else return!0;if(t==e)return!1}}function Ws(s){return s>=127462&&s<=127487}const Hs=8205;function Ql(s,t,e=!0,i=!0){return(e?Ur:Zl)(s,t,i)}function Ur(s,t,e){if(t==s.length)return t;t&&Gr(s.charCodeAt(t))&&Yr(s.charCodeAt(t-1))&&t--;let i=en(s,t);for(t+=Fs(i);t<s.length;){let n=en(s,t);if(i==Hs||n==Hs||e&&Jl(n))t+=Fs(n),i=n;else if(Ws(n)){let r=0,o=t-2;for(;o>=0&&Ws(en(s,o));)r++,o-=2;if(r%2==0)break;t+=2}else break}return t}function Zl(s,t,e){for(;t>1;){let i=Ur(s,t-2,e);if(i<t)return i;t--}return 0}function en(s,t){let e=s.charCodeAt(t);if(!Yr(e)||t+1==s.length)return e;let i=s.charCodeAt(t+1);return Gr(i)?(e-55296<<10)+(i-56320)+65536:e}function Gr(s){return s>=56320&&s<57344}function Yr(s){return s>=55296&&s<56320}function Fs(s){return s<65536?1:2}class W{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Ae(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),Pt.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Ae(this,t,e);let i=[];return this.decompose(t,e,i,0),Pt.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new Ve(this),r=new Ve(t);for(let o=e,l=e;;){if(n.next(o),r.next(o),o=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(t=1){return new Ve(this,t)}iterRange(t,e=this.length){return new Xr(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Jr(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?W.empty:t.length<=32?new X(t):Pt.from(X.split(t,[]))}}class X extends W{constructor(t,e=ta(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.text[r],l=n+o.length;if((e?i:l)>=t)return new ea(n,l,i,o);n=l+1,i++}}decompose(t,e,i,n){let r=t<=0&&e>=this.length?this:new X(Vs(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(n&1){let o=i.pop(),l=Si(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new X(l,o.length+r.length));else{let a=l.length>>1;i.push(new X(l.slice(0,a)),new X(l.slice(a)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof X))return super.replace(t,e,i);[t,e]=Ae(this,t,e);let n=Si(this.text,Si(i.text,Vs(this.text,0,t)),e),r=this.length+i.length-(e-t);return n.length<=32?new X(n,r):Pt.from(X.split(n,[]),r)}sliceString(t,e=this.length,i=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Bqm_Hovd.js","./index-D9bTQUpC.js","./index-Bx9on2--.js","./index-D8wX84LU.css","./index-Dio0XCm2.js","./index-BdNdXhQP.js","./index-pW9eskfl.js","./index-Da-AnxRT.js","./asciidoc-RQ_qptF1.js","./index-VyT6mhra.js"])))=>i.map(i=>d[i]);
2
+ import{_ as ee}from"./index-Bx9on2--.js";const Wl=1024;let Hl=0,yt=class{constructor(t,e){this.from=t,this.to=e}};class R{constructor(t={}){this.id=Hl++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=at.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}R.closedBy=new R({deserialize:s=>s.split(" ")});R.openedBy=new R({deserialize:s=>s.split(" ")});R.group=new R({deserialize:s=>s.split(" ")});R.isolate=new R({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});R.contextHash=new R({perNode:!0});R.lookAhead=new R({perNode:!0});R.mounted=new R({perNode:!0});class we{constructor(t,e,i,n=!1){this.tree=t,this.overlay=e,this.parser=i,this.bracketed=n}static get(t){return t&&t.props&&t.props[R.mounted.id]}}const Fl=Object.create(null);class at{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):Fl,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),n=new at(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return n}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(R.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return i=>{for(let n=i.prop(R.group),r=-1;r<(n?n.length:0);r++){let o=e[r<0?i.name:n[r]];if(o)return o}}}}at.none=new at("",Object.create(null),0,8);class rs{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let i of this.types){let n=null;for(let r of t){let o=r(i);if(o){n||(n=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in n&&(l=a.combine(n[a.id],l)),n[a.id]=l}}e.push(n?new at(i.name,n,i.id,i.flags):i)}return new rs(e)}}const ri=new WeakMap,Os=new WeakMap;var V;(function(s){s[s.ExcludeBuffers=1]="ExcludeBuffers",s[s.IncludeAnonymous=2]="IncludeAnonymous",s[s.IgnoreMounts=4]="IgnoreMounts",s[s.IgnoreOverlays=8]="IgnoreOverlays",s[s.EnterBracketed=16]="EnterBracketed"})(V||(V={}));class q{constructor(t,e,i,n,r){if(this.type=t,this.children=e,this.positions=i,this.length=n,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let t=we.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let i of this.children){let n=i.toString();n&&(e&&(e+=","),e+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Pi(this.topNode,t)}cursorAt(t,e=0,i=0){let n=ri.get(this)||this.topNode,r=new Pi(n);return r.moveTo(t,e),ri.set(this,r._tree),r}get topNode(){return new st(this,0,0,null)}resolve(t,e=0){let i=_e(ri.get(this)||this.topNode,t,e,!1);return ri.set(this,i),i}resolveInner(t,e=0){let i=_e(Os.get(this)||this.topNode,t,e,!0);return Os.set(this,i),i}resolveStack(t,e=0){return Kl(this,t,e)}iterate(t){let{enter:e,leave:i,from:n=0,to:r=this.length}=t,o=t.mode||0,l=(o&V.IncludeAnonymous)>0;for(let a=this.cursor(o|V.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:as(at.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,n)=>new q(this.type,e,i,n,this.propValues),t.makeTree||((e,i,n)=>new q(at.none,e,i,n)))}static build(t){return ql(t)}}q.empty=new q(at.none,[],[],0);class os{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new os(this.buffer,this.index)}}class Gt{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return at.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],i=this.buffer[t+3],n=this.set.types[e],r=n.name;if(/\W/.test(r)&&!n.isError&&(r=JSON.stringify(r)),t+=4,i==t)return r;let o=[];for(;t<i;)o.push(this.childString(t)),t=this.buffer[t+3];return r+"("+o.join(",")+")"}findChild(t,e,i,n,r){let{buffer:o}=this,l=-1;for(let a=t;a!=e&&!(Kr(r,n,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(t,e,i){let n=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l<e;){r[a++]=n[l++],r[a++]=n[l++]-i;let h=r[a++]=n[l++]-i;r[a++]=n[l++]-t,o=Math.max(o,h)}return new Gt(r,o,this.set)}}function Kr(s,t,e,i){switch(s){case-2:return e<t;case-1:return i>=t&&e<t;case 0:return e<t&&i>t;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function _e(s,t,e,i){for(var n;s.from==s.to||(e<1?s.from>=t:s.from>t)||(e>-1?s.to<=t:s.to<t);){let o=!i&&s instanceof st&&s.index<0?null:s.parent;if(!o)return s;s=o}let r=i?0:V.IgnoreOverlays;if(i)for(let o=s,l=o.parent;l;o=l,l=o.parent)o instanceof st&&o.index<0&&((n=l.enter(t,e,r))===null||n===void 0?void 0:n.from)!=o.from&&(s=l);for(;;){let o=s.enter(t,e,r);if(!o)return s;s=o}}class qr{cursor(t=0){return new Pi(this,t)}getChild(t,e=null,i=null){let n=Ds(this,t,e,i);return n.length?n[0]:null}getChildren(t,e=null,i=null){return Ds(this,t,e,i)}resolve(t,e=0){return _e(this,t,e,!1)}resolveInner(t,e=0){return _e(this,t,e,!0)}matchContext(t){return xn(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),i=this;for(;e;){let n=e.lastChild;if(!n||n.to!=e.to)break;n.type.isError&&n.from==n.to?(i=e,e=n.prevSibling):e=n}return i}get node(){return this}get next(){return this.parent}}class st extends qr{constructor(t,e,i,n){super(),this._tree=t,this.from=e,this.index=i,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,i,n,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=e>0?l.length:-1;t!=h;t+=e){let f=l[t],c=a[t]+o.from,u;if(!(!(r&V.EnterBracketed&&f instanceof q&&(u=we.get(f))&&!u.overlay&&u.bracketed&&i>=c&&i<=c+f.length)&&!Kr(n,i,c,c+f.length))){if(f instanceof Gt){if(r&V.ExcludeBuffers)continue;let d=f.findChild(0,f.buffer.length,e,i-c,n);if(d>-1)return new Rt(new Vl(o,f,t,c),null,d)}else if(r&V.IncludeAnonymous||!f.type.isAnonymous||ls(f)){let d;if(!(r&V.IgnoreMounts)&&(d=we.get(f))&&!d.overlay)return new st(d.tree,c,t,o);let p=new st(f,c,t,o);return r&V.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(e<0?f.children.length-1:0,e,i,n,r)}}}if(r&V.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,e,i=0){let n;if(!(i&V.IgnoreOverlays)&&(n=we.get(this._tree))&&n.overlay){let r=t-this.from,o=i&V.EnterBracketed&&n.bracketed;for(let{from:l,to:a}of n.overlay)if((e>0||o?l<=r:l<r)&&(e<0||o?a>=r:a>r))return new st(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Ds(s,t,e,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=n.type.is(e),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(t)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function xn(s,t,e=t.length-1){for(let i=s;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class Vl{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class Rt extends qr{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Rt(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,e,i=0){if(i&V.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Rt(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Rt(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Rt(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];t.push(i.slice(n,r,o)),e.push(0)}return new q(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function jr(s){if(!s.length)return null;let t=0,e=s[0];for(let r=1;r<s.length;r++){let o=s[r];(o.from>e.from||o.to<e.to)&&(e=o,t=r)}let i=e instanceof st&&e.index<0?null:e.parent,n=s.slice();return i?n[t]=i:n.splice(t,1),new zl(n,e)}class zl{constructor(t,e){this.heads=t,this.node=e}get next(){return jr(this.heads)}}function Kl(s,t,e){let i=s.resolveInner(t,e),n=null;for(let r=i instanceof st?i:i.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(n||(n=[i])).push(o.resolve(t,e)),r=o}else{let o=we.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let l=new st(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(_e(l,t,e,!1))}}return n?jr(n):i}class Pi{get name(){return this.type.name}constructor(t,e=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=e&~V.EnterBracketed,t instanceof st)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=i+n.buffer[t+1],this.to=i+n.buffer[t+2],!0}yield(t){return t?t instanceof st?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&V.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&V.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&V.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(e.findChild(n,this.index,-1,0,4))}else{let n=e.buffer[this.index+3];if(n<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:n}=this;if(n){if(t>0){if(this.index<n.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(n.buffer.buffer[r+3]<this.index)return!1;({index:e,parent:i}=n)}else({index:e,_parent:i}=this._tree);for(;i;{index:e,_parent:i}=i)if(e>-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&V.IncludeAnonymous||l instanceof Gt||!l.type.isAnonymous||ls(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(let n=this.index,r=this.stack.length;r>=0;){for(let o=t;o;o=o._parent)if(o.index==n){if(n==this.index)return o;e=o,i=r+1;break t}n=this.stack[--r]}for(let n=i;n<this.stack.length;n++)e=new Rt(this.buffer,e,this.stack[n]);return this.bufferNode=new Rt(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let i=0;;){let n=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(n=!0)}for(;;){if(n&&e&&e(this),n=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,n=!0}}}matchContext(t){if(!this.buffer)return xn(this.node.parent,t);let{buffer:e}=this.buffer,{types:i}=e.set;for(let n=t.length-1,r=this.stack.length-1;n>=0;r--){if(r<0)return xn(this._tree,t,n);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}}function ls(s){return s.children.some(t=>t instanceof Gt||!t.type.isAnonymous||ls(t))}function ql(s){var t;let{buffer:e,nodeSet:i,maxBufferLength:n=Wl,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(e)?new os(e,e.length):e,a=i.types,h=0,f=0;function c(C,A,v,I,E,z){let{id:P,start:O,end:F,size:N}=l,j=f,rt=h;if(N<0)if(l.next(),N==-1){let Nt=r[P];v.push(Nt),I.push(O-C);return}else if(N==-3){h=P;return}else if(N==-4){f=P;return}else throw new RangeError(`Unrecognized record size: ${N}`);let ct=a[P],At,Q,pt=O-C;if(F-O<=n&&(Q=m(l.pos-A,E))){let Nt=new Uint16Array(Q.size-Q.skip),gt=l.pos-Q.size,Mt=Nt.length;for(;l.pos>gt;)Mt=y(Q.start,Nt,Mt);At=new Gt(Nt,F-Q.start,i),pt=Q.start-C}else{let Nt=l.pos-N;l.next();let gt=[],Mt=[],te=P>=o?P:-1,de=0,si=F;for(;l.pos>Nt;)te>=0&&l.id==te&&l.size>=0?(l.end<=si-n&&(p(gt,Mt,O,de,l.end,si,te,j,rt),de=gt.length,si=l.end),l.next()):z>2500?u(O,Nt,gt,Mt):c(O,Nt,gt,Mt,te,z+1);if(te>=0&&de>0&&de<gt.length&&p(gt,Mt,O,de,O,si,te,j,rt),gt.reverse(),Mt.reverse(),te>-1&&de>0){let Ts=d(ct,rt);At=as(ct,gt,Mt,0,gt.length,0,F-O,Ts,Ts)}else At=g(ct,gt,Mt,F-O,j-F,rt)}v.push(At),I.push(pt)}function u(C,A,v,I){let E=[],z=0,P=-1;for(;l.pos>A;){let{id:O,start:F,end:N,size:j}=l;if(j>4)l.next();else{if(P>-1&&F<P)break;P<0&&(P=N-n),E.push(O,F,N),z++,l.next()}}if(z){let O=new Uint16Array(z*4),F=E[E.length-2];for(let N=E.length-3,j=0;N>=0;N-=3)O[j++]=E[N],O[j++]=E[N+1]-F,O[j++]=E[N+2]-F,O[j++]=j;v.push(new Gt(O,E[2]-F,i)),I.push(F-C)}}function d(C,A){return(v,I,E)=>{let z=0,P=v.length-1,O,F;if(P>=0&&(O=v[P])instanceof q){if(!P&&O.type==C&&O.length==E)return O;(F=O.prop(R.lookAhead))&&(z=I[P]+O.length+F)}return g(C,v,I,E,z,A)}}function p(C,A,v,I,E,z,P,O,F){let N=[],j=[];for(;C.length>I;)N.push(C.pop()),j.push(A.pop()+v-E);C.push(g(i.types[P],N,j,z-E,O-z,F)),A.push(E-v)}function g(C,A,v,I,E,z,P){if(z){let O=[R.contextHash,z];P=P?[O].concat(P):[O]}if(E>25){let O=[R.lookAhead,E];P=P?[O].concat(P):[O]}return new q(C,A,v,I,P)}function m(C,A){let v=l.fork(),I=0,E=0,z=0,P=v.end-n,O={size:0,start:0,skip:0};t:for(let F=v.pos-C;v.pos>F;){let N=v.size;if(v.id==A&&N>=0){O.size=I,O.start=E,O.skip=z,z+=4,I+=4,v.next();continue}let j=v.pos-N;if(N<0||j<F||v.start<P)break;let rt=v.id>=o?4:0,ct=v.start;for(v.next();v.pos>j;){if(v.size<0)if(v.size==-3||v.size==-4)rt+=4;else break t;else v.id>=o&&(rt+=4);v.next()}E=ct,I+=N,z+=rt}return(A<0||I==C)&&(O.size=I,O.start=E,O.skip=z),O.size>4?O:void 0}function y(C,A,v){let{id:I,start:E,end:z,size:P}=l;if(l.next(),P>=0&&I<o){let O=v;if(P>4){let F=l.pos-(P-4);for(;l.pos>F;)v=y(C,A,v)}A[--v]=O,A[--v]=z-C,A[--v]=E-C,A[--v]=I}else P==-3?h=I:P==-4&&(f=I);return v}let k=[],w=[];for(;l.pos>0;)c(s.start||0,s.bufferStart||0,k,w,-1,0);let B=(t=s.length)!==null&&t!==void 0?t:k.length?w[0]+k[0].length:0;return new q(a[s.topID],k.reverse(),w.reverse(),B)}const Bs=new WeakMap;function vi(s,t){if(!s.isAnonymous||t instanceof Gt||t.type!=s)return 1;let e=Bs.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=s||!(i instanceof q)){e=1;break}e+=vi(s,i)}Bs.set(t,e)}return e}function as(s,t,e,i,n,r,o,l,a){let h=0;for(let p=i;p<n;p++)h+=vi(s,t[p]);let f=Math.ceil(h*1.5/8),c=[],u=[];function d(p,g,m,y,k){for(let w=m;w<y;){let B=w,C=g[w],A=vi(s,p[w]);for(w++;w<y;w++){let v=vi(s,p[w]);if(A+v>=f)break;A+=v}if(w==B+1){if(A>f){let v=p[B];d(v.children,v.positions,0,v.children.length,g[B]+k);continue}c.push(p[B])}else{let v=g[w-1]+p[w-1].length-C;c.push(as(s,p,g,B,w,C,v,null,a))}u.push(C+k-r)}}return d(t,e,i,n,0),(l||a)(c,u,o)}class Ac{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Rt?this.setBuffer(t.context.buffer,t.index,e):t instanceof st&&this.map.set(t.tree,e)}get(t){return t instanceof Rt?this.getBuffer(t.context.buffer,t.index):t instanceof st?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Ft{constructor(t,e,i,n,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let n=[new Ft(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&n.push(r);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,h=0;;l++){let f=l<e.length?e[l]:null,c=f?f.fromA:1e9;if(c-a>=i)for(;o&&o.from<c;){let u=o;if(a>=u.from||c<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,c)-h;u=d>=p?null:new Ft(d,p,u.tree,u.offset+h,l>0,!!f)}if(u&&n.push(u),o.to>c)break;o=r<t.length?t[r++]:null}if(!f)break;a=f.toA,h=f.toA-f.toB}return n}}class _r{startParse(t,e,i){return typeof t=="string"&&(t=new jl(t)),i=i?i.length?i.map(n=>new yt(n.from,n.to)):[new yt(0,0)]:[new yt(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let r=n.advance();if(r)return r}}}class jl{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function Mc(s){return(t,e,i,n)=>new $l(t,s,e,i,n)}class Ps{constructor(t,e,i,n,r,o){this.parser=t,this.parse=e,this.overlay=i,this.bracketed=n,this.target=r,this.from=o}}function Es(s){if(!s.length||s.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class _l{constructor(t,e,i,n,r,o,l,a){this.parser=t,this.predicate=e,this.mounts=i,this.index=n,this.start=r,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const kn=new R({perNode:!0});class $l{constructor(t,e,i,n,r){this.nest=e,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new q(i.type,i.children,i.positions,i.length,i.propValues.concat([[kn,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[R.mounted.id]=new we(e,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].from<t&&(t=Math.min(t,this.inner[e].parse.parsedPos));return t}stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].parse.stopAt(t)}startInner(){let t=new Yl(this.fragments),e=null,i=null,n=new Pi(new st(this.baseTree,this.ranges[0].from,0,null),V.IncludeAnonymous|V.IgnoreMounts);t:for(let r,o;;){let l=!0,a;if(this.stoppedAt!=null&&n.from>=this.stoppedAt)l=!1;else if(t.hasNode(n)){if(e){let h=e.mounts.find(f=>f.frag.from<=n.from&&f.frag.to>=n.to&&f.mount.overlay);if(h)for(let f of h.mount.overlay){let c=f.from+h.pos,u=f.to+h.pos;c>=n.from&&u<=n.to&&!e.ranges.some(d=>d.from<u&&d.to>c)&&e.ranges.push({from:c,to:u})}}l=!1}else if(i&&(o=Ul(i.ranges,n.from,n.to)))l=o!=2;else if(!n.type.isAnonymous&&(r=this.nest(n,this.input))&&(n.from<n.to||!r.overlay)){n.tree||(Gl(n),e&&e.depth++,i&&i.depth++);let h=t.findMounts(n.from,r.parser);if(typeof r.overlay=="function")e=new _l(r.parser,r.overlay,h,this.inner.length,n.from,!!r.bracketed,n.tree,e);else{let f=Is(this.ranges,r.overlay||(n.from<n.to?[new yt(n.from,n.to)]:[]));f.length&&Es(f),(f.length||!r.overlay)&&this.inner.push(new Ps(r.parser,f.length?r.parser.startParse(this.input,Ns(h,f),f):r.parser.startParse(""),r.overlay?r.overlay.map(c=>new yt(c.from-n.from,c.to-n.from)):null,!!r.bracketed,n.tree,f.length?f[0].from:n.from)),r.overlay?f.length&&(i={ranges:f,depth:0,prev:i}):l=!1}}else if(e&&(a=e.predicate(n))&&(a===!0&&(a=new yt(n.from,n.to)),a.from<a.to)){let h=e.ranges.length-1;h>=0&&e.ranges[h].to==a.from?e.ranges[h]={from:e.ranges[h].from,to:a.to}:e.ranges.push(a)}if(l&&n.firstChild())e&&e.depth++,i&&i.depth++;else for(;!n.nextSibling();){if(!n.parent())break t;if(e&&!--e.depth){let h=Is(this.ranges,e.ranges);h.length&&(Es(h),this.inner.splice(e.index,0,new Ps(e.parser,e.parser.startParse(this.input,Ns(e.mounts,h),h),e.ranges.map(f=>new yt(f.from-e.start,f.to-e.start)),e.bracketed,e.target,h[0].from))),e=e.prev}i&&!--i.depth&&(i=i.prev)}}}}function Ul(s,t,e){for(let i of s){if(i.from>=e)break;if(i.to>t)return i.from<=t&&i.to>=e?2:1}return 0}function Rs(s,t,e,i,n,r){if(t<e){let o=s.buffer[t+1];i.push(s.slice(t,e,o)),n.push(o-r)}}function Gl(s){let{node:t}=s,e=[],i=t.context.buffer;do e.push(s.index),s.parent();while(!s.tree);let n=s.tree,r=n.children.indexOf(i),o=n.children[r],l=o.buffer,a=[r];function h(f,c,u,d,p,g){let m=e[g],y=[],k=[];Rs(o,f,m,y,k,d);let w=l[m+1],B=l[m+2];a.push(y.length);let C=g?h(m+4,l[m+3],o.set.types[l[m]],w,B-w,g-1):t.toTree();return y.push(C),k.push(w-d),Rs(o,l[m+3],c,y,k,d),new q(u,y,k,p)}n.children[r]=h(0,l.length,at.none,0,o.length,e.length-1);for(let f of a){let c=s.tree.children[f],u=s.tree.positions[f];s.yield(new st(c,u+s.from,f,s._tree))}}class Ls{constructor(t,e){this.offset=e,this.done=!1,this.cursor=t.cursor(V.IncludeAnonymous|V.IgnoreMounts|V.ExcludeBuffers)}moveTo(t){let{cursor:e}=this,i=t-this.offset;for(;!this.done&&e.from<i;)if(!(e.to>=i&&e.enter(i,1,V.IncludeAnonymous|V.IgnoreOverlays|V.ExcludeBuffers)))if(e.to<=i)e.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(e.children.length&&e.positions[0]==0&&e.children[0]instanceof q)e=e.children[0];else break}return!1}}class Yl{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(e=i.tree.prop(kn))!==null&&e!==void 0?e:i.to,this.inner=new Ls(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=(t=e.tree.prop(kn))!==null&&t!==void 0?t:e.to,this.inner=new Ls(e.tree,-e.offset)}}findMounts(t,e){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(R.mounted);if(o&&o.parser==e)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=r.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:r.from-a.offset,mount:o})}}}return n}}function Is(s,t){let e=null,i=t;for(let n=1,r=0;n<s.length;n++){let o=s[n-1].to,l=s[n].from;for(;r<i.length;r++){let a=i[r];if(a.from>=l)break;a.to<=o||(e||(i=e=t.slice()),a.from<o?(e[r]=new yt(a.from,o),a.to>l&&e.splice(r+1,0,new yt(l,a.to))):a.to>l?e[r--]=new yt(l,a.to):e.splice(r--,1))}}return i}function Xl(s,t,e,i){let n=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let f=n==s.length?1e9:o?s[n].to:s[n].from,c=r==t.length?1e9:l?t[r].to:t[r].from;if(o!=l){let u=Math.max(a,e),d=Math.min(f,c,i);u<d&&h.push(new yt(u,d))}if(a=Math.min(f,c),a==1e9)break;f==a&&(o?(o=!1,n++):o=!0),c==a&&(l?(l=!1,r++):l=!0)}return h}function Ns(s,t){let e=[];for(let{pos:i,mount:n,frag:r}of s){let o=i+(n.overlay?n.overlay[0].from:0),l=o+n.tree.length,a=Math.max(r.from,o),h=Math.min(r.to,l);if(n.overlay){let f=n.overlay.map(u=>new yt(u.from+i,u.to+i)),c=Xl(t,f,a,h);for(let u=0,d=a;;u++){let p=u==c.length,g=p?h:c[u].from;if(g>d&&e.push(new Ft(d,g,n.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=c[u].to}}else e.push(new Ft(a,h,n.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return e}let vn=[],$r=[];(()=>{let s="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,e=0;t<s.length;t++)(t%2?$r:vn).push(e=e+s[t])})();function Jl(s){if(s<768)return!1;for(let t=0,e=vn.length;;){let i=t+e>>1;if(s<vn[i])e=i;else if(s>=$r[i])t=i+1;else return!0;if(t==e)return!1}}function Ws(s){return s>=127462&&s<=127487}const Hs=8205;function Ql(s,t,e=!0,i=!0){return(e?Ur:Zl)(s,t,i)}function Ur(s,t,e){if(t==s.length)return t;t&&Gr(s.charCodeAt(t))&&Yr(s.charCodeAt(t-1))&&t--;let i=en(s,t);for(t+=Fs(i);t<s.length;){let n=en(s,t);if(i==Hs||n==Hs||e&&Jl(n))t+=Fs(n),i=n;else if(Ws(n)){let r=0,o=t-2;for(;o>=0&&Ws(en(s,o));)r++,o-=2;if(r%2==0)break;t+=2}else break}return t}function Zl(s,t,e){for(;t>1;){let i=Ur(s,t-2,e);if(i<t)return i;t--}return 0}function en(s,t){let e=s.charCodeAt(t);if(!Yr(e)||t+1==s.length)return e;let i=s.charCodeAt(t+1);return Gr(i)?(e-55296<<10)+(i-56320)+65536:e}function Gr(s){return s>=56320&&s<57344}function Yr(s){return s>=55296&&s<56320}function Fs(s){return s<65536?1:2}class W{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Ae(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),Pt.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Ae(this,t,e);let i=[];return this.decompose(t,e,i,0),Pt.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new Ve(this),r=new Ve(t);for(let o=e,l=e;;){if(n.next(o),r.next(o),o=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(t=1){return new Ve(this,t)}iterRange(t,e=this.length){return new Xr(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Jr(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?W.empty:t.length<=32?new X(t):Pt.from(X.split(t,[]))}}class X extends W{constructor(t,e=ta(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.text[r],l=n+o.length;if((e?i:l)>=t)return new ea(n,l,i,o);n=l+1,i++}}decompose(t,e,i,n){let r=t<=0&&e>=this.length?this:new X(Vs(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(n&1){let o=i.pop(),l=Si(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new X(l,o.length+r.length));else{let a=l.length>>1;i.push(new X(l.slice(0,a)),new X(l.slice(a)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof X))return super.replace(t,e,i);[t,e]=Ae(this,t,e);let n=Si(this.text,Si(i.text,Vs(this.text,0,t)),e),r=this.length+i.length-(e-t);return n.length<=32?new X(n,r):Pt.from(X.split(n,[]),r)}sliceString(t,e=this.length,i=`
3
3
  `){[t,e]=Ae(this,t,e);let n="";for(let r=0,o=0;r<=e&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>t&&o&&(n+=i),t<a&&e>r&&(n+=l.slice(Math.max(0,t-r),e-r)),r=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let r of t)i.push(r),n+=r.length+1,i.length==32&&(e.push(new X(i,n)),i=[],n=-1);return n>-1&&e.push(new X(i,n)),e}}class Pt extends W{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.children[r],l=n+o.length,a=i+o.lines-1;if((e?a:l)>=t)return o.lineInner(t,e,i,n);n=l+1,i=a+1}}decompose(t,e,i,n){for(let r=0,o=0;o<=e&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(t<=a&&e>=o){let h=n&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!h?i.push(l):l.decompose(t-o,e-o,i,h)}o=a+1}}replace(t,e,i){if([t,e]=Ae(this,t,e),i.lines<this.lines)for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],l=r+o.length;if(t>=r&&e<=l){let a=o.replace(t-r,e-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let f=this.children.slice();return f[n]=a,new Pt(f,this.length-(e-t)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=`
4
4
  `){[t,e]=Ae(this,t,e);let n="";for(let r=0,o=0;r<this.children.length&&o<=e;r++){let l=this.children[r],a=o+l.length;o>t&&r&&(n+=i),t<a&&e>o&&(n+=l.sliceString(t-o,e-o,i)),o=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof Pt))return 0;let i=0,[n,r,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,r+=e){if(n==o||r==l)return i;let a=this.children[n],h=t.children[r];if(a!=h)return i+a.scanIdentical(h,e);i+=a.length+1}}static from(t,e=t.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let p of t)p.flatten(d);return new X(d,e)}let n=Math.max(32,i>>5),r=n<<1,o=n>>1,l=[],a=0,h=-1,f=[];function c(d){let p;if(d.lines>r&&d instanceof Pt)for(let g of d.children)c(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof X&&a&&(p=f[f.length-1])instanceof X&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,f[f.length-1]=new X(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>n&&u(),a+=d.lines,h+=d.length+1,f.push(d))}function u(){a!=0&&(l.push(f.length==1?f[0]:Pt.from(f,h)),h=-1,a=f.length=0)}for(let d of t)c(d);return u(),l.length==1?l[0]:new Pt(l,e)}}W.empty=new X([""],0);function ta(s){let t=-1;for(let e of s)t+=e.length+1;return t}function Si(s,t,e=0,i=1e9){for(let n=0,r=0,o=!0;r<s.length&&n<=i;r++){let l=s[r],a=n+l.length;a>=e&&(a>i&&(l=l.slice(0,i-n)),n<e&&(l=l.slice(e-n)),o?(t[t.length-1]+=l,o=!1):t.push(l)),n=a+1}return t}function Vs(s,t,e){return Si(s,[""],t,e)}class Ve{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof X?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],o=r>>1,l=n instanceof X?n.text.length:n.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=`
5
5
  `,this;t--}else if(n instanceof X){let a=n.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=n.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof X?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Xr{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new Ve(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Jr{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(W.prototype[Symbol.iterator]=function(){return this.iter()},Ve.prototype[Symbol.iterator]=Xr.prototype[Symbol.iterator]=Jr.prototype[Symbol.iterator]=function(){return this});class ea{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function Ae(s,t,e){return t=Math.max(0,Math.min(s.length,t)),[t,Math.max(t,Math.min(s.length,e))]}function vt(s,t,e=!0,i=!0){return Ql(s,t,e,i)}function ia(s){return s>=56320&&s<57344}function na(s){return s>=55296&&s<56320}function sa(s,t){let e=s.charCodeAt(t);if(!na(e)||t+1==s.length)return e;let i=s.charCodeAt(t+1);return ia(i)?(e-55296<<10)+(i-56320)+65536:e}function Tc(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function ra(s){return s<65536?1:2}const Sn=/\r\n?|\n/;var dt=(function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s})(dt||(dt={}));class Vt{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e+1];t+=i<0?this.sections[e]:i}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let e=0,i=0,n=0;e<this.sections.length;){let r=this.sections[e++],o=this.sections[e++];o<0?(t(i,n,r),n+=r):n+=o,i+=r}}iterChangedRanges(t,e=!1){Cn(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];n<0?t.push(i,n):t.push(n,i)}return new Vt(t)}composeDesc(t){return this.empty?t:t.empty?this:Qr(this,t)}mapDesc(t,e=!1){return t.empty?this:An(this,t,e)}mapPos(t,e=-1,i=dt.Simple){let n=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=n+l;if(a<0){if(h>t)return r+(t-n);r+=l}else{if(i!=dt.Simple&&h>=t&&(i==dt.TrackDel&&n<t&&h>t||i==dt.TrackBefore&&n<t||i==dt.TrackAfter&&h>t))return null;if(h>t||h==t&&e<0&&!l)return t==n||e<0?r:r+a;r+=a}n=h}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return r}touchesRange(t,e=t){for(let i=0,n=0;i<this.sections.length&&n<=e;){let r=this.sections[i++],o=this.sections[i++],l=n+r;if(o>=0&&n<=e&&l>=t)return n<t&&l>e?"cover":!0;n=l}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];t+=(t?" ":"")+i+(n>=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Vt(t)}static create(t){return new Vt(t)}}class J extends Vt{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return Cn(this,(e,i,n,r,o)=>t=t.replace(n,n+(i-e),o),!1),t}mapDesc(t,e=!1){return An(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,r=0;n<e.length;n+=2){let o=e[n],l=e[n+1];if(l>=0){e[n]=l,e[n+1]=o;let a=n>>1;for(;i.length<a;)i.push(W.empty);i.push(o?t.slice(r,r+o):W.empty)}r+=o}return new J(e,i)}compose(t){return this.empty?t:t.empty?this:Qr(this,t,!0)}map(t,e=!1){return t.empty?this:An(this,t,e,!0)}iterChanges(t,e=!1){Cn(this,t,e)}get desc(){return Vt.create(this.sections)}filter(t){let e=[],i=[],n=[],r=new $e(this);t:for(let o=0,l=0;;){let a=o==t.length?1e9:t[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break t;let f=Math.min(r.len,a-l);it(n,f,-1);let c=r.ins==-1?-1:r.off==0?r.ins:0;it(e,f,c),c>0&&Ut(i,e,r.text),r.forward(f),l+=f}let h=t[o++];for(;l<h;){if(r.done)break t;let f=Math.min(r.len,h-l);it(e,f,-1),it(n,f,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(f),l+=f}}return{changes:new J(e,i),filtered:Vt.create(n)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e],n=this.sections[e+1];n<0?t.push(i):n==0?t.push([i]):t.push([i].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,i){let n=[],r=[],o=0,l=null;function a(f=!1){if(!f&&!n.length)return;o<e&&it(n,e-o,-1);let c=new J(n,r);l=l?l.compose(c.map(l)):c,n=[],r=[],o=0}function h(f){if(Array.isArray(f))for(let c of f)h(c);else if(f instanceof J){if(f.length!=e)throw new RangeError(`Mismatched change set length (got ${f.length}, expected ${e})`);a(),l=l?l.compose(f.map(l)):f}else{let{from:c,to:u=c,insert:d}=f;if(c>u||c<0||u>e)throw new RangeError(`Invalid change range ${c} to ${u} (in doc of length ${e})`);let p=d?typeof d=="string"?W.of(d.split(i||Sn)):d:W.empty,g=p.length;if(c==u&&g==0)return;c<o&&a(),c>o&&it(n,c-o,-1),it(n,u-c,g),Ut(r,n,p),o=u}}return h(t),a(!l),l}static empty(t){return new J(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="number")e.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)e.push(r[0],0);else{for(;i.length<n;)i.push(W.empty);i[n]=W.of(r.slice(1)),e.push(r[0],i[n].length)}}}return new J(e,i)}static createSet(t,e){return new J(t,e)}}function it(s,t,e,i=!1){if(t==0&&e<=0)return;let n=s.length-2;n>=0&&e<=0&&e==s[n+1]?s[n]+=t:n>=0&&t==0&&s[n]==0?s[n+1]+=e:i?(s[n]+=t,s[n+1]+=e):s.push(t,e)}function Ut(s,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i<s.length)s[s.length-1]=s[s.length-1].append(e);else{for(;s.length<i;)s.push(W.empty);s.push(e)}}function Cn(s,t,e){let i=s.inserted;for(let n=0,r=0,o=0;o<s.sections.length;){let l=s.sections[o++],a=s.sections[o++];if(a<0)n+=l,r+=l;else{let h=n,f=r,c=W.empty;for(;h+=l,f+=a,a&&i&&(c=c.append(i[o-2>>1])),!(e||o==s.sections.length||s.sections[o+1]<0);)l=s.sections[o++],a=s.sections[o++];t(n,h,r,f,c),n=h,r=f}}}function An(s,t,e,i=!1){let n=[],r=i?[]:null,o=new $e(s),l=new $e(t);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);it(n,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!e))){let h=l.len;for(it(n,l.ins,-1);h;){let f=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=f&&(it(n,0,o.ins),r&&Ut(r,n,o.text),a=o.i),o.forward(f),h-=f}l.next()}else if(o.ins>=0){let h=0,f=o.len;for(;f;)if(l.ins==-1){let c=Math.min(f,l.len);h+=c,f-=c,l.forward(c)}else if(l.ins==0&&l.len<f)f-=l.len,l.next();else break;it(n,h,a<o.i?o.ins:0),r&&a<o.i&&Ut(r,n,o.text),a=o.i,o.forward(o.len-f)}else{if(o.done&&l.done)return r?J.createSet(n,r):Vt.create(n);throw new Error("Mismatched change set lengths")}}}function Qr(s,t,e=!1){let i=[],n=e?[]:null,r=new $e(s),o=new $e(t);for(let l=!1;;){if(r.done&&o.done)return n?J.createSet(i,n):Vt.create(i);if(r.ins==0)it(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)it(i,0,o.ins,l),n&&Ut(n,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),h=i.length;if(r.ins==-1){let f=o.ins==-1?-1:o.off?0:o.ins;it(i,a,f,l),n&&f&&Ut(n,i,o.text)}else o.ins==-1?(it(i,r.off?0:r.len,a,l),n&&Ut(n,i,r.textBit(a))):(it(i,r.off?0:r.len,o.off?0:o.ins,l),n&&!o.off&&Ut(n,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class $e{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?W.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?W.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class _t{constructor(t,e,i,n){this.from=t,this.to=e,this.flags=i,this.goalColumn=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new _t(i,n,this.flags,this.goalColumn)}extend(t,e=t,i=0){if(t<=this.anchor&&e>=this.anchor)return x.range(t,e,void 0,void 0,i);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return x.range(this.anchor,n,void 0,void 0,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return x.range(t.anchor,t.head)}static create(t,e,i,n){return new _t(t,e,i,n)}}class x{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:x.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(t.ranges[i],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new x([this.main],0)}addRange(t,e=!0){return x.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let i=this.ranges.slice();return i[e]=t,x.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new x(t.ranges.map(e=>_t.fromJSON(e)),t.main)}static single(t,e=t){return new x([x.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<t.length;n++){let r=t[n];if(r.empty?r.from<=i:r.from<i)return x.normalized(t.slice(),e);i=r.to}return new x(t,e)}static cursor(t,e=0,i,n){return _t.create(t,t,(e==0?0:e<0?8:16)|(i==null?7:Math.min(6,i)),n)}static range(t,e,i,n,r){let o=n==null?7:Math.min(6,n);return!r&&t!=e&&(r=e<t?1:-1),r&&(o|=r<0?8:16),e<t?_t.create(e,t,o|32,i):_t.create(t,e,o,i)}static undirectionalRange(t,e){return _t.create(t,e,64,void 0)}static normalized(t,e=0){let i=t[e];t.sort((n,r)=>n.from-r.from),e=t.indexOf(i);for(let n=1;n<t.length;n++){let r=t[n],o=t[n-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);n<=e&&e--,t.splice(--n,2,r.anchor>r.head?x.range(a,l):x.range(l,a))}}return new x(t,e)}}function Zr(s,t){for(let e of s.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let hs=0;class T{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=hs++,this.default=t([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(t={}){return new T(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:fs),!!t.static,t.enables)}of(t){return new Ci([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ci(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ci(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function fs(s,t){return s==t||s.length==t.length&&s.every((e,i)=>e===t[i])}class Ci{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=hs++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,r=this.id,o=t[r]>>1,l=this.type==2,a=!1,h=!1,f=[];for(let c of this.dependencies)c=="doc"?a=!0:c=="selection"?h=!0:(((e=t[c.id])!==null&&e!==void 0?e:1)&1)==0&&f.push(t[c.id]);return{create(c){return c.values[o]=i(c),1},update(c,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Mn(c,f)){let d=i(c);if(l?!zs(d,c.values[o],n):!n(d,c.values[o]))return c.values[o]=d,1}return 0},reconfigure:(c,u)=>{let d,p=u.config.address[r];if(p!=null){let g=Ri(u,p);if(this.dependencies.every(m=>m instanceof T?u.facet(m)===c.facet(m):m instanceof Zt?u.field(m,!1)==c.field(m,!1):!0)||(l?zs(d=i(c),g,n):n(d=i(c),g)))return c.values[o]=g,0}else d=i(c);return c.values[o]=d,1}}}get extension(){return this}}function zs(s,t,e){if(s.length!=t.length)return!1;for(let i=0;i<s.length;i++)if(!e(s[i],t[i]))return!1;return!0}function Mn(s,t){let e=!1;for(let i of t)ze(s,i)&1&&(e=!0);return e}function oa(s,t,e){let i=e.map(a=>s[a.id]),n=e.map(a=>a.type),r=i.filter(a=>!(a&1)),o=s[t.id]>>1;function l(a){let h=[];for(let f=0;f<i.length;f++){let c=Ri(a,i[f]);if(n[f]==2)for(let u of c)h.push(u);else h.push(c)}return t.combine(h)}return{create(a){for(let h of i)ze(a,h);return a.values[o]=l(a),1},update(a,h){if(!Mn(a,r))return 0;let f=l(a);return t.compare(f,a.values[o])?0:(a.values[o]=f,1)},reconfigure(a,h){let f=Mn(a,i),c=h.config.facets[t.id],u=h.facet(t);if(c&&!f&&fs(e,c))return a.values[o]=u,0;let d=l(a);return t.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const oi=T.define({static:!0});class Zt{constructor(t,e,i,n,r){this.id=t,this.createF=e,this.updateF=i,this.compareF=n,this.spec=r,this.provides=void 0}static define(t){let e=new Zt(hs++,t.create,t.update,t.compare||((i,n)=>i===n),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(oi).find(i=>i.field==this);return(e?.create||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,n)=>{let r=i.values[e],o=this.updateF(r,n);return this.compareF(r,o)?0:(i.values[e]=o,1)},reconfigure:(i,n)=>{let r=i.facet(oi),o=n.facet(oi),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[e]=l.create(i),1):n.config.address[this.id]!=null?(i.values[e]=n.field(this),0):(i.values[e]=this.create(i),1)}}}init(t){return[this,oi.of({field:this,create:t})]}get extension(){return this}}const se={lowest:4,low:3,default:2,high:1,highest:0};function Le(s){return t=>new to(t,s)}const $i={highest:Le(se.highest),high:Le(se.high),default:Le(se.default),low:Le(se.low),lowest:Le(se.lowest)};class to{constructor(t,e){this.inner=t,this.prec=e}get extension(){return this}}class Ui{of(t){return new Tn(this,t)}reconfigure(t){return Ui.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class Tn{constructor(t,e){this.compartment=t,this.inner=e}get extension(){return this}}class Ei{constructor(t,e,i,n,r,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return e==null?t.default:this.staticValues[e>>1]}static resolve(t,e,i){let n=[],r=Object.create(null),o=new Map;for(let u of la(t,e,o))u instanceof Zt?n.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of n)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let f=i?.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=f&&f[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,fs(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=h.length<<1,h.push(y=>m.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(m=>oa(m,p,d))}}let c=h.map(u=>u(l));return new Ei(t,o,c,l,a,r)}}function la(s,t,e){let i=[[],[],[],[],[]],n=new Map;function r(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Tn&&e.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Tn){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=t.get(o.compartment)||o.inner;e.set(o.compartment,h),r(h,l)}else if(o instanceof to)r(o.inner,o.prec);else if(o instanceof Zt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Ci)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,se.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(s,se.default),i.reduce((o,l)=>o.concat(l))}function ze(s,t){if(t&1)return 2;let e=t>>1,i=s.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;s.status[e]=4;let n=s.computeSlot(s,s.config.dynamicSlots[e]);return s.status[e]=2|n}function Ri(s,t){return t&1?s.config.staticValues[t>>1]:s.values[t>>1]}const eo=T.define(),On=T.define({combine:s=>s.some(t=>t),static:!0}),io=T.define({combine:s=>s.length?s[0]:void 0,static:!0}),no=T.define(),so=T.define(),ro=T.define(),oo=T.define({combine:s=>s.length?s[0]:!1});class Re{constructor(t,e){this.type=t,this.value=e}static define(){return new aa}}class aa{of(t){return new Re(this,t)}}class ha{constructor(t){this.map=t}of(t){return new G(this,t)}}class G{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new G(this.type,e)}is(t){return this.type==t}static define(t={}){return new ha(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let r=n.map(e);r&&i.push(r)}return i}}G.reconfigure=G.define();G.appendConfig=G.define();class nt{constructor(t,e,i,n,r,o){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Zr(i,e.newLength),r.some(l=>l.type==nt.time)||(this.annotations=r.concat(nt.time.of(Date.now())))}static create(t,e,i,n,r,o){return new nt(t,e,i,n,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(nt.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}nt.time=Re.define();nt.userEvent=Re.define();nt.addToHistory=Re.define();nt.remote=Re.define();function fa(s,t){let e=[];for(let i=0,n=0;;){let r,o;if(i<s.length&&(n==t.length||t[n]>=s[i]))r=s[i++],o=s[i++];else if(n<t.length)r=t[n++],o=t[n++];else return e;!e.length||e[e.length-1]<r?e.push(r,o):e[e.length-1]<o&&(e[e.length-1]=o)}}function lo(s,t,e){var i;let n,r,o;return e?(n=t.changes,r=J.empty(t.changes.length),o=s.changes.compose(t.changes)):(n=t.changes.map(s.changes),r=s.changes.mapDesc(t.changes,!0),o=s.changes.compose(n)),{changes:o,selection:t.selection?t.selection.map(r):(i=s.selection)===null||i===void 0?void 0:i.map(n),effects:G.mapEffects(s.effects,n).concat(G.mapEffects(t.effects,r)),annotations:s.annotations.length?s.annotations.concat(t.annotations):t.annotations,scrollIntoView:s.scrollIntoView||t.scrollIntoView}}function Dn(s,t,e){let i=t.selection,n=xe(t.annotations);return t.userEvent&&(n=n.concat(nt.userEvent.of(t.userEvent))),{changes:t.changes instanceof J?t.changes:J.of(t.changes||[],e,s.facet(io)),selection:i&&(i instanceof x?i:x.single(i.anchor,i.head)),effects:xe(t.effects),annotations:n,scrollIntoView:!!t.scrollIntoView}}function ao(s,t,e){let i=Dn(s,t.length?t[0]:{},s.doc.length);t.length&&t[0].filter===!1&&(e=!1);for(let r=1;r<t.length;r++){t[r].filter===!1&&(e=!1);let o=!!t[r].sequential;i=lo(i,Dn(s,t[r],o?i.changes.newLength:s.doc.length),o)}let n=nt.create(s,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return ua(e?ca(n):n)}function ca(s){let t=s.startState,e=!0;for(let n of t.facet(no)){let r=n(s);if(r===!1){e=!1;break}Array.isArray(r)&&(e=e===!0?r:fa(e,r))}if(e!==!0){let n,r;if(e===!1)r=s.changes.invertedDesc,n=J.empty(t.doc.length);else{let o=s.changes.filter(e);n=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}s=nt.create(t,n,s.selection&&s.selection.map(r),G.mapEffects(s.effects,r),s.annotations,s.scrollIntoView)}let i=t.facet(so);for(let n=i.length-1;n>=0;n--){let r=i[n](s);r instanceof nt?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof nt?s=r[0]:s=ao(t,xe(r),!1)}return s}function ua(s){let t=s.startState,e=t.facet(ro),i=s;for(let n=e.length-1;n>=0;n--){let r=e[n](s);r&&Object.keys(r).length&&(i=lo(i,Dn(t,r,s.changes.newLength),!0))}return i==s?s:nt.create(t,s.changes,s.selection,i.effects,i.annotations,i.scrollIntoView)}const da=[];function xe(s){return s==null?da:Array.isArray(s)?s:[s]}var Ht=(function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s})(Ht||(Ht={}));const pa=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Bn;try{Bn=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ga(s){if(Bn)return Bn.test(s);for(let t=0;t<s.length;t++){let e=s[t];if(/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||pa.test(e)))return!0}return!1}function ma(s){return t=>{if(!/\S/.test(t))return Ht.Space;if(ga(t))return Ht.Word;for(let e=0;e<s.length;e++)if(t.indexOf(s[e])>-1)return Ht.Word;return Ht.Other}}class H{constructor(t,e,i,n,r,o){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)ze(this,l<<1);this.computeSlot=null}field(t,e=!0){let i=this.config.address[t.id];if(i==null){if(e)throw new RangeError("Field is not present in this state");return}return ze(this,i),Ri(this,i)}update(...t){return ao(this,t,!0)}applyTransaction(t){let e=this.config,{base:i,compartments:n}=e;for(let l of t.effects)l.is(Ui.reconfigure)?(e&&(n=new Map,e.compartments.forEach((a,h)=>n.set(h,a)),e=null),n.set(l.value.compartment,l.value.extension)):l.is(G.reconfigure)?(e=null,i=l.value):l.is(G.appendConfig)&&(e=null,i=xe(i).concat(l.value));let r;e?r=t.startState.values.slice():(e=Ei.resolve(i,n,this),r=new H(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=t.startState.facet(On)?t.newSelection:t.newSelection.asSingle();new H(e,t.newDoc,o,r,(l,a)=>a.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:x.cursor(e.from+t.length,-1)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),r=[i.range],o=xe(i.effects);for(let l=1;l<e.ranges.length;l++){let a=t(e.ranges[l]),h=this.changes(a.changes),f=h.map(n);for(let u=0;u<l;u++)r[u]=r[u].map(f);let c=n.mapDesc(h,!0);r.push(a.range.map(c)),n=n.compose(f),o=G.mapEffects(o,f).concat(G.mapEffects(xe(a.effects),c))}return{changes:n,selection:x.create(r,e.mainIndex),effects:o}}changes(t=[]){return t instanceof J?t:J.of(t,this.doc.length,this.facet(H.lineSeparator))}toText(t){return W.of(t.split(this.facet(H.lineSeparator)||Sn))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return e==null?t.default:(ze(this,e),Ri(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let i in t){let n=t[i];n instanceof Zt&&this.config.address[n.id]!=null&&(e[i]=n.spec.toJSON(this.field(t[i]),this))}return e}static fromJSON(t,e={},i){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(t,r)){let o=i[r],l=t[r];n.push(o.init(a=>o.spec.fromJSON(l,a)))}}return H.create({doc:t.doc,selection:x.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=Ei.resolve(t.extensions||[],new Map),i=t.doc instanceof W?t.doc:W.of((t.doc||"").split(e.staticFacet(H.lineSeparator)||Sn)),n=t.selection?t.selection instanceof x?t.selection:x.single(t.selection.anchor,t.selection.head):x.single(0);return Zr(n,i.length),e.staticFacet(On)||(n=n.asSingle()),new H(e,i,n,e.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(H.tabSize)}get lineBreak(){return this.facet(H.lineSeparator)||`
@@ -11,5 +11,5 @@ import{_ as ee}from"./index-C_gVizDw.js";const Wl=1024;let Hl=0,yt=class{constru
11
11
  `))};if((S.mac||S.android)&&c.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:l,to:a,insert:W.of([i.text.replace("."," ")])}),this.pendingContextChange=c,!t.state.readOnly){let u=this.to-this.from+(c.to-c.from+c.insert.length);ks(t,c,x.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),c.from<c.to&&!c.insert.length&&t.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(e.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(e.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let n=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=t.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,n.push(r)}e.updateCharacterBounds(i.rangeStart,n)},this.handlers.textformatupdate=i=>{let n=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(r.rangeStart),h=this.toEditorPos(r.rangeEnd);if(a<h){let f=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;n.push(U.mark({attributes:{style:f}}).range(a,h))}}}t.dispatch({effects:No.of(U.set(n))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let n=Je(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,n=this.pendingContextChange;return t.changes.iterChanges((r,o,l,a,h)=>{if(i)return;let f=h.length-(o-r);if(n&&o>=n.to)if(n.from==r&&n.to==o&&n.insert.eq(h)){n=this.pendingContextChange=null,e+=f,this.to+=f;return}else n=null,this.revertPending(t.state);if(r+=e,o+=e,o<=this.from)this.from+=f,this.to+=f;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),h.toString()),this.to+=f}e+=f}),n&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),n=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>1e4*3)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class D{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(n=>n.forEach(r=>i(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=t.root||Ba(t.parent)||document,this.viewState=new mr(this,t.state||H.create(t)),t.scrollTo&&t.scrollTo.is(hi)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ye).map(n=>new on(n));for(let n of this.plugins)n.update(this);this.observer=new tf(this),this.inputState=new vh(this),this.inputState.ensureHandlers(this.plugins),this.docView=new nr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((e=document.fonts)===null||e===void 0)&&e.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let e=t.length==1&&t[0]instanceof nt?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,n,r=this.state;for(let u of t){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;t.some(u=>u.annotation(Zo))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=tl(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,f=null;if(h?(this.observer.clearDelayedAndroidKey(),f=this.observer.readChange(),(f&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(f=null)):this.observer.clear(),r.facet(H.phrases)!=this.state.facet(H.phrases))return this.setState(r);n=Wi.create(this,r,t),n.flags|=l;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let u of t){if(c&&(c=c.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection,{x:p,y:g}=this.state.facet(D.cursorScrollMargin);c=new Ce(d.empty?d:x.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",g,p)}for(let d of u.effects)d.is(hi)&&(c=d.value.clip(this.state))}this.viewState.update(n,c),this.bidiCache=Ki.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),e=this.docView.update(n),this.state.facet(He)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(gi)!=n.state.facet(gi)&&(this.viewState.mustMeasureContent=!0),(e||i||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),e&&this.docViewUpdate(),!n.empty)for(let u of this.state.facet(qn))try{u(n)}catch(d){It(this.state,d,"update listener")}(a||f)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),f&&!$o(this,f)&&h.force&&Se(this.contentDOM,h.key,h.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new mr(this,t),this.plugins=t.facet(ye).map(i=>new on(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new nr(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(ye),i=t.state.facet(ye);if(e!=i){let n=[];for(let r of i){let o=e.indexOf(r);if(o<0)n.push(new on(r));else{let l=this.plugins[o];l.mustUpdate=t,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=t&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=t;for(let n=0;n<this.plugins.length;n++)this.plugins[n].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let e=t.value;if(e&&e.docViewUpdate)try{e.docViewUpdate(this)}catch(i){It(this.state,i,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.viewState.scrollParent,n=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:o,scaleY:l}=this.viewState;Math.abs(n-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0){if(wo(i||this.win))r=-1,o=this.viewState.heightMap.height/this.viewState.scaleY;else{let p=this.viewState.scrollAnchorAt(n);r=p.from,o=p.top}l=this.viewState.scaleY}this.updateState=1;let h=this.viewState.measure();if(!h&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];h&4||([this.measureRequests,f]=[f,this.measureRequests]);let c=f.map(p=>{try{return p.read(this)}catch(g){return It(this.state,g),kr}}),u=Wi.create(this,this.state,[]),d=!1;u.flags|=h,e?e.flags|=h:e=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),d=this.docView.update(u),d&&this.docViewUpdate());for(let p=0;p<f.length;p++)if(c[p]!=kr)try{let g=f[p];g.write&&g.write(c[p],this)}catch(g){It(this.state,g)}if(d&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let g=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)/this.viewState.scaleY-o/l;if((g>1||g<-1)&&!(S.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){n=n+g,i?r<0?i.scrollTop=i.scrollHeight:i.scrollTop+=g:this.win.scrollBy(0,g),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let a of this.state.facet(qn))a(e)}get themeClasses(){return Yn+" "+(this.state.facet(Gn)?sl:nl)+" "+this.state.facet(gi)}updateAttrs(){let t=vr(this,Wo,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Wt)?"true":"false",class:"cm-content",style:`${S.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),vr(this,ws,e);let i=this.observer.ignore(()=>{let n=Js(this.contentDOM,this.contentAttrs,e),r=Js(this.dom,this.editorAttrs,t);return n||r});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let n of i.effects)if(n.is(D.announce)){e&&(this.announceDOM.textContent="",this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=" "},200),e=!1);let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(He);let t=this.state.facet(D.cspNonce);Yt.mount(this.root,this.styleModules.concat(Qh).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;e<this.measureRequests.length;e++)if(this.measureRequests[e].key===t.key){this.measureRequests[e]=t;return}}this.measureRequests.push(t)}}plugin(t){let e=this.pluginMap.get(t);return(e===void 0||e&&e.plugin!=t)&&this.pluginMap.set(t,e=this.plugins.find(i=>i.plugin==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return fn(this,t,sr(this,t,e,i))}moveByGroup(t,e){return fn(this,t,sr(this,t,e,i=>uh(this,t.head,i)))}visualLineSide(t,e){return e?x.cursor(t.to,1):x.cursor(t.from,-1)}moveToLineBoundary(t,e,i=!0){return ch(this,t,e,i)}moveVertically(t,e,i){return fn(this,t,dh(this,t,e,i))}domAtPos(t,e=1){return this.docView.domAtPos(t,e)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){this.readMeasured();let i=$n(this,t,e);return i&&i.pos}posAndSideAtCoords(t,e=!0){return this.readMeasured(),$n(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.state.doc.lineAt(t),n=this.bidiSpans(i),r=n[Lt.find(n,t-i.from,-1,e)];return i.length&&(t==i.from&&e<0||t==i.to&&e>0)&&r.dir!=this.textDirectionAt(i.from)&&(t==i.to?(t=i.from+r.from,e=1):(t=i.from+r.to,e=-1)),this.docView.coordsAt(t,e,r.dir==$.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Ro)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>sf)return Ao(t.length);let e=this.textDirectionAt(t.from),i;for(let r of this.bidiCache)if(r.from==t.from&&r.dir==e&&(r.fresh||Co(r.isolates,i=tr(this,t))))return r.order;i||(i=tr(this,t));let n=Ha(t.text,e,i);return this.bidiCache.push(new Ki(t.from,t.to,e,i,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||S.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{bo(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){var i,n,r,o;return hi.of(new Ce(typeof t=="number"?x.cursor(t):t,(i=e.y)!==null&&i!==void 0?i:"nearest",(n=e.x)!==null&&n!==void 0?n:"nearest",(r=e.yMargin)!==null&&r!==void 0?r:5,(o=e.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return hi.of(new Ce(x.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return xt.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return xt.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=Yt.newName(),n=[gi.of(i),He.of(Xn(`.${i}`,t))];return e&&e.dark&&n.push(Gn.of(!0)),n}static baseTheme(t){return $i.lowest(He.of(Xn("."+Yn,t,rl)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&Y.get(i)||Y.get(t);return((e=n?.root)===null||e===void 0?void 0:e.view)||null}}D.styleModule=He;D.inputHandler=Po;D.clipboardInputFilter=ys;D.clipboardOutputFilter=bs;D.scrollHandler=Io;D.focusChangeEffect=Eo;D.perLineTextDirection=Ro;D.exceptionSink=Bo;D.updateListener=qn;D.editable=Wt;D.mouseSelectionStyle=Do;D.dragMovesSelection=Oo;D.clickAddsSelectionRange=To;D.decorations=Xi;D.blockWrappers=Ho;D.outerDecorations=xs;D.atomicRanges=ni;D.bidiIsolatedRanges=Fo;D.cursorScrollMargin=T.define({combine:s=>{let t=5,e=5;for(let i of s)typeof i=="number"?t=e=i:{x:t,y:e}=i;return{x:t,y:e}}});D.scrollMargins=Vo;D.darkTheme=Gn;D.cspNonce=T.define({combine:s=>s.length?s[0]:""});D.contentAttributes=ws;D.editorAttributes=Wo;D.lineWrapping=D.contentAttributes.of({class:"cm-lineWrapping"});D.announce=G.define();const sf=4096,kr={};class Ki{constructor(t,e,i,n,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some(r=>r.fresh))return t;let i=[],n=t.length?t[t.length-1].dir:$.LTR;for(let r=Math.max(0,t.length-10);r<t.length;r++){let o=t[r];o.dir==n&&!e.touchesRange(o.from,o.to)&&i.push(new Ki(e.mapPos(o.from,1),e.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function vr(s,t,e){for(let i=s.state.facet(t),n=i.length-1;n>=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&ps(o,e)}return e}const rf=S.mac?"mac":S.windows?"win":S.linux?"linux":"key";function of(s,t){const e=s.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;a<e.length-1;++a){const h=e[a];if(/^(cmd|meta|m)$/i.test(h))l=!0;else if(/^a(lt)?$/i.test(h))n=!0;else if(/^(c|ctrl|control)$/i.test(h))r=!0;else if(/^s(hift)?$/i.test(h))o=!0;else if(/^mod$/i.test(h))t=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+h)}return n&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function mi(s,t,e){return t.altKey&&(s="Alt-"+s),t.ctrlKey&&(s="Ctrl-"+s),t.metaKey&&(s="Meta-"+s),e!==!1&&t.shiftKey&&(s="Shift-"+s),s}const lf=$i.default(D.domEventHandlers({keydown(s,t){return ll(ol(t.state),s,t,"editor")}})),af=T.define({enables:lf}),Sr=new WeakMap;function ol(s){let t=s.facet(af),e=Sr.get(t);return e||Sr.set(t,e=ff(t.reduce((i,n)=>i.concat(n),[]))),e}function Dc(s,t,e){return ll(ol(s.state),t,s,e)}let $t=null;const hf=4e3;function ff(s,t=rf){let e=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,f)=>{var c,u;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>of(y,t));for(let y=1;y<p.length;y++){let k=p.slice(0,y).join(" ");n(k,!0),d[k]||(d[k]={preventDefault:!0,stopPropagation:!1,run:[w=>{let B=$t={view:w,prefix:k,scope:o};return setTimeout(()=>{$t==B&&($t=null)},hf),!0}]})}let g=p.join(" ");n(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(c=d._any)===null||c===void 0?void 0:c.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),h&&(m.preventDefault=!0),f&&(m.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let f=e[h]||(e[h]=Object.create(null));f._any||(f._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:c}=o;for(let u in f)f[u].run.push(d=>c(d,Jn))}let a=o[t]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return e}let Jn=null;function ll(s,t,e,i){Jn=t;let n=Sa(t),r=sa(n,0),o=ra(r)==n.length&&n!=" ",l="",a=!1,h=!1,f=!1;$t&&$t.view==e&&$t.scope==i&&(l=$t.prefix+" ",Yo.indexOf(t.keyCode)<0&&(h=!0,$t=null));let c=new Set,u=m=>{if(m){for(let y of m.run)if(!c.has(y)&&(c.add(y),y(e)))return m.stopPropagation&&(f=!0),!0;m.preventDefault&&(m.stopPropagation&&(f=!0),h=!0)}return!1},d=s[i],p,g;return d&&(u(d[l+mi(n,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(S.windows&&t.ctrlKey&&t.altKey)&&!(S.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=Xt[t.keyCode])&&p!=n?(u(d[l+mi(p,t,!0)])||t.shiftKey&&(g=Ye[t.keyCode])!=n&&g!=p&&u(d[l+mi(g,t,!1)]))&&(a=!0):o&&t.shiftKey&&u(d[l+mi(n,t,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&f&&t.stopPropagation(),Jn=null,a}class le{constructor(t,e,i,n,r){this.className=t,this.left=e,this.top=i,this.width=n,this.height=r}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let n=t.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let r=al(t);return[new le(e,n.left-r.left,n.top-r.top,null,n.bottom-n.top)]}else return cf(t,e,i)}}function al(s){let t=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==$.LTR?t.left:t.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:t.top-s.scrollDOM.scrollTop*s.scaleY}}function Cr(s,t,e,i){let n=s.coordsAtPos(t,e*2);if(!n)return i;let r=s.dom.getBoundingClientRect(),o=(n.top+n.bottom)/2,l=s.posAtCoords({x:r.left+1,y:o}),a=s.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function cf(s,t,e){if(e.to<=s.viewport.from||e.from>=s.viewport.to)return[];let i=Math.max(e.from,s.viewport.from),n=Math.min(e.to,s.viewport.to),r=s.textDirection==$.LTR,o=s.contentDOM,l=o.getBoundingClientRect(),a=al(s),h=o.querySelector(".cm-line"),f=h&&window.getComputedStyle(h),c=l.left+(f?parseInt(f.paddingLeft)+Math.min(0,parseInt(f.textIndent)):0),u=l.right-(f?parseInt(f.paddingRight):0),d=_n(s,i,1),p=_n(s,n,-1),g=d.type==et.Text?d:null,m=p.type==et.Text?p:null;if(g&&(s.lineWrapping||d.widgetLineBreaks)&&(g=Cr(s,i,1,g)),m&&(s.lineWrapping||p.widgetLineBreaks)&&(m=Cr(s,n,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return k(w(e.from,e.to,g));{let C=g?w(e.from,null,g):B(d,!1),A=m?w(null,e.to,m):B(p,!0),v=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&C.bottom+s.defaultLineHeight/2<A.top?v.push(y(c,C.bottom,u,A.top)):C.bottom<A.top&&s.elementAtHeight((C.bottom+A.top)/2).type==et.Text&&(C.bottom=A.top=(C.bottom+A.top)/2),k(C).concat(v).concat(k(A))}function y(C,A,v,I){return new le(t,C-a.left,A-a.top,Math.max(0,v-C),I-A)}function k({top:C,bottom:A,horizontal:v}){let I=[];for(let E=0;E<v.length;E+=2)I.push(y(v[E],C,v[E+1],A));return I}function w(C,A,v){let I=1e9,E=-1e9,z=[];function P(N,j,rt,ct,At){let Q=s.coordsAtPos(N,N==v.to?-2:2),pt=s.coordsAtPos(rt,rt==v.from?2:-2);!Q||!pt||(I=Math.min(Q.top,pt.top,I),E=Math.max(Q.bottom,pt.bottom,E),At==$.LTR?z.push(r&&j?c:Q.left,r&&ct?u:pt.right):z.push(!r&&ct?c:pt.left,!r&&j?u:Q.right))}let O=C??v.from,F=A??v.to;for(let N of s.visibleRanges)if(N.to>O&&N.from<F)for(let j=Math.max(N.from,O),rt=Math.min(N.to,F);;){let ct=s.state.doc.lineAt(j);for(let At of s.bidiSpans(ct)){let Q=At.from+ct.from,pt=At.to+ct.from;if(Q>=rt)break;pt>j&&P(Math.max(Q,j),C==null&&Q<=O,Math.min(pt,rt),A==null&&pt>=F,At.dir)}if(j=ct.to+1,j>=rt)break}return z.length==0&&P(O,C==null,F,A==null,s.textDirection),{top:I,bottom:E,horizontal:z}}function B(C,A){let v=l.top+(A?C.top:C.bottom);return{top:v,bottom:v,horizontal:[]}}}function uf(s,t){return s.constructor==t.constructor&&s.eq(t)}class df{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(Ti)!=t.state.facet(Ti)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(Ti);for(;e<i.length&&i[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:e}=this.view;(t!=this.scaleX||e!=this.scaleY)&&(this.scaleX=t,this.scaleY=e,this.dom.style.transform=`scale(${1/t}, ${1/e})`)}draw(t){if(t.length!=this.drawn.length||t.some((e,i)=>!uf(e,this.drawn[i]))){let e=this.dom.firstChild,i=0;for(let n of t)n.update&&e&&n.constructor&&this.drawn[i].constructor&&n.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(n.draw(),e);for(;e;){let n=e.nextSibling;e.remove(),e=n}this.drawn=t,S.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Ti=T.define();function hl(s){return[xt.define(t=>new df(t,s)),Ti.of(s)]}const De=T.define({combine(s){return cs(s,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})}});function Bc(s={}){return[De.of(s),pf,gf,yf,Lo.of(!0)]}function fl(s){return s.startState.facet(De)!=s.state.facet(De)}const pf=hl({above:!0,markers(s){let{state:t}=s,e=t.facet(De),i=[];for(let n of t.selection.ranges){let r=n==t.selection.main;if(n.empty||e.drawRangeCursor&&!(r&&S.ios&&e.iosSelectionHandles)){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=n.empty?n:x.cursor(n.head,n.assoc);for(let a of le.forRange(s,o,l))i.push(a)}}return i},update(s,t){s.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let e=fl(s);return e&&Ar(s.state,t),s.docChanged||s.selectionSet||e},mount(s,t){Ar(t.state,s)},class:"cm-cursorLayer"});function Ar(s,t){t.style.animationDuration=s.facet(De).cursorBlinkRate+"ms"}const gf=hl({above:!1,markers(s){let t=[],{main:e,ranges:i}=s.state.selection;for(let n of i)if(!n.empty)for(let r of le.forRange(s,"cm-selectionBackground",n))t.push(r);if(S.ios&&!e.empty&&s.state.facet(De).iosSelectionHandles){for(let n of le.forRange(s,"cm-selectionHandle cm-selectionHandle-start",x.cursor(e.from,1)))t.push(n);for(let n of le.forRange(s,"cm-selectionHandle cm-selectionHandle-end",x.cursor(e.to,1)))t.push(n)}return t},update(s,t){return s.docChanged||s.selectionSet||s.viewportChanged||fl(s)},class:"cm-selectionLayer"}),mf=S.gecko&&S.gecko_version==153?"#ffffff01":"transparent",yf=$i.highest(D.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${mf} !important`},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function Pc(){return wf}const bf=U.line({class:"cm-activeLine"}),wf=xt.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let t=-1,e=[];for(let i of s.state.selection.ranges){let n=s.lineBlockAt(i.head);n.from>t&&(e.push(bf.range(n.from)),t=n.from)}return U.set(e)}},{decorations:s=>s.decorations}),Mr=T.define({combine(s){let t,e;for(let i of s)t=t||i.topContainer,e=e||i.bottomContainer;return{topContainer:t,bottomContainer:e}}});function xf(s,t){let e=s.plugin(cl),i=e?e.specs.indexOf(t):-1;return i>-1?e.panels[i]:null}const cl=xt.fromClass(class{constructor(s){this.input=s.state.facet(Qn),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(e=>e(s));let t=s.state.facet(Mr);this.top=new yi(s,!0,t.topContainer),this.bottom=new yi(s,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(s){let t=s.state.facet(Mr);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new yi(s.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new yi(s.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let e=s.state.facet(Qn);if(e!=this.input){let i=e.filter(a=>a),n=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),f;h<0?(f=a(s.view),l.push(f)):(f=this.panels[h],f.update&&f.update(s)),n.push(f),(f.top?r:o).push(f)}this.specs=i,this.panels=n,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>D.scrollMargins.of(t=>{let e=t.plugin(s);return e&&{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}})});class yi{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Tr(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Tr(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Tr(s){let t=s.nextSibling;return s.remove(),t}const Qn=T.define({enables:cl});function Ec(s,t){let e,i=new Promise(o=>e=o),n=o=>kf(o,t,e);s.state.field(Oi,!1)?s.dispatch({effects:ul.of(n)}):s.dispatch({effects:G.appendConfig.of(Oi.init(()=>[n]))});let r=dl.of(n);return{close:r,result:i.then(o=>((s.win.queueMicrotask||(a=>s.win.setTimeout(a,10)))(()=>{s.state.field(Oi).indexOf(n)>-1&&s.dispatch({effects:r})}),o))}}function Rc(s,t){let e=s.state.field(Oi,!1)||[];for(let i of e){let n=xf(s,i);if(n&&n.dom.classList.contains(t))return n}return null}const Oi=Zt.define({create(){return[]},update(s,t){for(let e of t.effects)e.is(ul)?s=[e.value].concat(s):e.is(dl)&&(s=s.filter(i=>i!=e.value));return s},provide:s=>Qn.computeN([s],t=>t.field(s))}),ul=G.define(),dl=G.define();function kf(s,t,e){let i=t.content?t.content(s,()=>o(null)):null;if(!i){if(i=pe("form"),t.input){let l=pe("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(pe("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(pe("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let n=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l<n.length;l++){let a=n[l];a.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),o(null)):h.keyCode==13&&(h.preventDefault(),o(a))}),a.addEventListener("submit",h=>{h.preventDefault(),o(a)})}let r=pe("div",i,pe("button",{onclick:()=>o(null),"aria-label":s.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(r.className=t.class),r.classList.add("cm-dialog");function o(l){r.contains(r.ownerDocument.activeElement)&&s.focus(),e(l)}return{dom:r,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class Qt extends ae{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Qt.prototype.elementClass="";Qt.prototype.toDOM=void 0;Qt.prototype.mapMode=dt.TrackBefore;Qt.prototype.startSide=Qt.prototype.endSide=-1;Qt.prototype.point=!0;const Di=T.define(),vf=T.define(),Bi=T.define(),Or=T.define({combine:s=>s.some(t=>t)});function Sf(s){return[Cf]}const Cf=xt.fromClass(class{constructor(s){this.view=s,this.domAfter=null,this.prevViewport=s.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=s.state.facet(Bi).map(t=>new Br(s,t)),this.fixed=!s.state.facet(Or);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(s){if(this.updateGutters(s)){let t=this.prevViewport,e=s.view.viewport,i=Math.min(t.to,e.to)-Math.max(t.from,e.from);this.syncGutters(i<(e.to-e.from)*.8)}if(s.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(Or)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=s.view.viewport}syncGutters(s){let t=this.dom.nextSibling;s&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let e=L.iter(this.view.state.facet(Di),this.view.viewport.from),i=[],n=this.gutters.map(r=>new Af(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==et.Text&&o){Zn(e,i,l.from);for(let a of n)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of n)a.widget(this.view,l)}else if(r.type==et.Text){Zn(e,i,r.from);for(let o of n)o.line(this.view,r,i)}else if(r.widget)for(let o of n)o.widget(this.view,r);for(let r of n)r.finish();s&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(s){let t=s.startState.facet(Bi),e=s.state.facet(Bi),i=s.docChanged||s.heightChanged||s.viewportChanged||!L.eq(s.startState.facet(Di),s.state.facet(Di),s.view.viewport.from,s.view.viewport.to);if(t==e)for(let n of this.gutters)n.update(s)&&(i=!0);else{i=!0;let n=[];for(let r of e){let o=t.indexOf(r);o<0?n.push(new Br(this.view,r)):(this.gutters[o].update(s),n.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),n.indexOf(r)<0&&r.destroy();for(let r of n)r.config.side=="after"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=n}return i}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:s=>D.scrollMargins.of(t=>{let e=t.plugin(s);if(!e||e.gutters.length==0||!e.fixed)return null;let i=e.dom.offsetWidth*t.scaleX,n=e.domAfter?e.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==$.LTR?{left:i,right:n}:{right:i,left:n}})});function Dr(s){return Array.isArray(s)?s:[s]}function Zn(s,t,e){for(;s.value&&s.from<=e;)s.from==e&&t.push(s.value),s.next()}class Af{constructor(t,e,i){this.gutter=t,this.height=i,this.i=0,this.cursor=L.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:n}=this,r=(e.top-this.height)/t.scaleY,o=e.height/t.scaleY;if(this.i==n.elements.length){let l=new pl(t,o,r,i);n.elements.push(l),n.dom.appendChild(l.dom)}else n.elements[this.i].update(t,o,r,i);this.height=e.bottom,this.i++}line(t,e,i){let n=[];Zn(this.cursor,n,e.from),i.length&&(n=n.concat(i));let r=this.gutter.config.lineMarker(t,e,n);r&&n.unshift(r);let o=this.gutter;n.length==0&&!o.config.renderEmptyElements||this.addElement(t,e,n)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e),n=i?[i]:null;for(let r of t.state.facet(vf)){let o=r(t,e.widget,e);o&&(n||(n=[])).push(o)}n&&this.addElement(t,e,n)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class Br{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in e.domEventHandlers)this.dom.addEventListener(i,n=>{let r=n.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=n.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);e.domEventHandlers[i](t,l,n)&&n.preventDefault()});this.markers=Dr(e.markers(t)),e.initialSpacer&&(this.spacer=new pl(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=Dr(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let n=this.config.updateSpacer(this.spacer.markers[0],t);n!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[n])}let i=t.view.viewport;return!L.eq(this.markers,e,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class pl{constructor(t,e,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,n)}update(t,e,i,n){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),Mf(this.markers,n)||this.setMarkers(t,n)}setMarkers(t,e){let i="cm-gutterElement",n=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=r<e.length?e[r++]:null,h=!1;if(a){let f=a.elementClass;f&&(i+=" "+f);for(let c=o;c<this.markers.length;c++)if(this.markers[c].compare(a)){l=c,h=!0;break}}else l=this.markers.length;for(;o<l;){let f=this.markers[o++];if(f.toDOM){f.destroy(n);let c=n.nextSibling;n.remove(),n=c}}if(!a)break;a.toDOM&&(h?n=n.nextSibling:this.dom.insertBefore(a.toDOM(t),n)),h&&o++}this.dom.className=i,this.markers=e}destroy(){this.setMarkers(null,[])}}function Mf(s,t){if(s.length!=t.length)return!1;for(let e=0;e<s.length;e++)if(!s[e].compare(t[e]))return!1;return!0}const Tf=T.define(),Of=T.define(),be=T.define({combine(s){return cs(s,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let n in e){let r=i[n],o=e[n];i[n]=r?(l,a,h)=>r(l,a,h)||o(l,a,h):o}return i}})}});class dn extends Qt{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function pn(s,t){return s.state.facet(be).formatNumber(t,s.state)}const Df=Bi.compute([be],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(Tf)},lineMarker(t,e,i){return i.some(n=>n.toDOM)?null:new dn(pn(t,t.state.doc.lineAt(e.from).number))},widgetMarker:(t,e,i)=>{for(let n of t.state.facet(Of)){let r=n(t,e,i);if(r)return r}return null},lineMarkerChange:t=>t.startState.facet(be)!=t.state.facet(be),initialSpacer(t){return new dn(pn(t,Pr(t.state.doc.lines)))},updateSpacer(t,e){let i=pn(e.view,Pr(e.view.state.doc.lines));return i==t.number?t:new dn(i)},domEventHandlers:s.facet(be).domEventHandlers,side:"before"}));function Lc(s={}){return[be.of(s),Sf(),Df]}function Pr(s){let t=9;for(;t<s;)t=t*10+9;return t}const Bf=new class extends Qt{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Pf=Di.compute(["selection"],s=>{let t=[],e=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.head).from;n>e&&(e=n,t.push(Bf.range(n)))}return L.of(t)});function Ic(){return Pf}let Ef=0;class mt{constructor(t,e,i,n){this.name=t,this.set=e,this.base=i,this.modified=n,this.id=Ef++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i=typeof t=="string"?t:"?";if(t instanceof mt&&(e=t),e?.base)throw new Error("Can not derive from a modified tag");let n=new mt(i,[],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(t){let e=new qi(t);return i=>i.modified.indexOf(e)>-1?i:qi.get(i.base||i,i.modified.concat(e).sort((n,r)=>n.id-r.id))}}let Rf=0;class qi{constructor(t){this.name=t,this.instances=[],this.id=Rf++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&Lf(e,l.modified));if(i)return i;let n=[],r=new mt(t.name,n,t,e);for(let l of e)l.instances.push(r);let o=If(e);for(let l of t.set)if(!l.modified.length)for(let a of o)n.push(qi.get(l,a));return r}}function Lf(s,t){return s.length==t.length&&s.every((e,i)=>e==t[i])}function If(s){let t=[[]];for(let e=0;e<s.length;e++)for(let i=0,n=t.length;i<n;i++)t.push(t[i].concat(s[e]));return t.sort((e,i)=>i.length-e.length)}function Nf(s){let t=Object.create(null);for(let e in s){let i=s[e];Array.isArray(i)||(i=[i]);for(let n of e.split(" "))if(n){let r=[],o=2,l=n;for(let c=0;;){if(l=="..."&&c>0&&c+3==n.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+n);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),c+=u[0].length,c==n.length)break;let d=n[c++];if(c==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);l=n.slice(c)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+n);let f=new Ze(i,o,a>0?r.slice(0,a):null);t[h]=f.sort(t[h])}}return gl.add(t)}const gl=new R({combine(s,t){let e,i,n;for(;s||t;){if(!s||t&&s.depth<=t.depth?(n=t,t=t.next):(n=s,s=s.next),e&&e.mode==n.mode&&!n.context&&!e.context)continue;let r=new Ze(n.tags,n.mode,n.context);e?e.next=r:i=r,e=r}return i}});class Ze{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}Ze.empty=new Ze([],2,null);function ml(s,t){let e=Object.create(null);for(let r of s)if(!Array.isArray(r.tag))e[r.tag.id]=r.class;else for(let o of r.tag)e[o.id]=r.class;let{scope:i,all:n=null}=t||{};return{style:r=>{let o=n;for(let l of r)for(let a of l.set){let h=e[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Wf(s,t){let e=null;for(let i of s){let n=i.style(t);n&&(e=e?e+" "+n:n)}return e}function yl(s,t,e,i=0,n=s.length){let r=new Ff(i,Array.isArray(t)?t:[t],e);r.highlightRange(s.cursor(),i,n,"",r.highlighters),r.flush(n)}function Hf(s,t,e,i,n,r=0,o=s.length){let l=r;function a(h,f){if(!(h<=l)){for(let c=s.slice(l,h),u=0;;){let d=c.indexOf(`
12
12
  `,u),p=d<0?c.length:d;if(p>u&&i(c.slice(u,p),f),d<0)break;n(),u=d+1}l=h}}yl(t,e,(h,f,c)=>{a(h,""),a(f,c)},r,o),a(o,"")}class Ff{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=n,f=Vf(t)||Ze.empty,c=Wf(r,f.tags);if(c&&(h&&(h+=" "),h+=c,f.mode==1&&(n+=(n?" ":"")+c)),this.startSpan(Math.max(e,l),h),f.opaque)return;let u=t.tree&&t.tree.prop(R.mounted);if(u&&u.overlay){let d=t.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=t.firstChild();for(let m=0,y=l;;m++){let k=m<u.overlay.length?u.overlay[m]:null,w=k?k.from+l:a,B=Math.max(e,y),C=Math.min(i,w);if(B<C&&g)for(;t.from<C&&(this.highlightRange(t,B,C,n,r),this.startSpan(Math.min(C,t.to),h),!(t.to>=w||!t.nextSibling())););if(!k||w>i)break;y=k.to+l,y>e&&(this.highlightRange(d.cursor(),Math.max(e,k.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}g&&t.parent()}else if(t.firstChild()){u&&(n="");do if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,r),this.startSpan(Math.min(i,t.to),h)}while(t.nextSibling());t.parent()}}}function Vf(s){let t=s.type.prop(gl);for(;t&&t.context&&!s.matchContext(t.context);)t=t.next;return t||null}const b=mt.define,bi=b(),qt=b(),Er=b(qt),Rr=b(qt),jt=b(),wi=b(jt),gn=b(jt),Bt=b(),ie=b(Bt),Ot=b(),Dt=b(),ts=b(),Ne=b(ts),xi=b(),M={comment:bi,lineComment:b(bi),blockComment:b(bi),docComment:b(bi),name:qt,variableName:b(qt),typeName:Er,tagName:b(Er),propertyName:Rr,attributeName:b(Rr),className:b(qt),labelName:b(qt),namespace:b(qt),macroName:b(qt),literal:jt,string:wi,docString:b(wi),character:b(wi),attributeValue:b(wi),number:gn,integer:b(gn),float:b(gn),bool:b(jt),regexp:b(jt),escape:b(jt),color:b(jt),url:b(jt),keyword:Ot,self:b(Ot),null:b(Ot),atom:b(Ot),unit:b(Ot),modifier:b(Ot),operatorKeyword:b(Ot),controlKeyword:b(Ot),definitionKeyword:b(Ot),moduleKeyword:b(Ot),operator:Dt,derefOperator:b(Dt),arithmeticOperator:b(Dt),logicOperator:b(Dt),bitwiseOperator:b(Dt),compareOperator:b(Dt),updateOperator:b(Dt),definitionOperator:b(Dt),typeOperator:b(Dt),controlOperator:b(Dt),punctuation:ts,separator:b(ts),bracket:Ne,angleBracket:b(Ne),squareBracket:b(Ne),paren:b(Ne),brace:b(Ne),content:Bt,heading:ie,heading1:b(ie),heading2:b(ie),heading3:b(ie),heading4:b(ie),heading5:b(ie),heading6:b(ie),contentSeparator:b(Bt),list:b(Bt),quote:b(Bt),emphasis:b(Bt),strong:b(Bt),link:b(Bt),monospace:b(Bt),strikethrough:b(Bt),inserted:b(),deleted:b(),changed:b(),invalid:b(),meta:xi,documentMeta:b(xi),annotation:b(xi),processingInstruction:b(xi),definition:mt.defineModifier("definition"),constant:mt.defineModifier("constant"),function:mt.defineModifier("function"),standard:mt.defineModifier("standard"),local:mt.defineModifier("local"),special:mt.defineModifier("special")};for(let s in M){let t=M[s];t instanceof mt&&(t.name=s)}ml([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var mn;const oe=new R;function bl(s){return T.define({combine:s?t=>t.concat(s):void 0})}const zf=new R;class wt{constructor(t,e,i=[],n=""){this.data=t,this.name=n,H.prototype.hasOwnProperty("tree")||Object.defineProperty(H.prototype,"tree",{get(){return ue(this)}}),this.parser=e,this.extension=[Ee.of(this),H.languageData.of((r,o,l)=>{let a=Lr(r,o,l),h=a.type.prop(oe);if(!h)return[];let f=r.facet(h),c=a.type.prop(zf);if(c){let u=a.resolve(o-a.from,l);for(let d of c)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(f)}}return f})].concat(i)}isActiveAt(t,e,i=-1){return Lr(t,e,i).type.prop(oe)==this.data}findRegions(t){let e=t.facet(Ee);if(e?.data==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(r,o)=>{if(r.prop(oe)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(R.mounted);if(l){if(l.tree.prop(oe)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(n(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<r.children.length;a++){let h=r.children[a];h instanceof q&&n(h,r.positions[a]+o)}};return n(ue(t),0),i}get allowsNesting(){return!0}}wt.setState=G.define();function Lr(s,t,e){let i=s.facet(Ee),n=ue(s).topNode;if(!i||i.allowsNesting)for(let r=n;r;r=r.enter(t,e,V.ExcludeBuffers|V.EnterBracketed))r.type.isTop&&(n=r);return n}class es extends wt{constructor(t,e,i){super(t,e,[],i),this.parser=e}static define(t){let e=bl(t.languageData);return new es(e,t.parser.configure({props:[oe.add(i=>i.isTop?e:void 0)]}),t.name)}configure(t,e){return new es(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ue(s){let t=s.field(wt.state,!1);return t?t.tree:q.empty}class Kf{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let We=null;class Be{constructor(t,e,i=[],n,r,o,l,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Be(t,e,[],q.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Kf(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=q.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let n=Date.now()+t;t=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(Ft.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(e??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(Ft.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=We;We=this;try{return t()}finally{We=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Ir(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((h,f,c,u)=>a.push({fromA:h,toA:f,fromB:c,toB:u})),i=Ft.applyChanges(i,a),n=q.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let f=t.mapPos(h.from,1),c=t.mapPos(h.to,-1);f<c&&l.push({from:f,to:c})}}}return new Be(this.parser,e,i,n,r,o,l,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:n,to:r}=this.skipped[i];n<t.to&&r>t.from&&(this.fragments=Ir(this.fragments,n,r),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends _r{createParse(e,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let a=We;if(a){for(let h of n)a.tempSkipped.push(h);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=o,new q(at.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return We}}function Ir(s,t,e){return Ft.applyChanges(s,[{fromA:t,toA:e,fromB:t,toB:e}])}class Pe{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Pe(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Be.create(t.facet(Ee).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Pe(i)}}wt.state=Zt.define({create:Pe.init,update(s,t){for(let e of t.effects)if(e.is(wt.setState))return e.value;return t.startState.facet(Ee)!=t.state.facet(Ee)?Pe.init(t.state):s.apply(t)}});let wl=s=>{let t=setTimeout(()=>s(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(wl=s=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(s,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const yn=typeof navigator<"u"&&(!((mn=navigator.scheduling)===null||mn===void 0)&&mn.isInputPending)?()=>navigator.scheduling.isInputPending():null,qf=xt.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(wt.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(wt.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=wl(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:n}}=this.view,r=i.field(wt.state);if(r.tree==r.context.tree&&r.context.isDone(n+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!yn?Math.max(25,t.timeRemaining()-5):1e9),l=r.context.treeLen<n&&i.doc.length>n+1e3,a=r.context.work(()=>yn&&yn()||Date.now()>o,n+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:wt.setState.of(new Pe(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>It(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ee=T.define({combine(s){return s.length?s[0]:null},enables:s=>[wt.state,qf,D.contentAttributes.compute([s],t=>{let e=t.facet(s);return e&&e.name?{"data-language":e.name}:{}})]});class Wc{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class xl{constructor(t,e,i,n,r,o=void 0){this.name=t,this.alias=e,this.extensions=i,this.filename=n,this.loadFunc=r,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:e,support:i}=t;if(!e){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(i)}return new xl(t.name,(t.alias||[]).concat(t.name).map(n=>n.toLowerCase()),t.extensions||[],t.filename,e,i)}static matchFilename(t,e){for(let n of t)if(n.filename&&n.filename.test(e))return n;let i=/\.([^.]+)$/.exec(e);if(i){for(let n of t)if(n.extensions.indexOf(i[1])>-1)return n}return null}static matchLanguageName(t,e,i=!0){e=e.toLowerCase();for(let n of t)if(n.alias.some(r=>r==e))return n;if(i)for(let n of t)for(let r of n.alias){let o=e.indexOf(r);if(o>-1&&(r.length>2||!/\w/.test(e[o-1])&&!/\w/.test(e[o+r.length])))return n}return null}}const jf=T.define(),kl=T.define({combine:s=>{if(!s.length)return" ";let t=s[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return t}});function ji(s){let t=s.facet(kl);return t.charCodeAt(0)==9?s.tabSize*t.length:t.length}function _f(s,t){let e="",i=s.tabSize,n=s.facet(kl)[0];if(n==" "){for(;t>=i;)e+=" ",t-=i;n=" "}for(let r=0;r<t;r++)e+=n;return e}function $f(s,t){s instanceof H&&(s=new vl(s));for(let i of s.state.facet(jf)){let n=i(s,t);if(n!==void 0)return n}let e=ue(s.state);return e.length>=t?Uf(s,e,t):null}class vl{constructor(t,e={}){this.state=t,this.options=e,this.unit=ji(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return n!=null&&n>=i.from&&n<=i.to?r&&n==t?{text:"",from:t}:(e<0?n<t:n<=t)?{text:i.text.slice(n-i.from),from:n}:{text:i.text.slice(0,n-i.from),from:i.from}:i}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:i,from:n}=this.lineAt(t,e);return i.slice(t-n,Math.min(i.length,t+100-n))}column(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.countColumn(i,t-n),o=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return ba(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let o=r(n);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Sl=new R;function Uf(s,t,e){let i=t.resolveStack(e),n=t.resolveInner(e,-1).resolve(e,0).enterUnfinishedNodesBefore(e);if(n!=i.node){let r=[];for(let o=n;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return Cl(i,s,e)}function Cl(s,t,e){for(let i=s;i;i=i.next){let n=Yf(i.node);if(n)return n(Cs.create(t,e,i))}return 0}function Gf(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function Yf(s){let t=s.type.prop(Sl);if(t)return t;let e=s.firstChild,i;if(e&&(i=e.type.prop(R.closedBy))){let n=s.lastChild,r=n&&i.indexOf(n.name)>-1;return o=>Al(o,!0,1,void 0,r&&!Gf(o)?n.from:void 0)}return s.parent==null?Xf:null}function Xf(){return 0}class Cs extends vl{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Cs(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Jf(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return Cl(this.context.next,this.base,this.pos)}}function Jf(s,t){for(let e=t;e;e=e.parent)if(s==e)return!0;return!1}function Qf(s){let t=s.node,e=t.childAfter(t.from),i=t.lastChild;if(!e)return null;let n=s.options.simulateBreak,r=s.state.doc.lineAt(e.from),o=n==null||n<=r.from?r.to:Math.min(r.to,n);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(r.text.slice(e.to-r.from))[0].length;return{from:e.from,to:e.to+h}}l=a.to}}function Hc({closing:s,align:t=!0,units:e=1}){return i=>Al(i,t,e,s)}function Al(s,t,e,i,n){let r=s.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||n==s.pos+o,a=t?Qf(s):null;return a?l?s.column(a.from):s.column(a.to):s.baseIndent+(l?0:s.unit*e)}const Fc=s=>s.baseIndent;function Vc({except:s,units:t=1}={}){return e=>{let i=s&&s.test(e.textAfter);return e.baseIndent+(i?0:t*e.unit)}}const Zf=200;function zc(){return H.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let t=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!t.length)return s;let e=s.newDoc,{head:i}=s.newSelection.main,n=e.lineAt(i);if(i>n.from+Zf)return s;let r=e.sliceString(n.from,i);if(!t.some(h=>h.test(r)))return s;let{state:o}=s,l=-1,a=[];for(let{head:h}of o.selection.ranges){let f=o.doc.lineAt(h);if(f.from==l)continue;l=f.from;let c=$f(o,f.from);if(c==null)continue;let u=/^\s*/.exec(f.text)[0],d=_f(o,c);u!=d&&a.push({from:f.from,to:f.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const Kc=T.define(),qc=new R;function jc(s){let t=s.firstChild,e=s.lastChild;return t&&t.to<e.from?{from:t.to,to:e.type.isError?s.to:e.from}:null}class tn{constructor(t,e){this.specs=t;let i;function n(l){let a=Yt.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof e.all=="string"?e.all:e.all?n(e.all):void 0,o=e.scope;this.scope=o instanceof wt?l=>l.prop(oe)==o.data:o?l=>l==o:void 0,this.style=ml(t.map(l=>({tag:l.tag,class:l.class||n(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new Yt(i):null,this.themeType=e.themeType}static define(t,e){return new tn(t,e||{})}}const is=T.define(),tc=T.define({combine(s){return s.length?[s[0]]:null}});function bn(s){let t=s.facet(is);return t.length?t:s.facet(tc)}function _c(s,t){let e=[ic],i;return s instanceof tn&&(s.module&&e.push(D.styleModule.of(s.module)),i=s.themeType),i?e.push(is.computeN([D.darkTheme],n=>n.facet(D.darkTheme)==(i=="dark")?[s]:[])):e.push(is.of(s)),e}class ec{constructor(t){this.markCache=Object.create(null),this.tree=ue(t.state),this.decorations=this.buildDeco(t,bn(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=ue(t.state),i=bn(t.state),n=i!=bn(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<r.to&&!n&&e.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return U.none;let i=new ke;for(let{from:n,to:r}of t.visibleRanges)yl(this.tree,e,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=U.mark({class:a})))},n,r);return i.finish()}}const ic=$i.high(xt.fromClass(ec,{decorations:s=>s.decorations})),nc=D.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ml=1e4,Tl="()[]{}",Ol=T.define({combine(s){return cs(s,{afterCursor:!0,brackets:Tl,maxScanDistance:Ml,renderMatch:oc})}}),sc=U.mark({class:"cm-matchingBracket"}),rc=U.mark({class:"cm-nonmatchingBracket"});function oc(s){let t=[],e=s.matched?sc:rc;return t.push(e.range(s.start.from,s.start.to)),s.end&&t.push(e.range(s.end.from,s.end.to)),t}function Nr(s){let t=[],e=s.facet(Ol);for(let i of s.selection.ranges){if(!i.empty)continue;let n=ki(s,i.head,-1,e)||i.head>0&&ki(s,i.head-1,1,e)||e.afterCursor&&(ki(s,i.head,1,e)||i.head<s.doc.length&&ki(s,i.head+1,-1,e));n&&(t=t.concat(e.renderMatch(n,s)))}return U.set(t,!0)}const lc=xt.fromClass(class{constructor(s){this.paused=!1,this.decorations=Nr(s.state)}update(s){(s.docChanged||s.selectionSet||this.paused)&&(s.view.composing?(this.decorations=this.decorations.map(s.changes),this.paused=!0):(this.decorations=Nr(s.state),this.paused=!1))}},{decorations:s=>s.decorations}),ac=[lc,nc];function $c(s={}){return[Ol.of(s),ac]}const hc=new R;function ns(s,t,e){let i=s.prop(t<0?R.openedBy:R.closedBy);if(i)return i;if(s.name.length==1){let n=e.indexOf(s.name);if(n>-1&&n%2==(t<0?1:0))return[e[n+t]]}return null}function ss(s){let t=s.type.prop(hc);return t?t(s.node):s}function ki(s,t,e,i={}){let n=i.maxScanDistance||Ml,r=i.brackets||Tl,o=ue(s),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let h=ns(a.type,e,r);if(h&&a.from<a.to){let f=ss(a);if(f&&(e>0?t>=f.from&&t<f.to:t>f.from&&t<=f.to))return fc(s,t,e,a,f,h,r)}}return cc(s,t,e,o,l.type,n,r)}function fc(s,t,e,i,n,r,o){let l=i.parent,a={from:n.from,to:n.to},h=0,f=l?.cursor();if(f&&(e<0?f.childBefore(i.from):f.childAfter(i.to)))do if(e<0?f.to<=i.from:f.from>=i.to){if(h==0&&r.indexOf(f.type.name)>-1&&f.from<f.to){let c=ss(f);return{start:a,end:c?{from:c.from,to:c.to}:void 0,matched:!0}}else if(ns(f.type,e,o))h++;else if(ns(f.type,-e,o)){if(h==0){let c=ss(f);return{start:a,end:c&&c.from<c.to?{from:c.from,to:c.to}:void 0,matched:!1}}h--}}while(e<0?f.prevSibling():f.nextSibling());return{start:a,matched:!1}}function cc(s,t,e,i,n,r,o){if(e<0?!t:t==s.doc.length)return null;let l=e<0?s.sliceDoc(t-1,t):s.sliceDoc(t,t+1),a=o.indexOf(l);if(a<0||a%2==0!=e>0)return null;let h={from:e<0?t-1:t,to:e>0?t+1:t},f=s.doc.iterRange(t,e>0?s.doc.length:0),c=0;for(let u=0;!f.next().done&&u<=r;){let d=f.value;e<0&&(u+=d.length);let p=t+u*e;for(let g=e>0?0:d.length-1,m=e>0?d.length:-1;g!=m;g+=e){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=n))if(y%2==0==e>0)c++;else{if(c==1)return{start:h,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};c--}}e>0&&(u+=d.length)}return f.done?{start:h,matched:!1}:null}function Wr(s,t,e,i=0,n=0){t==null&&(t=s.search(/[^\s\u00a0]/),t==-1&&(t=s.length));let r=n;for(let o=i;o<t;o++)s.charCodeAt(o)==9?r+=e-r%e:r++;return r}class Dl{constructor(t,e,i,n){this.string=t,this.tabSize=e,this.indentUnit=i,this.overrideIndent=n,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e=this.string.charAt(this.pos),i;if(typeof t=="string"?i=e==t:i=e&&(t instanceof RegExp?t.test(e):t(e)),i)return++this.pos,e}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Wr(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return(t=this.overrideIndent)!==null&&t!==void 0?t:Wr(this.string,null,this.tabSize)}match(t,e,i){if(typeof t=="string"){let n=o=>i?o.toLowerCase():o,r=this.string.substr(this.pos,t.length);return n(r)==n(t)?(e!==!1&&(this.pos+=t.length),!0):null}else{let n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&e!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function uc(s){return{name:s.name||"",token:s.token,blankLine:s.blankLine||(()=>{}),startState:s.startState||(()=>!0),copyState:s.copyState||dc,indent:s.indent||(()=>null),languageData:s.languageData||{},tokenTable:s.tokenTable||Ms,mergeTokens:s.mergeTokens!==!1}}function dc(s){if(typeof s!="object")return s;let t={};for(let e in s){let i=s[e];t[e]=i instanceof Array?i.slice():i}return t}const Hr=new WeakMap;class Bl extends wt{constructor(t){let e=bl(t.languageData),i=uc(t),n,r=new class extends _r{createParse(o,l,a){return new gc(n,o,l,a)}};super(e,r,[],t.name),this.topNode=bc(e,this),n=this,this.streamParser=i,this.stateAfter=new R({perNode:!0}),this.tokenTable=t.tokenTable?new Ll(i.tokenTable):yc}static define(t){return new Bl(t)}getIndent(t){let e,{overrideIndentation:i}=t.options;i&&(e=Hr.get(t.state),e!=null&&e<t.pos-1e4&&(e=void 0));let n=As(this,t.node.tree,t.node.from,t.node.from,e??t.pos),r,o;if(n?(o=n.state,r=n.pos+1):(o=this.streamParser.startState(t.unit),r=t.node.from),t.pos-r>1e4)return null;for(;r<t.pos;){let a=t.state.doc.lineAt(r),h=Math.min(t.pos,a.to);if(a.length){let f=i?i(a.from):-1,c=new Dl(a.text,t.state.tabSize,t.unit,f<0?void 0:f);for(;c.pos<h-a.from;)El(this.streamParser.token,c,o)}else this.streamParser.blankLine(o,t.unit);if(h==t.pos)break;r=a.to+1}let l=t.lineAt(t.pos);return i&&e==null&&Hr.set(t.state,l.from),this.streamParser.indent(o,/^\s*(.*)/.exec(l.text)[1],t)}get allowsNesting(){return!1}}function As(s,t,e,i,n){let r=e>=i&&e+t.length<=n&&t.prop(s.stateAfter);if(r)return{state:s.streamParser.copyState(r),pos:e+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],a=e+t.positions[o],h=l instanceof q&&a<n&&As(s,l,a,i,n);if(h)return h}return null}function Pl(s,t,e,i,n){if(n&&e<=0&&i>=t.length)return t;!n&&e==0&&t.type==s.topNode&&(n=!0);for(let r=t.children.length-1;r>=0;r--){let o=t.positions[r],l=t.children[r],a;if(o<i&&l instanceof q){if(!(a=Pl(s,l,e-o,i-o,n)))break;return n?new q(t.type,t.children.slice(0,r).concat(a),t.positions.slice(0,r+1),o+a.length):a}}return null}function pc(s,t,e,i,n){for(let r of t){let o=r.from+(r.openStart?25:0),l=r.to-(r.openEnd?25:0),a=o<=e&&l>e&&As(s,r.tree,0-r.offset,e,l),h;if(a&&a.pos<=i&&(h=Pl(s,r.tree,e+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:h}}return{state:s.streamParser.startState(n?ji(n):4),tree:q.empty}}class gc{constructor(t,e,i,n){this.lang=t,this.input=e,this.fragments=i,this.ranges=n,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=n[n.length-1].to;let r=Be.get(),o=n[0].from,{state:l,tree:a}=pc(t,i,o,this.to,r?.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h<a.children.length;h++)this.chunks.push(a.children[h]),this.chunkPos.push(a.positions[h]);r&&this.parsedPos<r.viewport.from-1e5&&n.some(h=>h.from<=r.viewport.from&&h.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(ji(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let t=Be.get(),e=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(e,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos<i;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)e==`
13
13
  `&&(e="");else{let i=e.indexOf(`
14
- `);i>-1&&(e=e.slice(0,i))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let n=this.rangeIndex;;){let r=this.ranges[n].to;if(r>=i||(e=e.slice(0,r-(i-e.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,l=this.lineAfter(o);e+=l,i=o+l.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let n=this.ranges[this.rangeIndex].to,r=t+e;if(i>0?n>r:n>=r)break;let o=this.ranges[++this.rangeIndex].from;e+=o-n}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,i,n){let r=4;if(this.ranges.length>1){n=this.skipGapsTo(e,n,1),e+=n;let l=this.chunk.length;n=this.skipGapsTo(i,n,-1),i+=n,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==e?this.chunk[o+2]=i:this.chunk.push(t,e,i,r),n}parseLine(t){let{line:e,end:i}=this.nextLine(),n=0,{streamParser:r}=this.lang,o=new Dl(e,t?t.state.tabSize:4,t?ji(t.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=El(r.token,o,this.state);if(l&&(n=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=q.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:mc,topID:0,maxBufferLength:512,reused:this.chunkReused});t=new q(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new q(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function El(s,t,e){t.start=t.pos;for(let i=0;i<10;i++){let n=s(t,e);if(t.pos>t.start)return n}throw new Error("Stream parser failed to advance stream.")}const Ms=Object.create(null),ti=[at.none],mc=new rs(ti),Fr=[],Vr=Object.create(null),Rl=Object.create(null);for(let[s,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Rl[s]=Il(Ms,t);class Ll{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),Rl)}resolve(t){return t?this.table[t]||(this.table[t]=Il(this.extra,t)):0}}const yc=new Ll(Ms);function wn(s,t){Fr.indexOf(s)>-1||(Fr.push(s),console.warn(t))}function Il(s,t){let e=[];for(let l of t.split(" ")){let a=[];for(let h of l.split(".")){let f=s[h]||M[h];f?typeof f=="function"?a.length?a=a.map(f):wn(h,`Modifier ${h} used at start of tag`):a.length?wn(h,`Tag ${h} used as modifier`):a=Array.isArray(f)?f:[f]:wn(h,`Unknown highlighting tag ${h}`)}for(let h of a)e.push(h)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),n=i+" "+e.map(l=>l.id),r=Vr[n];if(r)return r.id;let o=Vr[n]=at.define({id:ti.length,name:i,props:[Nf({[i]:e})]});return ti.push(o),o.id}function bc(s,t){let e=at.define({id:ti.length,name:"Document",props:[oe.add(()=>s),Sl.add(()=>i=>t.getIndent(i))],top:!0});return ti.push(e),e}$.RTL,$.LTR;const _i=tn.define([{tag:[M.keyword,M.operatorKeyword,M.modifier],color:"var(--harvestgold)"},{tag:[M.string,M.special(M.string)],color:"var(--honey)"},{tag:[M.number,M.bool,M.null,M.atom],color:"var(--daybreak)"},{tag:[M.propertyName,M.attributeName,M.definition(M.variableName)],color:"var(--orange)"},{tag:[M.comment,M.lineComment,M.blockComment],color:"var(--pumpkin-pie)",fontStyle:"italic"},{tag:[M.heading,M.strong],color:"var(--butter)",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.link,color:"var(--harvestgold)",textDecoration:"underline"},{tag:M.monospace,color:"var(--honey)"},{tag:[M.meta,M.processingInstruction],color:"var(--pumpkin-pie)"},{tag:M.list,color:"var(--orange)"},{tag:M.invalid,color:"var(--state-error)"}]),wc=512*1024;async function Nl(s){switch(s.toLowerCase()){case".json":return(await ee(async()=>{const{json:t}=await import("./index-6xVu8SR3.js");return{json:t}},__vite__mapDeps([0,1,2,3]),import.meta.url)).json();case".yaml":case".yml":return(await ee(async()=>{const{yaml:t}=await import("./index-BJhuEfhB.js");return{yaml:t}},__vite__mapDeps([4,1,2,3]),import.meta.url)).yaml();case".md":case".markdown":return(await ee(async()=>{const{markdown:t}=await import("./index-Ds1IEeoY.js");return{markdown:t}},__vite__mapDeps([5,6,1,7,2,3]),import.meta.url)).markdown();case".adoc":case".asciidoc":case".asc":return(await ee(async()=>{const{asciidoc:t}=await import("./asciidoc-BQO4iSvH.js");return{asciidoc:t}},__vite__mapDeps([8,2,3]),import.meta.url)).asciidoc;case".py":return(await ee(async()=>{const{python:t}=await import("./index-DijpRmkl.js");return{python:t}},__vite__mapDeps([9,1,6,2,3]),import.meta.url)).python();case".js":case".mjs":case".cjs":return(await ee(async()=>{const{javascript:t}=await import("./index-CwoRnDne.js");return{javascript:t}},__vite__mapDeps([7,1,6,2,3]),import.meta.url)).javascript();case".ts":case".mts":return(await ee(async()=>{const{javascript:t}=await import("./index-CwoRnDne.js");return{javascript:t}},__vite__mapDeps([7,1,6,2,3]),import.meta.url)).javascript({typescript:!0});default:return null}}async function xc(s){return await Nl(s)??[]}let zr=!1;function kc(){if(zr||_i.module===null)return;const s=document.createElement("style");s.dataset.syntax="colours",s.textContent=_i.module.getRules(),document.head.appendChild(s),zr=!0}async function vc(s,t){if(s.length>wc)return null;const e=await Nl(t);if(e===null)return null;const i="language"in e?e.language:e;kc();const n=document.createDocumentFragment();return Hf(s,i.parser.parse(s),_i,(r,o)=>{if(o===""){n.append(r);return}const l=document.createElement("span");l.className=o,l.textContent=r,n.append(l)},()=>{n.append(`
14
+ `);i>-1&&(e=e.slice(0,i))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let n=this.rangeIndex;;){let r=this.ranges[n].to;if(r>=i||(e=e.slice(0,r-(i-e.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,l=this.lineAfter(o);e+=l,i=o+l.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let n=this.ranges[this.rangeIndex].to,r=t+e;if(i>0?n>r:n>=r)break;let o=this.ranges[++this.rangeIndex].from;e+=o-n}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,i,n){let r=4;if(this.ranges.length>1){n=this.skipGapsTo(e,n,1),e+=n;let l=this.chunk.length;n=this.skipGapsTo(i,n,-1),i+=n,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==e?this.chunk[o+2]=i:this.chunk.push(t,e,i,r),n}parseLine(t){let{line:e,end:i}=this.nextLine(),n=0,{streamParser:r}=this.lang,o=new Dl(e,t?t.state.tabSize:4,t?ji(t.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=El(r.token,o,this.state);if(l&&(n=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=q.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:mc,topID:0,maxBufferLength:512,reused:this.chunkReused});t=new q(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new q(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function El(s,t,e){t.start=t.pos;for(let i=0;i<10;i++){let n=s(t,e);if(t.pos>t.start)return n}throw new Error("Stream parser failed to advance stream.")}const Ms=Object.create(null),ti=[at.none],mc=new rs(ti),Fr=[],Vr=Object.create(null),Rl=Object.create(null);for(let[s,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Rl[s]=Il(Ms,t);class Ll{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),Rl)}resolve(t){return t?this.table[t]||(this.table[t]=Il(this.extra,t)):0}}const yc=new Ll(Ms);function wn(s,t){Fr.indexOf(s)>-1||(Fr.push(s),console.warn(t))}function Il(s,t){let e=[];for(let l of t.split(" ")){let a=[];for(let h of l.split(".")){let f=s[h]||M[h];f?typeof f=="function"?a.length?a=a.map(f):wn(h,`Modifier ${h} used at start of tag`):a.length?wn(h,`Tag ${h} used as modifier`):a=Array.isArray(f)?f:[f]:wn(h,`Unknown highlighting tag ${h}`)}for(let h of a)e.push(h)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),n=i+" "+e.map(l=>l.id),r=Vr[n];if(r)return r.id;let o=Vr[n]=at.define({id:ti.length,name:i,props:[Nf({[i]:e})]});return ti.push(o),o.id}function bc(s,t){let e=at.define({id:ti.length,name:"Document",props:[oe.add(()=>s),Sl.add(()=>i=>t.getIndent(i))],top:!0});return ti.push(e),e}$.RTL,$.LTR;const _i=tn.define([{tag:[M.keyword,M.operatorKeyword,M.modifier],color:"var(--harvestgold)"},{tag:[M.string,M.special(M.string)],color:"var(--honey)"},{tag:[M.number,M.bool,M.null,M.atom],color:"var(--daybreak)"},{tag:[M.propertyName,M.attributeName,M.definition(M.variableName)],color:"var(--orange)"},{tag:[M.comment,M.lineComment,M.blockComment],color:"var(--pumpkin-pie)",fontStyle:"italic"},{tag:[M.heading,M.strong],color:"var(--butter)",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.link,color:"var(--harvestgold)",textDecoration:"underline"},{tag:M.monospace,color:"var(--honey)"},{tag:[M.meta,M.processingInstruction],color:"var(--pumpkin-pie)"},{tag:M.list,color:"var(--orange)"},{tag:M.invalid,color:"var(--state-error)"}]),wc=512*1024;async function Nl(s){switch(s.toLowerCase()){case".json":return(await ee(async()=>{const{json:t}=await import("./index-Bqm_Hovd.js");return{json:t}},__vite__mapDeps([0,1,2,3]),import.meta.url)).json();case".yaml":case".yml":return(await ee(async()=>{const{yaml:t}=await import("./index-Dio0XCm2.js");return{yaml:t}},__vite__mapDeps([4,1,2,3]),import.meta.url)).yaml();case".md":case".markdown":return(await ee(async()=>{const{markdown:t}=await import("./index-BdNdXhQP.js");return{markdown:t}},__vite__mapDeps([5,6,1,7,2,3]),import.meta.url)).markdown();case".adoc":case".asciidoc":case".asc":return(await ee(async()=>{const{asciidoc:t}=await import("./asciidoc-RQ_qptF1.js");return{asciidoc:t}},__vite__mapDeps([8,2,3]),import.meta.url)).asciidoc;case".py":return(await ee(async()=>{const{python:t}=await import("./index-VyT6mhra.js");return{python:t}},__vite__mapDeps([9,1,6,2,3]),import.meta.url)).python();case".js":case".mjs":case".cjs":return(await ee(async()=>{const{javascript:t}=await import("./index-Da-AnxRT.js");return{javascript:t}},__vite__mapDeps([7,1,6,2,3]),import.meta.url)).javascript();case".ts":case".mts":return(await ee(async()=>{const{javascript:t}=await import("./index-Da-AnxRT.js");return{javascript:t}},__vite__mapDeps([7,1,6,2,3]),import.meta.url)).javascript({typescript:!0});default:return null}}async function xc(s){return await Nl(s)??[]}let zr=!1;function kc(){if(zr||_i.module===null)return;const s=document.createElement("style");s.dataset.syntax="colours",s.textContent=_i.module.getRules(),document.head.appendChild(s),zr=!0}async function vc(s,t){if(s.length>wc)return null;const e=await Nl(t);if(e===null)return null;const i="language"in e?e.language:e;kc();const n=document.createDocumentFragment();return Hf(s,i.parser.parse(s),_i,(r,o)=>{if(o===""){n.append(r);return}const l=document.createElement("span");l.className=o,l.textContent=r,n.append(l)},()=>{n.append(`
15
15
  `)}),n}const Uc=Object.freeze(Object.defineProperty({__proto__:null,HIGHLIGHT:_i,language_resolve:xc,sourceSpans_build:vc},Symbol.toStringTag,{value:"Module"}));export{qc as $,Re as A,Lc as B,J as C,$ as D,D as E,T as F,Ic as G,Bc as H,vl as I,zc as J,$c as K,Pc as L,_c as M,R as N,af as O,$i as P,_i as Q,ke as R,Zt as S,nt as T,Nf as U,xt as V,M as W,Wc as X,es as Y,Sl as Z,Vc as _,x as a,jc as a0,Hc as a1,_r as a2,at as a3,mt as a4,rs as a5,q as a6,Mc as a7,Ac as a8,V as a9,hc as aa,Kc as ab,wt as ac,bl as ad,oe as ae,xl as af,Be as ag,Bl as ah,zf as ai,Fc as aj,dt as ak,Yi as al,ae as am,Wl as an,Uc as ao,G as b,cs as c,Vt as d,ba as e,W as f,$f as g,vt as h,_f as i,ji as j,kl as k,xf as l,ki as m,Rc as n,Ec as o,U as p,Qn as q,sa as r,ue as s,ra as t,Ht as u,H as v,Tc as w,pe as x,Dc as y,xc as z};
package/dist/build.json CHANGED
@@ -1 +1 @@
1
- {"git":"4b0b492b","built":"2026-11-03 13:19"}
1
+ {"git":"2e21a9ea","built":"2026-11-03 17:13"}
package/dist/index.html CHANGED
@@ -19,8 +19,8 @@
19
19
  href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap"
20
20
  rel="stylesheet"
21
21
  />
22
- <script type="module" crossorigin src="./assets/index-C_gVizDw.js"></script>
23
- <link rel="stylesheet" crossorigin href="./assets/index-CmyfI33v.css">
22
+ <script type="module" crossorigin src="./assets/index-Bx9on2--.js"></script>
23
+ <link rel="stylesheet" crossorigin href="./assets/index-D8wX84LU.css">
24
24
  </head>
25
25
  <body>
26
26
  <!-- ARGUS's own four sounds, synthesised rather than borrowed