@volter/model-editor 0.5.66

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 (160) hide show
  1. package/BUNDLED_NOTICES +6748 -0
  2. package/LICENSE +686 -0
  3. package/LICENSE-BLENDER +1409 -0
  4. package/LICENSE-MCP +21 -0
  5. package/NOTICE +20 -0
  6. package/dist/.vite/manifest.json +1954 -0
  7. package/dist/assets/AudioViewer-CRWsJVYN.js +1 -0
  8. package/dist/assets/BVHLoader-xUHWsz84.js +1 -0
  9. package/dist/assets/ColladaLoader-Ccy_gHsu.js +3 -0
  10. package/dist/assets/EntityModelDocument-Dal8YnLK.js +1 -0
  11. package/dist/assets/EnvironmentAssetDocument-DFOFYX5v.js +1 -0
  12. package/dist/assets/FBXLoader-Dh0pOBW2.js +1 -0
  13. package/dist/assets/GameplaySessionTimeline-HJLZUV4Q.js +142 -0
  14. package/dist/assets/ImageViewer-BzqBpqL-.js +1 -0
  15. package/dist/assets/InspectorCanvasPreview-CLDhscy0.js +1 -0
  16. package/dist/assets/InspectorObjectPreview-BUZEp4xS.js +1 -0
  17. package/dist/assets/JsonAssetDocument-DCkqRS0N.js +2 -0
  18. package/dist/assets/LineSegments2-C8H20K8w.js +370 -0
  19. package/dist/assets/LiveModuleDocument-CuOBVz3A.js +2 -0
  20. package/dist/assets/LutAssetDocument-IyEir1rq.js +1 -0
  21. package/dist/assets/MTLLoader-C-rA0fNF.js +2 -0
  22. package/dist/assets/ModelAssetDocument-DNStNyCc.js +1 -0
  23. package/dist/assets/NonThreeAuthoringBootstrap-BE15Wpmw.js +2 -0
  24. package/dist/assets/OBJLoader-CopWRneC.js +5 -0
  25. package/dist/assets/Object3DDocumentToolbar-5Dv_8caG.js +1 -0
  26. package/dist/assets/Object3DPreview-C09u9uQZ.js +2 -0
  27. package/dist/assets/OnlineAssetDetail-DOPUI1iu.js +1 -0
  28. package/dist/assets/OrbitControls-DrFzvAAB.js +1 -0
  29. package/dist/assets/PLYLoader-D_esTZ2f.js +2 -0
  30. package/dist/assets/QuarksAssetDocument-BbSJ970L.js +2 -0
  31. package/dist/assets/RectAreaLightUniformsLib-u1ciScuw.js +1 -0
  32. package/dist/assets/STLLoader-Cl5I0sAi.js +1 -0
  33. package/dist/assets/ShaderAssetDocument-qlLeb2S3.js +12 -0
  34. package/dist/assets/SourceAssetViewer-DwhuqbA4.js +1 -0
  35. package/dist/assets/StageHost-D-o8MsFS.js +1122 -0
  36. package/dist/assets/TDSLoader-KKBg8ef1.js +1 -0
  37. package/dist/assets/ToolObject3DPreview-ILbch3kN.js +1 -0
  38. package/dist/assets/Toolbar-DYJjJKTt.js +1 -0
  39. package/dist/assets/TransientHint-D94hsJSR.js +1 -0
  40. package/dist/assets/VideoViewer-Bx3FPbgE.js +1 -0
  41. package/dist/assets/ViewportShadingMenu-B3N6hSdN.js +1 -0
  42. package/dist/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
  43. package/dist/assets/agx-base-srgb-BjWZJgrZ.lut +0 -0
  44. package/dist/assets/agx-look-medium-high-contrast-D5F_ob1L.lut +0 -0
  45. package/dist/assets/agx-look-punchy-dxsnycNs.lut +0 -0
  46. package/dist/assets/animation-mixers.service-N9HxGOMf.js +1 -0
  47. package/dist/assets/asset-editor-persistence-DGD05u26.js +1 -0
  48. package/dist/assets/blender-emscripten-engine-CEsWgnR7.js +2 -0
  49. package/dist/assets/blender-node-editor.document-BT2M622g.js +1 -0
  50. package/dist/assets/blender-properties-tab-C5tUuCSv.js +3 -0
  51. package/dist/assets/blender-runtime-host-4ufXy47O.js +4 -0
  52. package/dist/assets/blender-runtime-skin-DMq0XAvO.js +7138 -0
  53. package/dist/assets/blender-runtime.document-DeFQQsF6.js +8 -0
  54. package/dist/assets/blender-timeline.document-BnlSdxy0.js +1 -0
  55. package/dist/assets/blender-uv-editor.document-UC-XeNn0.js +1 -0
  56. package/dist/assets/blender-version.status-BZP39oH7.js +1 -0
  57. package/dist/assets/blender-wali-engine-D3iKpzn9.js +2 -0
  58. package/dist/assets/blender.command-IGP5wuda.js +1 -0
  59. package/dist/assets/blender.environment-CG-pC7sk.js +1 -0
  60. package/dist/assets/blender.keymap-GAQgeklK.js +1 -0
  61. package/dist/assets/blender.status-ujwGU6dU.js +1 -0
  62. package/dist/assets/blender.style-CxfbTFcE.js +1 -0
  63. package/dist/assets/browserAll-2r3AVaAO.js +14 -0
  64. package/dist/assets/canvas-preview-frames-CO60PDM7.js +5 -0
  65. package/dist/assets/city-EkhAOo5s.exr +0 -0
  66. package/dist/assets/client-DNXj_opT.js +25 -0
  67. package/dist/assets/clip-planes-CnAI6DZn.js +1 -0
  68. package/dist/assets/courtyard-DqlebbpC.exr +0 -0
  69. package/dist/assets/editor-presentation-activity-C7SNSmTd.js +1 -0
  70. package/dist/assets/filmic-srgb-Ct35FIH6.lut +0 -0
  71. package/dist/assets/forest-P_CQY3b_.exr +0 -0
  72. package/dist/assets/hosted-asset-materialization-BXM49Qkc.js +2 -0
  73. package/dist/assets/index-B4bmKkgY.css +1 -0
  74. package/dist/assets/index-BP6wv2A0.js +5 -0
  75. package/dist/assets/index-Bge9JUr6.js +1 -0
  76. package/dist/assets/index-BncK9THk.js +1 -0
  77. package/dist/assets/index-BtfYaG4D.js +952 -0
  78. package/dist/assets/index-CJbYy-CF.js +3 -0
  79. package/dist/assets/index-CanA16PU.js +2 -0
  80. package/dist/assets/index-CinJrH5C.js +9 -0
  81. package/dist/assets/index-CtzuWnCS.js +1 -0
  82. package/dist/assets/index-D2LwEE0L.js +562 -0
  83. package/dist/assets/index-DUqP1RMl.js +1 -0
  84. package/dist/assets/index-D_NuPfjr.js +9 -0
  85. package/dist/assets/index-DaQZGF7d.js +1 -0
  86. package/dist/assets/index-DgapqSPi.js +7 -0
  87. package/dist/assets/index-IEjydI9d.js +1 -0
  88. package/dist/assets/index-cpXNKgvz.js +1498 -0
  89. package/dist/assets/index-gHZae-lw.js +13 -0
  90. package/dist/assets/interior-Bo_lba15.exr +0 -0
  91. package/dist/assets/jsx-runtime-DPjLkJKQ.js +9 -0
  92. package/dist/assets/live-mixers-BRkRHd6g.js +1 -0
  93. package/dist/assets/material-preview.view-DqNcpd_b.js +1 -0
  94. package/dist/assets/model-inspection-JC6gbV8Q.js +1 -0
  95. package/dist/assets/model.layout-BpZE1W9V.js +1 -0
  96. package/dist/assets/models.finder-BplPGS4I.js +1 -0
  97. package/dist/assets/night-CvV4Gybt.exr +0 -0
  98. package/dist/assets/product-CfZaqLpw.js +1 -0
  99. package/dist/assets/properties-bone-constraints.inspector-Di8kNtAi.js +1 -0
  100. package/dist/assets/properties-bone.inspector-CqAIKNsE.js +1 -0
  101. package/dist/assets/properties-collection.inspector-DpHC_fXW.js +1 -0
  102. package/dist/assets/properties-constraints.inspector-C7G7NOZU.js +1 -0
  103. package/dist/assets/properties-data.inspector-D1sUUst6.js +1 -0
  104. package/dist/assets/properties-material.inspector-BUSjc8tl.js +1 -0
  105. package/dist/assets/properties-modifiers.inspector-Sq9bcfFz.js +1 -0
  106. package/dist/assets/properties-object.inspector-BzqiU_29.js +1 -0
  107. package/dist/assets/properties-output.inspector-BWpFqvfT.js +1 -0
  108. package/dist/assets/properties-particles.inspector-DO1KoaTz.js +1 -0
  109. package/dist/assets/properties-physics.inspector-BgkrTNSA.js +1 -0
  110. package/dist/assets/properties-render.inspector-BU5NOVoQ.js +1 -0
  111. package/dist/assets/properties-scene.inspector-DbMErJ48.js +1 -0
  112. package/dist/assets/properties-texture.inspector-toPpEwqp.js +1 -0
  113. package/dist/assets/properties-view-layer.inspector-COpx9iEK.js +1 -0
  114. package/dist/assets/properties-world.inspector-CxU0DrYX.js +1 -0
  115. package/dist/assets/react-18-DyywM-Z2.js +1 -0
  116. package/dist/assets/react-story-board-B9V-j_Y5.js +1 -0
  117. package/dist/assets/react-three-rapier.esm-CN6t4A7c.js +1 -0
  118. package/dist/assets/regions-DWeEBnE2.js +1 -0
  119. package/dist/assets/sculpt.layout-D-K5cLw6.js +1 -0
  120. package/dist/assets/session-CsR0lApe.js +4886 -0
  121. package/dist/assets/shading.layout-CZZHKBer.js +1 -0
  122. package/dist/assets/sky-precompute-worker-ChN7J87v.js +1 -0
  123. package/dist/assets/spark.module-gG1EsWx8.js +12120 -0
  124. package/dist/assets/stage-keyboard-CzlqI0nh.js +1 -0
  125. package/dist/assets/stage-overlay-set-DQeskS16.js +1 -0
  126. package/dist/assets/stage-presence-markers-S1lMOwIa.js +1 -0
  127. package/dist/assets/stage-transform-tools-Cqtv-ZQ1.js +1 -0
  128. package/dist/assets/story-capture-DmIUyEQn.js +1 -0
  129. package/dist/assets/story-mount-turn-2IYGgHob.js +1 -0
  130. package/dist/assets/story-pixi-preview-aw8xQhvF.js +1 -0
  131. package/dist/assets/story-three-preview-DDmMjlI8.js +37 -0
  132. package/dist/assets/studio-CysTBGIb.exr +0 -0
  133. package/dist/assets/sunrise-Dj0psFrf.exr +0 -0
  134. package/dist/assets/sunset-Bw3x2Bot.exr +0 -0
  135. package/dist/assets/texture.layout-DASpHVht.js +1 -0
  136. package/dist/assets/three.module-ZILb6uB7.js +3840 -0
  137. package/dist/assets/transform-mode-request-DSPwviXs.js +1 -0
  138. package/dist/assets/uv-editing.layout-A8RA-cbM.js +1 -0
  139. package/dist/assets/vgai-shared-fontawesome-CFSkqz69.js +1 -0
  140. package/dist/assets/vgai-shared-jsx-dev-runtime-DFDKL7fx.js +1 -0
  141. package/dist/assets/vgai-shared-jsx-runtime-DIqBpTut.js +1 -0
  142. package/dist/assets/vgai-shared-react-CdM3D1mG.js +1 -0
  143. package/dist/assets/vgai-shared-react-dom-DFajMqMT.js +1 -0
  144. package/dist/assets/vgai-shared-react-dom-client-S0ozfl6_.js +1 -0
  145. package/dist/assets/vgai-shared-three-DzfWDqlp.js +1 -0
  146. package/dist/assets/viewport-pick-context-DkawXbEi.js +1 -0
  147. package/dist/assets/viewport-surface-status-DuININWe.js +20 -0
  148. package/dist/assets/webworkerAll-CqQUotBj.js +101 -0
  149. package/dist/assets/worker-B7zhIsFh.js +2 -0
  150. package/dist/assets/world-documents-DkBqH8VU.js +3 -0
  151. package/dist/vgai-shared-react.json +10 -0
  152. package/dist/vgai-shared-three.json +3 -0
  153. package/dist-node/cli.js +19722 -0
  154. package/dist-node/create.js +14102 -0
  155. package/package.json +61 -0
  156. package/presets.mjs +2 -0
  157. package/src/contributions.d.ts +4 -0
  158. package/src/index.ts +10 -0
  159. package/starter/cube.blend +0 -0
  160. package/starter/cube.py +81 -0
