import{ContextTracker as O,ExternalTokenizer as e,LRParser as t}from"@lezer/lr";import{tags as a,styleTags as n}from"@lezer/highlight";const Q=63,r=64,P=1,c=2,s=3,i=4,o=5,p=6,f=7,X=65,l=66,S=8,d=9,R=10,u=11,h=12,k=13,x=19,b=20,g=29,$=33,T=34,v=47;const m=0,D=1,U=2,q=3,W=4;class Context{constructor(O,e,t){this.parent=O;this.depth=e;this.type=t;this.hash=(O?O.hash+O.hash<<8:0)+e+(e<<4)+t}static top=new Context(null,-1,m)}function findColumn(O,e){for(let t=0,a=e-O.pos-1;;a--,t++){let e=O.peek(a);if(isBreakSpace(e)||e==-1)return t}}function isNonBreakSpace(O){return O==32||O==9}function isBreakSpace(O){return O==10||O==13}function isSpace(O){return isNonBreakSpace(O)||isBreakSpace(O)}function isSep(O){return O<0||isSpace(O)}const C=new O({start:Context.top,reduce(O,e){return O.type!=q||e!=b&&e!=T?O:O.parent},shift(O,e,t,a){if(e==s)return new Context(O,findColumn(a,a.pos),D);if(e==X||e==o)return new Context(O,findColumn(a,a.pos),U);if(e==Q)return O.parent;if(e==x||e==$)return new Context(O,0,q);if(e==k&&O.type==W)return O.parent;if(e==v){let e=/[1-9]/.exec(a.read(a.pos,t.pos));if(e)return new Context(O,O.depth+ +e[0],W)}return O},hash(O){return O.hash}});function three(O,e,t=0){return O.peek(t)==e&&O.peek(t+1)==e&&O.peek(t+2)==e&&isSep(O.peek(t+3))}const Y=new e(((O,e)=>{if(O.next==-1&&e.canShift(r))return O.acceptToken(r);let t=O.peek(-1);if((isBreakSpace(t)||t<0)&&e.context.type!=q){if(three(O,45)){if(!e.canShift(Q))return O.acceptToken(P,3);O.acceptToken(Q)}if(three(O,46)){if(!e.canShift(Q))return O.acceptToken(c,3);O.acceptToken(Q)}let t=0;while(O.next==32){t++;O.advance()}!(t{if(e.context.type!=q)if(O.next==45){O.advance();isSep(O.next)&&O.acceptToken(e.context.type==D&&e.context.depth==findColumn(O,O.pos-1)?i:s)}else if(O.next==63){O.advance();isSep(O.next)&&O.acceptToken(e.context.type==U&&e.context.depth==findColumn(O,O.pos-1)?p:o)}else{let t=O.pos;for(;;)if(isNonBreakSpace(O.next)){if(O.pos==t)return;O.advance()}else if(O.next==33)readTag(O);else{if(O.next!=38){if(O.next==42){readAnchor(O);break}if(O.next==39||O.next==34){if(readQuoted(O,true))break;return}if(O.next==91||O.next==123){if(!scanBrackets(O))return;break}readPlain(O,true,false,0);break}readAnchor(O)}while(isNonBreakSpace(O.next))O.advance();if(O.next==58){if(O.pos==t&&e.canShift(g))return;let a=O.peek(1);isSep(a)&&O.acceptTokenTo(e.context.type==U&&e.context.depth==findColumn(O,t)?l:X,t)}}else if(O.next==63){O.advance();isSep(O.next)&&O.acceptToken(f)}}),{contextual:true});function uriChar(O){return O>32&&O<127&&O!=34&&O!=37&&O!=44&&O!=60&&O!=62&&O!=92&&O!=94&&O!=96&&O!=123&&O!=124&&O!=125}function hexChar(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function readUriChar(O,e){if(O.next==37){O.advance();hexChar(O.next)&&O.advance();hexChar(O.next)&&O.advance();return true}if(uriChar(O.next)||e&&O.next==44){O.advance();return true}return false}function readTag(O){O.advance();if(O.next==60){O.advance();for(;;)if(!readUriChar(O,true)){O.next==62&&O.advance();break}}else while(readUriChar(O,false));}function readAnchor(O){O.advance();while(!isSep(O.next)&&charTag(O.tag)!="f")O.advance()}function readQuoted(O,e){let t=O.next,a=false,n=O.pos;O.advance();for(;;){let Q=O.next;if(Q<0)break;O.advance();if(Q==t){if(Q!=39)break;if(O.next!=39)break;O.advance()}else if(Q==92&&t==34)O.next>=0&&O.advance();else if(isBreakSpace(Q)){if(e)return false;a=true}else if(e&&O.pos>=n+1024)return false}return!a}function scanBrackets(O){for(let e=[],t=O.pos+1024;;)if(O.next==91||O.next==123){e.push(O.next);O.advance()}else if(O.next==39||O.next==34){if(!readQuoted(O,true))return false}else if(O.next==93||O.next==125){if(e[e.length-1]!=O.next-2)return false;e.pop();O.advance();if(!e.length)return true}else{if(O.next<0||O.pos>t||isBreakSpace(O.next))return false;O.advance()}}const y="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function charTag(O){return O<33?"u":O>125?"s":y[O-33]}function isSafe(O,e){let t=charTag(O);return t!="u"&&!(e&&t=="f")}function readPlain(O,e,t,a){if(charTag(O.next)!="s"&&(O.next!=63&&O.next!=58&&O.next!=45||!isSafe(O.peek(1),t)))return false;O.advance();let n=O.pos;for(;;){let Q=O.next,r=0,P=a+1;while(isSpace(Q)){if(isBreakSpace(Q)){if(e)return false;P=0}else P++;Q=O.peek(++r)}let c=Q>=0&&(Q==58?isSafe(O.peek(r+1),t):Q==35?O.peek(r-1)!=32:isSafe(Q,t));if(!c||!t&&P<=a||P==0&&!t&&(three(O,45,r)||three(O,46,r)))break;if(e&&charTag(Q)=="f")return false;for(let e=r;e>=0;e--)O.advance();if(e&&O.pos>n+1024)return false}return true}const G=new e(((O,e)=>{if(O.next==33){readTag(O);O.acceptToken(h)}else if(O.next==38||O.next==42){let e=O.next==38?R:u;readAnchor(O);O.acceptToken(e)}else if(O.next==39||O.next==34){readQuoted(O,false);O.acceptToken(d)}else readPlain(O,false,e.context.type==q,e.context.depth)&&O.acceptToken(S)}));const V=new e(((O,e)=>{let t=e.context.type==W?e.context.depth:-1,a=O.pos;O:for(;;){let n=0,Q=O.next;while(Q==32)Q=O.peek(++n);if(!n&&(three(O,45,n)||three(O,46,n)))break;if(!isBreakSpace(Q)){t<0&&(t=Math.max(e.context.depth+1,n));if(nYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQ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odeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:C,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[Z],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQ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