Files
cms-backend/Resources/Public/JavaScript/Contrib/@codemirror/language.js
T

4 lines
37 KiB
JavaScript

import{NodeProp as y,IterMode as he,Tree as b,TreeFragment as H,Parser as yt,NodeType as U,NodeSet as fe}from"@lezer/common";import{StateEffect as j,StateField as Q,Facet as v,EditorState as L,countColumn as ue,combineConfig as vt,RangeSet as xt,RangeSetBuilder as X,Prec as St}from"@codemirror/state";import{ViewPlugin as V,logException as ce,EditorView as w,Decoration as p,WidgetType as Tt,gutter as de,GutterMarker as pe,Direction as $}from"@codemirror/view";import{tags as u,tagHighlighter as ge,highlightTree as me,styleTags as ke}from"@lezer/highlight";import{StyleModule as Pt}from"style-mod";var Y;const P=new y;function Z(n){return v.define({combine:n?t=>t.concat(n):void 0})}const At=new y;class g{constructor(t,e,r=[],i=""){this.data=t,this.name=i,L.prototype.hasOwnProperty("tree")||Object.defineProperty(L.prototype,"tree",{get(){return m(this)}}),this.parser=e,this.extension=[S.of(this),L.languageData.of((s,o,l)=>{let a=Ct(s,o,l),h=a.type.prop(P);if(!h)return[];let f=s.facet(h),c=a.type.prop(At);if(c){let k=a.resolve(o-a.from,l);for(let d of c)if(d.test(k,s)){let x=s.facet(d.facet);return d.type=="replace"?x:x.concat(f)}}return f})].concat(r)}isActiveAt(t,e,r=-1){return Ct(t,e,r).type.prop(P)==this.data}findRegions(t){let e=t.facet(S);if(e?.data==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(P)==this.data){r.push({from:o,to:o+s.length});return}let l=s.prop(y.mounted);if(l){if(l.tree.prop(P)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+o,to:a.to+o});else r.push({from:o,to:o+s.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+o),r.length>a)return}}for(let a=0;a<s.children.length;a++){let h=s.children[a];h instanceof b&&i(h,s.positions[a]+o)}};return i(m(t),0),r}get allowsNesting(){return!0}}g.setState=j.define();function Ct(n,t,e){let r=n.facet(S),i=m(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(t,e,he.ExcludeBuffers))s.type.isTop&&(i=s);return i}class J extends g{constructor(t,e,r){super(t,e,[],r),this.parser=e}static define(t){let e=Z(t.languageData);return new J(e,t.parser.configure({props:[P.add(r=>r.isTop?e:void 0)]}),t.name)}configure(t,e){return new J(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function m(n){let t=n.field(g.state,!1);return t?t.tree:b.empty}function It(n,t,e=50){var r;let i=(r=n.field(g.state,!1))===null||r===void 0?void 0:r.context;if(!i)return null;let s=i.viewport;i.updateViewport({from:0,to:t});let o=i.isDone(t)||i.work(e,t)?i.tree:null;return i.updateViewport(s),o}function be(n,t=n.doc.length){var e;return((e=n.field(g.state,!1))===null||e===void 0?void 0:e.context.isDone(t))||!1}function we(n,t=n.viewport.to,e=100){let r=It(n.state,t,e);return r!=m(n.state)&&n.dispatch({}),!!r}function ye(n){var t;return((t=n.plugin(Lt))===null||t===void 0?void 0:t.isWorking())||!1}class Dt{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 r=this.cursorPos-this.string.length;return t<r||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-r,e-r)}}let N=null;class C{constructor(t,e,r=[],i,s,o,l,a){this.parser=t,this.state=e,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,r){return new C(t,e,[],b.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Dt(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=b.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;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(H.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r: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(H.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=N;N=this;try{return t()}finally{N=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Ot(t,e.from,e.to);return t}changes(t,e){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((h,f,c,k)=>a.push({fromA:h,toA:f,fromB:c,toB:k})),r=H.applyChanges(r,a),i=b.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let f=t.mapPos(h.from,1),c=t.mapPos(h.to,-1);f<c&&l.push({from:f,to:c})}}}return new C(this.parser,e,r,i,s,o,l,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<t.to&&s>t.from&&(this.fragments=Ot(this.fragments,i,s),this.skipped.splice(r--,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 yt{createParse(e,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let a=N;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=o,new b(U.none,[],[],o-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 N}}function Ot(n,t,e){return H.applyChanges(n,[{fromA:t,toA:e,fromB:t,toB:e}])}class M{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),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,r)||e.takeTree(),new M(e)}static init(t){let e=Math.min(3e3,t.doc.length),r=C.create(t.facet(S).parser,t,{from:0,to:e});return r.work(20,e)||r.takeTree(),new M(r)}}g.state=Q.define({create:M.init,update(n,t){for(let e of t.effects)if(e.is(g.setState))return e.value;return t.startState.facet(S)!=t.state.facet(S)?M.init(t.state):n.apply(t)}});let Mt=n=>{let t=setTimeout(()=>n(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(Mt=n=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(n,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const tt=typeof navigator<"u"&&(!((Y=navigator.scheduling)===null||Y===void 0)&&Y.isInputPending)?()=>navigator.scheduling.isInputPending():null,Lt=V.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(g.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(g.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=Mt(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:r,viewport:{to:i}}=this.view,s=r.field(g.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!tt?Math.max(25,t.timeRemaining()-5):1e9),l=s.context.treeLen<i&&r.doc.length>i+1e3,a=s.context.work(()=>tt&&tt()||Date.now()>o,i+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:g.setState.of(new M(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>ce(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()}}}),S=v.define({combine(n){return n.length?n[0]:null},enables:n=>[g.state,Lt,w.contentAttributes.compute([n],t=>{let e=t.facet(n);return e&&e.name?{"data-language":e.name}:{}})]});class ve{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class bt{constructor(t,e,r,i,s,o=void 0){this.name=t,this.alias=e,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:e,support:r}=t;if(!e){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(r)}return new bt(t.name,(t.alias||[]).concat(t.name).map(i=>i.toLowerCase()),t.extensions||[],t.filename,e,r)}static matchFilename(t,e){for(let i of t)if(i.filename&&i.filename.test(e))return i;let r=/\.([^.]+)$/.exec(e);if(r){for(let i of t)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(t,e,r=!0){e=e.toLowerCase();for(let i of t)if(i.alias.some(s=>s==e))return i;if(r)for(let i of t)for(let s of i.alias){let o=e.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(e[o-1])&&!/\w/.test(e[o+s.length])))return i}return null}}const et=v.define(),nt=v.define({combine:n=>{if(!n.length)return" ";let t=n[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return t}});function B(n){let t=n.facet(nt);return t.charCodeAt(0)==9?n.tabSize*t.length:t.length}function rt(n,t){let e="",r=n.tabSize,i=n.facet(nt)[0];if(i==" "){for(;t>=r;)e+=" ",t-=r;i=" "}for(let s=0;s<t;s++)e+=i;return e}function it(n,t){n instanceof L&&(n=new q(n));for(let r of n.state.facet(et)){let i=r(n,t);if(i!==void 0)return i}let e=m(n.state);return e.length>=t?Se(n,e,t):null}function xe(n,t,e){let r=Object.create(null),i=new q(n,{overrideIndentation:o=>{var l;return(l=r[o])!==null&&l!==void 0?l:-1}}),s=[];for(let o=t;o<=e;){let l=n.doc.lineAt(o);o=l.to+1;let a=it(i,l.from);if(a==null)continue;/\S/.test(l.text)||(a=0);let h=/^\s*/.exec(l.text)[0],f=rt(n,a);h!=f&&(r[l.from]=a,s.push({from:l.from,to:l.from+h.length,insert:f}))}return n.changes(s)}class q{constructor(t,e={}){this.state=t,this.options=e,this.unit=B(t)}lineAt(t,e=1){let r=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==t?{text:"",from:t}:(e<0?i<t:i<=t)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(t,e);return r.slice(t-i,Math.min(r.length,t+100-i))}column(t,e=1){let{text:r,from:i}=this.lineAt(t,e),s=this.countColumn(r,t-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(t,e=t.length){return ue(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:r,from:i}=this.lineAt(t,e),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Nt=new y;function Se(n,t,e){let r=t.resolveStack(e),i=r.node.enterUnfinishedNodesBefore(e);if(i!=r.node){let s=[];for(let o=i;o!=r.node;o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return Bt(r,n,e)}function Bt(n,t,e){for(let r=n;r;r=r.next){let i=Pe(r.node);if(i)return i(_.create(t,e,r))}return 0}function Te(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Pe(n){let t=n.type.prop(Nt);if(t)return t;let e=n.firstChild,r;if(e&&(r=e.type.prop(y.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>Rt(o,!0,1,void 0,s&&!Te(o)?i.from:void 0)}return n.parent==null?Ae:null}function Ae(){return 0}class _ extends q{constructor(t,e,r){super(t.state,t.options),this.base=t,this.pos=e,this.context=r}get node(){return this.context.node}static create(t,e,r){return new _(t,e,r)}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 r=t.resolve(e.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Ce(r,t))break;e=this.state.doc.lineAt(r.from)}return this.lineIndent(e.from)}continue(){return Bt(this.context.next,this.base,this.pos)}}function Ce(n,t){for(let e=t;e;e=e.parent)if(n==e)return!0;return!1}function Ie(n){let t=n.node,e=t.childAfter(t.from),r=t.lastChild;if(!e)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(e.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped)return a.from<o?e:null;l=a.to}}function De({closing:n,align:t=!0,units:e=1}){return r=>Rt(r,t,e,n)}function Rt(n,t,e,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,l=r&&s.slice(o,o+r.length)==r||i==n.pos+o,a=t?Ie(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*e)}const Oe=n=>n.baseIndent;function Me({except:n,units:t=1}={}){return e=>{let r=n&&n.test(e.textAfter);return e.baseIndent+(r?0:t*e.unit)}}const Le=200;function Ne(){return L.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let t=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!t.length)return n;let e=n.newDoc,{head:r}=n.newSelection.main,i=e.lineAt(r);if(r>i.from+Le)return n;let s=e.sliceString(i.from,r);if(!t.some(h=>h.test(s)))return n;let{state:o}=n,l=-1,a=[];for(let{head:h}of o.selection.ranges){let f=o.doc.lineAt(h);if(f.from==l)continue;l=f.from;let c=it(o,f.from);if(c==null)continue;let k=/^\s*/.exec(f.text)[0],d=rt(o,c);k!=d&&a.push({from:f.from,to:f.from+k.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const Ft=v.define(),Et=new y;function Be(n){let t=n.firstChild,e=n.lastChild;return t&&t.to<e.from?{from:t.to,to:e.type.isError?n.to:e.from}:null}function Re(n,t,e){let r=m(n);if(r.length<e)return null;let i=r.resolveStack(e,1),s=null;for(let o=i;o;o=o.next){let l=o.node;if(l.to<=e||l.from>e)continue;if(s&&l.from<t)break;let a=l.type.prop(Et);if(a&&(l.to<r.length-50||r.length==n.doc.length||!Fe(l))){let h=a(l,n);h&&h.from<=e&&h.from>=t&&h.to>e&&(s=h)}}return s}function Fe(n){let t=n.lastChild;return t&&t.to==n.to&&t.type.isError}function D(n,t,e){for(let r of n.facet(Ft)){let i=r(n,t,e);if(i)return i}return Re(n,t,e)}function Wt(n,t){let e=t.mapPos(n.from,1),r=t.mapPos(n.to,-1);return e>=r?void 0:{from:e,to:r}}const O=j.define({map:Wt}),A=j.define({map:Wt});function st(n){let t=[];for(let{head:e}of n.state.selection.ranges)t.some(r=>r.from<=e&&r.to>=e)||t.push(n.lineBlockAt(e));return t}const T=Q.define({create(){return p.none},update(n,t){n=n.map(t.changes);for(let e of t.effects)if(e.is(O)&&!We(n,e.value.from,e.value.to)){let{preparePlaceholder:r}=t.state.facet(lt),i=r?p.replace({widget:new $e(r(t.state,e.value))}):qt;n=n.update({add:[i.range(e.value.from,e.value.to)]})}else e.is(A)&&(n=n.update({filter:(r,i)=>e.value.from!=r||e.value.to!=i,filterFrom:e.value.from,filterTo:e.value.to}));if(t.selection){let e=!1,{head:r}=t.selection.main;n.between(r,r,(i,s)=>{i<r&&s>r&&(e=!0)}),e&&(n=n.update({filterFrom:r,filterTo:r,filter:(i,s)=>s<=r||i>=r}))}return n},provide:n=>w.decorations.from(n),toJSON(n,t){let e=[];return n.between(0,t.doc.length,(r,i)=>{e.push(r,i)}),e},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let e=0;e<n.length;){let r=n[e++],i=n[e++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");t.push(qt.range(r,i))}return p.set(t,!0)}});function Ee(n){return n.field(T,!1)||xt.empty}function R(n,t,e){var r;let i=null;return(r=n.field(T,!1))===null||r===void 0||r.between(t,e,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function We(n,t,e){let r=!1;return n.between(t,t,(i,s)=>{i==t&&s==e&&(r=!0)}),r}function ot(n,t){return n.field(T,!1)?t:t.concat(j.appendConfig.of(at()))}const Ht=n=>{for(let t of st(n)){let e=D(n.state,t.from,t.to);if(e)return n.dispatch({effects:ot(n.state,[O.of(e),z(n,e)])}),!0}return!1},Ut=n=>{if(!n.state.field(T,!1))return!1;let t=[];for(let e of st(n)){let r=R(n.state,e.from,e.to);r&&t.push(A.of(r),z(n,r,!1))}return t.length&&n.dispatch({effects:t}),t.length>0};function z(n,t,e=!0){let r=n.state.doc.lineAt(t.from).number,i=n.state.doc.lineAt(t.to).number;return w.announce.of(`${n.state.phrase(e?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const jt=n=>{let{state:t}=n,e=[];for(let r=0;r<t.doc.length;){let i=n.lineBlockAt(r),s=D(t,i.from,i.to);s&&e.push(O.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return e.length&&n.dispatch({effects:ot(n.state,e)}),!!e.length},Vt=n=>{let t=n.state.field(T,!1);if(!t||!t.size)return!1;let e=[];return t.between(0,n.state.doc.length,(r,i)=>{e.push(A.of({from:r,to:i}))}),n.dispatch({effects:e}),!0};function He(n,t){for(let e=t;;){let r=D(n.state,e.from,e.to);if(r&&r.to>t.from)return r;if(!e.from)return null;e=n.lineBlockAt(e.from-1)}}const Ue=n=>{let t=[];for(let e of st(n)){let r=R(n.state,e.from,e.to);if(r)t.push(A.of(r),z(n,r,!1));else{let i=He(n,e);i&&t.push(O.of(i),z(n,i))}}return t.length>0&&n.dispatch({effects:ot(n.state,t)}),!!t.length},je=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Ht},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Ut},{key:"Ctrl-Alt-[",run:jt},{key:"Ctrl-Alt-]",run:Vt}],Ve={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},lt=v.define({combine(n){return vt(n,Ve)}});function at(n){let t=[T,Ge];return n&&t.push(lt.of(n)),t}function $t(n,t){let{state:e}=n,r=e.facet(lt),i=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=R(n.state,l.from,l.to);a&&n.dispatch({effects:A.of(a)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,t);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",e.phrase("folded code")),s.title=e.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const qt=p.replace({widget:new class extends Tt{toDOM(n){return $t(n,null)}}});class $e extends Tt{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return $t(t,this.value)}}const qe={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ht extends pe{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 ze(n={}){let t=Object.assign(Object.assign({},qe),n),e=new ht(t,!0),r=new ht(t,!1),i=V.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(S)!=o.state.facet(S)||o.startState.field(T,!1)!=o.state.field(T,!1)||m(o.startState)!=m(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new X;for(let a of o.viewportLineBlocks){let h=R(o.state,a.from,a.to)?r:D(o.state,a.from,a.to)?e:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:s}=t;return[i,de({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(i))===null||l===void 0?void 0:l.markers)||xt.empty},initialSpacer(){return new ht(t,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let h=R(o.state,l.from,l.to);if(h)return o.dispatch({effects:A.of(h)}),!0;let f=D(o.state,l.from,l.to);return f?(o.dispatch({effects:O.of(f)}),!0):!1}})}),at()]}const Ge=w.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 W{constructor(t,e){this.specs=t;let r;function i(l){let a=Pt.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const s=typeof e.all=="string"?e.all:e.all?i(e.all):void 0,o=e.scope;this.scope=o instanceof g?l=>l.prop(P)==o.data:o?l=>l==o:void 0,this.style=ge(t.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=r?new Pt(r):null,this.themeType=e.themeType}static define(t,e){return new W(t,e||{})}}const ft=v.define(),zt=v.define({combine(n){return n.length?[n[0]]:null}});function G(n){let t=n.facet(ft);return t.length?t:n.facet(zt)}function Je(n,t){let e=[Qe],r;return n instanceof W&&(n.module&&e.push(w.styleModule.of(n.module)),r=n.themeType),t?.fallback?e.push(zt.of(n)):r?e.push(ft.computeN([w.darkTheme],i=>i.facet(w.darkTheme)==(r=="dark")?[n]:[])):e.push(ft.of(n)),e}function _e(n,t,e){let r=G(n),i=null;if(r){for(let s of r)if(!s.scope||e&&s.scope(e)){let o=s.style(t);o&&(i=i?i+" "+o:o)}}return i}class Ke{constructor(t){this.markCache=Object.create(null),this.tree=m(t.state),this.decorations=this.buildDeco(t,G(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=m(t.state),r=G(t.state),i=r!=G(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<s.to&&!i&&e.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||i)&&(this.tree=e,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=s.to)}buildDeco(t,e){if(!e||!this.tree.length)return p.none;let r=new X;for(let{from:i,to:s}of t.visibleRanges)me(this.tree,e,(o,l,a)=>{r.add(o,l,this.markCache[a]||(this.markCache[a]=p.mark({class:a})))},i,s);return r.finish()}}const Qe=St.high(V.fromClass(Ke,{decorations:n=>n.decorations})),Xe=W.define([{tag:u.meta,color:"#404740"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),Ye=w.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Gt=1e4,Jt="()[]{}",_t=v.define({combine(n){return vt(n,{afterCursor:!0,brackets:Jt,maxScanDistance:Gt,renderMatch:en})}}),Ze=p.mark({class:"cm-matchingBracket"}),tn=p.mark({class:"cm-nonmatchingBracket"});function en(n){let t=[],e=n.matched?Ze:tn;return t.push(e.range(n.start.from,n.start.to)),n.end&&t.push(e.range(n.end.from,n.end.to)),t}const nn=Q.define({create(){return p.none},update(n,t){if(!t.docChanged&&!t.selection)return n;let e=[],r=t.state.facet(_t);for(let i of t.state.selection.ranges){if(!i.empty)continue;let s=F(t.state,i.head,-1,r)||i.head>0&&F(t.state,i.head-1,1,r)||r.afterCursor&&(F(t.state,i.head,1,r)||i.head<t.state.doc.length&&F(t.state,i.head+1,-1,r));s&&(e=e.concat(r.renderMatch(s,t.state)))}return p.set(e,!0)},provide:n=>w.decorations.from(n)}),rn=[nn,Ye];function sn(n={}){return[_t.of(n),rn]}const Kt=new y;function ut(n,t,e){let r=n.prop(t<0?y.openedBy:y.closedBy);if(r)return r;if(n.name.length==1){let i=e.indexOf(n.name);if(i>-1&&i%2==(t<0?1:0))return[e[i+t]]}return null}function ct(n){let t=n.type.prop(Kt);return t?t(n.node):n}function F(n,t,e,r={}){let i=r.maxScanDistance||Gt,s=r.brackets||Jt,o=m(n),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let h=ut(a.type,e,s);if(h&&a.from<a.to){let f=ct(a);if(f&&(e>0?t>=f.from&&t<f.to:t>f.from&&t<=f.to))return on(n,t,e,a,f,h,s)}}return ln(n,t,e,o,l.type,i,s)}function on(n,t,e,r,i,s,o){let l=r.parent,a={from:i.from,to:i.to},h=0,f=l?.cursor();if(f&&(e<0?f.childBefore(r.from):f.childAfter(r.to)))do if(e<0?f.to<=r.from:f.from>=r.to){if(h==0&&s.indexOf(f.type.name)>-1&&f.from<f.to){let c=ct(f);return{start:a,end:c?{from:c.from,to:c.to}:void 0,matched:!0}}else if(ut(f.type,e,o))h++;else if(ut(f.type,-e,o)){if(h==0){let c=ct(f);return{start:a,end:c&&c.from<c.to?{from:c.from,to:c.to}:void 0,matched:!1}}h--}}while(e<0?f.prevSibling():f.nextSibling());return{start:a,matched:!1}}function ln(n,t,e,r,i,s,o){let l=e<0?n.sliceDoc(t-1,t):n.sliceDoc(t,t+1),a=o.indexOf(l);if(a<0||a%2==0!=e>0)return null;let h={from:e<0?t-1:t,to:e>0?t+1:t},f=n.doc.iterRange(t,e>0?n.doc.length:0),c=0;for(let k=0;!f.next().done&&k<=s;){let d=f.value;e<0&&(k+=d.length);let x=t+k*e;for(let I=e>0?0:d.length-1,ae=e>0?d.length:-1;I!=ae;I+=e){let K=o.indexOf(d[I]);if(!(K<0||r.resolveInner(x+I,1).type!=i))if(K%2==0==e>0)c++;else{if(c==1)return{start:h,end:{from:x+I,to:x+I+1},matched:K>>1==a>>1};c--}}e>0&&(k+=d.length)}return f.done?{start:h,matched:!1}:null}function Qt(n,t,e,r=0,i=0){t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length));let s=i;for(let o=r;o<t;o++)n.charCodeAt(o)==9?s+=e-s%e:s++;return s}class dt{constructor(t,e,r,i){this.string=t,this.tabSize=e,this.indentUnit=r,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),r;if(typeof t=="string"?r=e==t:r=e&&(t instanceof RegExp?t.test(e):t(e)),r)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=Qt(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:Qt(this.string,null,this.tabSize)}match(t,e,r){if(typeof t=="string"){let i=o=>r?o.toLowerCase():o,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 an(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||hn,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||gt}}function hn(n){if(typeof n!="object")return n;let t={};for(let e in n){let r=n[e];t[e]=r instanceof Array?r.slice():r}return t}const Xt=new WeakMap;class wt extends g{constructor(t){let e=Z(t.languageData),r=an(t),i,s=new class extends yt{createParse(o,l,a){return new un(i,o,l,a)}};super(e,s,[et.of((o,l)=>this.getIndent(o,l))],t.name),this.topNode=pn(e),i=this,this.streamParser=r,this.stateAfter=new y({perNode:!0}),this.tokenTable=t.tokenTable?new re(r.tokenTable):dn}static define(t){return new wt(t)}getIndent(t,e){let r=m(t.state),i=r.resolve(e);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return null;let s,{overrideIndentation:o}=t.options;o&&(s=Xt.get(t.state),s!=null&&s<e-1e4&&(s=void 0));let l=pt(this,r,0,i.from,s??e),a,h;if(l?(h=l.state,a=l.pos+1):(h=this.streamParser.startState(t.unit),a=0),e-a>1e4)return null;for(;a<e;){let c=t.state.doc.lineAt(a),k=Math.min(e,c.to);if(c.length){let d=o?o(c.from):-1,x=new dt(c.text,t.state.tabSize,t.unit,d<0?void 0:d);for(;x.pos<k-c.from;)Zt(this.streamParser.token,x,h)}else this.streamParser.blankLine(h,t.unit);if(k==e)break;a=c.to+1}let f=t.lineAt(e);return o&&s==null&&Xt.set(t.state,f.from),this.streamParser.indent(h,/^\s*(.*)/.exec(f.text)[1],t)}get allowsNesting(){return!1}}function pt(n,t,e,r,i){let s=e>=r&&e+t.length<=i&&t.prop(n.stateAfter);if(s)return{state:n.streamParser.copyState(s),pos:e+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],a=e+t.positions[o],h=l instanceof b&&a<i&&pt(n,l,a,r,i);if(h)return h}return null}function Yt(n,t,e,r,i){if(i&&e<=0&&r>=t.length)return t;!i&&t.type==n.topNode&&(i=!0);for(let s=t.children.length-1;s>=0;s--){let o=t.positions[s],l=t.children[s],a;if(o<r&&l instanceof b){if(!(a=Yt(n,l,e-o,r-o,i)))break;return i?new b(t.type,t.children.slice(0,s).concat(a),t.positions.slice(0,s+1),o+a.length):a}}return null}function fn(n,t,e,r){for(let i of t){let s=i.from+(i.openStart?25:0),o=i.to-(i.openEnd?25:0),l=s<=e&&o>e&&pt(n,i.tree,0-i.offset,e,o),a;if(l&&(a=Yt(n,i.tree,e+i.offset,l.pos+i.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(r?B(r):4),tree:b.empty}}class un{constructor(t,e,r,i){this.lang=t,this.input=e,this.fragments=r,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=C.get(),o=i[0].from,{state:l,tree:a}=fn(t,r,o,s?.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h<a.children.length;h++)this.chunks.push(a.children[h]),this.chunkPos.push(a.positions[h]);s&&this.parsedPos<s.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(B(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=C.get(),e=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(e,this.chunkStart+2048);for(t&&(r=Math.min(r,t.viewport.to));this.parsedPos<r;)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==`
`&&(e="");else{let r=e.indexOf(`
`);r>-1&&(e=e.slice(0,r))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),r=t+e.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=r||(e=e.slice(0,s-(r-e.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,l=this.lineAfter(o);e+=l,r=o+l.length}return{line:e,end:r}}skipGapsTo(t,e,r){for(;;){let i=this.ranges[this.rangeIndex].to,s=t+e;if(r>0?i>s:i>=s)break;let o=this.ranges[++this.rangeIndex].from;e+=o-i}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,r,i,s){if(this.ranges.length>1){s=this.skipGapsTo(e,s,1),e+=s;let o=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-o}return this.chunk.push(t,e,r,i),s}parseLine(t){let{line:e,end:r}=this.nextLine(),i=0,{streamParser:s}=this.lang,o=new dt(e,t?t.state.tabSize:4,t?B(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Zt(s.token,o,this.state);if(l&&(i=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,i)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=b.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:cn,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new b(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 b(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function Zt(n,t,e){t.start=t.pos;for(let r=0;r<10;r++){let i=n(t,e);if(t.pos>t.start)return i}throw new Error("Stream parser failed to advance stream.")}const gt=Object.create(null),E=[U.none],cn=new fe(E),te=[],ee=Object.create(null),ne=Object.create(null);for(let[n,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"]])ne[n]=ie(gt,t);class re{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),ne)}resolve(t){return t?this.table[t]||(this.table[t]=ie(this.extra,t)):0}}const dn=new re(gt);function mt(n,t){te.indexOf(n)>-1||(te.push(n),console.warn(t))}function ie(n,t){let e=[];for(let l of t.split(" ")){let a=[];for(let h of l.split(".")){let f=n[h]||u[h];f?typeof f=="function"?a.length?a=a.map(f):mt(h,`Modifier ${h} used at start of tag`):a.length?mt(h,`Tag ${h} used as modifier`):a=Array.isArray(f)?f:[f]:mt(h,`Unknown highlighting tag ${h}`)}for(let h of a)e.push(h)}if(!e.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+e.map(l=>l.id),s=ee[i];if(s)return s.id;let o=ee[i]=U.define({id:E.length,name:r,props:[ke({[r]:e})]});return E.push(o),o.id}function pn(n){let t=U.define({id:E.length,name:"Document",props:[P.add(()=>n)],top:!0});return E.push(t),t}function se(n){return n.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(n)}function oe(n){for(let t=n.iter();!t.next().done;)if(se(t.value))return!0;return!1}function gn(n){let t=!1;return n.iterChanges((e,r,i,s,o)=>{!t&&oe(o)&&(t=!0)}),t}const kt=v.define({combine:n=>n.some(t=>t)});function mn(n={}){let t=[kn];return n.alwaysIsolate&&t.push(kt.of(!0)),t}const kn=V.fromClass(class{constructor(n){this.always=n.state.facet(kt)||n.textDirection!=$.LTR||n.state.facet(w.perLineTextDirection),this.hasRTL=!this.always&&oe(n.state.doc),this.tree=m(n.state),this.decorations=this.always||this.hasRTL?le(n,this.tree,this.always):p.none}update(n){let t=n.state.facet(kt)||n.view.textDirection!=$.LTR||n.state.facet(w.perLineTextDirection);if(!t&&!this.hasRTL&&gn(n.changes)&&(this.hasRTL=!0),!t&&!this.hasRTL)return;let e=m(n.state);(t!=this.always||e!=this.tree||n.docChanged||n.viewportChanged)&&(this.tree=e,this.always=t,this.decorations=le(n.view,e,t))}},{provide:n=>{function t(e){var r,i;return(i=(r=e.plugin(n))===null||r===void 0?void 0:r.decorations)!==null&&i!==void 0?i:p.none}return[w.outerDecorations.of(t),St.lowest(w.bidiIsolatedRanges.of(t))]}});function le(n,t,e){let r=new X,i=n.visibleRanges;e||(i=bn(i,n.state.doc));for(let{from:s,to:o}of i)t.iterate({enter:l=>{let a=l.type.prop(y.isolate);a&&r.add(l.from,l.to,wn[a])},from:s,to:o});return r.finish()}function bn(n,t){let e=t.iter(),r=0,i=[],s=null;for(let{from:o,to:l}of n)if(!(s&&s.to>o&&(o=s.to,o>=l)))for(r+e.value.length<o&&(e.next(o-(r+e.value.length)),r=o);;){let a=r,h=r+e.value.length;if(!e.lineBreak&&se(e.value)&&(s&&s.to>a-10?s.to=Math.min(l,h):i.push(s={from:a,to:Math.min(l,h)})),h>=l)break;r=h,e.next()}return i}const wn={rtl:p.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:$.RTL}),ltr:p.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:$.LTR}),auto:p.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};export{Dt as DocInput,W as HighlightStyle,q as IndentContext,J as LRLanguage,g as Language,bt as LanguageDescription,ve as LanguageSupport,C as ParseContext,wt as StreamLanguage,dt as StringStream,_ as TreeIndentContext,mn as bidiIsolates,sn as bracketMatching,Kt as bracketMatchingHandle,at as codeFolding,Me as continuedIndent,Xe as defaultHighlightStyle,Z as defineLanguageFacet,De as delimitedIndent,It as ensureSyntaxTree,Oe as flatIndent,jt as foldAll,Ht as foldCode,O as foldEffect,ze as foldGutter,Be as foldInside,je as foldKeymap,Et as foldNodeProp,Ft as foldService,T as foldState,D as foldable,Ee as foldedRanges,we as forceParsing,B as getIndentUnit,it as getIndentation,_e as highlightingFor,Nt as indentNodeProp,Ne as indentOnInput,xe as indentRange,et as indentService,rt as indentString,nt as indentUnit,S as language,P as languageDataProp,F as matchBrackets,At as sublanguageProp,Je as syntaxHighlighting,ye as syntaxParserRunning,m as syntaxTree,be as syntaxTreeAvailable,Ue as toggleFold,Vt as unfoldAll,Ut as unfoldCode,A as unfoldEffect};