@@ -0,0 +1,3 @@
1
+ import{countColumn as An,EditorState as yt,Facet as Q,StateEffect as jt,RangeSetBuilder as ne,RangeSet as Fe,StateField as je,Prec as We,combineConfig as He}from"./index-BP6wv2A0.js";import{V as Pt,d as Pn,D as R,E as U,S as Se,b as _t,G as Tn,W as Ue,l as Nn}from"./index-DgapqSPi.js";const In=1024;let Bn=0;class Ut{constructor(t,e){this.from=t,this.to=e}}class y{constructor(t={}){this.id=Bn++,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=L.match(t)),e=>{let n=t(e);return n===void 0?null:[this,n]}}}y.closedBy=new y({deserialize:r=>r.split(" ")});y.openedBy=new y({deserialize:r=>r.split(" ")});y.group=new y({deserialize:r=>r.split(" ")});y.isolate=new y({deserialize:r=>{if(r&&r!="rtl"&&r!="ltr"&&r!="auto")throw new RangeError("Invalid value for isolate: "+r);return r||"auto"}});y.contextHash=new y({perNode:!0});y.lookAhead=new y({perNode:!0});y.mounted=new y({perNode:!0});class xt{constructor(t,e,n,i=!1){this.tree=t,this.overlay=e,this.parser=n,this.bracketed=i}static get(t){return t&&t.props&&t.props[y.mounted.id]}}const On=Object.create(null);class L{constructor(t,e,n,i=0){this.name=t,this.props=e,this.id=n,this.flags=i}static define(t){let e=t.props&&t.props.length?Object.create(null):On,n=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new L(t.name||"",e,t.id,n);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[s[0].id]=s[1]}}return i}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(y.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let n in t)for(let i of n.split(" "))e[i]=t[n];return n=>{for(let i=n.prop(y.group),s=-1;s<(i?i.length:0);s++){let l=e[s<0?n.name:i[s]];if(l)return l}}}}L.none=new L("",Object.create(null),0,8);class re{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 n of this.types){let i=null;for(let s of t){let l=s(n);if(l){i||(i=Object.assign({},n.props));let o=l[1],a=l[0];a.combine&&a.id in i&&(o=a.combine(i[a.id],o)),i[a.id]=o}}e.push(i?new L(n.name,i,n.id,n.flags):n)}return new re(e)}}const Bt=new WeakMap,Ce=new WeakMap;var I;(function(r){r[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays",r[r.EnterBracketed=16]="EnterBracketed"})(I||(I={}));class C{constructor(t,e,n,i,s){if(this.type=t,this.children=e,this.positions=n,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[l,o]of s)this.props[typeof l=="number"?l:l.id]=o}}toString(){let t=xt.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let n of this.children){let i=n.toString();i&&(e&&(e+=","),e+=i)}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 Qt(this.topNode,t)}cursorAt(t,e=0,n=0){let i=Bt.get(this)||this.topNode,s=new Qt(i);return s.moveTo(t,e),Bt.set(this,s._tree),s}get topNode(){return new _(this,0,0,null)}resolve(t,e=0){let n=wt(Bt.get(this)||this.topNode,t,e,!1);return Bt.set(this,n),n}resolveInner(t,e=0){let n=wt(Ce.get(this)||this.topNode,t,e,!0);return Ce.set(this,n),n}resolveStack(t,e=0){return En(this,t,e)}iterate(t){let{enter:e,leave:n,from:i=0,to:s=this.length}=t,l=t.mode||0,o=(l&I.IncludeAnonymous)>0;for(let a=this.cursor(l|I.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=i&&(!o&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(o||!a.type.isAnonymous)&&n(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:le(L.none,this.children,this.positions,0,this.children.length,0,this.length,(e,n,i)=>new C(this.type,e,n,i,this.propValues),t.makeTree||((e,n,i)=>new C(L.none,e,n,i)))}static build(t){return Rn(t)}}C.empty=new C(L.none,[],[],0);class ie{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 ie(this.buffer,this.index)}}class it{constructor(t,e,n){this.buffer=t,this.length=e,this.set=n}get type(){return L.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],n=this.buffer[t+3],i=this.set.types[e],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),t+=4,n==t)return s;let l=[];for(;t<n;)l.push(this.childString(t)),t=this.buffer[t+3];return s+"("+l.join(",")+")"}findChild(t,e,n,i,s){let{buffer:l}=this,o=-1;for(let a=t;a!=e&&!(Ve(s,i,l[a+1],l[a+2])&&(o=a,n>0));a=l[a+3]);return o}slice(t,e,n){let i=this.buffer,s=new Uint16Array(e-t),l=0;for(let o=t,a=0;o<e;){s[a++]=i[o++],s[a++]=i[o++]-n;let h=s[a++]=i[o++]-n;s[a++]=i[o++]-t,l=Math.max(l,h)}return new it(s,l,this.set)}}function Ve(r,t,e,n){switch(r){case-2:return e<t;case-1:return n>=t&&e<t;case 0:return e<t&&n>t;case 1:return e<=t&&n>t;case 2:return n>t;case 4:return!0}}function wt(r,t,e,n){for(var i;r.from==r.to||(e<1?r.from>=t:r.from>t)||(e>-1?r.to<=t:r.to<t);){let l=!n&&r instanceof _&&r.index<0?null:r.parent;if(!l)return r;r=l}let s=n?0:I.IgnoreOverlays;if(n)for(let l=r,o=l.parent;o;l=o,o=l.parent)l instanceof _&&l.index<0&&((i=o.enter(t,e,s))===null||i===void 0?void 0:i.from)!=l.from&&(r=o);for(;;){let l=r.enter(t,e,s);if(!l)return r;r=l}}class $e{cursor(t=0){return new Qt(this,t)}getChild(t,e=null,n=null){let i=Ae(this,t,e,n);return i.length?i[0]:null}getChildren(t,e=null,n=null){return Ae(this,t,e,n)}resolve(t,e=0){return wt(this,t,e,!1)}resolveInner(t,e=0){return wt(this,t,e,!0)}matchContext(t){return Kt(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),n=this;for(;e;){let i=e.lastChild;if(!i||i.to!=e.to)break;i.type.isError&&i.from==i.to?(n=e,e=i.prevSibling):e=i}return n}get node(){return this}get next(){return this.parent}}class _ extends $e{constructor(t,e,n,i){super(),this._tree=t,this.from=e,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,n,i,s=0){for(let l=this;;){for(let{children:o,positions:a}=l._tree,h=e>0?o.length:-1;t!=h;t+=e){let f=o[t],d=a[t]+l.from,g;if(!(!(s&I.EnterBracketed&&f instanceof C&&(g=xt.get(f))&&!g.overlay&&g.bracketed&&n>=d&&n<=d+f.length)&&!Ve(i,n,d,d+f.length))){if(f instanceof it){if(s&I.ExcludeBuffers)continue;let k=f.findChild(0,f.buffer.length,e,n-d,i);if(k>-1)return new K(new Dn(l,f,t,d),null,k)}else if(s&I.IncludeAnonymous||!f.type.isAnonymous||se(f)){let k;if(!(s&I.IgnoreMounts)&&(k=xt.get(f))&&!k.overlay)return new _(k.tree,d,t,l);let w=new _(f,d,t,l);return s&I.IncludeAnonymous||!w.type.isAnonymous?w:w.nextChild(e<0?f.children.length-1:0,e,n,i,s)}}}if(s&I.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?t=l.index+e:t=e<0?-1:l._parent._tree.children.length,l=l._parent,!l))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,n=0){let i;if(!(n&I.IgnoreOverlays)&&(i=xt.get(this._tree))&&i.overlay){let s=t-this.from,l=n&I.EnterBracketed&&i.bracketed;for(let{from:o,to:a}of i.overlay)if((e>0||l?o<=s:o<s)&&(e<0||l?a>=s:a>s))return new _(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,n)}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 Ae(r,t,e,n){let i=r.cursor(),s=[];if(!i.firstChild())return s;if(e!=null){for(let l=!1;!l;)if(l=i.type.is(e),!i.nextSibling())return s}for(;;){if(n!=null&&i.type.is(n))return s;if(i.type.is(t)&&s.push(i.node),!i.nextSibling())return n==null?s:[]}}function Kt(r,t,e=t.length-1){for(let n=r;e>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(t[e]&&t[e]!=n.name)return!1;e--}}return!0}class Dn{constructor(t,e,n,i){this.parent=t,this.buffer=e,this.index=n,this.start=i}}class K extends $e{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,n){super(),this.context=t,this._parent=e,this.index=n,this.type=t.buffer.set.types[t.buffer.buffer[n]]}child(t,e,n){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],t,e-this.context.start,n);return s<0?null:new K(this.context,this,s)}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,n=0){if(n&I.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return s<0?null:new K(this.context,this,s)}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 K(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 K(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:n}=this.context,i=this.index+4,s=n.buffer[this.index+3];if(s>i){let l=n.buffer[this.index+1];t.push(n.slice(i,s,l)),e.push(0)}return new C(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function qe(r){if(!r.length)return null;let t=0,e=r[0];for(let s=1;s<r.length;s++){let l=r[s];(l.from>e.from||l.to<e.to)&&(e=l,t=s)}let n=e instanceof _&&e.index<0?null:e.parent,i=r.slice();return n?i[t]=n:i.splice(t,1),new Mn(i,e)}class Mn{constructor(t,e){this.heads=t,this.node=e}get next(){return qe(this.heads)}}function En(r,t,e){let n=r.resolveInner(t,e),i=null;for(let s=n instanceof _?n:n.context.parent;s;s=s.parent)if(s.index<0){let l=s.parent;(i||(i=[n])).push(l.resolve(t,e)),s=l}else{let l=xt.get(s.tree);if(l&&l.overlay&&l.overlay[0].from<=t&&l.overlay[l.overlay.length-1].to>=t){let o=new _(l.tree,l.overlay[0].from+s.from,-1,s);(i||(i=[n])).push(wt(o,t,e,!1))}}return i?qe(i):n}class Qt{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&~I.EnterBracketed,t instanceof _)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let n=t._parent;n;n=n._parent)this.stack.unshift(n.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:n,buffer:i}=this.buffer;return this.type=e||i.set.types[i.buffer[t]],this.from=n+i.buffer[t+1],this.to=n+i.buffer[t+2],!0}yield(t){return t?t instanceof _?(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,n){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,n,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],t,e-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}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,n=this.mode){return this.buffer?n&I.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&I.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&I.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,n=this.stack.length-1;if(t<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(e.findChild(i,this.index,-1,0,4))}else{let i=e.buffer[this.index+3];if(i<(n<0?e.buffer.length:e.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<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,n,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:e,parent:n}=i)}else({index:e,_parent:n}=this._tree);for(;n;{index:e,_parent:n}=n)if(e>-1)for(let s=e+t,l=t<0?-1:n._tree.children.length;s!=l;s+=t){let o=n._tree.children[s];if(this.mode&I.IncludeAnonymous||o instanceof it||!o.type.isAnonymous||se(o))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,n=0;if(t&&t.context==this.buffer)t:for(let i=this.index,s=this.stack.length;s>=0;){for(let l=t;l;l=l._parent)if(l.index==i){if(i==this.index)return l;e=l,n=s+1;break t}i=this.stack[--s]}for(let i=n;i<this.stack.length;i++)e=new K(this.buffer,e,this.stack[i]);return this.bufferNode=new K(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let n=0;;){let i=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&e&&e(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(t){if(!this.buffer)return Kt(this.node.parent,t);let{buffer:e}=this.buffer,{types:n}=e.set;for(let i=t.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return Kt(this._tree,t,i);let l=n[e.buffer[this.stack[s]]];if(!l.isAnonymous){if(t[i]&&t[i]!=l.name)return!1;i--}}return!0}}function se(r){return r.children.some(t=>t instanceof it||!t.type.isAnonymous||se(t))}function Rn(r){var t;let{buffer:e,nodeSet:n,maxBufferLength:i=In,reused:s=[],minRepeatType:l=n.types.length}=r,o=Array.isArray(e)?new ie(e,e.length):e,a=n.types,h=0,f=0;function d(x,A,p,T,v,N){let{id:b,start:m,end:S,size:P}=o,D=f,tt=h;if(P<0)if(o.next(),P==-1){let X=s[b];p.push(X),T.push(m-x);return}else if(P==-3){h=b;return}else if(P==-4){f=b;return}else throw new RangeError(`Unrecognized record size: ${P}`);let gt=a[b],Nt,st,we=m-x;if(S-m<=i&&(st=j(o.pos-A,v))){let X=new Uint16Array(st.size-st.skip),W=o.pos-st.size,$=X.length;for(;o.pos>W;)$=M(st.start,X,$);Nt=new it(X,S-st.start,n),we=st.start-x}else{let X=o.pos-P;o.next();let W=[],$=[],lt=b>=l?b:-1,ut=0,It=S;for(;o.pos>X;)lt>=0&&o.id==lt&&o.size>=0?(o.end<=It-i&&(w(W,$,m,ut,o.end,It,lt,D,tt),ut=W.length,It=o.end),o.next()):N>2500?g(m,X,W,$):d(m,X,W,$,lt,N+1);if(lt>=0&&ut>0&&ut<W.length&&w(W,$,m,ut,m,It,lt,D,tt),W.reverse(),$.reverse(),lt>-1&&ut>0){let ve=k(gt,tt);Nt=le(gt,W,$,0,W.length,0,S-m,ve,ve)}else Nt=O(gt,W,$,S-m,D-S,tt)}p.push(Nt),T.push(we)}function g(x,A,p,T){let v=[],N=0,b=-1;for(;o.pos>A;){let{id:m,start:S,end:P,size:D}=o;if(D>4)o.next();else{if(b>-1&&S<b)break;b<0&&(b=P-i),v.push(m,S,P),N++,o.next()}}if(N){let m=new Uint16Array(N*4),S=v[v.length-2];for(let P=v.length-3,D=0;P>=0;P-=3)m[D++]=v[P],m[D++]=v[P+1]-S,m[D++]=v[P+2]-S,m[D++]=D;p.push(new it(m,v[2]-S,n)),T.push(S-x)}}function k(x,A){return(p,T,v)=>{let N=0,b=p.length-1,m,S;if(b>=0&&(m=p[b])instanceof C){if(!b&&m.type==x&&m.length==v)return m;(S=m.prop(y.lookAhead))&&(N=T[b]+m.length+S)}return O(x,p,T,v,N,A)}}function w(x,A,p,T,v,N,b,m,S){let P=[],D=[];for(;x.length>T;)P.push(x.pop()),D.push(A.pop()+p-v);x.push(O(n.types[b],P,D,N-v,m-N,S)),A.push(v-p)}function O(x,A,p,T,v,N,b){if(N){let m=[y.contextHash,N];b=b?[m].concat(b):[m]}if(v>25){let m=[y.lookAhead,v];b=b?[m].concat(b):[m]}return new C(x,A,p,T,b)}function j(x,A){let p=o.fork(),T=0,v=0,N=0,b=p.end-i,m={size:0,start:0,skip:0};t:for(let S=p.pos-x;p.pos>S;){let P=p.size;if(p.id==A&&P>=0){m.size=T,m.start=v,m.skip=N,N+=4,T+=4,p.next();continue}let D=p.pos-P;if(P<0||D<S||p.start<b)break;let tt=p.id>=l?4:0,gt=p.start;for(p.next();p.pos>D;){if(p.size<0)if(p.size==-3||p.size==-4)tt+=4;else break t;else p.id>=l&&(tt+=4);p.next()}v=gt,T+=P,N+=tt}return(A<0||T==x)&&(m.size=T,m.start=v,m.skip=N),m.size>4?m:void 0}function M(x,A,p){let{id:T,start:v,end:N,size:b}=o;if(o.next(),b>=0&&T<l){let m=p;if(b>4){let S=o.pos-(b-4);for(;o.pos>S;)p=M(x,A,p)}A[--p]=m,A[--p]=N-x,A[--p]=v-x,A[--p]=T}else b==-3?h=T:b==-4&&(f=T);return p}let F=[],B=[];for(;o.pos>0;)d(r.start||0,r.bufferStart||0,F,B,-1,0);let V=(t=r.length)!==null&&t!==void 0?t:F.length?B[0]+F[0].length:0;return new C(a[r.topID],F.reverse(),B.reverse(),V)}const Pe=new WeakMap;function Et(r,t){if(!r.isAnonymous||t instanceof it||t.type!=r)return 1;let e=Pe.get(t);if(e==null){e=1;for(let n of t.children){if(n.type!=r||!(n instanceof C)){e=1;break}e+=Et(r,n)}Pe.set(t,e)}return e}function le(r,t,e,n,i,s,l,o,a){let h=0;for(let w=n;w<i;w++)h+=Et(r,t[w]);let f=Math.ceil(h*1.5/8),d=[],g=[];function k(w,O,j,M,F){for(let B=j;B<M;){let V=B,x=O[B],A=Et(r,w[B]);for(B++;B<M;B++){let p=Et(r,w[B]);if(A+p>=f)break;A+=p}if(B==V+1){if(A>f){let p=w[V];k(p.children,p.positions,0,p.children.length,O[V]+F);continue}d.push(w[V])}else{let p=O[B-1]+w[B-1].length-x;d.push(le(r,w,O,V,B,x,p,null,a))}g.push(x+F-s)}}return k(t,e,n,i,0),(o||a)(d,g,l)}class Kr{constructor(){this.map=new WeakMap}setBuffer(t,e,n){let i=this.map.get(t);i||this.map.set(t,i=new Map),i.set(e,n)}getBuffer(t,e){let n=this.map.get(t);return n&&n.get(e)}set(t,e){t instanceof K?this.setBuffer(t.context.buffer,t.index,e):t instanceof _&&this.map.set(t.tree,e)}get(t){return t instanceof K?this.getBuffer(t.context.buffer,t.index):t instanceof _?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 at{constructor(t,e,n,i,s=!1,l=!1){this.from=t,this.to=e,this.tree=n,this.offset=i,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],n=!1){let i=[new at(0,t.length,t,0,!1,n)];for(let s of e)s.to>t.length&&i.push(s);return i}static applyChanges(t,e,n=128){if(!e.length)return t;let i=[],s=1,l=t.length?t[0]:null;for(let o=0,a=0,h=0;;o++){let f=o<e.length?e[o]:null,d=f?f.fromA:1e9;if(d-a>=n)for(;l&&l.from<d;){let g=l;if(a>=g.from||d<=g.to||h){let k=Math.max(g.from,a)-h,w=Math.min(g.to,d)-h;g=k>=w?null:new at(k,w,g.tree,g.offset+h,o>0,!!f)}if(g&&i.push(g),l.to>d)break;l=s<t.length?t[s++]:null}if(!f)break;a=f.toA,h=f.toA-f.toB}return i}}class Ge{startParse(t,e,n){return typeof t=="string"&&(t=new _n(t)),n=n?n.length?n.map(i=>new Ut(i.from,i.to)):[new Ut(0,0)]:[new Ut(0,t.length)],this.createParse(t,e||[],n)}parse(t,e,n){let i=this.startParse(t,e,n);for(;;){let s=i.advance();if(s)return s}}}class _n{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)}}new y({perNode:!0});let Ln=0;class H{constructor(t,e,n,i){this.name=t,this.set=e,this.base=n,this.modified=i,this.id=Ln++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let n=typeof t=="string"?t:"?";if(t instanceof H&&(e=t),e?.base)throw new Error("Can not derive from a modified tag");let i=new H(n,[],null,[]);if(i.set.push(i),e)for(let s of e.set)i.set.push(s);return i}static defineModifier(t){let e=new Lt(t);return n=>n.modified.indexOf(e)>-1?n:Lt.get(n.base||n,n.modified.concat(e).sort((i,s)=>i.id-s.id))}}let zn=0;class Lt{constructor(t){this.name=t,this.instances=[],this.id=zn++}static get(t,e){if(!e.length)return t;let n=e[0].instances.find(o=>o.base==t&&Fn(e,o.modified));if(n)return n;let i=[],s=new H(t.name,i,t,e);for(let o of e)o.instances.push(s);let l=jn(e);for(let o of t.set)if(!o.modified.length)for(let a of l)i.push(Lt.get(o,a));return s}}function Fn(r,t){return r.length==t.length&&r.every((e,n)=>e==t[n])}function jn(r){let t=[[]];for(let e=0;e<r.length;e++)for(let n=0,i=t.length;n<i;n++)t.push(t[n].concat(r[e]));return t.sort((e,n)=>n.length-e.length)}function Wn(r){let t=Object.create(null);for(let e in r){let n=r[e];Array.isArray(n)||(n=[n]);for(let i of e.split(" "))if(i){let s=[],l=2,o=i;for(let d=0;;){if(o=="..."&&d>0&&d+3==i.length){l=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!g)throw new RangeError("Invalid path: "+i);if(s.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),d+=g[0].length,d==i.length)break;let k=i[d++];if(d==i.length&&k=="!"){l=0;break}if(k!="/")throw new RangeError("Invalid path: "+i);o=i.slice(d)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+i);let f=new vt(n,l,a>0?s.slice(0,a):null);t[h]=f.sort(t[h])}}return Je.add(t)}const Je=new y({combine(r,t){let e,n,i;for(;r||t;){if(!r||t&&r.depth>=t.depth?(i=t,t=t.next):(i=r,r=r.next),e&&e.mode==i.mode&&!i.context&&!e.context)continue;let s=new vt(i.tags,i.mode,i.context);e?e.next=s:n=s,e=s}return n}});class vt{constructor(t,e,n,i){this.tags=t,this.mode=e,this.context=n,this.next=i}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}}vt.empty=new vt([],2,null);function Ke(r,t){let e=Object.create(null);for(let s of r)if(!Array.isArray(s.tag))e[s.tag.id]=s.class;else for(let l of s.tag)e[l.id]=s.class;let{scope:n,all:i=null}=t||{};return{style:s=>{let l=i;for(let o of s)for(let a of o.set){let h=e[a.id];if(h){l=l?l+" "+h:h;break}}return l},scope:n}}function Hn(r,t){let e=null;for(let n of r){let i=n.style(t);i&&(e=e?e+" "+i:i)}return e}function Un(r,t,e,n=0,i=r.length){let s=new Vn(n,Array.isArray(t)?t:[t],e);s.highlightRange(r.cursor(),n,i,"",s.highlighters),s.flush(i)}class Vn{constructor(t,e,n){this.at=t,this.highlighters=e,this.span=n,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,n,i,s){let{type:l,from:o,to:a}=t;if(o>=n||a<=e)return;l.isTop&&(s=this.highlighters.filter(k=>!k.scope||k.scope(l)));let h=i,f=$n(t)||vt.empty,d=Hn(s,f.tags);if(d&&(h&&(h+=" "),h+=d,f.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(e,o),h),f.opaque)return;let g=t.tree&&t.tree.prop(y.mounted);if(g&&g.overlay){let k=t.node.enter(g.overlay[0].from+o,1),w=this.highlighters.filter(j=>!j.scope||j.scope(g.tree.type)),O=t.firstChild();for(let j=0,M=o;;j++){let F=j<g.overlay.length?g.overlay[j]:null,B=F?F.from+o:a,V=Math.max(e,M),x=Math.min(n,B);if(V<x&&O)for(;t.from<x&&(this.highlightRange(t,V,x,i,s),this.startSpan(Math.min(x,t.to),h),!(t.to>=B||!t.nextSibling())););if(!F||B>n)break;M=F.to+o,M>e&&(this.highlightRange(k.cursor(),Math.max(e,F.from+o),Math.min(n,M),"",w),this.startSpan(Math.min(n,M),h))}O&&t.parent()}else if(t.firstChild()){g&&(i="");do if(!(t.to<=e)){if(t.from>=n)break;this.highlightRange(t,e,n,i,s),this.startSpan(Math.min(n,t.to),h)}while(t.nextSibling());t.parent()}}}function $n(r){let t=r.type.prop(Je);for(;t&&t.context&&!r.matchContext(t.context);)t=t.next;return t||null}const u=H.define,Ot=u(),et=u(),Te=u(et),Ne=u(et),nt=u(),Dt=u(nt),Vt=u(nt),J=u(),ot=u(J),q=u(),G=u(),Xt=u(),mt=u(Xt),Mt=u(),c={comment:Ot,lineComment:u(Ot),blockComment:u(Ot),docComment:u(Ot),name:et,variableName:u(et),typeName:Te,tagName:u(Te),propertyName:Ne,attributeName:u(Ne),className:u(et),labelName:u(et),namespace:u(et),macroName:u(et),literal:nt,string:Dt,docString:u(Dt),character:u(Dt),attributeValue:u(Dt),number:Vt,integer:u(Vt),float:u(Vt),bool:u(nt),regexp:u(nt),escape:u(nt),color:u(nt),url:u(nt),keyword:q,self:u(q),null:u(q),atom:u(q),unit:u(q),modifier:u(q),operatorKeyword:u(q),controlKeyword:u(q),definitionKeyword:u(q),moduleKeyword:u(q),operator:G,derefOperator:u(G),arithmeticOperator:u(G),logicOperator:u(G),bitwiseOperator:u(G),compareOperator:u(G),updateOperator:u(G),definitionOperator:u(G),typeOperator:u(G),controlOperator:u(G),punctuation:Xt,separator:u(Xt),bracket:mt,angleBracket:u(mt),squareBracket:u(mt),paren:u(mt),brace:u(mt),content:J,heading:ot,heading1:u(ot),heading2:u(ot),heading3:u(ot),heading4:u(ot),heading5:u(ot),heading6:u(ot),contentSeparator:u(J),list:u(J),quote:u(J),emphasis:u(J),strong:u(J),link:u(J),monospace:u(J),strikethrough:u(J),inserted:u(),deleted:u(),changed:u(),invalid:u(),meta:Mt,documentMeta:u(Mt),annotation:u(Mt),processingInstruction:u(Mt),definition:H.defineModifier("definition"),constant:H.defineModifier("constant"),function:H.defineModifier("function"),standard:H.defineModifier("standard"),local:H.defineModifier("local"),special:H.defineModifier("special")};for(let r in c){let t=c[r];t instanceof H&&(t.name=r)}Ke([{tag:c.link,class:"tok-link"},{tag:c.heading,class:"tok-heading"},{tag:c.emphasis,class:"tok-emphasis"},{tag:c.strong,class:"tok-strong"},{tag:c.keyword,class:"tok-keyword"},{tag:c.atom,class:"tok-atom"},{tag:c.bool,class:"tok-bool"},{tag:c.url,class:"tok-url"},{tag:c.labelName,class:"tok-labelName"},{tag:c.inserted,class:"tok-inserted"},{tag:c.deleted,class:"tok-deleted"},{tag:c.literal,class:"tok-literal"},{tag:c.string,class:"tok-string"},{tag:c.number,class:"tok-number"},{tag:[c.regexp,c.escape,c.special(c.string)],class:"tok-string2"},{tag:c.variableName,class:"tok-variableName"},{tag:c.local(c.variableName),class:"tok-variableName tok-local"},{tag:c.definition(c.variableName),class:"tok-variableName tok-definition"},{tag:c.special(c.variableName),class:"tok-variableName2"},{tag:c.definition(c.propertyName),class:"tok-propertyName tok-definition"},{tag:c.typeName,class:"tok-typeName"},{tag:c.namespace,class:"tok-namespace"},{tag:c.className,class:"tok-className"},{tag:c.macroName,class:"tok-macroName"},{tag:c.propertyName,class:"tok-propertyName"},{tag:c.operator,class:"tok-operator"},{tag:c.comment,class:"tok-comment"},{tag:c.meta,class:"tok-meta"},{tag:c.invalid,class:"tok-invalid"},{tag:c.punctuation,class:"tok-punctuation"}]);var $t;const rt=new y;function oe(r){return Q.define({combine:r?t=>t.concat(r):void 0})}const Qe=new y;class E{constructor(t,e,n=[],i=""){this.data=t,this.name=i,yt.prototype.hasOwnProperty("tree")||Object.defineProperty(yt.prototype,"tree",{get(){return z(this)}}),this.parser=e,this.extension=[Y.of(this),yt.languageData.of((s,l,o)=>{let a=Ie(s,l,o),h=a.type.prop(rt);if(!h)return[];let f=s.facet(h),d=a.type.prop(Qe);if(d){let g=a.resolve(l-a.from,o);for(let k of d)if(k.test(g,s)){let w=s.facet(k.facet);return k.type=="replace"?w:w.concat(f)}}return f})].concat(n)}isActiveAt(t,e,n=-1){return Ie(t,e,n).type.prop(rt)==this.data}findRegions(t){let e=t.facet(Y);if(e?.data==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[],i=(s,l)=>{if(s.prop(rt)==this.data){n.push({from:l,to:l+s.length});return}let o=s.prop(y.mounted);if(o){if(o.tree.prop(rt)==this.data){if(o.overlay)for(let a of o.overlay)n.push({from:a.from+l,to:a.to+l});else n.push({from:l,to:l+s.length});return}else if(o.overlay){let a=n.length;if(i(o.tree,o.overlay[0].from+l),n.length>a)return}}for(let a=0;a<s.children.length;a++){let h=s.children[a];h instanceof C&&i(h,s.positions[a]+l)}};return i(z(t),0),n}get allowsNesting(){return!0}}E.setState=jt.define();function Ie(r,t,e){let n=r.facet(Y),i=z(r).topNode;if(!n||n.allowsNesting)for(let s=i;s;s=s.enter(t,e,I.ExcludeBuffers|I.EnterBracketed))s.type.isTop&&(i=s);return i}class zt extends E{constructor(t,e,n){super(t,e,[],n),this.parser=e}static define(t){let e=oe(t.languageData);return new zt(e,t.parser.configure({props:[rt.add(n=>n.isTop?e:void 0)]}),t.name)}configure(t,e){return new zt(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function z(r){let t=r.field(E.state,!1);return t?t.tree:C.empty}function Xe(r,t,e=50){var n;let i=(n=r.field(E.state,!1))===null||n===void 0?void 0:n.context;if(!i)return null;let s=i.viewport;i.updateViewport({from:0,to:t});let l=i.isDone(t)||i.work(e,t)?i.tree:null;return i.updateViewport(s),l}function qn(r,t=r.doc.length){var e;return((e=r.field(E.state,!1))===null||e===void 0?void 0:e.context.isDone(t))||!1}function Gn(r,t=r.viewport.to,e=100){let n=Xe(r.state,t,e);return n!=z(r.state)&&r.dispatch({}),!!n}function Jn(r){var t;return((t=r.plugin(tn))===null||t===void 0?void 0:t.isWorking())||!1}class Ye{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 n=this.cursorPos-this.string.length;return t<n||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}}let kt=null;class ht{constructor(t,e,n=[],i,s,l,o,a){this.parser=t,this.state=e,this.fragments=n,this.tree=i,this.treeLen=s,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,n){return new ht(t,e,[],C.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Ye(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=C.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}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 i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(at.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=i,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(at.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=kt;kt=this;try{return t()}finally{kt=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Be(t,e.from,e.to);return t}changes(t,e){let{fragments:n,tree:i,treeLen:s,viewport:l,skipped:o}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((h,f,d,g)=>a.push({fromA:h,toA:f,fromB:d,toB:g})),n=at.applyChanges(n,a),i=C.empty,s=0,l={from:t.mapPos(l.from,-1),to:t.mapPos(l.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let f=t.mapPos(h.from,1),d=t.mapPos(h.to,-1);f<d&&o.push({from:f,to:d})}}}return new ht(this.parser,e,n,i,s,l,o,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 n=0;n<this.skipped.length;n++){let{from:i,to:s}=this.skipped[n];i<t.to&&s>t.from&&(this.fragments=Be(this.fragments,i,s),this.skipped.splice(n--,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 Ge{createParse(e,n,i){let s=i[0].from,l=i[i.length-1].to;return{parsedPos:s,advance(){let a=kt;if(a){for(let h of i)a.tempSkipped.push(h);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=l,new C(L.none,[],[],l-s)},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 kt}}function Be(r,t,e){return at.applyChanges(r,[{fromA:t,toA:e,fromB:t,toB:e}])}class ct{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),n=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,n)||e.takeTree(),new ct(e)}static init(t){let e=Math.min(3e3,t.doc.length),n=ht.create(t.facet(Y).parser,t,{from:0,to:e});return n.work(20,e)||n.takeTree(),new ct(n)}}E.state=je.define({create:ct.init,update(r,t){for(let e of t.effects)if(e.is(E.setState))return e.value;return t.startState.facet(Y)!=t.state.facet(Y)?ct.init(t.state):r.apply(t)}});let Ze=r=>{let t=setTimeout(()=>r(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(Ze=r=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(r,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const qt=typeof navigator<"u"&&(!(($t=navigator.scheduling)===null||$t===void 0)&&$t.isInputPending)?()=>navigator.scheduling.isInputPending():null,tn=Pt.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(E.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(E.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=Ze(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:n,viewport:{to:i}}=this.view,s=n.field(E.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,t&&!qt?Math.max(25,t.timeRemaining()-5):1e9),o=s.context.treeLen<i&&n.doc.length>i+1e3,a=s.context.work(()=>qt&&qt()||Date.now()>l,i+(o?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:E.setState.of(new ct(s.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>Nn(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()}}}),Y=Q.define({combine(r){return r.length?r[0]:null},enables:r=>[E.state,tn,U.contentAttributes.compute([r],t=>{let e=t.facet(r);return e&&e.name?{"data-language":e.name}:{}})]});class Kn{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class ae{constructor(t,e,n,i,s,l=void 0){this.name=t,this.alias=e,this.extensions=n,this.filename=i,this.loadFunc=s,this.support=l,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:n}=t;if(!e){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(n)}return new ae(t.name,(t.alias||[]).concat(t.name).map(i=>i.toLowerCase()),t.extensions||[],t.filename,e,n)}static matchFilename(t,e){for(let i of t)if(i.filename&&i.filename.test(e))return i;let n=/\.([^.]+)$/.exec(e);if(n){for(let i of t)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(t,e,n=!0){e=e.toLowerCase();for(let i of t)if(i.alias.some(s=>s==e))return i;if(n)for(let i of t)for(let s of i.alias){let l=e.indexOf(s);if(l>-1&&(s.length>2||!/\w/.test(e[l-1])&&!/\w/.test(e[l+s.length])))return i}return null}}const en=Q.define(),he=Q.define({combine:r=>{if(!r.length)return" ";let t=r[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(r[0]));return t}});function St(r){let t=r.facet(he);return t.charCodeAt(0)==9?r.tabSize*t.length:t.length}function fe(r,t){let e="",n=r.tabSize,i=r.facet(he)[0];if(i==" "){for(;t>=n;)e+=" ",t-=n;i=" "}for(let s=0;s<t;s++)e+=i;return e}function ue(r,t){r instanceof yt&&(r=new Wt(r));for(let n of r.state.facet(en)){let i=n(r,t);if(i!==void 0)return i}let e=z(r.state);return e.length>=t?Xn(r,e,t):null}function Qn(r,t,e){let n=Object.create(null),i=new Wt(r,{overrideIndentation:l=>{var o;return(o=n[l])!==null&&o!==void 0?o:-1}}),s=[];for(let l=t;l<=e;){let o=r.doc.lineAt(l);l=o.to+1;let a=ue(i,o.from);if(a==null)continue;/\S/.test(o.text)||(a=0);let h=/^\s*/.exec(o.text)[0],f=fe(r,a);h!=f&&(n[o.from]=a,s.push({from:o.from,to:o.from+h.length,insert:f}))}return r.changes(s)}class Wt{constructor(t,e={}){this.state=t,this.options=e,this.unit=St(t)}lineAt(t,e=1){let n=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=n.from&&i<=n.to?s&&i==t?{text:"",from:t}:(e<0?i<t:i<=t)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(t,e);return n.slice(t-i,Math.min(n.length,t+100-i))}column(t,e=1){let{text:n,from:i}=this.lineAt(t,e),s=this.countColumn(n,t-i),l=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return l>-1&&(s+=l-this.countColumn(n,n.search(/\S|$/))),s}countColumn(t,e=t.length){return An(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:n,from:i}=this.lineAt(t,e),s=this.options.overrideIndentation;if(s){let l=s(i);if(l>-1)return l}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ce=new y;function Xn(r,t,e){let n=t.resolveStack(e),i=t.resolveInner(e,-1).resolve(e,0).enterUnfinishedNodesBefore(e);if(i!=n.node){let s=[];for(let l=i;l&&!(l.from<n.node.from||l.to>n.node.to||l.from==n.node.from&&l.type==n.node.type);l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)n={node:s[l],next:n}}return nn(n,r,e)}function nn(r,t,e){for(let n=r;n;n=n.next){let i=Zn(n.node);if(i)return i(Ht.create(t,e,n))}return 0}function Yn(r){return r.pos==r.options.simulateBreak&&r.options.simulateDoubleBreak}function Zn(r){let t=r.type.prop(ce);if(t)return t;let e=r.firstChild,n;if(e&&(n=e.type.prop(y.closedBy))){let i=r.lastChild,s=i&&n.indexOf(i.name)>-1;return l=>rn(l,!0,1,void 0,s&&!Yn(l)?i.from:void 0)}return r.parent==null?tr:null}function tr(){return 0}class Ht extends Wt{constructor(t,e,n){super(t.state,t.options),this.base=t,this.pos=e,this.context=n}get node(){return this.context.node}static create(t,e,n){return new Ht(t,e,n)}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 n=t.resolve(e.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(er(n,t))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){return nn(this.context.next,this.base,this.pos)}}function er(r,t){for(let e=t;e;e=e.parent)if(r==e)return!0;return!1}function nr(r){let t=r.node,e=t.childAfter(t.from),n=t.lastChild;if(!e)return null;let i=r.options.simulateBreak,s=r.state.doc.lineAt(e.from),l=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let o=e.to;;){let a=t.childAfter(o);if(!a||a==n)return null;if(!a.type.isSkipped){if(a.from>=l)return null;let h=/^ */.exec(s.text.slice(e.to-s.from))[0].length;return{from:e.from,to:e.to+h}}o=a.to}}function rr({closing:r,align:t=!0,units:e=1}){return n=>rn(n,t,e,r)}function rn(r,t,e,n,i){let s=r.textAfter,l=s.match(/^\s*/)[0].length,o=n&&s.slice(l,l+n.length)==n||i==r.pos+l,a=t?nr(r):null;return a?o?r.column(a.from):r.column(a.to):r.baseIndent+(o?0:r.unit*e)}const ir=r=>r.baseIndent;function sr({except:r,units:t=1}={}){return e=>{let n=r&&r.test(e.textAfter);return e.baseIndent+(n?0:t*e.unit)}}const lr=200;function or(){return yt.transactionFilter.of(r=>{if(!r.docChanged||!r.isUserEvent("input.type")&&!r.isUserEvent("input.complete"))return r;let t=r.startState.languageDataAt("indentOnInput",r.startState.selection.main.head);if(!t.length)return r;let e=r.newDoc,{head:n}=r.newSelection.main,i=e.lineAt(n);if(n>i.from+lr)return r;let s=e.sliceString(i.from,n);if(!t.some(h=>h.test(s)))return r;let{state:l}=r,o=-1,a=[];for(let{head:h}of l.selection.ranges){let f=l.doc.lineAt(h);if(f.from==o)continue;o=f.from;let d=ue(l,f.from);if(d==null)continue;let g=/^\s*/.exec(f.text)[0],k=fe(l,d);g!=k&&a.push({from:f.from,to:f.from+g.length,insert:k})}return a.length?[r,{changes:a,sequential:!0}]:r})}const sn=Q.define(),ln=new y;function ar(r){let t=r.firstChild,e=r.lastChild;return t&&t.to<e.from?{from:t.to,to:e.type.isError?r.to:e.from}:null}function hr(r,t,e){let n=z(r);if(n.length<e)return null;let i=n.resolveStack(e,1),s=null;for(let l=i;l;l=l.next){let o=l.node;if(o.to<=e||o.from>e)continue;if(s&&o.from<t)break;let a=o.type.prop(ln);if(a&&(o.to<n.length-50||n.length==r.doc.length||!fr(o))){let h=a(o,r);h&&h.from<=e&&h.from>=t&&h.to>e&&(s=h)}}return s}function fr(r){let t=r.lastChild;return t&&t.to==r.to&&t.type.isError}function dt(r,t,e){for(let n of r.facet(sn)){let i=n(r,t,e);if(i)return i}return hr(r,t,e)}function on(r,t){let e=t.mapPos(r.from,1),n=t.mapPos(r.to,-1);return e>=n?void 0:{from:e,to:n}}const pt=jt.define({map:on}),ft=jt.define({map:on});function de(r){let t=[];for(let{head:e}of r.state.selection.ranges)t.some(n=>n.from<=e&&n.to>=e)||t.push(r.lineBlockAt(e));return t}const Z=je.define({create(){return R.none},update(r,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((n,i)=>r=Oe(r,n,i)),r=r.map(t.changes);let e=[];for(let n of t.effects)n.is(pt)&&!cr(r,n.value.from,n.value.to)?e.push(n.value):n.is(ft)&&(r=r.update({filter:(i,s)=>n.value.from!=i||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));if(e.length){let{preparePlaceholder:n}=t.state.facet(ge),i=e.map(s=>(n?R.replace({widget:new kr(n(t.state,s))}):De).range(s.from,s.to));r=r.update({add:i})}return t.selection&&(r=Oe(r,t.selection.main.head)),r},provide:r=>U.decorations.from(r),toJSON(r,t){let e=[];return r.between(0,t.doc.length,(n,i)=>{e.push(n,i)}),e},fromJSON(r){if(!Array.isArray(r)||r.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let e=0;e<r.length;){let n=r[e++],i=r[e++];if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");t.push(De.range(n,i))}return R.set(t,!0)}});function Oe(r,t,e=t){let n=!1;return r.between(t,e,(i,s)=>{i<e&&s>t&&(n=!0)}),n?r.update({filterFrom:t,filterTo:e,filter:(i,s)=>i>=e||s<=t}):r}function ur(r){return r.field(Z,!1)||Fe.empty}function Ct(r,t,e){var n;let i=null;return(n=r.field(Z,!1))===null||n===void 0||n.between(t,e,(s,l)=>{(!i||i.from>s)&&(i={from:s,to:l})}),i}function cr(r,t,e){let n=!1;return r.between(t,t,(i,s)=>{i==t&&s==e&&(n=!0)}),n}function pe(r,t){return r.field(Z,!1)?t:t.concat(jt.appendConfig.of(me()))}const an=r=>{for(let t of de(r)){let e=dt(r.state,t.from,t.to);if(e)return r.dispatch({effects:pe(r.state,[pt.of(e),Ft(r,e)])}),!0}return!1},hn=r=>{if(!r.state.field(Z,!1))return!1;let t=[];for(let e of de(r)){let n=Ct(r.state,e.from,e.to);n&&t.push(ft.of(n),Ft(r,n,!1))}return t.length&&r.dispatch({effects:t}),t.length>0};function Ft(r,t,e=!0){let n=r.state.doc.lineAt(t.from).number,i=r.state.doc.lineAt(t.to).number;return U.announce.of(`${r.state.phrase(e?"Folded lines":"Unfolded lines")} ${n} ${r.state.phrase("to")} ${i}.`)}const fn=r=>{let{state:t}=r,e=[];for(let n=0;n<t.doc.length;){let i=r.lineBlockAt(n),s=dt(t,i.from,i.to);s&&e.push(pt.of(s)),n=(s?r.lineBlockAt(s.to):i).to+1}return e.length&&r.dispatch({effects:pe(r.state,e)}),!!e.length},un=r=>{let t=r.state.field(Z,!1);if(!t||!t.size)return!1;let e=[];return t.between(0,r.state.doc.length,(n,i)=>{e.push(ft.of({from:n,to:i}))}),r.dispatch({effects:e}),!0};function dr(r,t){for(let e=t;;){let n=dt(r.state,e.from,e.to);if(n&&n.to>t.from)return n;if(!e.from)return null;e=r.lineBlockAt(e.from-1)}}const pr=r=>{let t=[];for(let e of de(r)){let n=Ct(r.state,e.from,e.to);if(n)t.push(ft.of(n),Ft(r,n,!1));else{let i=dr(r,e);i&&t.push(pt.of(i),Ft(r,i))}}return t.length>0&&r.dispatch({effects:pe(r.state,t)}),!!t.length},gr=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:an},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:hn},{key:"Ctrl-Alt-[",run:fn},{key:"Ctrl-Alt-]",run:un}],mr={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},ge=Q.define({combine(r){return He(r,mr)}});function me(r){let t=[Z,xr];return r&&t.push(ge.of(r)),t}function cn(r,t){let{state:e}=r,n=e.facet(ge),i=l=>{let o=r.lineBlockAt(r.posAtDOM(l.target)),a=Ct(r.state,o.from,o.to);a&&r.dispatch({effects:ft.of(a)}),l.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(r,i,t);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",e.phrase("folded code")),s.title=e.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const De=R.replace({widget:new class extends Ue{toDOM(r){return cn(r,null)}}});class kr extends Ue{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return cn(t,this.value)}}const br={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Gt extends Tn{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function yr(r={}){let t={...br,...r},e=new Gt(t,!0),n=new Gt(t,!1),i=Pt.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Y)!=l.state.facet(Y)||l.startState.field(Z,!1)!=l.state.field(Z,!1)||z(l.startState)!=z(l.state)||t.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new ne;for(let a of l.viewportLineBlocks){let h=Ct(l.state,a.from,a.to)?n:dt(l.state,a.from,a.to)?e:null;h&&o.add(a.from,a.from,h)}return o.finish()}}),{domEventHandlers:s}=t;return[i,Pn({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(i))===null||o===void 0?void 0:o.markers)||Fe.empty},initialSpacer(){return new Gt(t,!1)},domEventHandlers:{...s,click:(l,o,a)=>{if(s.click&&s.click(l,o,a))return!0;let h=Ct(l.state,o.from,o.to);if(h)return l.dispatch({effects:ft.of(h)}),!0;let f=dt(l.state,o.from,o.to);return f?(l.dispatch({effects:pt.of(f)}),!0):!1}}}),me()]}const xr=U.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Tt{constructor(t,e){this.specs=t;let n;function i(o){let a=Se.newName();return(n||(n=Object.create(null)))["."+a]=o,a}const s=typeof e.all=="string"?e.all:e.all?i(e.all):void 0,l=e.scope;this.scope=l instanceof E?o=>o.prop(rt)==l.data:l?o=>o==l:void 0,this.style=Ke(t.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=n?new Se(n):null,this.themeType=e.themeType}static define(t,e){return new Tt(t,e||{})}}const Yt=Q.define(),dn=Q.define({combine(r){return r.length?[r[0]]:null}});function Rt(r){let t=r.facet(Yt);return t.length?t:r.facet(dn)}function wr(r,t){let e=[Cr],n;return r instanceof Tt&&(r.module&&e.push(U.styleModule.of(r.module)),n=r.themeType),t?.fallback?e.push(dn.of(r)):n?e.push(Yt.computeN([U.darkTheme],i=>i.facet(U.darkTheme)==(n=="dark")?[r]:[])):e.push(Yt.of(r)),e}function vr(r,t,e){let n=Rt(r),i=null;if(n){for(let s of n)if(!s.scope||e&&s.scope(e)){let l=s.style(t);l&&(i=i?i+" "+l:l)}}return i}class Sr{constructor(t){this.markCache=Object.create(null),this.tree=z(t.state),this.decorations=this.buildDeco(t,Rt(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=z(t.state),n=Rt(t.state),i=n!=Rt(t.startState),{viewport:s}=t.view,l=t.changes.mapPos(this.decoratedTo,1);e.length<s.to&&!i&&e.type==this.tree.type&&l>=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=l):(e!=this.tree||t.viewportChanged||i)&&(this.tree=e,this.decorations=this.buildDeco(t.view,n),this.decoratedTo=s.to)}buildDeco(t,e){if(!e||!this.tree.length)return R.none;let n=new ne;for(let{from:i,to:s}of t.visibleRanges)Un(this.tree,e,(l,o,a)=>{n.add(l,o,this.markCache[a]||(this.markCache[a]=R.mark({class:a})))},i,s);return n.finish()}}const Cr=We.high(Pt.fromClass(Sr,{decorations:r=>r.decorations})),Ar=Tt.define([{tag:c.meta,color:"#404740"},{tag:c.link,textDecoration:"underline"},{tag:c.heading,textDecoration:"underline",fontWeight:"bold"},{tag:c.emphasis,fontStyle:"italic"},{tag:c.strong,fontWeight:"bold"},{tag:c.strikethrough,textDecoration:"line-through"},{tag:c.keyword,color:"#708"},{tag:[c.atom,c.bool,c.url,c.contentSeparator,c.labelName],color:"#219"},{tag:[c.literal,c.inserted],color:"#164"},{tag:[c.string,c.deleted],color:"#a11"},{tag:[c.regexp,c.escape,c.special(c.string)],color:"#e40"},{tag:c.definition(c.variableName),color:"#00f"},{tag:c.local(c.variableName),color:"#30a"},{tag:[c.typeName,c.namespace],color:"#085"},{tag:c.className,color:"#167"},{tag:[c.special(c.variableName),c.macroName],color:"#256"},{tag:c.definition(c.propertyName),color:"#00c"},{tag:c.comment,color:"#940"},{tag:c.invalid,color:"#f00"}]),Pr=U.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),pn=1e4,gn="()[]{}",mn=Q.define({combine(r){return He(r,{afterCursor:!0,brackets:gn,maxScanDistance:pn,renderMatch:Ir})}}),Tr=R.mark({class:"cm-matchingBracket"}),Nr=R.mark({class:"cm-nonmatchingBracket"});function Ir(r){let t=[],e=r.matched?Tr:Nr;return t.push(e.range(r.start.from,r.start.to)),r.end&&t.push(e.range(r.end.from,r.end.to)),t}function Me(r){let t=[],e=r.facet(mn);for(let n of r.selection.ranges){if(!n.empty)continue;let i=bt(r,n.head,-1,e)||n.head>0&&bt(r,n.head-1,1,e)||e.afterCursor&&(bt(r,n.head,1,e)||n.head<r.doc.length&&bt(r,n.head+1,-1,e));i&&(t=t.concat(e.renderMatch(i,r)))}return R.set(t,!0)}const Br=Pt.fromClass(class{constructor(r){this.paused=!1,this.decorations=Me(r.state)}update(r){(r.docChanged||r.selectionSet||this.paused)&&(r.view.composing?(this.decorations=this.decorations.map(r.changes),this.paused=!0):(this.decorations=Me(r.state),this.paused=!1))}},{decorations:r=>r.decorations}),Or=[Br,Pr];function Dr(r={}){return[mn.of(r),Or]}const kn=new y;function Zt(r,t,e){let n=r.prop(t<0?y.openedBy:y.closedBy);if(n)return n;if(r.name.length==1){let i=e.indexOf(r.name);if(i>-1&&i%2==(t<0?1:0))return[e[i+t]]}return null}function te(r){let t=r.type.prop(kn);return t?t(r.node):r}function bt(r,t,e,n={}){let i=n.maxScanDistance||pn,s=n.brackets||gn,l=z(r),o=l.resolveInner(t,e);for(let a=o;a;a=a.parent){let h=Zt(a.type,e,s);if(h&&a.from<a.to){let f=te(a);if(f&&(e>0?t>=f.from&&t<f.to:t>f.from&&t<=f.to))return Mr(r,t,e,a,f,h,s)}}return Er(r,t,e,l,o.type,i,s)}function Mr(r,t,e,n,i,s,l){let o=n.parent,a={from:i.from,to:i.to},h=0,f=o?.cursor();if(f&&(e<0?f.childBefore(n.from):f.childAfter(n.to)))do if(e<0?f.to<=n.from:f.from>=n.to){if(h==0&&s.indexOf(f.type.name)>-1&&f.from<f.to){let d=te(f);return{start:a,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(Zt(f.type,e,l))h++;else if(Zt(f.type,-e,l)){if(h==0){let d=te(f);return{start:a,end:d&&d.from<d.to?{from:d.from,to:d.to}:void 0,matched:!1}}h--}}while(e<0?f.prevSibling():f.nextSibling());return{start:a,matched:!1}}function Er(r,t,e,n,i,s,l){if(e<0?!t:t==r.doc.length)return null;let o=e<0?r.sliceDoc(t-1,t):r.sliceDoc(t,t+1),a=l.indexOf(o);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=r.doc.iterRange(t,e>0?r.doc.length:0),d=0;for(let g=0;!f.next().done&&g<=s;){let k=f.value;e<0&&(g+=k.length);let w=t+g*e;for(let O=e>0?0:k.length-1,j=e>0?k.length:-1;O!=j;O+=e){let M=l.indexOf(k[O]);if(!(M<0||n.resolveInner(w+O,1).type!=i))if(M%2==0==e>0)d++;else{if(d==1)return{start:h,end:{from:w+O,to:w+O+1},matched:M>>1==a>>1};d--}}e>0&&(g+=k.length)}return f.done?{start:h,matched:!1}:null}function Ee(r,t,e,n=0,i=0){t==null&&(t=r.search(/[^\s\u00a0]/),t==-1&&(t=r.length));let s=i;for(let l=n;l<t;l++)r.charCodeAt(l)==9?s+=e-s%e:s++;return s}class ke{constructor(t,e,n,i){this.string=t,this.tabSize=e,this.indentUnit=n,this.overrideIndent=i,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),n;if(typeof t=="string"?n=e==t:n=e&&(t instanceof RegExp?t.test(e):t(e)),n)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=Ee(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:Ee(this.string,null,this.tabSize)}match(t,e,n){if(typeof t=="string"){let i=l=>n?l.toLowerCase():l,s=this.string.substr(this.pos,t.length);return i(s)==i(t)?(e!==!1&&(this.pos+=t.length),!0):null}else{let i=this.string.slice(this.pos).match(t);return i&&i.index>0?null:(i&&e!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function Rr(r){return{name:r.name||"",token:r.token,blankLine:r.blankLine||(()=>{}),startState:r.startState||(()=>!0),copyState:r.copyState||_r,indent:r.indent||(()=>null),languageData:r.languageData||{},tokenTable:r.tokenTable||xe,mergeTokens:r.mergeTokens!==!1}}function _r(r){if(typeof r!="object")return r;let t={};for(let e in r){let n=r[e];t[e]=n instanceof Array?n.slice():n}return t}const Re=new WeakMap;class be extends E{constructor(t){let e=oe(t.languageData),n=Rr(t),i,s=new class extends Ge{createParse(l,o,a){return new zr(i,l,o,a)}};super(e,s,[],t.name),this.topNode=Wr(e,this),i=this,this.streamParser=n,this.stateAfter=new y({perNode:!0}),this.tokenTable=t.tokenTable?new wn(n.tokenTable):jr}static define(t){return new be(t)}getIndent(t){let e,{overrideIndentation:n}=t.options;n&&(e=Re.get(t.state),e!=null&&e<t.pos-1e4&&(e=void 0));let i=ye(this,t.node.tree,t.node.from,t.node.from,e??t.pos),s,l;if(i?(l=i.state,s=i.pos+1):(l=this.streamParser.startState(t.unit),s=t.node.from),t.pos-s>1e4)return null;for(;s<t.pos;){let a=t.state.doc.lineAt(s),h=Math.min(t.pos,a.to);if(a.length){let f=n?n(a.from):-1,d=new ke(a.text,t.state.tabSize,t.unit,f<0?void 0:f);for(;d.pos<h-a.from;)yn(this.streamParser.token,d,l)}else this.streamParser.blankLine(l,t.unit);if(h==t.pos)break;s=a.to+1}let o=t.lineAt(t.pos);return n&&e==null&&Re.set(t.state,o.from),this.streamParser.indent(l,/^\s*(.*)/.exec(o.text)[1],t)}get allowsNesting(){return!1}}function ye(r,t,e,n,i){let s=e>=n&&e+t.length<=i&&t.prop(r.stateAfter);if(s)return{state:r.streamParser.copyState(s),pos:e+t.length};for(let l=t.children.length-1;l>=0;l--){let o=t.children[l],a=e+t.positions[l],h=o instanceof C&&a<i&&ye(r,o,a,n,i);if(h)return h}return null}function bn(r,t,e,n,i){if(i&&e<=0&&n>=t.length)return t;!i&&e==0&&t.type==r.topNode&&(i=!0);for(let s=t.children.length-1;s>=0;s--){let l=t.positions[s],o=t.children[s],a;if(l<n&&o instanceof C){if(!(a=bn(r,o,e-l,n-l,i)))break;return i?new C(t.type,t.children.slice(0,s).concat(a),t.positions.slice(0,s+1),l+a.length):a}}return null}function Lr(r,t,e,n,i){for(let s of t){let l=s.from+(s.openStart?25:0),o=s.to-(s.openEnd?25:0),a=l<=e&&o>e&&ye(r,s.tree,0-s.offset,e,o),h;if(a&&a.pos<=n&&(h=bn(r,s.tree,e+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:h}}return{state:r.streamParser.startState(i?St(i):4),tree:C.empty}}class zr{constructor(t,e,n,i){this.lang=t,this.input=e,this.fragments=n,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let s=ht.get(),l=i[0].from,{state:o,tree:a}=Lr(t,n,l,this.to,s?.state);this.state=o,this.parsedPos=this.chunkStart=l+a.length;for(let h=0;h<a.children.length;h++)this.chunks.push(a.children[h]),this.chunkPos.push(a.positions[h]);s&&this.parsedPos<s.viewport.from-1e5&&i.some(h=>h.from<=s.viewport.from&&h.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(St(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=ht.get(),e=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(e,this.chunkStart+512);for(t&&(n=Math.min(n,t.viewport.to));this.parsedPos<n;)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==`
2
+ `&&(e="");else{let n=e.indexOf(`
3
+ `);n>-1&&(e=e.slice(0,n))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),n=t+e.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=n||(e=e.slice(0,s-(n-e.length)),i++,i==this.ranges.length))break;let l=this.ranges[i].from,o=this.lineAfter(l);e+=o,n=l+o.length}return{line:e,end:n}}skipGapsTo(t,e,n){for(;;){let i=this.ranges[this.rangeIndex].to,s=t+e;if(n>0?i>s:i>=s)break;let l=this.ranges[++this.rangeIndex].from;e+=l-i}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,n,i){let s=4;if(this.ranges.length>1){i=this.skipGapsTo(e,i,1),e+=i;let o=this.chunk.length;i=this.skipGapsTo(n,i,-1),n+=i,s+=this.chunk.length-o}let l=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&l>=0&&this.chunk[l]==t&&this.chunk[l+2]==e?this.chunk[l+2]=n:this.chunk.push(t,e,n,s),i}parseLine(t){let{line:e,end:n}=this.nextLine(),i=0,{streamParser:s}=this.lang,l=new ke(e,t?t.state.tabSize:4,t?St(t.state):2);if(l.eol())s.blankLine(this.state,l.indentUnit);else for(;!l.eol();){let o=yn(s.token,l,this.state);if(o&&(i=this.emitToken(this.lang.tokenTable.resolve(o),this.parsedPos+l.start,this.parsedPos+l.pos,i)),l.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=C.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Fr,topID:0,maxBufferLength:512,reused:this.chunkReused});t=new C(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 C(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function yn(r,t,e){t.start=t.pos;for(let n=0;n<10;n++){let i=r(t,e);if(t.pos>t.start)return i}throw new Error("Stream parser failed to advance stream.")}const xe=Object.create(null),At=[L.none],Fr=new re(At),_e=[],Le=Object.create(null),xn=Object.create(null);for(let[r,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"]])xn[r]=vn(xe,t);class wn{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),xn)}resolve(t){return t?this.table[t]||(this.table[t]=vn(this.extra,t)):0}}const jr=new wn(xe);function Jt(r,t){_e.indexOf(r)>-1||(_e.push(r),console.warn(t))}function vn(r,t){let e=[];for(let o of t.split(" ")){let a=[];for(let h of o.split(".")){let f=r[h]||c[h];f?typeof f=="function"?a.length?a=a.map(f):Jt(h,`Modifier ${h} used at start of tag`):a.length?Jt(h,`Tag ${h} used as modifier`):a=Array.isArray(f)?f:[f]:Jt(h,`Unknown highlighting tag ${h}`)}for(let h of a)e.push(h)}if(!e.length)return 0;let n=t.replace(/ /g,"_"),i=n+" "+e.map(o=>o.id),s=Le[i];if(s)return s.id;let l=Le[i]=L.define({id:At.length,name:n,props:[Wn({[n]:e})]});return At.push(l),l.id}function Wr(r,t){let e=L.define({id:At.length,name:"Document",props:[rt.add(()=>r),ce.add(()=>n=>t.getIndent(n))],top:!0});return At.push(e),e}function Sn(r){return r.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(r)}function Cn(r){for(let t=r.iter();!t.next().done;)if(Sn(t.value))return!0;return!1}function Hr(r){let t=!1;return r.iterChanges((e,n,i,s,l)=>{!t&&Cn(l)&&(t=!0)}),t}const ee=Q.define({combine:r=>r.some(t=>t)});function Ur(r={}){let t=[Vr];return r.alwaysIsolate&&t.push(ee.of(!0)),t}const Vr=Pt.fromClass(class{constructor(r){this.always=r.state.facet(ee)||r.textDirection!=_t.LTR||r.state.facet(U.perLineTextDirection),this.hasRTL=!this.always&&Cn(r.state.doc),this.tree=z(r.state),this.decorations=this.always||this.hasRTL?ze(r,this.tree,this.always):R.none}update(r){let t=r.state.facet(ee)||r.view.textDirection!=_t.LTR||r.state.facet(U.perLineTextDirection);if(!t&&!this.hasRTL&&Hr(r.changes)&&(this.hasRTL=!0),!t&&!this.hasRTL)return;let e=z(r.state);(t!=this.always||e!=this.tree||r.docChanged||r.viewportChanged)&&(this.tree=e,this.always=t,this.decorations=ze(r.view,e,t))}},{provide:r=>{function t(e){var n,i;return(i=(n=e.plugin(r))===null||n===void 0?void 0:n.decorations)!==null&&i!==void 0?i:R.none}return[U.outerDecorations.of(t),We.lowest(U.bidiIsolatedRanges.of(t))]}});function ze(r,t,e){let n=new ne,i=r.visibleRanges;e||(i=$r(i,r.state.doc));for(let{from:s,to:l}of i)t.iterate({enter:o=>{let a=o.type.prop(y.isolate);a&&n.add(o.from,o.to,qr[a])},from:s,to:l});return n.finish()}function $r(r,t){let e=t.iter(),n=0,i=[],s=null;for(let{from:l,to:o}of r)if(!(s&&s.to>l&&(l=s.to,l>=o)))for(n+e.value.length<l&&(e.next(l-(n+e.value.length)),n=l);;){let a=n,h=n+e.value.length;if(!e.lineBreak&&Sn(e.value)&&(s&&s.to>a-10?s.to=Math.min(o,h):i.push(s={from:a,to:Math.min(o,h)})),h>=o)break;n=h,e.next()}return i}const qr={rtl:R.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:_t.RTL}),ltr:R.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:_t.LTR}),auto:R.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})},Xr=Object.freeze(Object.defineProperty({__proto__:null,DocInput:Ye,HighlightStyle:Tt,IndentContext:Wt,LRLanguage:zt,Language:E,LanguageDescription:ae,LanguageSupport:Kn,ParseContext:ht,StreamLanguage:be,StringStream:ke,TreeIndentContext:Ht,bidiIsolates:Ur,bracketMatching:Dr,bracketMatchingHandle:kn,codeFolding:me,continuedIndent:sr,defaultHighlightStyle:Ar,defineLanguageFacet:oe,delimitedIndent:rr,ensureSyntaxTree:Xe,flatIndent:ir,foldAll:fn,foldCode:an,foldEffect:pt,foldGutter:yr,foldInside:ar,foldKeymap:gr,foldNodeProp:ln,foldService:sn,foldState:Z,foldable:dt,foldedRanges:ur,forceParsing:Gn,getIndentUnit:St,getIndentation:ue,highlightingFor:vr,indentNodeProp:ce,indentOnInput:or,indentRange:Qn,indentService:en,indentString:fe,indentUnit:he,language:Y,languageDataProp:rt,matchBrackets:bt,sublanguageProp:Qe,syntaxHighlighting:wr,syntaxParserRunning:Jn,syntaxTree:z,syntaxTreeAvailable:qn,toggleFold:pr,unfoldAll:un,unfoldCode:hn,unfoldEffect:ft},Symbol.toStringTag,{value:"Module"}));export{In as D,Tt as H,Wt as I,Kn as L,y as N,Ge as P,C as T,St as a,he as b,re as c,L as d,I as e,wr as f,ue as g,Wn as h,fe as i,zt as j,ce as k,sr as l,bt as m,ln as n,ar as o,ir as p,rr as q,Qe as r,z as s,c as t,oe as u,Kr as v,Xr as w};
@@ -0,0 +1,2 @@
1
+ import{g as U,s as ue,E as S,a as fe,V as X,D as f,c as m,r as de}from"./index-DgapqSPi.js";import{codePointAt as me,fromCodePoint as ge,codePointSize as pe,EditorState as xe,EditorSelection as p,StateEffect as _,StateField as Se,Facet as Y,combineConfig as Z,Prec as Me,CharCategory as g,RangeSetBuilder as ve,findClusterBreak as ee}from"./index-BP6wv2A0.js";const G=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class b{constructor(e,r,n=0,i=e.length,s,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=s?c=>s(G(c)):G,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return me(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let r=ge(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=pe(e);let i=this.normalize(r);if(i.length)for(let s=0,l=n,c=!0;;s++){let o=i.charCodeAt(s),a=this.match(o,l,c,this.bufferPos+this.bufferStart,s==i.length-1);if(a)return this.value=a,this;if(s==i.length-1)break;c&&s<r.length&&r.charCodeAt(s)==o?l++:c=!1}}}match(e,r,n,i,s){let l=null;for(let c=0;c<this.matches.length;){let o=this.matches[c],a=!1;this.query.charCodeAt(o.index)==e&&(o.index==this.query.length-1?l={from:o.from,to:i,precise:s&&o.precise}:(o.index++,a=!0)),a?c++:this.matches.splice(c,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?l={from:r,to:i,precise:n&&s}:this.matches.push({from:r,index:1,precise:n})),l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart)&&(l=null),l}}typeof Symbol<"u"&&(b.prototype[Symbol.iterator]=function(){return this});const te={from:-1,to:-1,match:/.*/.exec(""),precise:!0},z="gm"+(/x/.unicode==null?"":"u");class re{constructor(e,r,n,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=te,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new ne(e,r,n,i,s);this.re=new RegExp(r,z+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=e.iter();let l=e.lineAt(i);this.curLineStart=l.from,this.matchPos=D(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,i=n+r[0].length;if(this.matchPos=D(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,precise:!0,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const O=new WeakMap;class C{constructor(e,r){this.from=e,this.text=r}get to(){return this.from+this.text.length}static get(e,r,n){let i=O.get(e);if(!i||i.from>=n||i.to<=r){let c=new C(r,e.sliceString(r,n));return O.set(e,c),c}if(i.from==r&&i.to==n)return i;let{text:s,from:l}=i;return l>r&&(s=e.sliceString(r,l)+s,l=r),i.to<n&&(s+=e.sliceString(i.to,n)),O.set(e,new C(l,s)),new C(r,s.slice(r-l,n-l))}}class ne{constructor(e,r,n,i,s){this.text=e,this.to=s,this.done=!1,this.value=te,this.matchPos=D(e,i),this.re=new RegExp(r,z+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=C.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,i=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,precise:!0,match:r},this.matchPos=D(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=C.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(re.prototype[Symbol.iterator]=ne.prototype[Symbol.iterator]=function(){return this});function ye(t){try{return new RegExp(t,z),!0}catch{return!1}}function D(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e<r.to&&(n=r.text.charCodeAt(e-r.from))>=56320&&n<57344;)e++;return e}const Ce=t=>{let{state:e}=t,r=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:i}=ue(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:e.phrase("go")});return i.then(s=>{let l=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!l){t.dispatch({effects:n});return}let c=e.doc.lineAt(e.selection.main.head),[,o,a,h,d]=l,A=h?+h.slice(1):0,k=a?+a:c.number;if(a&&d){let T=k/100;o&&(T=T*(o=="-"?-1:1)+c.number/e.doc.lines),k=Math.round(e.doc.lines*T)}else a&&o&&(k=k*(o=="-"?-1:1)+c.number);let H=e.doc.line(Math.max(1,Math.min(e.doc.lines,k))),K=p.cursor(H.from+Math.max(0,Math.min(A,H.length)));t.dispatch({effects:[n,S.scrollIntoView(K.from,{y:"center"})],selection:K})}),!0},be={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ie=Y.define({combine(t){return Z(t,be,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function je(t){let e=[Ee,Ae];return t&&e.push(ie.of(t)),e}const ke=f.mark({class:"cm-selectionMatch"}),Le=f.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function j(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=g.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=g.Word)}function We(t,e,r,n){return t(e.sliceDoc(r,r+1))==g.Word&&t(e.sliceDoc(n-1,n))==g.Word}const Ae=X.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(ie),{state:r}=t,n=r.selection;if(n.ranges.length>1)return f.none;let i=n.main,s,l=null;if(i.empty){if(!e.highlightWordAroundCursor)return f.none;let o=r.wordAt(i.head);if(!o)return f.none;l=r.charCategorizer(i.head),s=r.sliceDoc(o.from,o.to)}else{let o=i.to-i.from;if(o<e.minSelectionLength||o>200)return f.none;if(e.wholeWords){if(s=r.sliceDoc(i.from,i.to),l=r.charCategorizer(i.head),!(j(l,r,i.from,i.to)&&We(l,r,i.from,i.to)))return f.none}else if(s=r.sliceDoc(i.from,i.to),!s)return f.none}let c=[];for(let o of t.visibleRanges){let a=new b(r.doc,s,o.from,o.to);for(;!a.next().done;){let{from:h,to:d}=a.value;if((!l||j(l,r,h,d))&&(i.empty&&h<=i.from&&d>=i.to?c.push(Le.range(h,d)):(h>=i.to||d<=i.from)&&c.push(ke.range(h,d)),c.length>e.maxMatches))return f.none}}return f.set(c)}},{decorations:t=>t.decorations}),Ee=S.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Fe=({state:t,dispatch:e})=>{let{selection:r}=t,n=p.create(r.ranges.map(i=>t.wordAt(i.head)||p.cursor(i.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function De(t,e){let{main:r,ranges:n}=t.selection,i=t.wordAt(r.head),s=i&&i.from==r.from&&i.to==r.to;for(let l=!1,c=new b(t.doc,e,n[n.length-1].to);;)if(c.next(),c.done){if(l)return null;c=new b(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),l=!0}else{if(l&&n.some(o=>o.from==c.value.from))continue;if(s){let o=t.wordAt(c.value.from);if(!o||o.from!=c.value.from||o.to!=c.value.to)continue}return c.value}}const Re=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(s=>s.from===s.to))return Fe({state:t,dispatch:e});let n=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=n))return!1;let i=De(t,n);return i?(e(t.update({selection:t.selection.addRange(p.range(i.from,i.to),!1),effects:S.scrollIntoView(i.to)})),!0):!1},M=Y.define({combine(t){return Z(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Ve(e),scrollToMatch:e=>S.scrollIntoView(e)})}});function Je(t){return t?[M.of(t),Q]:Q}class se{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||ye(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
2
+ `:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Oe(this):new Pe(this)}getCursor(e,r=0,n){let i=e.doc?e:xe.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?y(this,i,r,n):v(this,i,r,n)}}class le{constructor(e){this.spec=e}}function qe(t,e,r){return(n,i,s,l)=>{if(r&&!r(n,i,s,l))return!1;let c=n>=l&&i<=l+s.length?s.slice(n-l,i-l):e.doc.sliceString(n,i);return t(c,e,n,i)}}function v(t,e,r,n){let i;return t.wholeWord&&(i=we(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=qe(t.test,e,i)),new b(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:s=>s.toLowerCase(),i)}function we(t,e){return(r,n,i,s)=>((s>r||s+i.length<n)&&(s=Math.max(0,r-2),i=t.sliceString(s,Math.min(t.length,n+2))),(e(R(i,r-s))!=g.Word||e(q(i,r-s))!=g.Word)&&(e(q(i,n-s))!=g.Word||e(R(i,n-s))!=g.Word))}class Pe extends le{constructor(e){super(e)}nextMatch(e,r,n){let i=v(this.spec,e,n,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,r+this.spec.unquoted.length);i=v(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==r&&i.value.to==n?null:i.value}prevMatchInRange(e,r,n){for(let i=n;;){let s=Math.max(r,i-1e4-this.spec.unquoted.length),l=v(this.spec,e,s,i),c=null;for(;!l.nextOverlapping().done;)c=l.value;if(c)return c;if(s==r)return null;i-=1e4}}prevMatch(e,r,n){let i=this.prevMatchInRange(e,0,r);return i||(i=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=r||i.to!=n)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,r){let n=v(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let s=v(this.spec,e,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function Ie(t,e,r){return(n,i,s)=>(!r||r(n,i,s))&&t(s[0],e,n,i)}function y(t,e,r,n){let i;return t.wholeWord&&(i=Te(e.charCategorizer(e.selection.main.head))),t.test&&(i=Ie(t.test,e,i)),new re(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},r,n)}function R(t,e){return t.slice(ee(t,e,!1),e)}function q(t,e){return t.slice(e,ee(t,e))}function Te(t){return(e,r,n)=>!n[0].length||(t(R(n.input,n.index))!=g.Word||t(q(n.input,n.index))!=g.Word)&&(t(q(n.input,n.index+n[0].length))!=g.Word||t(R(n.input,n.index+n[0].length))!=g.Word)}class Oe extends le{nextMatch(e,r,n){let i=y(this.spec,e,n,e.doc.length).next();return i.done&&(i=y(this.spec,e,0,r).next()),i.done?null:i.value}prevMatchInRange(e,r,n){for(let i=1;;i++){let s=Math.max(r,n-i*1e4),l=y(this.spec,e,s,n),c=null;for(;!l.next().done;)c=l.value;if(c&&(s==r||c.from>s+10))return c;if(s==r)return null}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let i=n.length;i>0;i--){let s=+n.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+n.slice(i)}return r})}matchAll(e,r){let n=y(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let s=y(this.spec,e,Math.max(0,r-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const L=_.define(),B=_.define(),x=Se.define({create(t){return new $(I(t).create(),null)},update(t,e){for(let r of e.effects)r.is(L)?t=new $(r.value.create(),t.panel):r.is(B)&&(t=new $(t.query,r.value?N:null));return t},provide:t=>fe.from(t,e=>e.panel)});function Ue(t){let e=t.field(x,!1);return e?e.query.spec:I(t)}function Xe(t){var e;return((e=t.field(x,!1))===null||e===void 0?void 0:e.panel)!=null}class ${constructor(e,r){this.query=e,this.panel=r}}const $e=f.mark({class:"cm-searchMatch"}),Qe=f.mark({class:"cm-searchMatch cm-searchMatch-selected"}),_e=X.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(x))}update(t){let e=t.state.field(x);(e!=t.startState.field(x)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return f.none;let{view:r}=this,n=new ve;for(let i=0,s=r.visibleRanges,l=s.length;i<l;i++){let{from:c,to:o}=s[i];for(;i<l-1&&o>s[i+1].from-500;)o=s[++i].to;t.highlight(r.state,c,o,(a,h)=>{let d=r.state.selection.ranges.some(A=>A.from==a&&A.to==h);n.add(a,h,d?Qe:$e)})}return n.finish()}},{decorations:t=>t.decorations});function W(t){return e=>{let r=e.state.field(x,!1);return r&&r.query.spec.valid?t(e,r):ae(e)}}const w=W((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let i=p.single(n.from,n.to),s=t.state.facet(M);return t.dispatch({selection:i,effects:[V(t,n),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),oe(t),!0}),P=W((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,i=e.prevMatch(r,n,n);if(!i)return!1;let s=p.single(i.from,i.to),l=t.state.facet(M);return t.dispatch({selection:s,effects:[V(t,i),l.scrollToMatch(s.main,t)],userEvent:"select.search"}),oe(t),!0}),ze=W((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:p.create(r.map(n=>p.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),Be=({state:t,dispatch:e})=>{let r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:i}=r.main,s=[],l=0;for(let c=new b(t.doc,t.sliceDoc(n,i));!c.next().done;){if(s.length>1e3)return!1;c.value.from==n&&(l=s.length),s.push(p.range(c.value.from,c.value.to))}return e(t.update({selection:p.create(s,l),userEvent:"select.search.matches"})),!0},J=W((t,{query:e})=>{let{state:r}=t,{from:n,to:i}=r.selection.main;if(r.readOnly)return!1;let s=e.nextMatch(r,n,n);if(!s)return!1;let l=s,c=[],o,a,h=[];l.precise?l.from==n&&l.to==i&&(a=r.toText(e.getReplacement(l)),c.push({from:l.from,to:l.to,insert:a}),l=e.nextMatch(r,l.from,l.to),h.push(S.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))):l=e.nextMatch(r,l.from,l.to);let d=t.state.changes(c);return l&&(o=p.single(l.from,l.to).map(d),h.push(V(t,l)),h.push(r.facet(M).scrollToMatch(o.main,t))),t.dispatch({changes:d,selection:o,effects:h,userEvent:"input.replace"}),!0}),Ne=W((t,{query:e})=>{if(t.state.readOnly)return!1;let r=[];for(let i of e.matchAll(t.state,1e9)){let{from:s,to:l,precise:c}=i;c&&r.push({from:s,to:l,insert:e.getReplacement(i)})}if(!r.length)return!1;let n=t.state.phrase("replaced $ matches",r.length)+".";return t.dispatch({changes:r,effects:S.announce.of(n),userEvent:"input.replace.all"}),!0});function N(t){return t.state.facet(M).createPanel(t)}function I(t,e){var r,n,i,s,l;let c=t.selection.main,o=c.empty||c.to>c.from+100?"":t.sliceDoc(c.from,c.to);if(e&&!o)return e;let a=t.facet(M);return new se({search:((r=e?.literal)!==null&&r!==void 0?r:a.literal)?o:o.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:a.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:a.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:a.regexp,wholeWord:(l=e?.wholeWord)!==null&&l!==void 0?l:a.wholeWord})}function ce(t){let e=U(t,N);return e&&e.dom.querySelector("[main-field]")}function oe(t){let e=ce(t);e&&e==t.root.activeElement&&e.select()}const ae=t=>{let e=t.state.field(x,!1);if(e&&e.panel){let r=ce(t);if(r&&r!=t.root.activeElement){let n=I(t.state,e.query.spec);n.valid&&t.dispatch({effects:L.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[B.of(!0),e?L.of(I(t.state,e.query.spec)):_.appendConfig.of(Q)]});return!0},he=t=>{let e=t.state.field(x,!1);if(!e||!e.panel)return!1;let r=U(t,N);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:B.of(!1)}),!0},Ye=[{key:"Mod-f",run:ae,scope:"editor search-panel"},{key:"F3",run:w,shift:P,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:w,shift:P,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:he,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Be},{key:"Mod-Alt-g",run:Ce},{key:"Mod-d",run:Re,preventDefault:!0}];class Ve{constructor(e){this.view=e;let r=this.query=e.state.field(x).query.spec;this.commit=this.commit.bind(this),this.searchField=m("input",{value:r.search,placeholder:u(e,"Find"),"aria-label":u(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=m("input",{value:r.replace,placeholder:u(e,"Replace"),"aria-label":u(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=m("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=m("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=m("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(i,s,l){return m("button",{class:"cm-button",name:i,onclick:s,type:"button"},l)}this.dom=m("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,n("next",()=>w(e),[u(e,"next")]),n("prev",()=>P(e),[u(e,"previous")]),n("select",()=>ze(e),[u(e,"all")]),m("label",null,[this.caseField,u(e,"match case")]),m("label",null,[this.reField,u(e,"regexp")]),m("label",null,[this.wordField,u(e,"by word")]),...e.state.readOnly?[]:[m("br"),this.replaceField,n("replace",()=>J(e),[u(e,"replace")]),n("replaceAll",()=>Ne(e),[u(e,"replace all")])],m("button",{name:"close",onclick:()=>he(e),"aria-label":u(e,"close"),type:"button"},["×"])])}commit(){let e=new se({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:L.of(e)}))}keydown(e){de(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?P:w)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),J(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(L)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(M).top}}function u(t,e){return t.state.phrase(e)}const E=30,F=/[\s\.,:;?!]/;function V(t,{from:e,to:r}){let n=t.state.doc.lineAt(e),i=t.state.doc.lineAt(r).to,s=Math.max(n.from,e-E),l=Math.min(i,r+E),c=t.state.sliceDoc(s,l);if(s!=n.from){for(let o=0;o<E;o++)if(!F.test(c[o+1])&&F.test(c[o])){c=c.slice(o);break}}if(l!=i){for(let o=c.length-1;o>c.length-E;o--)if(!F.test(c[o-1])&&F.test(c[o])){c=c.slice(0,o);break}}return S.announce.of(`${t.state.phrase("current match")}. ${c} ${t.state.phrase("on line")} ${n.number}.`)}const He=S.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Q=[x,Me.low(_e),He];export{re as RegExpCursor,b as SearchCursor,se as SearchQuery,he as closeSearchPanel,w as findNext,P as findPrevious,Ue as getSearchQuery,Ce as gotoLine,je as highlightSelectionMatches,ae as openSearchPanel,Ne as replaceAll,J as replaceNext,Je as search,Ye as searchKeymap,Xe as searchPanelOpen,ze as selectMatches,Re as selectNextOccurrence,Be as selectSelectionMatches,L as setSearchQuery};
@@ -0,0 +1,9 @@
1
+ import{r as O}from"./index-D_NuPfjr.js";var y={exports:{}},n={};/**
2
+ * @license React
3
+ * react-dom.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var o;function S(){if(o)return n;o=1;var u=O();function g(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var i={d:{f:c,r:function(){throw Error(g(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},m=Symbol.for("react.portal");function v(r,e,t){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:a==null?null:""+a,children:r,containerInfo:e,implementation:t}}var f=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}return n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,n.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(g(299));return v(r,e,null,t)},n.flushSync=function(r){var e=f.T,t=i.p;try{if(f.T=null,i.p=2,r)return r()}finally{f.T=e,i.p=t,i.d.f()}},n.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,i.d.C(r,e))},n.prefetchDNS=function(r){typeof r=="string"&&i.d.D(r)},n.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,a=d(t,e.crossOrigin),s=typeof e.integrity=="string"?e.integrity:void 0,l=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?i.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:a,integrity:s,fetchPriority:l}):t==="script"&&i.d.X(r,{crossOrigin:a,integrity:s,fetchPriority:l,nonce:typeof e.nonce=="string"?e.nonce:void 0})}},n.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=d(e.as,e.crossOrigin);i.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&i.d.M(r)},n.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,a=d(t,e.crossOrigin);i.d.L(r,t,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}},n.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=d(e.as,e.crossOrigin);i.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else i.d.m(r)},n.requestFormReset=function(r){i.d.r(r)},n.unstable_batchedUpdates=function(r,e){return r(e)},n.useFormState=function(r,e,t){return f.H.useFormState(r,e,t)},n.useFormStatus=function(){return f.H.useHostTransitionStatus()},n.version="19.2.7",n}var _;function T(){if(_)return y.exports;_=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(g){console.error(g)}}return u(),y.exports=S(),y.exports}export{T as r};
@@ -0,0 +1 @@
1
+ import{g as f}from"./_commonjsHelpers-D6-XlEtG.js";import{r as i}from"./index-CinJrH5C.js";function c(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s=i();const p=f(s),l=c({__proto__:null,default:p},[s]);export{l as _,p as i,s as r};