(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[9799],{56318:(t,e,s)=>{"use strict";s.d(e,{GA:()=>$,Gn:()=>C,Mb:()=>a,TK:()=>o,eC:()=>l,vQ:()=>O});var i=s(89843),n=s(3546),r=s(17592);class o{constructor(t,e,s){this.state=t,this.pos=e,this.explicit=s,this.abortListeners=[]}tokenBefore(t){let e=(0,r.syntaxTree)(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),s=Math.max(e.from,this.pos-250),i=e.text.slice(s-e.from,this.pos-e.from),n=i.search(function(t,e){var s;let{source:i}=t,n=e&&"^"!=i[0],r="$"!=i[i.length-1];return n||r?new RegExp(`${n?"^":""}(?:${i})${r?"$":""}`,null!==(s=t.flags)&&void 0!==s?s:t.ignoreCase?"i":""):t}(t,!1));return n<0?null:{from:s+n,to:this.pos,text:i.slice(n)}}get aborted(){return null==this.abortListeners}addEventListener(t,e){"abort"==t&&this.abortListeners&&this.abortListeners.push(e)}}function h(t){let e=Object.keys(t).join(""),s=/\w/.test(e);return s&&(e=e.replace(/\w/g,"")),`[${s?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function a(t){let e=t.map((t=>"string"==typeof t?{label:t}:t)),[s,i]=e.every((t=>/^\w+$/.test(t.label)))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),s=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let t=1;t<i.length;t++)s[i[t]]=!0}let i=h(e)+h(s)+"*$";return[new RegExp("^"+i),new RegExp(i)]}(e);return t=>{let n=t.matchBefore(i);return n||t.explicit?{from:n?n.from:t.pos,options:e,validFor:s}:null}}function l(t,e){return s=>{for(let e=(0,r.syntaxTree)(s.state).resolveInner(s.pos,-1);e;e=e.parent){if(t.indexOf(e.name)>-1)return null;if(e.type.isTop)break}return e(s)}}const c=i.Annotation.define();"object"==typeof navigator&&navigator.platform;const f=n.EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class u{constructor(t,e,s,i){this.field=t,this.line=e,this.from=s,this.to=i}}class p{constructor(t,e,s){this.field=t,this.from=e,this.to=s}map(t){let e=t.mapPos(this.from,-1,i.MapMode.TrackDel),s=t.mapPos(this.to,1,i.MapMode.TrackDel);return null==e||null==s?null:new p(this.field,e,s)}}class d{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let s=[],i=[e],n=t.doc.lineAt(e),o=/^\s*/.exec(n.text)[0];for(let n of this.lines){if(s.length){let s=o,h=/^\t*/.exec(n)[0].length;for(let e=0;e<h;e++)s+=t.facet(r.indentUnit);i.push(e+s.length-h),n=s+n.slice(h)}s.push(n),e+=n.length+1}let h=this.fieldPositions.map((t=>new p(t.field,i[t.line]+t.from,i[t.line]+t.to)));return{text:s,ranges:h}}static parse(t){let e,s=[],i=[],n=[];for(let r of t.split(/\r\n?|\n/)){for(;e=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(r);){let t=e[1]?+e[1]:null,o=e[2]||e[3]||"",h=-1;for(let e=0;e<s.length;e++)(null!=t?s[e].seq==t:o&&s[e].name==o)&&(h=e);if(h<0){let e=0;for(;e<s.length&&(null==t||null!=s[e].seq&&s[e].seq<t);)e++;s.splice(e,0,{seq:t,name:o}),h=e;for(let t of n)t.field>=h&&t.field++}n.push(new u(h,i.length,e.index,e.index+o.length)),r=r.slice(0,e.index)+o+r.slice(e.index+e[0].length)}for(let t;t=/\\([{}])/.exec(r);){r=r.slice(0,t.index)+t[1]+r.slice(t.index+t[0].length);for(let e of n)e.line==i.length&&e.from>t.index&&(e.from--,e.to--)}i.push(r)}return new d(i,n)}}let g=n.Decoration.widget({widget:new class extends n.WidgetType{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),m=n.Decoration.mark({class:"cm-snippetField"});class k{constructor(t,e){this.ranges=t,this.active=e,this.deco=n.Decoration.set(t.map((t=>(t.from==t.to?g:m).range(t.from,t.to))))}map(t){let e=[];for(let s of this.ranges){let i=s.map(t);if(!i)return null;e.push(i)}return new k(e,this.active)}selectionInsideField(t){return t.ranges.every((t=>this.ranges.some((e=>e.field==this.active&&e.from<=t.from&&e.to>=t.to))))}}const x=i.StateEffect.define({map:(t,e)=>t&&t.map(e)}),b=i.StateEffect.define(),v=i.StateField.define({create:()=>null,update(t,e){for(let s of e.effects){if(s.is(x))return s.value;if(s.is(b)&&t)return new k(t.ranges,s.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>n.EditorView.decorations.from(t,(t=>t?t.deco:n.Decoration.none))});function y(t,e){return i.EditorSelection.create(t.filter((t=>t.field==e)).map((t=>i.EditorSelection.range(t.from,t.to))))}function S(t){let e=d.parse(t);return(t,s,n,r)=>{let{text:o,ranges:h}=e.instantiate(t.state,n),a={changes:{from:n,to:r,insert:i.Text.of(o)},scrollIntoView:!0,annotations:s?[c.of(s),i.Transaction.userEvent.of("input.complete")]:void 0};if(h.length&&(a.selection=y(h,0)),h.some((t=>t.field>0))){let e=new k(h,0),s=a.effects=[x.of(e)];void 0===t.state.field(v,!1)&&s.push(i.StateEffect.appendConfig.of([v,A,I,f]))}t.dispatch(t.state.update(a))}}function w(t){return({state:e,dispatch:s})=>{let i=e.field(v,!1);if(!i||t<0&&0==i.active)return!1;let n=i.active+t,r=t>0&&!i.ranges.some((e=>e.field==n+t));return s(e.update({selection:y(i.ranges,n),effects:x.of(r?null:new k(i.ranges,n)),scrollIntoView:!0})),!0}}const P=[{key:"Tab",run:w(1),shift:w(-1)},{key:"Escape",run:({state:t,dispatch:e})=>!!t.field(v,!1)&&(e(t.update({effects:x.of(null)})),!0)}],T=i.Facet.define({combine:t=>t.length?t[0]:P}),A=i.Prec.highest(n.keymap.compute([T],(t=>t.facet(T))));function C(t,e){return Object.assign(Object.assign({},e),{apply:S(t)})}const I=n.EditorView.domEventHandlers({mousedown(t,e){let s,i=e.state.field(v,!1);if(!i||null==(s=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let n=i.ranges.find((t=>t.from<=s&&t.to>=s));return!(!n||n.field==i.active||(e.dispatch({selection:y(i.ranges,n.field),effects:x.of(i.ranges.some((t=>t.field>n.field))?new k(i.ranges,n.field):null),scrollIntoView:!0}),0))}}),R={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},E=i.StateEffect.define({map(t,e){let s=e.mapPos(t,-1,i.MapMode.TrackAfter);return null==s?void 0:s}}),N=new class extends i.RangeValue{};N.startSide=1,N.endSide=-1;const D=i.StateField.define({create:()=>i.RangeSet.empty,update(t,e){if(t=t.map(e.changes),e.selection){let s=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:t=>t>=s.from&&t<=s.to})}for(let s of e.effects)s.is(E)&&(t=t.update({add:[N.range(s.value,s.value+1)]}));return t}});function O(){return[M,D]}const z="()[]{}<>";function B(t){for(let e=0;e<8;e+=2)if(z.charCodeAt(e)==t)return z.charAt(e+1);return(0,i.fromCodePoint)(t<128?t:t+1)}function F(t,e){return t.languageDataAt("closeBrackets",e)[0]||R}const L="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),M=n.EditorView.inputHandler.of(((t,e,s,n)=>{if((L?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let r=t.state.selection.main;if(n.length>2||2==n.length&&1==(0,i.codePointSize)((0,i.codePointAt)(n,0))||e!=r.from||s!=r.to)return!1;let o=function(t,e){let s=F(t,t.selection.main.head),n=s.brackets||R.brackets;for(let r of n){let o=B((0,i.codePointAt)(r,0));if(e==r)return o==r?G(t,r,n.indexOf(r+r+r)>-1,s):U(t,r,o,s.before||R.before);if(e==o&&j(t,t.selection.main.from))return W(t,0,o)}return null}(t.state,n);return!!o&&(t.dispatch(o),!0)})),$=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let s=F(t,t.selection.main.head).brackets||R.brackets,n=null,r=t.changeByRange((e=>{if(e.empty){let n=function(t,e){let s=t.sliceString(e-2,e);return(0,i.codePointSize)((0,i.codePointAt)(s,0))==s.length?s:s.slice(1)}(t.doc,e.head);for(let r of s)if(r==n&&V(t.doc,e.head)==B((0,i.codePointAt)(r,0)))return{changes:{from:e.head-r.length,to:e.head+r.length},range:i.EditorSelection.cursor(e.head-r.length)}}return{range:n=e}}));return n||e(t.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!n}}];function j(t,e){let s=!1;return t.field(D).between(0,t.doc.length,(t=>{t==e&&(s=!0)})),s}function V(t,e){let s=t.sliceString(e,e+2);return s.slice(0,(0,i.codePointSize)((0,i.codePointAt)(s,0)))}function U(t,e,s,n){let r=null,o=t.changeByRange((o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:s,from:o.to}],effects:E.of(o.to+e.length),range:i.EditorSelection.range(o.anchor+e.length,o.head+e.length)};let h=V(t.doc,o.head);return!h||/\s/.test(h)||n.indexOf(h)>-1?{changes:{insert:e+s,from:o.head},effects:E.of(o.head+e.length),range:i.EditorSelection.cursor(o.head+e.length)}:{range:r=o}}));return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function W(t,e,s){let n=null,r=t.changeByRange((e=>e.empty&&V(t.doc,e.head)==s?{changes:{from:e.head,to:e.head+s.length,insert:s},range:i.EditorSelection.cursor(e.head+s.length)}:n={range:e}));return n?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function G(t,e,s,n){let o=n.stringPrefixes||R.stringPrefixes,h=null,a=t.changeByRange((n=>{if(!n.empty)return{changes:[{insert:e,from:n.from},{insert:e,from:n.to}],effects:E.of(n.to+e.length),range:i.EditorSelection.range(n.anchor+e.length,n.head+e.length)};let a,l=n.head,c=V(t.doc,l);if(c==e){if(_(t,l))return{changes:{insert:e+e,from:l},effects:E.of(l+e.length),range:i.EditorSelection.cursor(l+e.length)};if(j(t,l)){let n=s&&t.sliceDoc(l,l+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+n.length,insert:n},range:i.EditorSelection.cursor(l+n.length)}}}else{if(s&&t.sliceDoc(l-2*e.length,l)==e+e&&(a=q(t,l-2*e.length,o))>-1&&_(t,a))return{changes:{insert:e+e+e+e,from:l},effects:E.of(l+e.length),range:i.EditorSelection.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=i.CharCategory.Word&&q(t,l,o)>-1&&!function(t,e,s,i){let n=(0,r.syntaxTree)(t).resolveInner(e,-1),o=i.reduce(((t,e)=>Math.max(t,e.length)),0);for(let r=0;r<5;r++){let r=t.sliceDoc(n.from,Math.min(n.to,n.from+s.length+o)),h=r.indexOf(s);if(!h||h>-1&&i.indexOf(r.slice(0,h))>-1){let e=n.firstChild;for(;e&&e.from==n.from&&e.to-e.from>s.length+h;){if(t.sliceDoc(e.to-s.length,e.to)==s)return!1;e=e.firstChild}return!0}let a=n.to==e&&n.parent;if(!a)break;n=a}return!1}(t,l,e,o))return{changes:{insert:e+e,from:l},effects:E.of(l+e.length),range:i.EditorSelection.cursor(l+e.length)}}return{range:h=n}}));return h?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function _(t,e){let s=(0,r.syntaxTree)(t).resolveInner(e+1);return s.parent&&s.from==e}function q(t,e,s){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=i.CharCategory.Word)return e;for(let r of s){let s=e-r.length;if(t.sliceDoc(s,e)==r&&n(t.sliceDoc(s-1,s))!=i.CharCategory.Word)return s}return-1}},49906:(t,e,s)=>{"use strict";s.d(e,{IK:()=>I,Jq:()=>g,RA:()=>d,WQ:()=>R});var i=s(79352),n=s(27061);class r{constructor(t,e,s,i,n,r,o,h,a,l=0,c){this.p=t,this.stack=e,this.state=s,this.reducePos=i,this.pos=n,this.score=r,this.buffer=o,this.bufferBase=h,this.curContext=a,this.lookAhead=l,this.parent=c}toString(){return`[${this.stack.filter(((t,e)=>e%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,s=0){let i=t.parser.context;return new r(t,[],e,s,s,0,[],0,i?new o(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let s=t>>19,i=65535&t,{parser:n}=this.p,r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==s)return this.pushState(n.getGoto(this.state,i,!0),this.reducePos),i<n.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,4,!0),void this.reduceContext(i,this.reducePos);let o=this.stack.length-3*(s-1)-(262144&t?6:0),h=o?this.stack[o-2]:this.p.ranges[0].from,a=this.reducePos-h;a>=2e3&&!(null===(e=this.p.parser.nodeSet.types[i])||void 0===e?void 0:e.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=a):this.p.lastBigReductionSize<a&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=a));let l=o?this.stack[o-1]:0,c=this.bufferBase+this.buffer.length-l;if(i<n.minRepeatTerm||131072&t){let t=n.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,h,t,c+4,!0)}if(262144&t)this.state=this.stack[o];else{let t=this.stack[o-3];this.state=n.getGoto(t,i,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(i,h)}storeNode(t,e,s,i=4,n=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let t=this,i=this.buffer.length;if(0==i&&t.parent&&(i=t.bufferBase-t.parent.bufferBase,t=t.parent),i>0&&0==t.buffer[i-4]&&t.buffer[i-1]>-1){if(e==s)return;if(t.buffer[i-2]>=e)return void(t.buffer[i-2]=s)}}if(n&&this.pos!=s){let n=this.buffer.length;if(n>0&&0!=this.buffer[n-4])for(;n>0&&this.buffer[n-2]>s;)this.buffer[n]=this.buffer[n-4],this.buffer[n+1]=this.buffer[n-3],this.buffer[n+2]=this.buffer[n-2],this.buffer[n+3]=this.buffer[n-1],n-=4,i>4&&(i-=4);this.buffer[n]=t,this.buffer[n+1]=e,this.buffer[n+2]=s,this.buffer[n+3]=i}else this.buffer.push(t,e,s,i)}shift(t,e,s,i){if(131072&t)this.pushState(65535&t,this.pos);else if(0==(262144&t)){let n=t,{parser:r}=this.p;(i>this.pos||e<=r.maxNode)&&(this.pos=i,r.stateFlag(n,1)||(this.reducePos=i)),this.pushState(n,s),this.shiftContext(e,s),e<=r.maxNode&&this.buffer.push(e,s,i,4)}else this.pos=i,this.shiftContext(e,s),e<=this.p.parser.maxNode&&this.buffer.push(e,s,i,4)}apply(t,e,s,i){65536&t?this.reduce(t):this.shift(t,e,s,i)}useNode(t,e){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=t)&&(this.p.reused.push(t),s++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(s,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let s=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new r(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let s=t<=this.p.parser.maxNode;s&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,s?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new h(this);;){let s=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==s)return!1;if(0==(65536&s))return!0;e.reduce(s)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let s=[];for(let i,n=0;n<e.length;n+=2)(i=e[n+1])!=this.state&&this.p.parser.hasAction(i,t)&&s.push(e[n],i);if(this.stack.length<120)for(let t=0;s.length<8&&t<e.length;t+=2){let i=e[t+1];s.some(((t,e)=>1&e&&t==i))||s.push(e[t],i)}e=s}let s=[];for(let t=0;t<e.length&&s.length<4;t+=2){let i=e[t+1];if(i==this.state)continue;let n=this.split();n.pushState(i,this.pos),n.storeNode(0,n.pos,n.pos,4,!0),n.shiftContext(e[t],this.pos),n.reducePos=this.pos,n.score-=200,s.push(n)}return s}forceReduce(){let{parser:t}=this.p,e=t.stateSlot(this.state,5);if(0==(65536&e))return!1;if(!t.validAction(this.state,e)){let s=e>>19,i=65535&e,n=this.stack.length-3*s;if(n<0||t.getGoto(this.stack[n],i,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],s=(i,n)=>{if(!e.includes(i))return e.push(i),t.allActions(i,(e=>{if(393216&e);else if(65536&e){let s=(e>>19)-n;if(s>1){let i=65535&e,n=this.stack.length-3*s;if(n>=0&&t.getGoto(this.stack[n],i,!1)>=0)return s<<19|65536|i}}else{let t=s(e,n+1);if(null!=t)return t}}))};return s(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e<this.stack.length;e+=3)if(this.stack[e]!=t.stack[e])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(e)))}reduceContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(e)))}emitContext(){let t=this.buffer.length-1;(t<0||-3!=this.buffer[t])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||-4!=this.buffer[t])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let e=new o(this.curContext.tracker,t);e.hash!=this.curContext.hash&&this.emitContext(),this.curContext=e}}setLookAhead(t){t>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class o{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class h{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,s=t>>19;0==s?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(s-1);let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class a{constructor(t,e,s){this.stack=t,this.pos=e,this.index=s,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new a(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}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]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new a(this.stack,this.pos,this.index)}}function l(t,e=Uint16Array){if("string"!=typeof t)return t;let s=null;for(let i=0,n=0;i<t.length;){let r=0;for(;;){let e=t.charCodeAt(i++),s=!1;if(126==e){r=65535;break}e>=92&&e--,e>=34&&e--;let n=e-32;if(n>=46&&(n-=46,s=!0),r+=n,s)break;r*=46}s?s[n++]=r:s=new e(r)}return s}class c{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const f=new c;class u{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=f,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let s=this.range,i=this.rangeIndex,n=this.pos+t;for(;n<s.from;){if(!i)return null;let t=this.ranges[--i];n-=s.from-t.to,s=t}for(;e<0?n>s.to:n>=s.to;){if(i==this.ranges.length-1)return null;let t=this.ranges[++i];n+=t.from-s.to,s=t}return n}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let e of this.ranges)if(e.to>t)return Math.max(t,e.from);return this.end}peek(t){let e,s,i=this.chunkOff+t;if(i>=0&&i<this.chunk.length)e=this.pos+t,s=this.chunk.charCodeAt(i);else{let i=this.resolveOffset(t,1);if(null==i)return-1;if(e=i,e>=this.chunk2Pos&&e<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(e-this.chunk2Pos);else{let t=this.rangeIndex,i=this.range;for(;i.to<=e;)i=this.ranges[++t];this.chunk2=this.input.chunk(this.chunk2Pos=e),e+this.chunk2.length>i.to&&(this.chunk2=this.chunk2.slice(0,i.to-e)),s=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),s}acceptToken(t,e=0){let s=e?this.resolveOffset(e,-1):this.pos;if(null==s||s<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=s}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:e}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=e,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),e=this.pos+t.length;this.chunk=e>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=f,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,e){if(t>=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let s="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(s+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return s}}class p{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:s}=e.p;m(this.data,t,e,this.id,s.data,s.tokenPrecTable)}}p.prototype.contextual=p.prototype.fallback=p.prototype.extend=!1;class d{constructor(t,e,s){this.precTable=e,this.elseToken=s,this.data="string"==typeof t?l(t):t}token(t,e){let s=t.pos,i=0;for(;;){let s=t.next<0,n=t.resolveOffset(1,1);if(m(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(null==this.elseToken)return;if(s||i++,null==n)break;t.reset(n,t.token)}i&&(t.reset(s,t.token),t.acceptToken(this.elseToken,i))}}d.prototype.contextual=p.prototype.fallback=p.prototype.extend=!1;class g{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function m(t,e,s,i,n,r){let o=0,h=1<<i,{dialect:a}=s.p.parser;t:for(;0!=(h&t[o]);){let s=t[o+1];for(let i=o+3;i<s;i+=2)if((t[i+1]&h)>0){let s=t[i];if(a.allows(s)&&(-1==e.token.value||e.token.value==s||x(s,e.token.value,n,r))){e.acceptToken(s);break}}let i=e.next,l=0,c=t[o+2];if(!(e.next<0&&c>l&&65535==t[s+3*c-3]&&65535==t[s+3*c-3])){for(;l<c;){let n=l+c>>1,r=s+n+(n<<1),h=t[r],a=t[r+1]||65536;if(i<h)c=n;else{if(!(i>=a)){o=t[r+2],e.advance();continue t}l=n+1}}break}o=t[s+3*c-1]}}function k(t,e,s){for(let i,n=e;65535!=(i=t[n]);n++)if(i==s)return n-e;return-1}function x(t,e,s,i){let n=k(s,i,e);return n<0||k(s,i,t)<n}const b=void 0!==n&&n.env&&/\bparse\b/.test(n.env.LOG);let v=null;function y(t,e,s){let n=t.cursor(i.IterMode.IncludeAnonymous);for(n.moveTo(e);;)if(!(s<0?n.childBefore(e):n.childAfter(e)))for(;;){if((s<0?n.to<e:n.from>e)&&!n.type.isError)return s<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(s<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return s<0?0:t.length}}class S{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?y(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?y(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let e=this.trees.length-1;if(e<0)return this.nextFragment(),null;let s=this.trees[e],n=this.index[e];if(n==s.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=s.children[n],o=this.start[e]+s.positions[n];if(o>t)return this.nextStart=o,null;if(r instanceof i.Tree){if(o==t){if(o<this.safeFrom)return null;let t=o+r.length;if(t<=this.safeTo){let e=r.prop(i.NodeProp.lookAhead);if(!e||t+e<this.fragment.to)return r}}this.index[e]++,o+r.length>=Math.max(this.safeFrom,t)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+r.length}}}class w{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((t=>new c))}getActions(t){let e=0,s=null,{parser:i}=t.p,{tokenizers:n}=i,r=i.stateSlot(t.state,3),o=t.curContext?t.curContext.hash:0,h=0;for(let i=0;i<n.length;i++){if(0==(1<<i&r))continue;let a=n[i],l=this.tokens[i];if((!s||a.fallback)&&((a.contextual||l.start!=t.pos||l.mask!=r||l.context!=o)&&(this.updateCachedToken(l,a,t),l.mask=r,l.context=o),l.lookAhead>l.end+25&&(h=Math.max(l.lookAhead,h)),0!=l.value)){let i=e;if(l.extended>-1&&(e=this.addActions(t,l.extended,l.end,e)),e=this.addActions(t,l.value,l.end,e),!a.extend&&(s=l,e>i))break}}for(;this.actions.length>e;)this.actions.pop();return h&&t.setLookAhead(h),s||t.pos!=this.stream.end||(s=new c,s.value=t.p.parser.eofTerm,s.start=s.end=t.pos,e=this.addActions(t,s.value,s.end,e)),this.mainToken=s,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new c,{pos:s,p:i}=t;return e.start=s,e.end=Math.min(s+1,i.stream.end),e.value=s==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,s){let i=this.stream.clipPos(s.pos);if(e.token(this.stream.reset(i,t),s),t.value>-1){let{parser:e}=s.p;for(let i=0;i<e.specialized.length;i++)if(e.specialized[i]==t.value){let n=e.specializers[i](this.stream.read(t.start,t.end),s);if(n>=0&&s.p.parser.dialect.allows(n>>1)){0==(1&n)?t.value=n>>1:t.extended=n>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,s,i){for(let e=0;e<i;e+=3)if(this.actions[e]==t)return i;return this.actions[i++]=t,this.actions[i++]=e,this.actions[i++]=s,i}addActions(t,e,s,i){let{state:n}=t,{parser:r}=t.p,{data:o}=r;for(let t=0;t<2;t++)for(let h=r.stateSlot(n,t?2:1);;h+=3){if(65535==o[h]){if(1!=o[h+1]){0==i&&2==o[h+1]&&(i=this.putAction(E(o,h+2),e,s,i));break}h=E(o,h+2)}o[h]==e&&(i=this.putAction(E(o,h+1),e,s,i))}return i}}class P{constructor(t,e,s,i){this.parser=t,this.input=e,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new u(e,i),this.tokens=new w(t,this.stream),this.topTerm=t.top[1];let{from:n}=i[0];this.stacks=[r.start(this,t.top[0],n)],this.fragments=s.length&&this.stream.end-n>4*t.bufferLength?new S(s,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,s=this.stacks,i=this.minStackPos,n=this.stacks=[];if(this.bigReductionCount>300&&1==s.length){let[t]=s;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;r<s.length;r++){let o=s[r];for(;;){if(this.tokens.mainToken=null,o.pos>i)n.push(o);else{if(this.advanceStack(o,n,s))continue;{t||(t=[],e=[]),t.push(o);let s=this.tokens.getMainToken(o);e.push(s.value,s.end)}}break}}if(!n.length){let e=t&&function(t){let e=null;for(let s of t){let t=s.p.stoppedAt;(s.pos==s.p.stream.end||null!=t&&s.pos>t)&&s.p.parser.stateFlag(s.state,2)&&(!e||e.score<s.score)&&(e=s)}return e}(t);if(e)return b&&console.log("Finish with "+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw b&&t&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&t){let s=null!=this.stoppedAt&&t[0].pos>this.stoppedAt?t[0]:this.runRecovery(t,e,n);if(s)return b&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(n.length>t)for(n.sort(((t,e)=>e.score-t.score));n.length>t;)n.pop();n.some((t=>t.reducePos>i))&&this.recovering--}else if(n.length>1){t:for(let t=0;t<n.length-1;t++){let e=n[t];for(let s=t+1;s<n.length;s++){let i=n[s];if(e.sameState(i)||e.buffer.length>500&&i.buffer.length>500){if(!((e.score-i.score||e.buffer.length-i.buffer.length)>0)){n.splice(t--,1);continue t}n.splice(s--,1)}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let t=1;t<n.length;t++)n[t].pos<this.minStackPos&&(this.minStackPos=n[t].pos);return null}stopAt(t){if(null!=this.stoppedAt&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,e,s){let n=t.pos,{parser:r}=this,o=b?this.stackID(t)+" -> ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,s=e?t.curContext.hash:0;for(let h=this.fragments.nodeAt(n);h;){let n=this.parser.nodeSet.types[h.type.id]==h.type?r.getGoto(t.state,h.type.id):-1;if(n>-1&&h.length&&(!e||(h.prop(i.NodeProp.contextHash)||0)==s))return t.useNode(h,n),b&&console.log(o+this.stackID(t)+` (via reuse of ${r.getName(h.type.id)})`),!0;if(!(h instanceof i.Tree)||0==h.children.length||h.positions[0]>0)break;let a=h.children[0];if(!(a instanceof i.Tree&&0==h.positions[0]))break;h=a}}let h=r.stateSlot(t.state,4);if(h>0)return t.reduce(h),b&&console.log(o+this.stackID(t)+` (via always-reduce ${r.getName(65535&h)})`),!0;if(t.stack.length>=9e3)for(;t.stack.length>6e3&&t.forceReduce(););let a=this.tokens.getActions(t);for(let i=0;i<a.length;){let h=a[i++],l=a[i++],c=a[i++],f=i==a.length||!s,u=f?t:t.split(),p=this.tokens.mainToken;if(u.apply(h,l,p?p.start:u.pos,c),b&&console.log(o+this.stackID(u)+` (via ${0==(65536&h)?"shift":`reduce of ${r.getName(65535&h)}`} for ${r.getName(l)} @ ${n}${u==t?"":", split"})`),f)return!0;u.pos>n?e.push(u):s.push(u)}return!1}advanceFully(t,e){let s=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>s)return T(t,e),!0}}runRecovery(t,e,s){let i=null,n=!1;for(let r=0;r<t.length;r++){let o=t[r],h=e[r<<1],a=e[1+(r<<1)],l=b?this.stackID(o)+" -> ":"";if(o.deadEnd){if(n)continue;if(n=!0,o.restart(),b&&console.log(l+this.stackID(o)+" (restarted)"),this.advanceFully(o,s))continue}let c=o.split(),f=l;for(let t=0;c.forceReduce()&&t<10&&(b&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,s));t++)b&&(f=this.stackID(c)+" -> ");for(let t of o.recoverByInsert(h))b&&console.log(l+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,s);this.stream.end>o.pos?(a==o.pos&&(a++,h=0),o.recoverByDelete(h,a),b&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(h)})`),T(o,s)):(!i||i.score<o.score)&&(i=o)}return i}stackToTree(t){return t.close(),i.Tree.build({buffer:a.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let e=(v||(v=new WeakMap)).get(t);return e||v.set(t,e=String.fromCodePoint(this.nextStackID++)),e+t}}function T(t,e){for(let s=0;s<e.length;s++){let i=e[s];if(i.pos==t.pos&&i.sameState(t))return void(e[s].score<t.score&&(e[s]=t))}e.push(t)}class A{constructor(t,e,s){this.source=t,this.flags=e,this.disabled=s}allows(t){return!this.disabled||0==this.disabled[t]}}const C=t=>t;class I{constructor(t){this.start=t.start,this.shift=t.shift||C,this.reduce=t.reduce||C,this.reuse=t.reuse||C,this.hash=t.hash||(()=>0),this.strict=!1!==t.strict}}class R extends i.Parser{constructor(t){if(super(),this.wrappers=[],14!=t.version)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let s=0;s<t.repeatNodeCount;s++)e.push("");let s=Object.keys(t.topRules).map((e=>t.topRules[e][1])),n=[];for(let t=0;t<e.length;t++)n.push([]);function r(t,e,s){n[t].push([e,e.deserialize(String(s))])}if(t.nodeProps)for(let e of t.nodeProps){let t=e[0];"string"==typeof t&&(t=i.NodeProp[t]);for(let s=1;s<e.length;){let i=e[s++];if(i>=0)r(i,t,e[s++]);else{let n=e[s+-i];for(let o=-i;o>0;o--)r(e[s++],t,n);s++}}}this.nodeSet=new i.NodeSet(e.map(((e,r)=>i.NodeType.define({name:r>=this.minRepeatTerm?void 0:e,id:r,props:n[r],top:s.indexOf(r)>-1,error:0==r,skipped:t.skippedNodes&&t.skippedNodes.indexOf(r)>-1})))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=i.DefaultBufferLength;let o=l(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t<this.specializerSpecs.length;t++)this.specialized[t]=this.specializerSpecs[t].term;this.specializers=this.specializerSpecs.map(N),this.states=l(t.states,Uint32Array),this.data=l(t.stateData),this.goto=l(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map((t=>"number"==typeof t?new p(o,t):t)),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,s){let i=new P(this,t,e,s);for(let n of this.wrappers)i=n(i,t,e,s);return i}getGoto(t,e,s=!1){let i=this.goto;if(e>=i[0])return-1;for(let n=i[e+1];;){let e=i[n++],r=1&e,o=i[n++];if(r&&s)return o;for(let s=n+(e>>1);n<s;n++)if(i[n]==t)return o;if(r)return-1}}hasAction(t,e){let s=this.data;for(let i=0;i<2;i++)for(let n,r=this.stateSlot(t,i?2:1);;r+=3){if(65535==(n=s[r])){if(1!=s[r+1]){if(2==s[r+1])return E(s,r+2);break}n=s[r=E(s,r+2)]}if(n==e||0==n)return E(s,r+1)}return 0}stateSlot(t,e){return this.states[6*t+e]}stateFlag(t,e){return(this.stateSlot(t,0)&e)>0}validAction(t,e){return!!this.allActions(t,(t=>t==e||null))}allActions(t,e){let s=this.stateSlot(t,4),i=s?e(s):void 0;for(let s=this.stateSlot(t,1);null==i;s+=3){if(65535==this.data[s]){if(1!=this.data[s+1])break;s=E(this.data,s+2)}i=e(E(this.data,s+1))}return i}nextStates(t){let e=[];for(let s=this.stateSlot(t,1);;s+=3){if(65535==this.data[s]){if(1!=this.data[s+1])break;s=E(this.data,s+2)}if(0==(1&this.data[s+2])){let t=this.data[s+1];e.some(((e,s)=>1&s&&e==t))||e.push(this.data[s],t)}}return e}configure(t){let e=Object.assign(Object.create(R.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let s=this.topRules[t.top];if(!s)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=s}return t.tokenizers&&(e.tokenizers=this.tokenizers.map((e=>{let s=t.tokenizers.find((t=>t.from==e));return s?s.to:e}))),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map(((s,i)=>{let n=t.specializers.find((t=>t.from==s.external));if(!n)return s;let r=Object.assign(Object.assign({},s),{external:n.to});return e.specializers[i]=N(r),r}))),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),s=e.map((()=>!1));if(t)for(let i of t.split(" ")){let t=e.indexOf(i);t>=0&&(s[t]=!0)}let i=null;for(let t=0;t<e.length;t++)if(!s[t])for(let s,n=this.dialects[e[t]];65535!=(s=this.data[n++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[s]=1;return new A(t,s,i)}static deserialize(t){return new R(t)}}function E(t,e){return t[e]|t[e+1]<<16}function N(t){if(t.external){let e=t.extend?1:0;return(s,i)=>t.external(s,i)<<1|e}return t.get}},27061:t=>{var e,s,i=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(s){try{return e.call(null,t,0)}catch(s){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:n}catch(t){e=n}try{s="function"==typeof clearTimeout?clearTimeout:r}catch(t){s=r}}();var h,a=[],l=!1,c=-1;function f(){l&&h&&(l=!1,h.length?a=h.concat(a):c=-1,a.length&&u())}function u(){if(!l){var t=o(f);l=!0;for(var e=a.length;e;){for(h=a,a=[];++c<e;)h&&h[c].run();c=-1,e=a.length}h=null,l=!1,function(t){if(s===clearTimeout)return clearTimeout(t);if((s===r||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(t);try{return s(t)}catch(e){try{return s.call(null,t)}catch(e){return s.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)e[s-1]=arguments[s];a.push(new p(t,e)),1!==a.length||l||o(u)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=d,i.addListener=d,i.once=d,i.off=d,i.removeListener=d,i.removeAllListeners=d,i.emit=d,i.prependListener=d,i.prependOnceListener=d,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}}}]); |