sveast 0.6.0 → 0.7.0
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.
- package/README.md +35 -3
- package/core.js +1 -1
- package/entities.js +1 -1
- package/index.d.ts +80 -0
- package/index.js +1 -1
- package/is-valid-type.js +1 -1
- package/lexer.d.ts +79 -0
- package/lexer.js +2 -0
- package/package.json +6 -1
- package/parse-imports-exports.js +1 -1
- package/parse-module.js +1 -1
- package/parse.js +1 -1
- package/{shared-y4gayx8p.js → shared-1xjsv3h6.js} +2 -2
- package/{shared-f8ty80r9.js → shared-as9can03.js} +8 -8
- package/shared-b37zemjd.js +2 -0
- package/shared-drsxcq8p.js +2 -0
- package/{shared-9f69x2q9.js → shared-g16dt48m.js} +2 -2
- package/shared-gyydaea2.js +3 -0
- package/shared-mwp38arc.js +2 -0
- package/shared-pmkdz7sc.js +3 -0
- package/shared-pt7hcxxy.js +2 -0
- package/shared-pyjcz2f8.js +12 -0
- package/shared-qnfwr59k.js +2 -0
- package/{shared-c4vs4cam.js → shared-yr6e6h72.js} +2 -2
- package/typescript.js +1 -1
- package/walk.js +1 -1
- package/shared-0ehch67h.js +0 -2
- package/shared-3xek95jd.js +0 -12
- package/shared-88pt6me6.js +0 -2
- package/shared-c1jf0gfc.js +0 -2
- package/shared-etx1q7m5.js +0 -3
- package/shared-nqsechtt.js +0 -2
- package/shared-rfyyd11j.js +0 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{o,c}from"./shared-as9can03.js";import{u,a,f,e,M,j,W,U,z,K,H,G,Q,X,I,Y,J,R,Z,ee,te,ie,P,O,re,q,se,ne,n,oe,ae,le,pe,ce,he,ue,fe,de,D,me,ye,xe,ge,be,ve,L,Se,ke,Te,B,we,Ae,Ee,Ce,i,Ne,_e,Pe,w,d,Le}from"./shared-pyjcz2f8.js";import{N}from"./shared-g16dt48m.js";import{x,g}from"./shared-drsxcq8p.js";import{_}from"./shared-pt7hcxxy.js";var fn={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]};function mn(t,r){return Object.hasOwn(fn,t)&&fn[t].includes(r)}var Ye=new Set("arguments await break case catch class const continue debugger default delete do else enum eval export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof var void while with yield".split(" ")),Ke=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y,it=/\r(?!\n)|[\u2028\u2029]/;function F(t){if(t===32||t<=13&&t>=9)return!0;if(t<160)return!1;return t===160||t===5760||t>=8192&&t<=8202||t===8232||t===8233||t===8239||t===8287||t===12288||t===65279}function De(t,r){let l=r;while(l<t.length&&F(t.charCodeAt(l)))l++;return l}function Ve(t,r){let l=t.codePointAt(r);if(l===void 0||!o(l,!0))return r;let s=r+(l<=65535?1:2),p=t.codePointAt(s);while(p!==void 0&&c(p,!0))s+=p<=65535?1:2,p=t.codePointAt(s);return s}function ot(t){let r=t.indexOf("<");while(r!==-1){let l=t.charCodeAt(r+1);if(l===33||l===115){Ke.lastIndex=r;let s=Ke.exec(t);if(s){if(l===115)return s[2]==="ts";r=t.indexOf("<",Ke.lastIndex);continue}}r=t.indexOf("<",r+1)}return!1}class Je{source;index=0;loc;lfOnly;isTypeScript;typescript;entityNames;css;script;comments;root;stack;fragments;metaTags=new Set;lastAutoClosedTag;nextAngle=-1;nextBrace=-1;constructor(t,r,l,s={}){if(this.source=t,this.loc=s.loc??!1,this.lfOnly=this.loc&&!it.test(t),this.isTypeScript=ot(t),this.typescript=l.typescript,this.isTypeScript&&!this.typescript)_();this.entityNames=l.entityNames,this.css=s.css??!0,this.script=s.script??!0,this.comments=s.comments??!0,this.root={type:"Root",start:0,end:r,css:null,js:[],options:null,fragment:{type:"Fragment",nodes:[]},comments:[]},this.stack=[this.root],this.fragments=[this.root.fragment]}match(t){if(t.length===1)return this.source.charCodeAt(this.index)===t.charCodeAt(0);return this.source.startsWith(t,this.index)}matchRegex(t){return t.lastIndex=this.index,t.exec(this.source)?.[0]??null}eat(t,r=!1){if(this.match(t))return this.index+=t.length,!0;if(r)n(this.index,t);return!1}read(t){let r=this.matchRegex(t);if(r)this.index+=r.length;return r}readUntil(t){if(this.index>=this.source.length)i(this.source.length);let r=this.source.indexOf(t,this.index),l=r===-1?this.source.length:r,s=this.source.slice(this.index,l);return this.index=l,s}allowWhitespace(){this.index=De(this.source,this.index)}requireWhitespace(){if(!F(this.source.charCodeAt(this.index)))oe(this.index);this.allowWhitespace()}eatClosingBrace(){this.allowWhitespace(),this.eat("}",!0)}sourceLocation(t,r){return this.loc?{start:a(t),end:a(r)}:void 0}readIdentifierName(){let t=this.index,r=Ve(this.source,t),l=this.source.slice(t,r);if(this.index=r,Ye.has(l))Ne(t,l);let s={type:"Identifier",name:l,start:t,end:r};if(this.loc)s.loc=this.sourceLocation(t,r);return s}current(){return this.stack[this.stack.length-1]}append(t){this.fragments[this.fragments.length-1].nodes.push(t)}open(t,r){this.append(t),this.stack.push(t),this.fragments.push(r)}setFragment(t){this.fragments[this.fragments.length-1]=t}close(){this.stack.pop(),this.fragments.pop()}}var lt=["===","!==","==","!=","&&","||","??"];function en(t,r,l,s){return{type:"Literal",start:r,end:l,value:s,raw:t.slice(r,l)}}function hn(t,r){let l=t.charCodeAt(r);if(l===34||l===39){for(let p=r+1;p<t.length;p++){let m=t.charCodeAt(p);if(m===l)return en(t,r,p+1,t.slice(r+1,p));if(m===92||m===10||m===13)return null}return null}let s=r;for(;s<t.length;s++){let p=t.charCodeAt(s);if(p<48||p>57)break}if(s===r||l===48&&s-r>1)return null;return en(t,r,s,Number(t.slice(r,s)))}function st(t,r){let l=Ve(t,r);if(l===r)return hn(t,r);let s=t.slice(r,l);if(s==="true"||s==="false"||s==="null")return en(t,r,l,s==="null"?null:s==="true");if(Ye.has(s))return null;let p={type:"Identifier",start:r,end:l,name:s};for(let m=l;;){let h=t.charCodeAt(m),y,S;if(h===46){if(S=Ve(t,m+1),S===m+1)return null;y={type:"Identifier",start:m+1,end:S,name:t.slice(m+1,S)}}else if(h===91){if(y=hn(t,m+1),!y||t.charCodeAt(y.end)!==93)return null;S=y.end+1}else return p;p={type:"MemberExpression",start:r,end:S,object:p,property:y,computed:h===91,optional:!1},m=S}}function nn(t,r){if(t.charCodeAt(r)!==33||t.charCodeAt(r+1)===61)return st(t,r);let l=nn(t,De(t,r+1));if(!l)return null;return{type:"UnaryExpression",start:r,end:l.end,operator:"!",prefix:!0,argument:l}}function xn(t,r){let l=De(t,r);if(l>=t.length)return!1;let s=t.charCodeAt(l);return s===125||s===41}function ct(t,r){let l=nn(t,r);if(!l||xn(t,l.end))return l;let s=De(t,l.end),p=lt.find((y)=>t.startsWith(y,s));if(!p)return null;let m=nn(t,De(t,s+p.length));if(!m||!xn(t,m.end))return null;let{end:h}=m;if(p==="&&"||p==="||"||p==="??")return{type:"LogicalExpression",start:l.start,end:h,left:l,operator:p,right:m};return{type:"BinaryExpression",start:l.start,end:h,left:l,operator:p,right:m}}function We(t){if(t.loc={start:f(t.start),end:f(t.end)},t.type==="MemberExpression")We(t.object),We(t.property);else if(t.type==="UnaryExpression")We(t.argument);else if(t.type==="BinaryExpression"||t.type==="LogicalExpression")We(t.left),We(t.right)}function C(t){let r=!t.loc||t.lfOnly?ct(t.source,t.index):null;if(r){if(t.index=r.end,t.loc)We(r);return r}let{node:l,end:s}=d(t,t.source,t.index);return t.index=s,l}var Sn=/<\/script\s*>/g,at=new Set(["server","client","worker","test","default"]);function gn(t,r,l){let{source:s,index:p}=t;if(p>=s.length)i(s.length);Sn.lastIndex=p;let m=Sn.exec(s);if(!m)P(s.length,"script");t.index=m.index+m[0].length;let h=t.script?w(t,s.slice(0,m.index),p):pt(p,m.index);if(h.start=p,h.loc)Object.assign(h.loc.start,f(r)),Object.assign(h.loc.end,f(t.index));else if(t.loc)h.loc={start:f(r),end:f(t.index)};let y="default";for(let S of l){if(at.has(S.name))he(S,S.name);if(S.name==="module"){if(S.value!==!0)pe(S,S.name);y="module"}if(S.name==="context"){let A=S.value;if(A===!0||!Array.isArray(A)||A.length!==1||A[0].type!=="Text"||A[0].data!=="module")ce(S);y="module"}}return{type:"Script",start:r,end:t.index,context:y,content:h,attributes:l}}function pt(t,r){return{type:"Program",start:t,end:r,body:[],sourceType:"module"}}var ut=/(even|odd|\+?(\d+|\d*n(\s*[+-]\s*\d+)?)|-\d*n(\s*\+\s*\d+))((?=\s*[,)])|\s+of(\s+|(?=[.#[*:&])))/y,dt=/\d+(\.\d+)?%/y,ft=/\\[0-9a-fA-F]{1,6}(\r\n|\s)?/y,mt=/\s*>/y,Re=-1,on=34,ht=35,xt=36,St=38,ln=39,gt=40,yt=41,Ge=42,At=43,Tt=45,Et=46,sn=47,tn=58,bt=59,En=60,yn=61,Ct=62,_t=91,He=92,vt=93,wt=94,bn=123,rn=124,kt=125,Cn=126,$e=[];function _n(t,r,l){let s=t.index;$e=[];let p=t.css?Rt(t):Pt(t),m=t.index;return t.eat("</style",!0),t.read(mt),{type:"StyleSheet",start:r,end:t.index,attributes:l,children:p,comments:$e,content:{start:s,end:m,styles:t.source.slice(s,m),comment:null}}}function Pt(t){let{source:r,index:l}=t;while(l<r.length){let s=r.charCodeAt(l);if(s===sn&&r.charCodeAt(l+1)===Ge){let p=r.indexOf("*/",l+2);l=p===-1?r.length:p+2}else if(s===on||s===ln){l++;while(l<r.length){let p=r.charCodeAt(l);if(p===s||p===10)break;l+=p===He?2:1}l++}else if(s===En&&r.startsWith("</style",l))break;else l++}return t.index=Math.min(l,r.length),[]}function Rt(t){let r=[];for(;;){if(Ie(t,!0),t.match("</style")||t.index>=t.source.length)break;r.push(t.match("@")?vn(t):wn(t))}return r}function vn(t){let r=t.index;t.eat("@",!0);let l=Oe(t),s=cn(t,!0),p=null;if(t.match("{"))p=Rn(t);else t.eat(";",!0);return{type:"Atrule",start:r,end:t.index,name:l,prelude:s,block:p}}function wn(t){let r=t.index;return{type:"Rule",prelude:kn(t,!1),block:Rn(t),start:r,end:t.index}}function kn(t,r){let l=[];Ie(t,!0);let s=t.index;while(t.index<t.source.length){l.push(Ot(t,r));let p=t.index;if(Ie(t,!0),t.match(r?")":"{"))return{type:"SelectorList",start:s,end:p,children:l};t.eat(",",!0),Ie(t,!0)}return i(t.source.length)}function An(t,r){return{type:"RelativeSelector",combinator:t,selectors:[],start:r,end:-1}}function Ot(t,r){let{source:l,index:s}=t,p=[],m=An(null,t.index);while(t.index<l.length){let h=t.index,y=l.charCodeAt(h),S=m.selectors;if(y===St)t.index++,S.push({type:"NestingSelector",name:"&",start:h,end:t.index});else if(y===Ge)t.index++,S.push(Tn(t,h,"*"));else if(y===ht)t.index++,S.push({type:"IdSelector",name:Oe(t),start:h,end:t.index});else if(y===Et)t.index++,S.push({type:"ClassSelector",name:Oe(t),start:h,end:t.index});else if(y===tn){let v=l.charCodeAt(h+1)===tn;t.index+=v?2:1;let k=Oe(t),Be=null;if(t.eat("("))Be=kn(t,!0),t.eat(")",!0);if(v)S.push({type:"PseudoElementSelector",name:k,start:h,end:t.index,...Be&&{args:Be}});else S.push({type:"PseudoClassSelector",name:k,args:Be,start:h,end:t.index})}else if(y===_t)t.index++,S.push(Nt(t,h));else{let v=r?t.read(ut):null,k=!v&&je(y)?t.read(dt):null;if(v)S.push({type:"Nth",value:v,start:h,end:t.index});else if(k)S.push({type:"Percentage",value:k,start:h,end:t.index});else if(Pn(l,h)===0){let Be=Oe(t);S.push(Tn(t,h,Be))}}let A=t.index;Ie(t,!1);let T=t.match(",")||t.match(r?")":"{");if(t.index=A,T)return m.end=A,p.push(m),{type:"ComplexSelector",start:s,end:A,children:p};let E=Lt(t);if(E){if(m.selectors.length>0)m.end=A,p.push(m);if(m=An(E,E.start),t.allowWhitespace(),t.match(",")||t.match(r?")":"{"))Y(t.index)}}return i(l.length)}function Tn(t,r,l){let s=l,p;if(t.eat("|"))p=s,s=t.eat("*")?"*":Oe(t);return{type:"TypeSelector",name:s,...p!==void 0&&{namespace:p},start:r,end:t.index}}function Nt(t,r){let l=t.source;t.allowWhitespace();let s=Oe(t);t.allowWhitespace();let p=null,m=null,h=l.charCodeAt(t.index);if(h===yn)m="=";else if((h===Cn||h===wt||h===xt||h===Ge||h===rn)&&l.charCodeAt(t.index+1)===yn)m=l.slice(t.index,t.index+2);if(m)t.index+=m.length,t.allowWhitespace(),p=It(t);t.allowWhitespace();let y=t.index;while(Nn(l.charCodeAt(t.index)))t.index++;let S=t.index>y?l.slice(y,t.index):null;return t.allowWhitespace(),t.eat("]",!0),{type:"AttributeSelector",start:r,end:t.index,name:s,matcher:m,value:p,flags:S}}function Pn(t,r){let l=t.charCodeAt(r);if(l===At||l===Cn||l===Ct)return 1;if(l===rn&&t.charCodeAt(r+1)===rn)return 2;return 0}function Lt(t){let r=t.index;t.allowWhitespace();let l=t.index,s=Pn(t.source,l);if(s>0){t.index+=s;let p=t.index;return t.allowWhitespace(),{type:"Combinator",name:t.source.slice(l,p),start:l,end:p}}if(t.index!==r)return{type:"Combinator",name:" ",start:r,end:t.index};return null}function Rn(t){let r=t.index;t.eat("{",!0);let l=[];while(t.index<t.source.length){if(Ie(t,!0),t.match("}"))break;l.push(Bt(t))}return t.eat("}",!0),{type:"Block",start:r,end:t.index,children:l}}function Bt(t){if(t.match("@"))return vn(t);let r=t.index;cn(t,!1);let l=t.source.charCodeAt(t.index);return t.index=r,l===bn?wn(t):Dt(t)}function Dt(t){let{source:r,index:l}=t;if(l>=r.length)i(r.length);let s=l;while(s<r.length){let S=r.charCodeAt(s);if(S===tn||F(S))break;s++}let p=r.slice(l,s);t.index=s,t.allowWhitespace(),t.eat(":");let m=t.index;t.allowWhitespace();let h=cn(t,!0);if(!h&&!p.startsWith("--"))X({start:l,end:m});let y=t.index;if(!t.match("}"))t.eat(";",!0);return{type:"Declaration",start:l,end:y,property:p,value:h}}function cn(t,r){let l=t.source,s=l.length,p="",m=t.index,h=null,y=!1,S=!1,A=Re,T=t.index;while(T<s){let E=l.charCodeAt(T);if(y){y=!1,T++;continue}if(E===He){y=!0,T++;continue}if(E===A)A=Re;else if(E===yt)S=!1;else if(A===Re&&(E===on||E===ln))A=E;else if(E===gt){if(Wt(l,p,m,T))S=!0}else if((E===bt||E===bn||E===kt)&&!S&&A===Re){if(t.index=T,!r)return"";if(p+=l.slice(m,T),h){let v=p.length-p.trimStart().length;for(let k of h)k.position=Math.max(0,(k.position??0)-v)}return p.trim()}else if(E===sn&&!S&&A===Re&&l.charCodeAt(T+1)===Ge){p+=l.slice(m,T),t.index=T;let v=On(t);if(r)v.position=p.length,$e.push(v),h??=[],h.push(v);T=t.index,m=T;continue}T++}return t.index=s,i(s)}function Wt(t,r,l,s){if(s-l>=3)return t.charCodeAt(s-3)===117&&t.charCodeAt(s-2)===114&&t.charCodeAt(s-1)===108;return(r+t.slice(l,s)).endsWith("url")}function It(t){let r=t.source,l=Re;if(t.eat('"'))l=on;else if(t.eat("'"))l=ln;let s=t.index,p=!1,m=s;while(m<r.length){let h=r.charCodeAt(m);if(p)p=!1;else if(h===He)p=!0;else if(l===Re?h===vt||F(h):h===l)return t.index=l===Re?m:m+1,r.slice(s,m).trim();m++}return t.index=m,i(r.length)}function Oe(t){let{source:r,index:l}=t,s=r.charCodeAt(l);if(je(s)||s===Tt&&je(r.charCodeAt(l+1)))I(l);let p="",m=l,h=l;while(h<r.length){let y=r.charCodeAt(h);if(y===He){p+=r.slice(m,h),t.index=h;let S=t.matchRegex(ft);if(S){let A=String.fromCodePoint(Number.parseInt(S.slice(1),16));p+=A==="\\"?"\\\\":A,h+=S.length}else p+=`\\${r[h+1]}`,h+=2;m=h}else if(y>=160||Ft(y))h++;else break}if(p+=r.slice(m,h),t.index=h,p==="")I(l);return p}function Ie(t,r){let l=t.source;t.allowWhitespace();for(;;){let s=l.charCodeAt(t.index);if(s===sn&&l.charCodeAt(t.index+1)===Ge){let p=On(t);if(r)$e.push(p)}else if(s===En&&t.eat("<!--"))t.readUntil("-->"),t.eat("-->",!0);else break;t.allowWhitespace()}}function On(t){let r=t.index;t.eat("/*",!0);let l=t.readUntil("*/");return t.eat("*/",!0),{type:"CSSComment",value:l,start:r,end:t.index}}function je(t){return t>=48&&t<=57}function Nn(t){return t>=65&&t<=90||t>=97&&t<=122}function Ft(t){return Nn(t)||je(t)||t===95||t===45}var an=/<\/textarea(\s[^>]*)?>/iy,Mt=/^![a-zA-Z]+$/,Gt=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,Ut=/^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\-_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*)?$/u,pn="\\u200C\\u200D",qt=new RegExp(`^(?:\\p{Lu}[$${pn}\\p{ID_Continue}.]*|\\p{ID_Start}[$${pn}\\p{ID_Continue}]*(?:\\.[$${pn}\\p{ID_Continue}]+)+)$`,"u"),Vt=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),$t=new Map([["use","UseDirective"],["animate","AnimateDirective"],["bind","BindDirective"],["class","ClassDirective"],["style","StyleDirective"],["on","OnDirective"],["let","LetDirective"],["in","TransitionDirective"],["out","TransitionDirective"],["transition","TransitionDirective"]]),un=new Map([["svelte:head",["SvelteHead",!0]],["svelte:options",["SvelteOptions",!0]],["svelte:window",["SvelteWindow",!0]],["svelte:document",["SvelteDocument",!0]],["svelte:body",["SvelteBody",!0]],["svelte:element",["SvelteElement",!1]],["svelte:component",["SvelteComponent",!1]],["svelte:self",["SvelteSelf",!1]],["svelte:fragment",["SvelteFragment",!1]],["svelte:boundary",["SvelteBoundary",!1]]]),Ln=[...un.keys()],jt=`${Ln.slice(0,-1).join(", ")} or ${Ln.at(-1)}`,Gn=47,Xe=62,Un=61,Ht=34,Xt=39,Bn=123,Fe=(t)=>t===Ht||t===Xt;function zt(t,r,l){let s=r;for(;s<t.length;s++){let p=t.charCodeAt(s);if(F(p)||p===Gn||p===Xe)break;if(l&&(Fe(p)||p===Un))break}return s}function ze(t,r){let l=t.index;if(l>=t.source.length)i(t.source.length);let s=zt(t.source,l,r);return t.index=s,{name:t.source.slice(l,s),start:l,end:s,loc:t.sourceLocation(l,s)}}var Ue=(t,r,l,s=l)=>({start:t,end:r,type:"Text",raw:l,data:s});function qn(t){return Vt.has(t)||t.charCodeAt(0)===33&&t.toLowerCase()==="!doctype"}function Qt(t){let r=t.charCodeAt(0);if(r>=97&&r<=122&&!t.includes("."))return!1;return qt.test(t)}function Zt(t){let r=!0;for(let l=0;l<t.length&&r;l++){let s=t.charCodeAt(l);r=s>=97&&s<=122||l>0&&s>=48&&s<=57}return r&&t.length>0||Mt.test(t)||Gt.test(t)||Ut.test(t)}function Dn(t,r){for(let l=t.length-1;l>=0;l--){let s=r(t[l]);if(s!==void 0)return s}return!1}function Kt(t,r,l){let s=un.get(r);if(s)return s[0];if(l)return"Component";if(r==="title"){if(Dn(t.stack,({type:m})=>{if(m==="SvelteHead")return!0;return m==="RegularElement"||m==="Component"?!1:void 0}))return"TitleElement"}if(r==="slot"){if(!Dn(t.stack,(m)=>m.type==="RegularElement"&&m.attributes.some((h)=>h.type==="Attribute"&&h.name==="shadowrootmode")?!0:void 0))return"SlotElement"}return"RegularElement"}function Vn(t){let r=t.index++;if(t.eat("!--")){let l=t.readUntil("-->");t.eat("-->",!0),t.append({type:"Comment",start:r,end:t.index,data:l})}else if(t.eat("/"))Yt(t,r);else er(t,r)}function Yt(t,r){let{name:l}=ze(t,!1);if(t.allowWhitespace(),t.eat(">",!0),qn(l))Pe(r);let s=t.current();while(!("name"in s)||s.name!==l){if(s.type!=="RegularElement"){let p=t.lastAutoClosedTag;if(p?.tag===l)ie(r,l,p.reason);te(r,l)}s.end=r,t.close(),s=t.current()}if(s.end=t.index,t.close(),t.stack.length<(t.lastAutoClosedTag?.depth??0))t.lastAutoClosedTag=void 0}function Jt(t,r,l){return{type:t,start:r,end:-1,name:l}}function er(t,r){let l=ze(t,!1),{name:s}=l,p=un.get(s);if(!p&&s.startsWith("svelte:"))ge(l,jt);let m=Qt(s);if(!m&&!Zt(s))Ee(l);if(p?.[1]){if(t.metaTags.has(s))me(r,s);if(t.current().type!=="Root")xe(r,s);t.metaTags.add(s)}let h=Jt(Kt(t,s,m),r,s);if(t.loc)h.name_loc=l.loc;h.attributes=[],h.fragment={type:"Fragment",nodes:[]},t.allowWhitespace();let y=t.current();if(y.type==="RegularElement"&&mn(y.name,s))y.end=r,t.close(),t.lastAutoClosedTag={tag:y.name,reason:s,depth:t.stack.length};if((s==="script"||s==="style")&&t.current().type==="Root"){let A=[];h.attributes=A,Mn(t,A,lr),tr(t,h,r,A);return}if(Mn(t,h.attributes,cr),h.type==="SvelteComponent"){let A=Wn(h);if(!A)de(r);if(!In(A.value))fe(A.start);h.expression=Fn(A.value)}else if(h.type==="SvelteElement"){let A=Wn(h);if(!A)D(r);if(A.value===!0)D(A);h.tag=In(A.value)?Fn(A.value):or(A.value[0])}if(!t.eat("/")&&!qn(s))if(t.eat(">",!0),s==="textarea")h.fragment.nodes=jn(t,(A,T)=>(an.lastIndex=T,an.test(A)),"inside <textarea>"),t.read(an);else if(s==="script"||s==="style")h.fragment.nodes.push(nr(t,`</${s}>`));else{t.open(h,h.fragment);return}else t.eat(">",!0);h.end=t.index,t.append(h)}function nr(t,r){let l=t.index,s=t.source.indexOf(r,l);t.index=s===-1?t.source.length:s;let p=Ue(l,t.index,t.source.slice(l,t.index));return t.eat(r,!0),p}function tr(t,r,l,s){t.eat(">",!0);let p=rr(t.root.fragment.nodes,l);if(r.name==="style"){let y=_n(t,l,s);if(y.content.comment=p,t.root.css)ue(l);t.root.css=y;return}let m=gn(t,l,s);if(p&&t.comments)m.content.leadingComments=[{type:"Line",value:p.data}];let h=m.context==="module"?"module":"instance";if(t.root[h])le(l);t.root[h]=m}function rr(t,r){let l=t.length-1;if(l<0||t[l].end!==r)return null;for(let s=l;s>=0;s--){let p=t[s];if(p.type==="Comment")return p;if(p.type!=="Text"||p.data.trim())return null}return null}var ir=(t)=>t.type==="Attribute"&&t.name==="this";function Wn(t){let r=t.attributes.find(ir);if(r)t.attributes.splice(t.attributes.indexOf(r),1);return r}function In(t){if(t===!0)return!1;if(!Array.isArray(t))return!0;return t.length===1&&t[0].type==="ExpressionTag"}function Fn(t){return(Array.isArray(t)?t[0]:t).expression}function or(t){if(t.type!=="Text")return t.expression;return{type:"Literal",value:t.data,raw:`'${t.raw}'`,start:t.start,end:t.end}}function Mn(t,r,l){let s=new Set;for(;;){let p=l(t);if(!p)return;let{type:m}=p;if(m==="Attribute"||m==="BindDirective"||m==="StyleDirective"||m==="ClassDirective"){let h=`${m==="BindDirective"?"Attribute":m}${p.name}`;if(s.has(h))M(p);if(p.name!=="this")s.add(h)}r.push(p),t.allowWhitespace()}}function dn(t,r,l,s,p){return t.loc?{type:"Attribute",start:l,end:s,name:r.name,name_loc:r.loc,value:p}:{type:"Attribute",start:l,end:s,name:r.name,value:p}}function $n(t){if(Fe(t.source.charCodeAt(t.index)))n(t.index,"=")}function lr(t){let r=t.index,l=ze(t,!0);if(!l.name)return null;let s=!0;if(t.eat("=")){t.allowWhitespace();let{source:p}=t,m=t.index,h=-1;if(Fe(p.charCodeAt(m))){let A=p.indexOf(p[m],m+1);if(A!==-1)h=A+1}if(h===-1){h=m;while(h<p.length&&p.charCodeAt(h)!==Xe&&!F(p.charCodeAt(h)))h++;if(h===m)O(m)}t.index=h;let y=Fe(p.charCodeAt(m))?1:0,S=p.slice(m+y,h-y);s=[Ue(h-S.length-y,h-y,S,N(S,!0,t.entityNames))]}return $n(t),dn(t,l,r,t.index,s)}function sr(t){let r=t.index,l=t.match("/*");if(!l&&!t.match("//"))return!1;t.index+=2;let s=t.readUntil(l?"*/":`
|
|
2
|
+
`);if(l)t.eat("*/");let p={type:l?"Block":"Line",start:r,end:t.index,value:s},m=t.sourceLocation(r,t.index);if(m)p.loc=m;if(t.comments)t.root.comments.push(p);return!0}function cr(t){while(sr(t))t.allowWhitespace();let r=t.index;if(t.eat("{"))return ar(t,r);let l=ze(t,!0);if(!l.name)return null;let s=t.index;t.allowWhitespace();let p=!0;if(t.eat("=")){if(t.allowWhitespace(),t.match("/>"))p=[Ue(t.index,t.index+1,"/")],t.index++;else p=dr(t);s=t.index}else $n(t);let m=l.name.indexOf(":"),h=m>0?$t.get(l.name.slice(0,m)):void 0;return h?ur(t,h,l,m,r,s,p):dn(t,l,r,s,p)}function ar(t,r){if(t.allowWhitespace(),t.eat("@attach")){t.requireWhitespace();let p=C(t);return t.eatClosingBrace(),{type:"AttachTag",start:r,end:t.index,expression:p}}if(t.eat("...")){let p=C(t);return t.eatClosingBrace(),{type:"SpreadAttribute",start:r,end:t.index,expression:p}}let l=t.readIdentifierName();if(l.name==="")j(r);t.eatClosingBrace();let s={type:"ExpressionTag",start:l.start,end:l.end,expression:l};return dn(t,l,r,t.index,s)}function pr(t){if(t===!0)return;return Array.isArray(t)?t[0]:t}function ur(t,r,l,s,p,m,h){let[y,...S]=l.name.slice(s+1).split("|");if(y==="")ee({start:p,end:p+s+1},l.name);let A={start:p,end:m,type:r,name:y};if(t.loc)A.name_loc=l.loc;if(r==="StyleDirective")return A.modifiers=S,A.value=h,A;let T=pr(h);if(T&&(Array.isArray(h)&&h.length>1||T.type==="Text"))Z(T.start);if(A.expression=T?.expression??null,A.modifiers=S,r==="TransitionDirective"){let E=l.name.slice(0,s);A.intro=E!=="out",A.outro=E!=="in"}if((r==="BindDirective"||r==="ClassDirective")&&!A.expression)A.expression={start:p+s+1,end:m,type:"Identifier",name:y};return A}function dr(t){let r=t.source.charCodeAt(t.index),l=Fe(r);if(l){if(t.index++,t.source.charCodeAt(t.index)===r)return t.index++,[Ue(t.index-1,t.index-1,"")]}let s;try{s=jn(t,l?(p,m)=>p.charCodeAt(m)===r:fr,"in attribute value",l?r:void 0)}catch(p){let m=p instanceof e?p.position?.[0]:void 0;if(p instanceof e&&p.code==="js_parse_error"&&m!==void 0&&t.source.startsWith("/>",m-1))t.index=m,n(m,l?String.fromCharCode(r):"}");throw p}if(l)t.index++;else if(s.length===0)O(t.index);return l||s.length>1||s[0].type==="Text"?s:s[0]}function fr(t,r){let l=t.charCodeAt(r);return F(l)||Fe(l)||l===Un||l===60||l===Xe||l===96||l===Gn&&t.charCodeAt(r+1)===Xe}function jn(t,r,l,s){let{source:p}=t,m=[],h=t.index,y=(S)=>{if(S<=h)return;let A=p.slice(h,S);m.push(Ue(h,S,A,N(A,!0,t.entityNames)))};while(t.index<p.length){let S=t.index;if(r(p,S))return y(S),m;if(p.charCodeAt(S)!==Bn){if(t.index++,s!==void 0)while(t.index<p.length&&p.charCodeAt(t.index)!==Bn&&p.charCodeAt(t.index)!==s)t.index++;continue}t.index++;let A=p.charCodeAt(t.index);if(A===35||A===64){t.index++;let E=t.index;while(t.index<p.length&&p.charCodeAt(t.index)>=97&&p.charCodeAt(t.index)<=122)t.index++;let v=p.slice(E,t.index);(A===35?K:Ce)(S,v,l)}y(S),t.allowWhitespace();let T=C(t);t.eatClosingBrace(),m.push({type:"ExpressionTag",start:S,end:t.index,expression:T}),h=t.index}i(p.length)}var mr=new Map([["html","html"],["svg","svg"],["mathml","mathml"],["http://www.w3.org/2000/svg","svg"],["http://www.w3.org/1998/Math/MathML","mathml"]]),hr=new Map([["type",(t,r)=>{if(r!=="String"&&r!=="Number"&&r!=="Boolean"&&r!=="Array"&&r!=="Object")return!1;return t.type=r,!0}],["reflect",(t,r)=>{if(typeof r!=="boolean")return!1;return t.reflect=r,!0}],["attribute",(t,r)=>{if(typeof r!=="string")return!1;return t.attribute=r,!0}]]),Hn="[a-z0-9_.\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}-]",xr=new RegExp(`^[a-z]${Hn}*-${Hn}*$`,"u"),Sr=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ")),Qe=(t)=>(r,l)=>{let s=Ze(l);if(typeof s!=="boolean")L(l,"true or false");r[t]=s},gr=new Map([["runes",Qe("runes")],["immutable",Qe("immutable")],["preserveWhitespace",Qe("preserveWhitespace")],["accessors",Qe("accessors")],["namespace",(t,r)=>{let l=mr.get(Ze(r));if(!l)L(r,'"html", "mathml" or "svg"');t.namespace=l}],["css",(t,r)=>{if(Ze(r)!=="injected")L(r,'"injected"');t.css="injected"}],["tag",(t,r)=>be(r)],["customElement",(t,r)=>{let l=Ar(r);if(l)t.customElement=l}]]);function zn(t){let r=[],l={start:t.start,end:t.end,attributes:r};for(let s of t.attributes){if(s.type!=="Attribute")ve(s);r.push(s);let p=gr.get(s.name);if(!p)Ae(s,s.name);p(l,s)}return l}function Ze({value:t}){if(t===!0)return!0;let r=Array.isArray(t)?t:[t];if(r.length===0)return!0;if(r.length>1)return null;let[l]=r;if(l.type==="Text")return l.data;return l.expression.type==="Literal"?l.expression.value:null}function Xn(t,r){if(typeof r!=="string")B(t);if(!r)return;if(!xr.test(r))B(t);if(Sr.has(r))we(t)}function yr(t,r){let l=new Map;for(let s of t.properties){if(s.type!=="Property"||s.computed||s.key.type!=="Identifier")r();if(!l.has(s.key.name))l.set(s.key.name,s.value)}return l}function Ar(t){let r=()=>Se(t);if(t.value===!0)r();let l=Array.isArray(t.value)?t.value[0]:t.value;if(l.type==="Text"){let T=Ze(t);return Xn(t,T),{tag:T}}let{expression:s}=l;if(s.type!=="ObjectExpression"){if(s.type==="Literal"&&s.value===null)return;r()}let p=yr(s,r),m={},h=p.get("tag");if(h){let T=h.type==="Literal"?h.value:void 0;Xn(null,T),m.tag=T}let y=p.get("props");if(y){let T=()=>ke(t);if(y.type!=="ObjectExpression")T();m.props={};for(let E of y.properties){if(E.type!=="Property"||E.computed||E.key.type!=="Identifier"||E.value.type!=="ObjectExpression")T();let v={};m.props[E.key.name]=v;for(let k of E.value.properties){if(k.type!=="Property"||k.computed||k.key.type!=="Identifier"||k.value.type!=="Literal")T();if(!hr.get(k.key.name)?.(v,k.value.value))T()}}}let S=p.get("shadow");if(S)if(S.type==="ObjectExpression")m.shadow=S;else if(S.type==="Literal"&&(S.value==="open"||S.value==="none"))m.shadow=S.value;else Te(t);let A=p.get("extend");if(A)m.extend=A;return m}var Tr={"{":"}","(":")","[":"]"};function qe(t,r,l=Tr){let s=Object.values(l),p=[],m=r;while(m<t.length){let h=t[m++];if(h==="'"||h==='"'||h==="`")m=Er(t,m,h);else if(Object.hasOwn(l,h))p.push(h);else if(s.includes(h)){let y=l[p.pop()??""];if(h!==y)n(m-1,y);if(p.length===0)return m}}i(t.length)}function Er(t,r,l){let s=r;while(s<t.length){let p=t[s++];if(p===l)return s;if(p==="\\")s++;else if(l==="`"&&p==="$"&&t[s]==="{")s=qe(t,s)}_e(r)}var br=/\?\s*:/g;function Me(t){let r=t.index,l=t.readIdentifierName();if(l.name!==""){let y=Qn(t);return{...l,typeAnnotation:y}}let s=t.source[t.index];if(s!=="{"&&s!=="[")se(t.index);t.index=qe(t.source,r);let{node:p}=d(t,`${t.source.slice(0,t.index)} = 1`,r);g(p,"AssignmentExpression");let m=p.left;g(m,"ObjectPattern","ArrayPattern");let h=Qn(t);if(m.typeAnnotation=h,h)m.end=h.end;return m}function Qn(t){let r=t.index;if(t.allowWhitespace(),!t.eat(":")){t.index=r;return}let l="_ as ",s=t.index-l.length,p=t.source.slice(0,s)+l+t.source.slice(t.index).replace(br,":"),m=d(t,p,s).node;if(m.type==="AssignmentExpression"){let h=m.right.start;while(p[h]!=="=")h-=1;m=d(t,p.slice(0,h),s).node}if(m.type==="SequenceExpression")m=m.expressions[0];return g(m,"TSAsExpression"),t.index=m.end,{type:"TSTypeAnnotation",start:r,end:t.index,typeAnnotation:m.typeAnnotation}}var Cr=/\s*}/y,_r={IfBlock:"if",EachBlock:"each",KeyBlock:"key",AwaitBlock:"await",SnippetBlock:"snippet"},V=()=>({type:"Fragment",nodes:[]});function Kn(t,r){if(t.eat("if")){t.requireWhitespace();let l=C(t);t.eatClosingBrace();let s=V();t.open({type:"IfBlock",elseif:!1,start:r,end:-1,test:l,consequent:s,alternate:null},s)}else if(t.eat("each"))wr(t,r);else if(t.eat("await")){t.requireWhitespace();let l=C(t);t.allowWhitespace();let s={type:"AwaitBlock",start:r,end:-1,expression:l,value:null,error:null,pending:null,then:null,catch:null},p=V();if(t.eat("then"))s.value=Zn(t),s.then=p;else if(t.eat("catch"))s.error=Zn(t),s.catch=p;else s.pending=p;t.eat("}",!0),t.open(s,p)}else if(t.eat("key")){t.requireWhitespace();let l=C(t);t.eatClosingBrace();let s=V();t.open({type:"KeyBlock",start:r,end:-1,expression:l,fragment:s},s)}else if(t.eat("snippet"))kr(t,r);else re(t.index)}function Zn(t){if(t.matchRegex(Cr))return t.allowWhitespace(),null;t.requireWhitespace();let r=Me(t);return t.allowWhitespace(),r}function vr(t){let r={assertion:null},l=t.end,s=(m)=>{if(m.type==="TSAsExpression"&&m.end===t.end)return r.assertion=m,l=m.expression.end,m.expression;return x(m,s),m},p=t;if(t.type==="TSAsExpression")r.assertion=t,p=t.expression,l=p.end;else x(t,s);return p.end=l,{expression:p,assertion:r.assertion}}function wr(t,r){t.requireWhitespace();let l=t.source,s;while(!s)try{s=C(t)}catch(S){let T=((S instanceof e?S.position:void 0)?.[0]??r)-2;while(T>r&&t.source.slice(T,T+2)!=="as")T-=1;if(T<=r)throw t.source=l,S;t.source=l.slice(0,T)}if(t.source=l,t.allowWhitespace(),!t.match("as")){if(s.type==="SequenceExpression")s=s.expressions[0];let S=vr(s);if(s=S.expression,S.assertion){let A=S.assertion.typeAnnotation.start-2;while(t.source.slice(A,A+2)!=="as")A-=1;t.index=A}}let p=null,m,h;if(t.eat("as"))t.requireWhitespace(),p=Me(t);else t.index=s.end;if(t.allowWhitespace(),t.eat(",")){if(t.allowWhitespace(),m=t.readIdentifierName().name,!m)q(t.index);t.allowWhitespace()}if(t.eat("("))t.allowWhitespace(),h=C(t),t.allowWhitespace(),t.eat(")",!0),t.allowWhitespace();t.eat("}",!0);let y=V();t.open({type:"EachBlock",start:r,end:-1,expression:s,body:y,context:p,index:m,key:h},y)}function kr(t,r){t.requireWhitespace();let l=t.readIdentifierName();if(l.name==="")q(t.index);t.allowWhitespace();let s=t.index,p;if(t.isTypeScript&&t.match("<")){let S=qe(t.source,s,{"<":">"});p=t.source.slice(s+1,S-1),t.index=S}t.allowWhitespace(),t.eat("(",!0);let m=1;while(t.index<t.source.length&&(!t.match(")")||m!==1)){if(t.match("("))m++;if(t.match(")"))m--;t.index+=1}t.eat(")",!0);let{node:h}=d(t,`${t.source.slice(0,t.index)} => {}`,s,!0);g(h,"ArrowFunctionExpression"),t.eatClosingBrace();let y=V();t.open({type:"SnippetBlock",start:r,end:-1,expression:l,typeParams:p,parameters:h.params,body:y},y)}function Yn(t,r){let l=t.index-1,s=t.current();if(s.type==="IfBlock"){if(!t.eat("else"))n(l,"{:else} or {:else if}");if(t.eat("if"))z(l);if(t.allowWhitespace(),s.alternate=V(),t.setFragment(s.alternate),t.eat("if")){t.requireWhitespace();let p=C(t);t.eatClosingBrace();let m=V();t.open({start:r,end:-1,type:"IfBlock",elseif:!0,test:p,consequent:m,alternate:null},m)}else t.eatClosingBrace()}else if(s.type==="EachBlock"){if(!t.eat("else"))n(l,"{:else}");t.eatClosingBrace(),s.fallback=V(),t.setFragment(s.fallback)}else if(s.type==="AwaitBlock"){let p;if(t.eat("then"))p="then";else if(t.eat("catch"))p="catch";else n(l,"{:then ...} or {:catch ...}");if(s[p])W(l,`{:${p}}`);if(!t.eat("}")){t.requireWhitespace();let h=Me(t);if(p==="then")s.value=h;else s.error=h;t.eatClosingBrace()}let m=V();s[p]=m,t.setFragment(m)}else U(l)}function Jn(t){let r=t.current(),l=_r[r.type];if(!l)G(t.index-1);t.eat(l,!0),t.eatClosingBrace();while(r.type==="IfBlock"&&r.elseif)r.end=t.index,t.close(),r=t.current();r.end=t.index,t.close()}var Pr=/\s*}/y;function Rr(t){return t.type==="CallExpression"||t.type==="ChainExpression"&&t.expression.type==="CallExpression"}function et(t,r){if(t.eat("html")){t.requireWhitespace();let l=C(t);t.eatClosingBrace(),t.append({type:"HtmlTag",start:r,end:t.index,expression:l})}else if(t.eat("debug")){let l=[];if(!t.read(Pr)){let s=C(t),p=s.type==="SequenceExpression"?s.expressions:[s];for(let m of p){if(m.type!=="Identifier")J(m.start);l.push(m)}t.eatClosingBrace()}t.append({type:"DebugTag",start:r,end:t.index,identifiers:l})}else if(t.eat("const")){t.requireWhitespace();let l=Me(t);t.allowWhitespace(),t.eat("=",!0),t.allowWhitespace();let s=t.index,p=C(t),m=t.index;if(p.type==="SequenceExpression"&&!t.source.slice(s,p.start).includes("("))Q(p);t.eatClosingBrace();let h={type:"VariableDeclarator",id:l,init:p,start:l.start,end:m};t.append({type:"ConstTag",start:r,end:t.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[h],start:r+2,end:t.index-1}})}else if(t.eat("render")){t.requireWhitespace();let l=C(t);if(!Rr(l))ae(l);t.eatClosingBrace(),t.append({type:"RenderTag",start:r,end:t.index,expression:l})}else ne(t.index)}var Or=/(?:var|interface|enum)\b/y,Nr=/(?:let|const|type)\b/y;function nt(t){let r=t.index;if(t.index+=1,t.allowWhitespace(),t.eat("#"))Kn(t,r);else if(t.eat(":"))Yn(t,r);else if(t.eat("@"))et(t,r);else if(t.match("/")&&!t.match("/*")&&!t.match("//"))t.index+=1,Jn(t);else if(!Lr(t,r)){let l=C(t);t.eatClosingBrace(),t.append({type:"ExpressionTag",start:r,end:t.index,expression:l})}}function Lr(t,r){let l=t.index,s=t.matchRegex(Or);if(s)R({start:l,end:l+s.length});if(!t.matchRegex(Nr))return!1;let p=t.root.comments.length,m=Le(t,t.source,l);if(m.type==="ExpressionStatement")return t.root.comments.length=p,!1;if(m.type!=="VariableDeclaration"||m.kind!=="let"&&m.kind!=="const")R(m);return t.index=m.end,t.eatClosingBrace(),t.append({type:"DeclarationTag",start:r,end:t.index,declaration:m}),!0}function rt(t){let{source:r,index:l}=t;if(t.nextAngle<l)t.nextAngle=tt(r,"<",l);if(t.nextBrace<l)t.nextBrace=tt(r,"{",l);let s=Math.min(t.nextAngle,t.nextBrace);t.index=s;let p=r.slice(l,s);t.append({type:"Text",start:l,end:s,raw:p,data:N(p,!1,t.entityNames)})}function tt(t,r,l){let s=t.indexOf(r,l);return s===-1?t.length:s}function b(t,r,l){let s=t.charCodeAt(0)===65279?t.slice(1):t;u(s);let p=new Je(s.trimEnd(),s.length,l,r);while(p.index<p.source.length)if(p.match("<"))Vn(p);else if(p.match("{"))nt(p);else rt(p);if(p.stack.length>1){let S=p.current();if(S.end=S.start+1,S.type==="RegularElement")P(S,S.name);H(S)}let{nodes:m}=p.root.fragment,h=m.findIndex((S)=>S.type==="SvelteOptions"),y=m[h];if(y?.type==="SvelteOptions"){m.splice(h,1),p.root.options=zn(y);let{nodes:S}=y.fragment;if(S.length>0)ye({start:S[0].start,end:S[S.length-1].end},y.name)}return p.root}
|
|
3
|
+
export{b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var S={await:1,case:1,default:1,delete:1,extends:1,in:1,instanceof:1,new:1,of:1,return:1,throw:1,typeof:1,void:1,yield:1,do:2,else:2,finally:2,try:2,for:4,if:4,while:4,with:4,import:5,export:6};var C=Array(m(128,0)).fill(null);for(let t of Object.entries(S)){let a=m(t[0].charCodeAt(0),t[0].length),e=C[a]??[];e.push(t),C[a]=e}function m(t,a){return t*11+a}function V(t,a,e){let i=t.charCodeAt(a);if(i>=128||e-a>10)return 3;let E=m(i,e-a),o=C[E];if(o===null)return 3;for(let n=0;n<o.length;n++)if(t.startsWith(o[n][0],a))return o[n][1];return 3}var L=/\s/,_=new Uint8Array(128);for(let t of["az","AZ","09","__","$$","\\\\"])for(let a=t.charCodeAt(0);a<=t.charCodeAt(1);a++)_[a]=1;function r(t){return t>=128?!L.test(String.fromCharCode(t)):_[t]===1}function b(t){return t<128?t===32||t>=9&&t<=13:L.test(String.fromCharCode(t))}function k(t,a,e){let i=t.length,E=B(t,a),o=[],n=t.startsWith("#!")?P(t,2):0,A=0,s=!1,c=!1,R=-1,T=()=>{if(A=0,o.length===0)R=-1};while(n<=E){let l=t.charCodeAt(n);if(l===32||l===10||b(l)){n++;continue}if(l===47){let O=t.charCodeAt(n+1);if(O===47){n=P(t,n+2);continue}if(O===42){let f=t.indexOf("*/",n+2);n=f===-1?i:f+2;continue}}let D=s,U=c;if(s=!1,c=!1,r(l)||l===35){let O=n;n++;while(n<i){let g=t.charCodeAt(n);if(g===92)n+=2;else if(r(g))n++;else break}let f=D?3:V(t,O,n);if(o.length===0&&(f===6?a||K(t,n):f===5&&N(t,n)))n=Math.max(n,e(R!==-1&&f===6?R:O,O)),T();else if(f===6)A=2;else if(f===4)c=!0,A=3;else A=f===1||f===2?f:3;continue}switch(n++,l){case 34:case 39:n=x(t,n,l),A=3;break;case 96:n=u(t,n,o),A=t.charCodeAt(n-1)===123?1:3;break;case 47:{let O=A===3?-1:w(t,n);if(O===-1)A=1;else{n=O;while(n<i&&r(t.charCodeAt(n)))n++;A=3}break}case 40:o.push(U?1:0),A=1;break;case 41:A=o.pop()===1?2:3;break;case 123:o.push(A===1?3:2),A=0;break;case 125:{let O=o.pop();if(O===4)n=u(t,n,o),A=t.charCodeAt(n-1)===123?1:3;else if(O===3)A=3;else T();break}case 59:T();break;case 93:A=3;break;case 46:if(h(t.charCodeAt(n))){while(n<i&&r(t.charCodeAt(n)))n++;A=3}else if(t.startsWith("..",n))n+=2,A=1;else s=!0,A=1;break;case 63:if(t.charCodeAt(n)===46&&!h(t.charCodeAt(n+1)))n++,s=!0;A=1;break;case 33:A=A===3&&!b(t.charCodeAt(n-2))?3:1;break;case 43:case 45:if(t.charCodeAt(n)===l&&A===3)n++;else A=1;break;case 61:if(A=t.charCodeAt(n)===62?2:1,A===2)n++;break;case 64:if(o.length===0&&R===-1)R=n-1;A=1;break;default:A=1}}}function h(t){return t>=48&&t<=57}function P(t,a){for(let e=a;e<t.length;e++){let i=t.charCodeAt(e);if(i===10||i===13||i===8232||i===8233)return e}return t.length}function x(t,a,e){for(let i=a;i<t.length;i++){let E=t.charCodeAt(i);if(E===e)return i+1;if(E===92)i+=t.startsWith(`\r
|
|
2
|
+
`,i+1)?2:1;else if(E===10||E===13)return i}return t.length}function u(t,a,e){for(let i=a;i<t.length;i++){let E=t.charCodeAt(i);if(E===96)return i+1;if(E===92)i++;else if(E===36&&t.charCodeAt(i+1)===123)return e.push(4),i+2}return t.length}function w(t,a){let e=!1;for(let i=a;i<t.length;i++){let E=t.charCodeAt(i);if(E===10||E===13||E===8232||E===8233)return-1;if(E===92)i++;else if(E===91)e=!0;else if(E===93)e=!1;else if(E===47&&!e)return i+1}return-1}function p(t,a){for(let e=a;e<t.length;e++){let i=t.charCodeAt(e);if(b(i))continue;if(i===47){let E=t.charCodeAt(e+1);if(E===47){e=P(t,e+2)-1;continue}if(E===42){let o=t.indexOf("*/",e+2);if(o===-1)return t.length;e=o+1;continue}}return e}return t.length}function y(t,a,e){return t.charCodeAt(a)===e.charCodeAt(0)&&t.startsWith(e,a)&&!r(t.charCodeAt(a+e.length))}function N(t,a){let e=t.charCodeAt(p(t,a));return e!==40&&e!==46}function K(t,a){let e=p(t,a);if(y(t,e,"import"))return!0;if(y(t,e,"type"))e=p(t,e+4);let i=t.charCodeAt(e);if(i===42)return!0;if(i!==123)return!1;for(e++;e<t.length;e++){let E=t.charCodeAt(e);if(E===125)break;if(E===34||E===39)e=x(t,e+1,E)-1;else if(E===47)e=Math.max(e,p(t,e)-1)}return y(t,p(t,e+1),"from")}var d=/import|export/g;function B(t,a){let e=-1;d.lastIndex=0;for(let i=d.exec(t);i!==null;i=d.exec(t)){let E=i.index,o=E+6;if(!r(t.charCodeAt(E-1))&&!r(t.charCodeAt(o))&&(t.charCodeAt(E)===105?N(t,o):a||K(t,o)))e=E}return e}
|
|
3
|
+
export{r,k,h,p,y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function Oe(t){return{support:"typescript",parser:t}}function $e(t){return{support:"entities",names:t}}function qe(t){return t&&"parser"in t?t.parser:void 0}function De(t){return t&&"names"in t?t.names:void 0}function _(){throw Error('sveast: parsing TypeScript needs `typescript` from "sveast/typescript": createParser({ typescript })')}
|
|
2
|
+
export{Oe,$e,qe,De,_};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{A,E}from"./shared-as9can03.js";import{l,m,x}from"./shared-drsxcq8p.js";import{_}from"./shared-pt7hcxxy.js";var Oe="",C,F=0;function u(t){Oe=t,C=void 0,F=0}function a(t){if(!C){C=[0];let s=Oe.indexOf(`
|
|
2
|
+
`);while(s!==-1)C.push(s+1),s=Oe.indexOf(`
|
|
3
|
+
`,s+1)}let o=0,r=C.length-1;if(t>=C[F])o=F;else r=F-1;if(o<r&&t<C[o+1])r=o;while(o<r){let s=o+r+1>>>1;if(C[s]<=t)o=s;else r=s-1}return F=o,{line:o+1,column:t-C[o],character:t}}function f(t){let{line:o,column:r}=a(t);return{line:o,column:r}}function ze(){return Oe.split(`
|
|
4
|
+
`)}var et=/^\t+/;class e extends Error{name="ParseError";code;reason;position;start;end;frame;constructor(t,o,r){super(`${r}
|
|
5
|
+
https://svelte.dev/e/${o}`);this.code=o,this.reason=r;let s=typeof t==="number"?t:t?.start,c=typeof t==="number"?t:t?.end;if(s!==void 0)this.position=[s,c??s],this.start=a(this.position[0]),this.end=a(this.position[1]),this.frame=tt(this.start.line-1,this.end.column)}}var Me=(t)=>t.replace(et,(o)=>" ".repeat(o.length));function tt(t,o){let r=ze(),s=Math.max(0,t-2),c=Math.min(t+3,r.length),v=String(c+1).length;return r.slice(s,c).map((p,h)=>{let b=String(h+s+1).padStart(v," ");if(s+h!==t)return`${b}: ${Me(p)}`;let g=`${" ".repeat(v+2+Me(p.slice(0,o)).length)}^`;return`${b}: ${Me(p)}
|
|
6
|
+
${g}`}).join(`
|
|
7
|
+
`)}function M(t){throw new e(t,"attribute_duplicate","Attributes need to be unique")}function j(t){throw new e(t,"attribute_empty_shorthand","Attribute shorthand cannot be empty")}function W(t,o){throw new e(t,"block_duplicate_clause",`${o} cannot appear more than once within a block`)}function U(t){throw new e(t,"block_invalid_continuation_placement","{:...} block is invalid at this position (did you forget to close the preceding element or block?)")}function z(t){throw new e(t,"block_invalid_elseif","'elseif' should be 'else if'")}function K(t,o,r){throw new e(t,"block_invalid_placement",`{#${o} ...} block cannot be ${r}`)}function H(t){throw new e(t,"block_unclosed","Block was left open")}function G(t){throw new e(t,"block_unexpected_close","Unexpected block closing tag")}function Q(t){throw new e(t,"const_tag_invalid_expression","{@const ...} must consist of a single variable declaration")}function X(t){throw new e(t,"css_empty_declaration","Declaration cannot be empty")}function I(t){throw new e(t,"css_expected_identifier","Expected a valid CSS identifier")}function Y(t){throw new e(t,"css_selector_invalid","Invalid selector")}function J(t){throw new e(t,"debug_tag_invalid_arguments","{@debug ...} arguments must be identifiers, not arbitrary expressions")}function R(t){throw new e(t,"declaration_tag_invalid_type","Declaration tags must be `let` or `const` declarations")}function Z(t){throw new e(t,"directive_invalid_value","Directive value must be a JavaScript expression enclosed in curly braces")}function ee(t,o){throw new e(t,"directive_missing_name",`\`${o}\` name cannot be empty`)}function te(t,o){throw new e(t,"element_invalid_closing_tag",`\`</${o}>\` attempted to close an element that was not open`)}function ie(t,o,r){throw new e(t,"element_invalid_closing_tag_autoclosed",`\`</${o}>\` attempted to close element that was already automatically closed by \`<${r}>\` (cannot nest \`<${r}>\` inside \`<${o}>\`)`)}function P(t,o){throw new e(t,"element_unclosed",`\`<${o}>\` was left open`)}function O(t){throw new e(t,"expected_attribute_value","Expected attribute value")}function re(t){throw new e(t,"expected_block_type","Expected 'if', 'each', 'await', 'key' or 'snippet'")}function q(t){throw new e(t,"expected_identifier","Expected an identifier")}function se(t){throw new e(t,"expected_pattern","Expected identifier or destructure pattern")}function ne(t){throw new e(t,"expected_tag","Expected 'html', 'render', 'attach', 'const', or 'debug'")}function n(t,o){throw new e(t,"expected_token",`Expected token ${o}`)}function oe(t){throw new e(t,"expected_whitespace","Expected whitespace")}function Ue(t,o){throw new e(t,"js_parse_error",`${o}`)}function ae(t){throw new e(t,"render_tag_invalid_expression","`{@render ...}` tags can only contain call expressions")}function le(t){throw new e(t,"script_duplicate","A component can have a single top-level `<script>` element and/or a single top-level `<script module>` element")}function pe(t,o){throw new e(t,"script_invalid_attribute_value",`If the \`${o}\` attribute is supplied, it must be a boolean attribute`)}function ce(t){throw new e(t,"script_invalid_context",'If the context attribute is supplied, its value must be "module"')}function he(t,o){throw new e(t,"script_reserved_attribute",`The \`${o}\` attribute is reserved and cannot be used`)}function ue(t){throw new e(t,"style_duplicate","A component can have a single top-level `<style>` element")}function fe(t){throw new e(t,"svelte_component_invalid_this","Invalid component definition — must be an `{expression}`")}function de(t){throw new e(t,"svelte_component_missing_this","`<svelte:component>` must have a 'this' attribute")}function D(t){throw new e(t,"svelte_element_missing_this","`<svelte:element>` must have a 'this' attribute with a value")}function me(t,o){throw new e(t,"svelte_meta_duplicate",`A component can only have one \`<${o}>\` element`)}function ye(t,o){throw new e(t,"svelte_meta_invalid_content",`<${o}> cannot have children`)}function xe(t,o){throw new e(t,"svelte_meta_invalid_placement",`\`<${o}>\` tags cannot be inside elements or blocks`)}function ge(t,o){throw new e(t,"svelte_meta_invalid_tag",`Valid \`<svelte:...>\` tag names are ${o}`)}function be(t){throw new e(t,"svelte_options_deprecated_tag",'"tag" option is deprecated — use "customElement" instead')}function ve(t){throw new e(t,"svelte_options_invalid_attribute","`<svelte:options>` can only receive static attributes")}function L(t,o){throw new e(t,"svelte_options_invalid_attribute_value",`Value must be ${o}, if specified`)}function Se(t){throw new e(t,"svelte_options_invalid_customelement",'"customElement" must be a string literal defining a valid custom element name or an object of the form { tag?: string; shadow?: "open" | "none" | `ShadowRootInit`; props?: { [key: string]: { attribute?: string; reflect?: boolean; type: .. } } }')}function ke(t){throw new e(t,"svelte_options_invalid_customelement_props",'"props" must be a statically analyzable object literal of the form "{ [key: string]: { attribute?: string; reflect?: boolean; type?: "String" | "Boolean" | "Number" | "Array" | "Object" }"')}function Te(t){throw new e(t,"svelte_options_invalid_customelement_shadow",'"shadow" must be either "open", "none" or `ShadowRootInit` object.')}function B(t){throw new e(t,"svelte_options_invalid_tagname","Tag name must be lowercase and hyphenated")}function we(t){throw new e(t,"svelte_options_reserved_tagname","Tag name is reserved")}function Ae(t,o){throw new e(t,"svelte_options_unknown_attribute",`\`<svelte:options>\` unknown attribute '${o}'`)}function Ee(t){throw new e(t,"tag_invalid_name","Expected a valid element or component name. Components must have a valid variable name or dot notation expression")}function Ce(t,o,r){throw new e(t,"tag_invalid_placement",`{@${o} ...} tag cannot be ${r}`)}function i(t){throw new e(t,"unexpected_eof","Unexpected end of input")}function Ne(t,o){throw new e(t,"unexpected_reserved_word",`'${o}' is a reserved word in JavaScript and cannot be used here`)}function _e(t){throw new e(t,"unterminated_string_constant","Unterminated string constant")}function Pe(t){throw new e(t,"void_element_invalid_content","Void elements cannot have children or closing tags")}var T="",Ge=[],We=0;function Je(t,o){T=t,Ge=o,We=0}function Xe(){return We}function qe(t,o,r,s){We=s}function Ke(t,o,r,s,c,v){We=s;let p=o;if(t&&p.includes(`
|
|
8
|
+
`)){let b=T.lastIndexOf(`
|
|
9
|
+
`,r-1)+1,g=b,N=T.charCodeAt(g);while(N===32||N===9)N=T.charCodeAt(++g);if(g>b)p=nt(p,T.slice(b,g))}let h={type:t?"Block":"Line",value:p,start:r,end:s};if(c&&v)h.loc={start:c,end:v};Ge.push(h)}function nt(t,o){let r=t.startsWith(o)?o.length:0,s="",c=t.indexOf(`
|
|
10
|
+
`,r);while(c!==-1){if(s+=t.slice(r,c+1),r=c+1,t.startsWith(o,r))r+=o.length;c=t.indexOf(`
|
|
11
|
+
`,r)}return s+t.slice(r)}function Ye(t,o,r){let s=0,c=o.length;while(s<c){let v=s+c>>>1;if(o[v].start<r)s=v+1;else c=v}if(s>=o.length)return;if(k=o.slice(s).map(({type:v,value:p,start:h,end:b})=>({type:v,value:p,start:h,end:b})),y=0,Be(t,void 0,!1),y<k.length&&(k[y].start>=t.end||t.type==="Program")){t.trailingComments??=[];while(y<k.length)t.trailingComments.push(k[y++])}}var k=[],y=0,ot=new Map([["BlockStatement","body"],["Program","body"],["ArrayExpression","elements"],["ObjectExpression","properties"]]);function Ve(t,o){for(let r=t;r<o;r++){let s=T.charCodeAt(r);if(s!==44&&s!==41&&s!==32&&s!==9)return!0}return!1}function Be(t,o,r){while(y<k.length&&k[y].start<t.start)t.leadingComments??=[],t.leadingComments.push(k[y++]);if(y>=k.length)return;let s=k[y].start;if(s<t.end||!Ve(t.end,s)){let c=m(t),v=ot.get(t.type),p=v===void 0?void 0:c[v],h=Array.isArray(p)&&p.length===0;for(let b in c){if(y>=k.length)return;if(b==="type")continue;let g=c[b];if(Array.isArray(g)){let N=b===v;for(let S=0;S<g.length;S++){let Fe=g[S];if(l(Fe))Be(Fe,t,N?S===g.length-1:h)}}else if(l(g))Be(g,t,h)}if(y>=k.length)return}if(o!==void 0&&t.end===o.end)return;if(r)while(y<k.length){if(o&&k[y].start>=o.end)break;t.trailingComments??=[],t.trailingComments.push(k[y++])}else if(t.end<=k[y].start&&!Ve(t.end,k[y].start))t.trailingComments=[k[y++]]}var Re=!1,He=new Map;function je(t){if(!(t instanceof RegExp))return t;let o=He.get(t);if(!o){let r=new Set(t.source.slice(4,-2).split("|"));o={test:(s)=>r.has(s)},He.set(t,o)}return o}var V=A((t)=>{let{keywordTypes:o,tokTypes:r}=t.acorn,s=new Map("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this const class extends export import super".split(" ").map((c)=>[c,o[c]]));return class extends t{constructor(c,v,p){super(c,v,p);this.keywords=je(this.keywords),this.reservedWords=je(this.reservedWords),this.reservedWordsStrict=je(this.reservedWordsStrict),this.reservedWordsStrictBind=je(this.reservedWordsStrictBind)}parseParenAndDistinguishExpression(c,v){let p=super.parseParenAndDistinguishExpression(c,v);if(p.type==="ParenthesizedExpression")Re=!0;return p}checkLocalExport(){}skipSpace(){let c=this.input,v=this.options.locations,p=this.pos,h=c.charCodeAt(p);for(;;)if(h===32||h===9)h=c.charCodeAt(++p);else if(h===10){if(h=c.charCodeAt(++p),v)this.curLine++,this.lineStart=p}else break;if(this.pos=p,h===47||h<33||h>=128)super.skipSpace()}readWord1(){let c=this.input,v=this.pos,p=v,h=c.charCodeAt(p);while(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===95||h===36)h=c.charCodeAt(++p);if(h>=128||h===92)return super.readWord1();return this.containsEsc=!1,this.pos=p,c.slice(v,p)}readWord(){let c=this.readWord1();return this.finishToken(s.get(c)??r.name,c)}}}),rt=E(V),it=/ \(\d+:\d+\)$/;function $e(t){return t}function Qe(t){return t instanceof SyntaxError&&"pos"in t&&typeof t.pos==="number"}function De(t,o,r,s,c,v=t.root.comments.length){let p=t.root.comments;Je(o,p);let h={onComment:t.comments?Ke:qe,sourceType:"module",ecmaVersion:16,locations:t.loc,preserveParens:s};if(t.lfOnly)h.startLocation=a(r);let b=t.isTypeScript?t.typescript:rt;if(!b)_();let g;try{g=c(b,h)}catch(N){if(!Qe(N))throw N;Ue(N.pos,N.message.replace(it,""))}if(p.length>v)Ye($e(g),p,r);return g}function w(t,o,r=0){return $e(De(t,o,0,!1,(s,c)=>{if(r>0&&c.locations)c.startLocation=a(r);let v=new s(c,o,r).parse();return v.start=0,v},0))}var st={count:0};function d(t,o,r,s=!1){st.count+=1,Re=!1;let c=$e(De(t,o,r,!0,(p,h)=>p.parseExpressionAt(o,r,h))),v=Math.max(c.end,Xe());return{node:Re&&!s?Ze(c):c,end:v}}function Le(t,o,r){return $e(De(t,o,r,!1,(s,c)=>{let v=new s(c,o,r);try{return v.nextToken(),v.parseStatement(null,!0,Object.create(null))}catch(p){if(Qe(p)&&p.pos===o.length)i(o.length);throw p}}))}function Ie(t,o,r){let s=De(t,o,0,!1,(c,v)=>{let p=new c(v,o,0),h=p.startNode(),b=[],g=Object.create(null);return r((N)=>{p.pos=N,p.context=p.initialContext(),p.exprAllowed=!0,p.nextToken();let S=p.parseStatement(null,!0,g);return b.push(S),S.end}),h.body=b,p.finishNode(h,"Program")});return $e(s).body}function Ze(t){let o=t;while(o.type==="ParenthesizedExpression")o=o.expression;return x(o,Ze),o}
|
|
12
|
+
export{u,a,f,e,M,j,W,U,z,K,H,G,Q,X,I,Y,J,R,Z,ee,te,ie,P,O,re,q,se,ne,n,oe,ae,le,pe,ce,he,ue,fe,de,D,me,ye,xe,ge,be,ve,L,Se,ke,Te,B,we,Ae,Ee,Ce,i,Ne,_e,Pe,V,w,d,Le,Ie};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{v}from"./shared-f8ty80r9.js";var x=/(?:\s|\/\/.*|\/\*[\s\S]*?\*\/)*/g,F=new Map([["any","TSAnyKeyword"],["bigint","TSBigIntKeyword"],["boolean","TSBooleanKeyword"],["never","TSNeverKeyword"],["null","TSNullKeyword"],["number","TSNumberKeyword"],["object","TSObjectKeyword"],["string","TSStringKeyword"],["symbol","TSSymbolKeyword"],["undefined","TSUndefinedKeyword"],["unknown","TSUnknownKeyword"],["void","TSVoidKeyword"]]),q=new Set("public private protected readonly declare abstract override static accessor".split(" ")),O=new Set("public private protected readonly override".split(" ")),K=new Set("var let const function class abstract enum interface type namespace module global".split(" ")),V=new Set("var let const function class interface enum".split(" ")),k=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),L=1,H=32,U=256,j=0,z=1,d=2,G=3,Q=4,N=6,C=7,D=256,A=1024,W=8|A,Y=d|D,w=1,X=2,I=40,J=41,Z=44,P=46,_=58,f=61,R=60,y=123,tt=91,T=42,et=35,S=34,b=39,st=SyntaxError("speculative parse failed"),g=v((m)=>{let{tokTypes:s,keywordTypes:M,isIdentifierChar:B,isIdentifierStart:c}=m.acorn,u=new m.acorn.TokenType("@");class E extends m{inType=!1;$5=!1;$6=!1;$8=null;$o=null;$p=!1;$q=!1;$i=null;$b=[[]];$r=0;$12=0;constructor(t,e,r){super(t,e,r);let i=this.options.onComment;if(typeof i==="function")this.options.onComment=(n,a,h,o,l,p)=>{if(h<this.$12)return;this.$12=o,i.call(this,n,a,h,o,l,p)}}getTokenFromCode(t){if(t===64)return++this.pos,this.finishToken(u);return super.getTokenFromCode(t)}readToken_lt_gt(t){if(this.inType)return this.finishOp(s.relational,1);return super.readToken_lt_gt(t)}$9(t){let e=this.inType;this.inType=!0;let r=t();if(this.inType=e,!e&&this.type===s.relational)this.pos=this.start,this.nextToken();return r}$1(){return this.type===s.relational&&this.value==="<"}$k(){if(this.type===s.bitShift&&this.value==="<<")this.pos=this.start+1,this.finishToken(s.relational,"<");return this.$1()}$c(){return this.type===s.relational&&this.value===">"}$s(){return this.type===s.prefix&&this.value==="!"}hasPrecedingLineBreak(){return this.$13(this.lastTokEnd,this.start)}$13(t,e){for(let r=t;r<e;r++){let i=this.input.charCodeAt(r);if(i===10||i===13||i===8232||i===8233)return!0}return!1}$d(t=this.pos){return x.lastIndex=t,x.exec(this.input),x.lastIndex}$2(){return this.input.charCodeAt(this.$d())}$3(){let t=this.$d(),e=t;while(e<this.input.length&&B(this.input.charCodeAt(e)))e++;return this.input.slice(t,e)}$a(){return!this.$13(this.pos,this.$d())}$14(){return this.$a()&&c(this.$2())&&!Object.hasOwn(M,this.$3())}$15(){return{pos:this.pos,type:this.type,value:this.value,start:this.start,end:this.end,startLoc:this.startLoc,endLoc:this.endLoc,lastTokStart:this.lastTokStart,lastTokEnd:this.lastTokEnd,lastTokStartLoc:this.lastTokStartLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,context:this.context.slice(),exprAllowed:this.exprAllowed,containsEsc:this.containsEsc,inType:this.inType,$5:this.$5,$6:this.$6,$8:this.$8,scopes:this.scopeStack.length,privateNames:this.privateNameStack.length,labels:this.labels,labelCount:this.labels.length,strict:this.strict,yieldPos:this.yieldPos,awaitPos:this.awaitPos,awaitIdentPos:this.awaitIdentPos,potentialArrowAt:this.potentialArrowAt,potentialArrowInForAwait:this.potentialArrowInForAwait}}$16(t){this.pos=t.pos,this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.startLoc=t.startLoc,this.endLoc=t.endLoc,this.lastTokStart=t.lastTokStart,this.lastTokEnd=t.lastTokEnd,this.lastTokStartLoc=t.lastTokStartLoc,this.lastTokEndLoc=t.lastTokEndLoc,this.curLine=t.curLine,this.lineStart=t.lineStart,this.context=t.context,this.exprAllowed=t.exprAllowed,this.containsEsc=t.containsEsc,this.inType=t.inType,this.$5=t.$5,this.$6=t.$6,this.$8=t.$8,this.scopeStack.length=t.scopes,this.privateNameStack.length=t.privateNames,this.labels=t.labels,this.labels.length=t.labelCount,this.strict=t.strict,this.yieldPos=t.yieldPos,this.awaitPos=t.awaitPos,this.awaitIdentPos=t.awaitIdentPos,this.potentialArrowAt=t.potentialArrowAt,this.potentialArrowInForAwait=t.potentialArrowInForAwait}raise(t,e){if(this.$r>0)throw st;return super.raise(t,e)}$1y(t,e){try{super.raise(t,e)}catch(r){if(r instanceof SyntaxError)r.$1z=!0;throw r}throw Error("unreachable")}$f(t,e=!1){let r=this.$15();this.$r++;try{let i=t();if(e||i===void 0)this.$16(r);return i}catch(i){if(!(i instanceof SyntaxError)||!e&&i.$1z)throw i;this.$16(r);return}finally{this.$r--}}$t(t){return this.$f(t,!0)===!0}$17(t){if(t.end=this.lastTokEnd,this.options.locations)t.loc.end=this.lastTokEndLoc}$l(t,e){if(t.start=e.start,this.options.locations)t.loc.start=e.loc.start}$4(t=!1){let e=this.startNode();return e.typeAnnotation=this.$9(()=>(this.next(),t?this.$20():this.$0())),this.finishNode(e,"TSTypeAnnotation")}$g(t,e){if(e&&this.eat(s.question))t.optional=!0,this.$17(t);if(this.type===s.colon)t.typeAnnotation=this.$4(),this.$17(t);return t}$20(){if(this.type!==s.name&&this.type!==s._this)return this.$0();if(this.isContextual("asserts")&&this.$a()&&c(this.$2())){let t=this.startNode();if(this.next(),t.parameterName=this.type===s._this?this.$u():this.parseIdent(),this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.$v(t,!0);return t.asserts=!0,t.typeAnnotation=null,this.finishNode(t,"TSTypePredicate")}if(this.$3()==="is"&&this.$a()){let t=this.startNode();return t.parameterName=this.type===s._this?this.$u():this.parseIdent(!0),this.$v(t,!1)}return this.$0()}$v(t,e){this.next();let r=this.startNode();return r.typeAnnotation=this.$0(),t.typeAnnotation=this.finishNode(r,"TSTypeAnnotation"),t.asserts=e,this.finishNode(t,"TSTypePredicate")}$u(){let t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")}parseWholeType(){this.inType=!0,this.nextToken();let t=this.$0();if(this.type!==s.eof)this.unexpected();return t}$0(){let t=this.$18();if(this.$5||this.type!==s._extends||this.hasPrecedingLineBreak())return t;let e=this.startNodeAt(t.start,t.loc?.start);return this.next(),e.checkType=t,e.extendsType=this.$h(!0,()=>this.$18()),this.expect(s.question),e.trueType=this.$h(!1,()=>this.$0()),this.expect(s.colon),e.falseType=this.$h(!1,()=>this.$0()),this.finishNode(e,"TSConditionalType")}$h(t,e){let r=this.$5;this.$5=t;let i=e();return this.$5=r,i}$18(){if(this.$21())return this.$19("TSFunctionType");if(this.type===s._new||this.isContextual("abstract")&&this.$3()==="new")return this.$19("TSConstructorType");return this.$1a("TSUnionType",s.bitwiseOR,()=>this.$1a("TSIntersectionType",s.bitwiseAND,()=>this.$1b()))}$19(t){let e=this.startNode();if(t==="TSConstructorType"){if(e.abstract=this.isContextual("abstract"),e.abstract)this.next();this.next()}return this.$h(!1,()=>this.$m(e,s.arrow)),this.finishNode(e,t)}$m(t,e){if(this.$1())t.typeParameters=this.$7();if(this.expect(s.parenL),t.parameters=this.parseBindingList(s.parenR,!1,!0),this.type===e)t.typeAnnotation=this.$4(!0);else if(e===s.arrow)this.unexpected()}$21(){if(this.$1())return!0;if(this.type!==s.parenL)return!1;return this.$t(()=>{if(this.next(),this.type===s.parenR||this.type===s.ellipsis)return!0;if(this.type===s.name||this.type===s._this)this.next();else if(this.type===s.braceL||this.type===s.bracketL)this.parseBindingAtom();else return!1;let t=this.type;if(t===s.colon||t===s.comma||t===s.question||t===s.eq)return!0;if(t!==s.parenR)return!1;return this.next(),this.type===s.arrow})}$1a(t,e,r){let i=this.startNode(),n=this.eat(e),a=[];do a.push(r());while(this.eat(e));if(a.length===1&&!n)return a[0];return i.types=a,this.finishNode(i,t)}$1b(){if(this.type===s.name&&!this.containsEsc){let t=this.value;if(t==="keyof"||t==="unique"||t==="readonly"){let e=this.startNode();return this.next(),e.operator=t,e.typeAnnotation=this.$1b(),this.finishNode(e,"TSTypeOperator")}if(t==="infer"){let e=this.startNode();this.next();let r=this.startNode();r.name=this.$w();let i=this.$f(()=>this.$22());if(i)r.constraint=i;return e.typeParameter=this.finishNode(r,"TSTypeParameter"),this.finishNode(e,"TSInferType")}}return this.$h(!1,()=>this.$23())}$22(){if(!this.eat(s._extends))return;let t=this.$h(!0,()=>this.$0());if(this.$5||this.type!==s.question)return t;return}$w(){if(this.type!==s.name&&!this.type.keyword)this.unexpected();let t=this.type===s.name?this.value:this.type.keyword;return this.next(),t}$23(){let t=this.$24();while(!this.hasPrecedingLineBreak()&&this.eat(s.bracketL)){let e=this.startNodeAt(t.start,t.loc?.start);if(this.eat(s.bracketR))e.elementType=t,t=this.finishNode(e,"TSArrayType");else e.objectType=t,e.indexType=this.$0(),this.expect(s.bracketR),t=this.finishNode(e,"TSIndexedAccessType")}return t}$24(){switch(this.type){case s.name:case s._void:case s._null:{let t=F.get(this.value);if(t&&(this.type!==s.name||!this.containsEsc&&this.$2()!==P)){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.$1c()}case s.string:case s.num:case s._true:case s._false:{let t=this.startNode();return t.literal=this.parseExprAtom(),this.finishNode(t,"TSLiteralType")}case s.plusMin:{if(this.value!=="-")break;let t=this.startNode(),e=this.startNode();if(this.next(),this.type!==s.num)this.unexpected();return e.operator="-",e.prefix=!0,e.argument=this.parseExprAtom(),t.literal=this.finishNode(e,"UnaryExpression"),this.finishNode(t,"TSLiteralType")}case s.backQuote:return this.$25();case s._this:{let t=this.$u();if(this.isContextual("is")&&!this.hasPrecedingLineBreak()){let e=this.startNodeAt(t.start,t.loc?.start);return e.parameterName=t,this.$v(e,!1)}return t}case s._typeof:return this.$26();case s._import:return this.$1d();case s.braceL:return this.$27()?this.$28():this.$29();case s.bracketL:return this.$2a();case s.parenL:{let t=this.startNode();return this.next(),t.typeAnnotation=this.$0(),this.expect(s.parenR),this.finishNode(t,"TSParenthesizedType")}default:if(this.type.keyword)return this.$1c()}return this.unexpected()}$1c(){let t=this.startNode();if(t.typeName=this.$j(),!this.hasPrecedingLineBreak()&&this.$1())t.typeArguments=this.$e();return this.finishNode(t,"TSTypeReference")}$j(){let t=this.parseIdent(!0);while(this.eat(s.dot)){let e=this.startNodeAt(t.start,t.loc?.start);e.left=t,e.right=this.parseIdent(!0),t=this.finishNode(e,"TSQualifiedName")}return t}$26(){let t=this.startNode();if(this.next(),t.exprName=this.type===s._import?this.$1d():this.$j(),!this.hasPrecedingLineBreak()&&this.$1())t.typeArguments=this.$e();return this.finishNode(t,"TSTypeQuery")}$1d(){let t=this.startNode();if(this.next(),t.argument=this.$1e(),this.eat(s.dot))t.qualifier=this.$j();if(this.$1())t.typeArguments=this.$e();return this.finishNode(t,"TSImportType")}$x(){if(this.type!==s.string)this.unexpected();return this.parseExprAtom()}$1e(){this.expect(s.parenL);let t=this.$x();return this.expect(s.parenR),t}$25(){let t=this.startNode(),e=this.startNode();this.next(),e.expressions=[];let r=this.parseTemplateElement({isTagged:!1});e.quasis=[r];while(!r.tail){if(this.type===s.eof)this.raise(this.pos,"Unterminated template literal");this.expect(s.dollarBraceL),e.expressions.push(this.$0()),this.expect(s.braceR),r=this.parseTemplateElement({isTagged:!1}),e.quasis.push(r)}return this.next(),t.literal=this.finishNode(e,"TemplateLiteral"),this.finishNode(t,"TSLiteralType")}$27(){return this.$t(()=>{if(this.next(),this.type===s.plusMin)return this.next(),this.isContextual("readonly");if(this.isContextual("readonly"))this.next();if(this.type!==s.bracketL)return!1;if(this.next(),this.type!==s.name)return!1;return this.next(),this.type===s._in})}$28(){let t=this.startNode();if(this.expect(s.braceL),this.type===s.plusMin)t.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))t.readonly=!0;this.expect(s.bracketL);let e=this.startNode();if(e.name=this.$w(),this.expect(s._in),e.constraint=this.$0(),t.typeParameter=this.finishNode(e,"TSTypeParameter"),t.nameType=this.eatContextual("as")?this.$0():null,this.expect(s.bracketR),this.type===s.plusMin)t.optional=this.value,this.next(),this.expect(s.question);else if(this.eat(s.question))t.optional=!0;if(this.eat(s.colon))t.typeAnnotation=this.$0();return this.semicolon(),this.expect(s.braceR),this.finishNode(t,"TSMappedType")}$29(){let t=this.startNode();return t.members=this.$1f(),this.finishNode(t,"TSTypeLiteral")}$1f(){this.expect(s.braceL);let t=[];while(!this.eat(s.braceR))t.push(this.$2b());return t}$2b(){let t=this.startNode(),e="TSPropertySignature",r=this.type===s._new?this.$2():-1;if(this.type===s.parenL||this.$1())e="TSCallSignatureDeclaration",this.$m(t,s.colon);else if(r===I||r===R)e="TSConstructSignatureDeclaration",this.next(),this.$m(t,s.colon);else{let i=this.type===s._new?this.parseIdent(!0):null;if(this.isContextual("readonly")&&this.$n(!0))this.next(),t.readonly=!0;if(this.type===s.bracketL&&this.$1g())return this.$1h(t);let n="method";if(i)t.key=i;else{if((this.isContextual("get")||this.isContextual("set"))&&this.$n(!1))n=this.value,this.next();this.parsePropertyName(t)}if(this.eat(s.question))t.optional=!0;if(this.type===s.parenL||this.$1()){if(e="TSMethodSignature",n!=="method")t.kind=n;this.$m(t,s.colon),t.kind=n}else if(this.type===s.colon)t.typeAnnotation=this.$4()}return this.$1i(),this.finishNode(t,e)}$1i(){if(!this.eat(s.comma))this.semicolon()}$1g(){return this.$t(()=>{if(this.next(),this.type!==s.name)return!1;return this.next(),this.type===s.colon})}$1h(t){if(this.expect(s.bracketL),t.parameters=[this.$g(this.parseIdent(),!1)],this.expect(s.bracketR),this.type===s.colon)t.typeAnnotation=this.$4();return this.$1i(),this.finishNode(t,"TSIndexSignature")}$2a(){let t=this.startNode();this.expect(s.bracketL),t.elementTypes=[];while(!this.eat(s.bracketR))if(t.elementTypes.push(this.$2c()),this.type!==s.bracketR)this.expect(s.comma);return this.finishNode(t,"TSTupleType")}$2c(){let t=this.start,e=this.startLoc,r=this.eat(s.ellipsis),i;if((this.type===s.name||this.type.keyword)&&this.$2d()){let n=this.startNode();n.label=this.parseIdent(!0),n.optional=this.eat(s.question),this.expect(s.colon),n.elementType=this.$0(),i=this.finishNode(n,"TSNamedTupleMember")}else if(i=this.$0(),this.eat(s.question)){let n=this.startNodeAt(i.start,i.loc?.start);n.typeAnnotation=i,i=this.finishNode(n,"TSOptionalType")}if(r){let n=this.startNodeAt(t,e);n.typeAnnotation=i,i=this.finishNode(n,"TSRestType")}return i}$2d(){let t=this.$d();if(this.input.charCodeAt(t)===63)t=this.$d(t+1);return this.input.charCodeAt(t)===_}$7(){return this.$9(()=>{let t=this.startNode();this.next(),t.params=[];while(!this.$c()){let e=this.startNode();while((this.type===s._const||this.type===s._in||this.isContextual("out"))&&c(this.$2()))e[this.value]=!0,this.next();if(e.name=this.$w(),this.eat(s._extends))e.constraint=this.$0();if(this.eat(s.eq))e.default=this.$0();if(t.params.push(this.finishNode(e,"TSTypeParameter")),!this.$c()){if(this.expect(s.comma),this.$c())t.extra={trailingComma:this.lastTokStart}}}if(this.next(),t.params.length===0)this.$1y(this.start,"Type parameter list cannot be empty.");return this.finishNode(t,"TSTypeParameterDeclaration")})}$e(){return this.$9(()=>{let t=this.startNode();this.next(),t.params=[];while(!this.$c())if(t.params.push(this.$0()),!this.$c())this.expect(s.comma);if(t.params.length===0)this.unexpected();return this.next(),this.finishNode(t,"TSTypeParameterInstantiation")})}$1j(){let t=[];do{let e=this.startNode();if(e.expression=this.$j(),this.$1())e.typeParameters=this.$e();t.push(this.finishNode(e,"TSExpressionWithTypeArguments"))}while(this.eat(s.comma));return t}$1k(t=!1){if(this.type!==s.name||this.containsEsc){if(this.type===s._const&&this.$3()==="enum")return this.$y(this.startNode());return}if(!this.$2e(this.value))return;if(this.value==="declare")return this.$2f(t);return this.$1l(this.startNode(),this.value)}$2e(t){switch(t){case"interface":case"type":case"namespace":return this.$14();case"enum":return c(this.$2());case"abstract":return this.$a()&&this.$3()==="class";case"module":{let e=this.$2();return this.$a()&&(e===S||e===b||c(e))}case"declare":return this.$a()&&K.has(this.$3());case"global":return this.$a()&&this.$2()===y}return!1}$1l(t,e){switch(e){case"interface":return this.$1m(t);case"type":return this.$2g(t);case"enum":return this.$y(t);case"abstract":return this.$1n(t,!0);case"global":return t.global=!0,t.id=this.parseIdent(),t.body=this.$z(),this.finishNode(t,"TSModuleDeclaration")}return this.$2h(t)}$2f(t){let e=this.$6;this.$6=!0;let r=this.startNode();this.next();let i=this.value;if(i==="const"&&this.$3()==="enum")r.const=!0;if(!t&&V.has(i))r.declare=!0;let n;if(r.const)n=this.$y(r);else if(i==="var"||i==="let"||i==="const")n=this.parseVarStatement(r,i,!0);else if(i==="function")this.next(),n=this.parseFunction(r,w,!1,!1);else if(i==="class")n=this.parseClass(r,!0);else n=this.$1l(r,i);return n.declare=!0,this.$6=e,n}$1n(t,e){return this.next(),t.abstract=!0,this.parseClass(t,e)}$1m(t){if(this.next(),t.id=this.parseIdent(),this.checkLValSimple(t.id,C),this.$1())t.typeParameters=this.$7();return this.$9(()=>{if(this.eat(s._extends))t.extends=this.$1j();let e=this.startNode();e.body=this.$1f(),t.body=this.finishNode(e,"TSInterfaceBody")}),this.finishNode(t,"TSInterfaceDeclaration")}$2g(t){if(this.next(),t.id=this.parseIdent(),this.checkLValSimple(t.id,N),this.$1())t.typeParameters=this.$7();return t.typeAnnotation=this.$9(()=>(this.expect(s.eq),this.$0())),this.semicolon(),this.finishNode(t,"TSTypeAliasDeclaration")}$y(t){if(this.type===s._const)t.const=!0,this.next();this.next(),t.id=this.parseIdent(),this.checkLValSimple(t.id,Y),this.expect(s.braceL),t.members=[];while(!this.eat(s.braceR)){let e=this.startNode();if(e.id=this.type===s.string?this.parseExprAtom():this.parseIdent(!0),this.eat(s.eq))e.initializer=this.parseMaybeAssign();if(t.members.push(this.finishNode(e,"TSEnumMember")),this.type!==s.braceR)this.expect(s.comma)}return this.finishNode(t,"TSEnumDeclaration")}$2h(t){if(this.next(),this.type===s.string){if(t.id=this.parseExprAtom(),this.type===s.braceL)t.body=this.$z();else this.semicolon();return this.finishNode(t,"TSModuleDeclaration")}return t.id=this.parseIdent(),this.checkLValSimple(t.id,W),this.$1o(t)}$1o(t){if(this.eat(s.dot)){let e=this.startNode();e.id=this.parseIdent(),t.body=this.$1o(e)}else t.body=this.$z();return this.finishNode(t,"TSModuleDeclaration")}$z(){this.enterScope(U);let t=this.startNode();this.enterScope(0),this.expect(s.braceL),t.body=[];while(!this.eat(s.braceR))t.body.push(this.parseStatement(null,!0));return this.exitScope(),this.exitScope(),this.finishNode(t,"TSModuleBlock")}$1p(t,e){if(t.isExport=e,t.id=this.parseIdent(),this.checkLValSimple(t.id,d),this.expect(s.eq),this.isContextual("require")&&this.$2()===I){let r=this.startNode();this.next(),r.expression=this.$1e(),t.moduleReference=this.finishNode(r,"TSExternalModuleReference")}else t.moduleReference=this.$j();return this.semicolon(),this.finishNode(t,"TSImportEqualsDeclaration")}$2i(){let t=this.$d();if(this.input.charCodeAt(t)!==f)return!1;let e=this.input.charCodeAt(t+1);return e!==f&&e!==62}parseStatement(t,e,r){if(this.type===u)this.$1q(!0);let i=this.$1k();if(i)return i;return super.parseStatement(t,e,r)}parseVarStatement(t,e,r){return super.parseVarStatement(t,e,r||this.$6)}parseVarId(t,e){if(super.parseVarId(t,e),t.id.type==="Identifier"&&this.$s()&&!this.hasPrecedingLineBreak())this.next(),t.definite=!0;this.$g(t.id,!1)}parseCatchClauseParam(){let t=this.$g(this.parseBindingAtom(),!1),e=t.type==="Identifier";return this.enterScope(e?H:0),this.checkLValPattern(t,e?Q:d),this.expect(s.parenR),t}parseImport(t){if(this.next(),t.importKind="value",this.type===s.string)t.specifiers=[],t.source=this.parseExprAtom();else{if(this.isContextual("type")){let e=this.$2();if(e===y||e===T||c(e)&&this.$3()!=="from")t.importKind="type",this.next()}if(this.type===s.name&&this.$2i())return this.$1p(t,!1);t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.$x()}return this.$1r(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseWithClause(){if(this.isContextual("assert")&&!this.hasPrecedingLineBreak())this.type=s._with;return this.type===s._with?super.parseWithClause():void 0}$1r(t){let e=this.parseWithClause();if(e)t.attributes=e}parseImportSpecifier(){return this.$1s("importKind",()=>super.parseImportSpecifier())}parseExportSpecifier(t){return this.$1s("exportKind",()=>super.parseExportSpecifier(t))}$1s(t,e){let r=this.isContextual("type")?this.$2():-1;if(r===S||r===b||c(r)&&this.$3()!=="as"){let n=this.startNode();this.next();let a=e();return this.$l(a,n),a[t]="type",a}let i=e();return i[t]="value",i}parseExport(t,e){if(this.next(),this.eat(s._import)){if(t.importKind="value",this.isContextual("type")&&c(this.$2())&&this.$3()!=="from")t.importKind="type",this.next();return this.$1p(t,!0)}if(this.eat(s.eq))return t.expression=this.parseExpression(),this.semicolon(),this.finishNode(t,"TSExportAssignment");if(this.eatContextual("as"))return this.expectContextual("namespace"),t.id=this.parseIdent(),this.semicolon(),this.finishNode(t,"TSNamespaceExportDeclaration");if(t.exportKind="value",this.isContextual("type")){let n=this.$2();if(n===y||n===T)t.exportKind="type",this.next()}if(this.eat(s.star))return this.parseExportAllDeclaration(t,e);if(this.eat(s._default)){if(this.isContextual("interface")&&this.$14())t.declaration=this.$1m(this.startNode());else if(this.isContextual("abstract")&&this.$3()==="class")t.declaration=this.$1n(this.startNode(),"nullableID");else t.declaration=this.parseExportDefaultDeclaration();return this.finishNode(t,"ExportDefaultDeclaration")}let r=this.isContextual("declare"),i=this.$1k(!0);if(i||this.shouldParseExportStatement()){if(t.declaration=i??this.parseStatement(null),r||t.declaration.type==="TSInterfaceDeclaration"||t.declaration.type==="TSTypeAliasDeclaration")t.exportKind="type";return t.specifiers=[],t.source=null,this.finishNode(t,"ExportNamedDeclaration")}if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))t.source=this.$x(),this.$1r(t);else{for(let n of t.specifiers)if(this.checkUnreserved(n.local),this.checkLocalExport(n.local),n.local.type==="Literal")this.raise(n.local.start,"A string literal cannot be used as an exported binding without `from`.");t.source=null}return this.semicolon(),this.finishNode(t,"ExportNamedDeclaration")}parseFunction(t,e,r,i,n){let a=e&w;if(a)this.$i=t;super.parseFunction(t,e,r,i,n),this.$i=null;let h=!t.body;if(h)t.type="TSDeclareFunction";if(a&&t.id){if(h){if(this.$6&&this.currentScope().flags&L)this.declareName(t.id.name,A,t.id.start);this.checkLValSimple(t.id,j)}else if(!(e&X)){let o=G;if(this.strict||t.generator||t.async)o=this.treatFunctionsAsVar?z:d;this.checkLValSimple(t.id,o)}}return t}parseFunctionParams(t){if(this.$1())t.typeParameters=this.$7();if(super.parseFunctionParams(t),this.type===s.colon)t.returnType=this.$4(!0)}parseFunctionBody(t,e,r,i){if(r&&this.type===s.colon)t.returnType=this.$4(!0);if(e||this.type===s.braceL){super.parseFunctionBody(t,e,r,i);return}this.semicolon(),this.exitScope()}parseMethod(t,e,r){let i=this.$o;this.$o=null;let n=super.parseMethod(t,e,r);if(!n.body)n.type="TSDeclareMethod";if(i)n.typeParameters=i;return n}parseBindingList(t,e,r,i){let n=i===!0||this.$p;return this.$p=!1,super.parseBindingList(t,e,r,n)}$n(t){if(!t&&!this.$a())return!1;let e=this.$2();return e===tt||e===y||e===T||e===P||e===et||e===S||e===b||e>=48&&e<=57||c(e)}parseAssignableListItem(t){let e=this.$10(),r=this.start,i=this.startLoc,n,a=!1,h=!1;if(t)while(this.type===s.name&&O.has(this.value)&&!this.containsEsc&&this.$n(!1)){if(this.value==="readonly")a=!0;else if(this.value==="override")h=!0;else n=this.value;this.next()}let o;if(this.type===s._this)o=this.startNode(),o.name="this",this.next(),this.finishNode(o,"Identifier");else o=this.parseBindingAtom();let l=this.type===s.eq?this.parseMaybeDefault(r,i,o):this.parseMaybeDefault(o.start,o.loc?.start,this.$g(o,!0));if(e.length>0)l.decorators=e;if(!n&&!a&&!h)return l;let p=this.startNodeAt(r,i);if(n)p.accessibility=n;if(a)p.readonly=!0;if(h)p.override=!0;return p.parameter=l,this.finishNode(p,"TSParameterProperty")}parseBindingListItem(t){if(t.type==="RestElement")this.$g(t,!0);return t}checkLValSimple(t,e,r){if(this.$i&&t===this.$i.id){this.$i=null;return}if(!e&&k.has(t.type)){this.checkLValSimple(t.expression,e,r);return}switch(t.type){case"TSParameterProperty":this.checkLValInnerPattern(t.parameter,e,r);return;case"Identifier":if(t.name==="this")return}super.checkLValSimple(t,e,r)}toAssignable(t,e,r){if(t&&!e&&k.has(t.type))return t;return super.toAssignable(t,e,r)}declareName(t,e,r){let i=this.currentScope();if(e&A){this.$1t(i,t),i.$1u??=[],i.$1u.push(t);return}if(e===N||e===C){if(i.$11??=[],e===N&&i.$11.includes(t))this.raise(r,`type '${t}' has already been declared.`);i.$11.push(t),this.$1t(i,t);return}if(e&D){if(i.$1v??=[],i.$1v.includes(t))return;super.declareName(t,d,r),i.$1v.push(t);return}super.declareName(t,e,r)}$1t(t,e){if(this.inModule&&t.flags&L)delete this.undefinedExports[e]}checkLocalExport(t){for(let e=this.scopeStack.length-1;e>=0;e--){let r=this.scopeStack[e];if(r.$11?.includes(t.name)||r.$1u?.includes(t.name))return}super.checkLocalExport(t)}checkExport(){}raiseRecoverable(t,e){if(e==="Duplicate constructor in the same class")return;super.raiseRecoverable(t,e)}$10(){let t=[];while(this.type===u)t.push(this.$1w());return t}$1q(t){let e=this.$b[this.$b.length-1];while(this.type===u)e.push(this.$1w());if(this.type===s._export){if(!t)this.unexpected()}else if(this.type!==s._class&&!((this.isContextual("abstract")||this.isContextual("declare"))&&this.$3()==="class"))this.raise(this.start,"Leading decorators must be attached to a class declaration.")}$1w(){let t=this.startNode();this.next(),this.$b.push([]);let e=this.start,r=this.startLoc,i;if(this.type===s.parenL){if(this.next(),i=this.parseExpression(),this.expect(s.parenR),this.options.preserveParens){let a=this.startNodeAt(e,r);a.expression=i,i=this.finishNode(a,"ParenthesizedExpression")}}else{i=this.parseIdent(!1);while(this.eat(s.dot)){let a=this.startNodeAt(e,r);a.object=i,a.property=this.parseIdent(!0),a.computed=!1,i=this.finishNode(a,"MemberExpression")}}let n=this.$k()?this.$e():void 0;if(this.eat(s.parenL)){let a=this.startNodeAt(i.start,i.loc?.start);if(a.callee=i,a.arguments=this.parseExprList(s.parenR,!1,!1),n)a.typeArguments=n;i=this.finishNode(a,"CallExpression")}else if(n){let a=this.startNodeAt(i.start,i.loc?.start);a.expression=i,a.typeArguments=n,i=this.finishNode(a,"TSInstantiationExpression")}return t.expression=i,this.$b.pop(),this.finishNode(t,"Decorator")}shouldParseExportStatement(){return this.type===u||super.shouldParseExportStatement()}parseExprAtom(t,e,r){if(this.type===u)this.$1q(!1);return super.parseExprAtom(t,e,r)}parseProperty(t,e){if(t||this.type!==u)return super.parseProperty(t,e);let r=this.$10(),i=super.parseProperty(t,e);if(i.type==="SpreadElement")this.raise(i.start,"Decorators can't be used with SpreadElement");return i.decorators=r,i}parseClassId(t,e){let r=this.$b.length-1,i=this.$b[r];if(i.length>0)t.decorators=i,this.$l(t,i[0]),this.$b[r]=[];if(!this.isContextual("implements")||e===!0)super.parseClassId(t,e);if(this.$1())t.typeParameters=this.$7()}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass&&this.$1())t.superTypeParameters=this.$e();if(this.eatContextual("implements"))t.implements=this.$9(()=>this.$1j())}parseClassElement(t){if(this.type===u){let h=this.$10();if(this.type===s.braceR)this.raise(this.start,"Decorators must be attached to a class element.");let o=this.parseClassElement(t);return o.decorators=h,this.$l(o,h[0]),o}if(this.eat(s.semi))return null;let e=this.startNode();while(this.type===s.name&&q.has(this.value)&&!this.containsEsc&&this.$n(this.value==="static")){let h=this.value;if(this.next(),h==="static"&&this.type===s.braceL)return this.next(),this.parseClassStaticBlock(e),e;if(h==="public"||h==="private"||h==="protected")e.accessibility=h;else e[h]=!0}if(this.type===s.bracketL&&this.$1g())return this.$1h(e);e.static??=!1;let r="",i=!1,n=!1,a="method";if(this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===s.star)&&!this.canInsertSemicolon())n=!0;else r="async";if(!r&&this.eat(s.star))i=!0;if(!r&&!n&&!i){let h=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())a=h;else r=h}if(r)e.computed=!1,e.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),e.key.name=r,this.finishNode(e.key,"Identifier");else this.parseClassElementName(e);if(this.eat(s.question))e.optional=!0;if(this.type===s.parenL||this.$1()||a!=="method"||i||n){let h=e.key,o=!e.static&&!e.computed&&(h.type==="Identifier"&&h.name==="constructor"||h.type==="Literal"&&h.value==="constructor");if(e.kind=o?"constructor":a,this.$1())e.typeParameters=this.$7();this.$p=o,this.parseClassMethod(e,i,n,o&&t)}else{if(!e.optional&&this.$s())this.next(),e.definite=!0;if(this.type===s.colon)e.typeAnnotation=this.$4();this.parseClassField(e)}return e}parseMaybeAssign(t,e,r){if(this.$k()){let i=this.$f(()=>{let n=this.$7(),a=super.parseMaybeAssign(t,e,r);if(a.type!=="ArrowFunctionExpression")return;return a.typeParameters=n,this.$l(a,n),a});if(i)return i}return super.parseMaybeAssign(t,e,r)}parseMaybeUnary(t,e,r,i){if(this.$k()){let n=this.startNode();return n.typeAnnotation=this.$9(()=>{this.next();let a=this.$0();if(!this.$c())this.unexpected();return this.next(),a}),n.expression=this.parseMaybeUnary(null,!1,!1,i),this.finishNode(n,"TSTypeAssertion")}return super.parseMaybeUnary(t,e,r,i)}parseMaybeConditional(t,e){let r=this.start,i=this.startLoc,n=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return n;if(this.type===s.question&&!(n.type==="ArrowFunctionExpression"&&n.start===r)&&!this.$2j()){this.next();let a=this.startNodeAt(r,i);return a.test=n,a.consequent=this.parseMaybeAssign(),this.expect(s.colon),a.alternate=this.parseMaybeAssign(t),this.finishNode(a,"ConditionalExpression")}return n}$2j(){let t=this.$d(),e=this.input.charCodeAt(t);if(e===_||e===Z||e===J)return!0;return e===f&&this.input.charCodeAt(t+1)!==f}parseParenItem(t){return this.$g(t,!0)}$1x(){if(this.type!==s.colon)return!0;let t=this.$f(()=>{let e=this.$4(!0);return this.type===s.arrow&&!this.canInsertSemicolon()?e:void 0});if(!t)return!1;return this.$8=t,!0}shouldParseArrow(t){return this.$1x()&&super.shouldParseArrow(t)}shouldParseAsyncArrow(){return this.$1x()&&super.shouldParseAsyncArrow()}parseArrowExpression(t,e,r,i){if(this.$8)t.returnType=this.$8,this.$8=null;return super.parseArrowExpression(t,e,r,i)}parseExprList(t,e,r,i){if(!this.$q)return super.parseExprList(t,e,r,i);this.$q=!1;let n=[],a=!0;while(!this.eat(t)){if(a)a=!1;else if(this.expect(s.comma),e&&this.afterTrailingComma(t))break;if(this.type===s.ellipsis){let h=this.parseSpread(i);if(this.eat(s.question))h.optional=!0;if(this.type===s.colon)h.typeAnnotation=this.$4();n.push(h)}else n.push(this.parseMaybeAssign(!1,i,this.parseParenItem))}return n}parseSubscript(t,e,r,i,n,a,h){if(this.$s()&&!this.hasPrecedingLineBreak()){let l=this.startNodeAt(e,r);return this.exprAllowed=!1,this.next(),l.expression=t,this.finishNode(l,"TSNonNullExpression")}if(n&&this.$1()){let l=this.$f(()=>this.$2k(e,r,h));if(l)return l}let o=this.type===s.questionDot&&this.$2()===R;if(this.$1()||o||this.type===s.bitShift&&this.value==="<<"){let l=this.$f(()=>{if(o)this.next();this.$k();let p=this.$e();if(this.type===s.parenL&&!i)return p;if(this.type===s.backQuote)return o?void 0:p;if(o)return;if(this.$c()||this.type===s.bitShift||this.type.startsExpr&&this.type!==s.parenL&&!this.hasPrecedingLineBreak())return;return p});if(l){let p=this.startNodeAt(e,r);if(this.type===s.parenL&&!i){if(this.next(),p.callee=t,p.arguments=this.parseExprList(s.parenR,!0,!1),p.typeArguments=l,o)t.optional=!0;if(o||a)p.optional=o;return this.finishNode(p,"CallExpression")}if(this.type===s.backQuote)return p.tag=t,p.quasi=this.parseTemplate({isTagged:!0}),p.typeArguments=l,this.finishNode(p,"TaggedTemplateExpression");return p.expression=t,p.typeArguments=l,this.finishNode(p,"TSInstantiationExpression")}}if(n&&this.type===s.parenL)this.$q=!0;return super.parseSubscript(t,e,r,i,n,a,h)}$2k(t,e,r){let i=this.startNodeAt(t,e);if(i.typeParameters=this.$7(),this.expect(s.parenL),i.params=this.parseBindingList(s.parenR,!1,!0),this.type===s.colon)i.returnType=this.$4(!0);if(this.type!==s.arrow||this.canInsertSemicolon())return;return this.next(),this.parseArrowExpression(i,i.params,!0,r)}parseDynamicImport(t){if(this.next(),t.source=this.parseMaybeAssign(),this.eat(s.comma)&&this.type!==s.parenR)t.arguments=[this.parseExpression()];return this.expect(s.parenR),this.finishNode(t,"ImportExpression")}parseNew(){let t=super.parseNew();if(t.callee?.type!=="TSInstantiationExpression")return t;let e=this.startNodeAt(t.start,t.loc?.start);return e.callee=t.callee.expression,e.typeArguments=t.callee.typeArguments,e.arguments=t.arguments,this.finishNodeAt(e,"NewExpression",t.end,t.loc?.end)}parseExprOp(t,e,r,i,n){if(s._in.binop>i&&this.type===s.name&&(this.value==="as"||this.value==="satisfies")&&!this.containsEsc&&!this.hasPrecedingLineBreak()){let a=this.value==="satisfies",h=this.startNodeAt(e,r);return h.expression=t,h.typeAnnotation=this.$9(()=>{if(this.next(),!a&&this.type===s._const){let o=this.startNode();return o.typeName=this.parseIdent(!0),this.finishNode(o,"TSTypeReference")}return this.$0()}),this.finishNode(h,a?"TSSatisfiesExpression":"TSAsExpression"),this.parseExprOp(h,e,r,i,n)}return super.parseExprOp(t,e,r,i,n)}parseGetterSetter(t){t.kind=t.key.name,super.parseGetterSetter(t)}parsePropertyValue(t,e,r,i,n,a,h,o){if(!e&&this.$1()){if(this.$o=this.$7(),this.type!==s.parenL)this.unexpected();t.kind="init"}return super.parsePropertyValue(t,e,r,i,n,a,h,o)}}return E});
|
|
2
|
-
export{
|
|
1
|
+
import{A}from"./shared-as9can03.js";var x=/(?:\s|\/\/.*|\/\*[\s\S]*?\*\/)*/g,F=new Map([["any","TSAnyKeyword"],["bigint","TSBigIntKeyword"],["boolean","TSBooleanKeyword"],["never","TSNeverKeyword"],["null","TSNullKeyword"],["number","TSNumberKeyword"],["object","TSObjectKeyword"],["string","TSStringKeyword"],["symbol","TSSymbolKeyword"],["undefined","TSUndefinedKeyword"],["unknown","TSUnknownKeyword"],["void","TSVoidKeyword"]]),q=new Set("public private protected readonly declare abstract override static accessor".split(" ")),O=new Set("public private protected readonly override".split(" ")),K=new Set("var let const function class abstract enum interface type namespace module global".split(" ")),V=new Set("var let const function class interface enum".split(" ")),L=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),C=1,H=32,U=256,j=0,z=1,d=2,G=3,Q=4,N=6,w=7,D=256,g=1024,W=8|g,Y=d|D,I=1,X=2,P=40,J=41,Z=44,_=46,v=58,f=61,R=60,y=123,tt=91,S=42,et=35,b=34,E=39,st=SyntaxError("speculative parse failed"),T=A((m)=>{let{tokTypes:s,keywordTypes:M,isIdentifierChar:B,isIdentifierStart:c}=m.acorn,u=new m.acorn.TokenType("@");class k extends m{inType=!1;$5=!1;$6=!1;$8=null;$o=null;$p=!1;$q=!1;$i=null;$b=[[]];$r=0;$12=0;constructor(t,e,r){super(t,e,r);let i=this.options.onComment;if(typeof i==="function")this.options.onComment=(n,a,h,o,l,p)=>{if(h<this.$12)return;this.$12=o,i.call(this,n,a,h,o,l,p)}}getTokenFromCode(t){if(t===64)return++this.pos,this.finishToken(u);return super.getTokenFromCode(t)}readToken_lt_gt(t){if(this.inType)return this.finishOp(s.relational,1);return super.readToken_lt_gt(t)}$9(t){let e=this.inType;this.inType=!0;let r=t();if(this.inType=e,!e&&this.type===s.relational)this.pos=this.start,this.nextToken();return r}$1(){return this.type===s.relational&&this.value==="<"}$k(){if(this.type===s.bitShift&&this.value==="<<")this.pos=this.start+1,this.finishToken(s.relational,"<");return this.$1()}$c(){return this.type===s.relational&&this.value===">"}$s(){return this.type===s.prefix&&this.value==="!"}hasPrecedingLineBreak(){return this.$13(this.lastTokEnd,this.start)}$13(t,e){for(let r=t;r<e;r++){let i=this.input.charCodeAt(r);if(i===10||i===13||i===8232||i===8233)return!0}return!1}$d(t=this.pos){return x.lastIndex=t,x.exec(this.input),x.lastIndex}$2(){return this.input.charCodeAt(this.$d())}$3(){let t=this.$d(),e=t;while(e<this.input.length&&B(this.input.charCodeAt(e)))e++;return this.input.slice(t,e)}$a(){return!this.$13(this.pos,this.$d())}$14(){return this.$a()&&c(this.$2())&&!Object.hasOwn(M,this.$3())}$15(){return{pos:this.pos,type:this.type,value:this.value,start:this.start,end:this.end,startLoc:this.startLoc,endLoc:this.endLoc,lastTokStart:this.lastTokStart,lastTokEnd:this.lastTokEnd,lastTokStartLoc:this.lastTokStartLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,context:this.context.slice(),exprAllowed:this.exprAllowed,containsEsc:this.containsEsc,inType:this.inType,$5:this.$5,$6:this.$6,$8:this.$8,scopes:this.scopeStack.length,privateNames:this.privateNameStack.length,labels:this.labels,labelCount:this.labels.length,strict:this.strict,yieldPos:this.yieldPos,awaitPos:this.awaitPos,awaitIdentPos:this.awaitIdentPos,potentialArrowAt:this.potentialArrowAt,potentialArrowInForAwait:this.potentialArrowInForAwait}}$16(t){this.pos=t.pos,this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.startLoc=t.startLoc,this.endLoc=t.endLoc,this.lastTokStart=t.lastTokStart,this.lastTokEnd=t.lastTokEnd,this.lastTokStartLoc=t.lastTokStartLoc,this.lastTokEndLoc=t.lastTokEndLoc,this.curLine=t.curLine,this.lineStart=t.lineStart,this.context=t.context,this.exprAllowed=t.exprAllowed,this.containsEsc=t.containsEsc,this.inType=t.inType,this.$5=t.$5,this.$6=t.$6,this.$8=t.$8,this.scopeStack.length=t.scopes,this.privateNameStack.length=t.privateNames,this.labels=t.labels,this.labels.length=t.labelCount,this.strict=t.strict,this.yieldPos=t.yieldPos,this.awaitPos=t.awaitPos,this.awaitIdentPos=t.awaitIdentPos,this.potentialArrowAt=t.potentialArrowAt,this.potentialArrowInForAwait=t.potentialArrowInForAwait}raise(t,e){if(this.$r>0)throw st;return super.raise(t,e)}$1y(t,e){try{super.raise(t,e)}catch(r){if(r instanceof SyntaxError)r.$1z=!0;throw r}throw Error("unreachable")}$f(t,e=!1){let r=this.$15();this.$r++;try{let i=t();if(e||i===void 0)this.$16(r);return i}catch(i){if(!(i instanceof SyntaxError)||!e&&i.$1z)throw i;this.$16(r);return}finally{this.$r--}}$t(t){return this.$f(t,!0)===!0}$17(t){if(t.end=this.lastTokEnd,this.options.locations)t.loc.end=this.lastTokEndLoc}$l(t,e){if(t.start=e.start,this.options.locations)t.loc.start=e.loc.start}$4(t=!1){let e=this.startNode();return e.typeAnnotation=this.$9(()=>(this.next(),t?this.$20():this.$0())),this.finishNode(e,"TSTypeAnnotation")}$g(t,e){if(e&&this.eat(s.question))t.optional=!0,this.$17(t);if(this.type===s.colon)t.typeAnnotation=this.$4(),this.$17(t);return t}$20(){if(this.type!==s.name&&this.type!==s._this)return this.$0();if(this.isContextual("asserts")&&this.$a()&&c(this.$2())){let t=this.startNode();if(this.next(),t.parameterName=this.type===s._this?this.$u():this.parseIdent(),this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.$v(t,!0);return t.asserts=!0,t.typeAnnotation=null,this.finishNode(t,"TSTypePredicate")}if(this.$3()==="is"&&this.$a()){let t=this.startNode();return t.parameterName=this.type===s._this?this.$u():this.parseIdent(!0),this.$v(t,!1)}return this.$0()}$v(t,e){this.next();let r=this.startNode();return r.typeAnnotation=this.$0(),t.typeAnnotation=this.finishNode(r,"TSTypeAnnotation"),t.asserts=e,this.finishNode(t,"TSTypePredicate")}$u(){let t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")}parseWholeType(){this.inType=!0,this.nextToken();let t=this.$0();if(this.type!==s.eof)this.unexpected();return t}$0(){let t=this.$18();if(this.$5||this.type!==s._extends||this.hasPrecedingLineBreak())return t;let e=this.startNodeAt(t.start,t.loc?.start);return this.next(),e.checkType=t,e.extendsType=this.$h(!0,()=>this.$18()),this.expect(s.question),e.trueType=this.$h(!1,()=>this.$0()),this.expect(s.colon),e.falseType=this.$h(!1,()=>this.$0()),this.finishNode(e,"TSConditionalType")}$h(t,e){let r=this.$5;this.$5=t;let i=e();return this.$5=r,i}$18(){if(this.$21())return this.$19("TSFunctionType");if(this.type===s._new||this.isContextual("abstract")&&this.$3()==="new")return this.$19("TSConstructorType");return this.$1a("TSUnionType",s.bitwiseOR,()=>this.$1a("TSIntersectionType",s.bitwiseAND,()=>this.$1b()))}$19(t){let e=this.startNode();if(t==="TSConstructorType"){if(e.abstract=this.isContextual("abstract"),e.abstract)this.next();this.next()}return this.$h(!1,()=>this.$m(e,s.arrow)),this.finishNode(e,t)}$m(t,e){if(this.$1())t.typeParameters=this.$7();if(this.expect(s.parenL),t.parameters=this.parseBindingList(s.parenR,!1,!0),this.type===e)t.typeAnnotation=this.$4(!0);else if(e===s.arrow)this.unexpected()}$21(){if(this.$1())return!0;if(this.type!==s.parenL)return!1;return this.$t(()=>{if(this.next(),this.type===s.parenR||this.type===s.ellipsis)return!0;if(this.type===s.name||this.type===s._this)this.next();else if(this.type===s.braceL||this.type===s.bracketL)this.parseBindingAtom();else return!1;let t=this.type;if(t===s.colon||t===s.comma||t===s.question||t===s.eq)return!0;if(t!==s.parenR)return!1;return this.next(),this.type===s.arrow})}$1a(t,e,r){let i=this.startNode(),n=this.eat(e),a=[];do a.push(r());while(this.eat(e));if(a.length===1&&!n)return a[0];return i.types=a,this.finishNode(i,t)}$1b(){if(this.type===s.name&&!this.containsEsc){let t=this.value;if(t==="keyof"||t==="unique"||t==="readonly"){let e=this.startNode();return this.next(),e.operator=t,e.typeAnnotation=this.$1b(),this.finishNode(e,"TSTypeOperator")}if(t==="infer"){let e=this.startNode();this.next();let r=this.startNode();r.name=this.$w();let i=this.$f(()=>this.$22());if(i)r.constraint=i;return e.typeParameter=this.finishNode(r,"TSTypeParameter"),this.finishNode(e,"TSInferType")}}return this.$h(!1,()=>this.$23())}$22(){if(!this.eat(s._extends))return;let t=this.$h(!0,()=>this.$0());if(this.$5||this.type!==s.question)return t;return}$w(){if(this.type!==s.name&&!this.type.keyword)this.unexpected();let t=this.type===s.name?this.value:this.type.keyword;return this.next(),t}$23(){let t=this.$24();while(!this.hasPrecedingLineBreak()&&this.eat(s.bracketL)){let e=this.startNodeAt(t.start,t.loc?.start);if(this.eat(s.bracketR))e.elementType=t,t=this.finishNode(e,"TSArrayType");else e.objectType=t,e.indexType=this.$0(),this.expect(s.bracketR),t=this.finishNode(e,"TSIndexedAccessType")}return t}$24(){switch(this.type){case s.name:case s._void:case s._null:{let t=F.get(this.value);if(t&&(this.type!==s.name||!this.containsEsc&&this.$2()!==_)){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.$1c()}case s.string:case s.num:case s._true:case s._false:{let t=this.startNode();return t.literal=this.parseExprAtom(),this.finishNode(t,"TSLiteralType")}case s.plusMin:{if(this.value!=="-")break;let t=this.startNode(),e=this.startNode();if(this.next(),this.type!==s.num)this.unexpected();return e.operator="-",e.prefix=!0,e.argument=this.parseExprAtom(),t.literal=this.finishNode(e,"UnaryExpression"),this.finishNode(t,"TSLiteralType")}case s.backQuote:return this.$25();case s._this:{let t=this.$u();if(this.isContextual("is")&&!this.hasPrecedingLineBreak()){let e=this.startNodeAt(t.start,t.loc?.start);return e.parameterName=t,this.$v(e,!1)}return t}case s._typeof:return this.$26();case s._import:return this.$1d();case s.braceL:return this.$27()?this.$28():this.$29();case s.bracketL:return this.$2a();case s.parenL:{let t=this.startNode();return this.next(),t.typeAnnotation=this.$0(),this.expect(s.parenR),this.finishNode(t,"TSParenthesizedType")}default:if(this.type.keyword)return this.$1c()}return this.unexpected()}$1c(){let t=this.startNode();if(t.typeName=this.$j(),!this.hasPrecedingLineBreak()&&this.$1())t.typeArguments=this.$e();return this.finishNode(t,"TSTypeReference")}$j(){let t=this.parseIdent(!0);while(this.eat(s.dot)){let e=this.startNodeAt(t.start,t.loc?.start);e.left=t,e.right=this.parseIdent(!0),t=this.finishNode(e,"TSQualifiedName")}return t}$26(){let t=this.startNode();if(this.next(),t.exprName=this.type===s._import?this.$1d():this.$j(),!this.hasPrecedingLineBreak()&&this.$1())t.typeArguments=this.$e();return this.finishNode(t,"TSTypeQuery")}$1d(){let t=this.startNode();if(this.next(),t.argument=this.$1e(),this.eat(s.dot))t.qualifier=this.$j();if(this.$1())t.typeArguments=this.$e();return this.finishNode(t,"TSImportType")}$x(){if(this.type!==s.string)this.unexpected();return this.parseExprAtom()}$1e(){this.expect(s.parenL);let t=this.$x();return this.expect(s.parenR),t}$25(){let t=this.startNode(),e=this.startNode();this.next(),e.expressions=[];let r=this.parseTemplateElement({isTagged:!1});e.quasis=[r];while(!r.tail){if(this.type===s.eof)this.raise(this.pos,"Unterminated template literal");this.expect(s.dollarBraceL),e.expressions.push(this.$0()),this.expect(s.braceR),r=this.parseTemplateElement({isTagged:!1}),e.quasis.push(r)}return this.next(),t.literal=this.finishNode(e,"TemplateLiteral"),this.finishNode(t,"TSLiteralType")}$27(){return this.$t(()=>{if(this.next(),this.type===s.plusMin)return this.next(),this.isContextual("readonly");if(this.isContextual("readonly"))this.next();if(this.type!==s.bracketL)return!1;if(this.next(),this.type!==s.name)return!1;return this.next(),this.type===s._in})}$28(){let t=this.startNode();if(this.expect(s.braceL),this.type===s.plusMin)t.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))t.readonly=!0;this.expect(s.bracketL);let e=this.startNode();if(e.name=this.$w(),this.expect(s._in),e.constraint=this.$0(),t.typeParameter=this.finishNode(e,"TSTypeParameter"),t.nameType=this.eatContextual("as")?this.$0():null,this.expect(s.bracketR),this.type===s.plusMin)t.optional=this.value,this.next(),this.expect(s.question);else if(this.eat(s.question))t.optional=!0;if(this.eat(s.colon))t.typeAnnotation=this.$0();return this.semicolon(),this.expect(s.braceR),this.finishNode(t,"TSMappedType")}$29(){let t=this.startNode();return t.members=this.$1f(),this.finishNode(t,"TSTypeLiteral")}$1f(){this.expect(s.braceL);let t=[];while(!this.eat(s.braceR))t.push(this.$2b());return t}$2b(){let t=this.startNode(),e="TSPropertySignature",r=this.type===s._new?this.$2():-1;if(this.type===s.parenL||this.$1())e="TSCallSignatureDeclaration",this.$m(t,s.colon);else if(r===P||r===R)e="TSConstructSignatureDeclaration",this.next(),this.$m(t,s.colon);else{let i=this.type===s._new?this.parseIdent(!0):null;if(this.isContextual("readonly")&&this.$n(!0))this.next(),t.readonly=!0;if(this.type===s.bracketL&&this.$1g())return this.$1h(t);let n="method";if(i)t.key=i;else{if((this.isContextual("get")||this.isContextual("set"))&&this.$n(!1))n=this.value,this.next();this.parsePropertyName(t)}if(this.eat(s.question))t.optional=!0;if(this.type===s.parenL||this.$1()){if(e="TSMethodSignature",n!=="method")t.kind=n;this.$m(t,s.colon),t.kind=n}else if(this.type===s.colon)t.typeAnnotation=this.$4()}return this.$1i(),this.finishNode(t,e)}$1i(){if(!this.eat(s.comma))this.semicolon()}$1g(){return this.$t(()=>{if(this.next(),this.type!==s.name)return!1;return this.next(),this.type===s.colon})}$1h(t){if(this.expect(s.bracketL),t.parameters=[this.$g(this.parseIdent(),!1)],this.expect(s.bracketR),this.type===s.colon)t.typeAnnotation=this.$4();return this.$1i(),this.finishNode(t,"TSIndexSignature")}$2a(){let t=this.startNode();this.expect(s.bracketL),t.elementTypes=[];while(!this.eat(s.bracketR))if(t.elementTypes.push(this.$2c()),this.type!==s.bracketR)this.expect(s.comma);return this.finishNode(t,"TSTupleType")}$2c(){let t=this.start,e=this.startLoc,r=this.eat(s.ellipsis),i;if((this.type===s.name||this.type.keyword)&&this.$2d()){let n=this.startNode();n.label=this.parseIdent(!0),n.optional=this.eat(s.question),this.expect(s.colon),n.elementType=this.$0(),i=this.finishNode(n,"TSNamedTupleMember")}else if(i=this.$0(),this.eat(s.question)){let n=this.startNodeAt(i.start,i.loc?.start);n.typeAnnotation=i,i=this.finishNode(n,"TSOptionalType")}if(r){let n=this.startNodeAt(t,e);n.typeAnnotation=i,i=this.finishNode(n,"TSRestType")}return i}$2d(){let t=this.$d();if(this.input.charCodeAt(t)===63)t=this.$d(t+1);return this.input.charCodeAt(t)===v}$7(){return this.$9(()=>{let t=this.startNode();this.next(),t.params=[];while(!this.$c()){let e=this.startNode();while((this.type===s._const||this.type===s._in||this.isContextual("out"))&&c(this.$2()))e[this.value]=!0,this.next();if(e.name=this.$w(),this.eat(s._extends))e.constraint=this.$0();if(this.eat(s.eq))e.default=this.$0();if(t.params.push(this.finishNode(e,"TSTypeParameter")),!this.$c()){if(this.expect(s.comma),this.$c())t.extra={trailingComma:this.lastTokStart}}}if(this.next(),t.params.length===0)this.$1y(this.start,"Type parameter list cannot be empty.");return this.finishNode(t,"TSTypeParameterDeclaration")})}$e(){return this.$9(()=>{let t=this.startNode();this.next(),t.params=[];while(!this.$c())if(t.params.push(this.$0()),!this.$c())this.expect(s.comma);if(t.params.length===0)this.unexpected();return this.next(),this.finishNode(t,"TSTypeParameterInstantiation")})}$1j(){let t=[];do{let e=this.startNode();if(e.expression=this.$j(),this.$1())e.typeParameters=this.$e();t.push(this.finishNode(e,"TSExpressionWithTypeArguments"))}while(this.eat(s.comma));return t}$1k(t=!1){if(this.type!==s.name||this.containsEsc){if(this.type===s._const&&this.$3()==="enum")return this.$y(this.startNode());return}if(!this.$2e(this.value))return;if(this.value==="declare")return this.$2f(t);return this.$1l(this.startNode(),this.value)}$2e(t){switch(t){case"interface":case"type":case"namespace":return this.$14();case"enum":return c(this.$2());case"abstract":return this.$a()&&this.$3()==="class";case"module":{let e=this.$2();return this.$a()&&(e===b||e===E||c(e))}case"declare":return this.$a()&&K.has(this.$3());case"global":return this.$a()&&this.$2()===y}return!1}$1l(t,e){switch(e){case"interface":return this.$1m(t);case"type":return this.$2g(t);case"enum":return this.$y(t);case"abstract":return this.$1n(t,!0);case"global":return t.global=!0,t.id=this.parseIdent(),t.body=this.$z(),this.finishNode(t,"TSModuleDeclaration")}return this.$2h(t)}$2f(t){let e=this.$6;this.$6=!0;let r=this.startNode();this.next();let i=this.value;if(i==="const"&&this.$3()==="enum")r.const=!0;if(!t&&V.has(i))r.declare=!0;let n;if(r.const)n=this.$y(r);else if(i==="var"||i==="let"||i==="const")n=this.parseVarStatement(r,i,!0);else if(i==="function")this.next(),n=this.parseFunction(r,I,!1,!1);else if(i==="class")n=this.parseClass(r,!0);else n=this.$1l(r,i);return n.declare=!0,this.$6=e,n}$1n(t,e){return this.next(),t.abstract=!0,this.parseClass(t,e)}$1m(t){if(this.next(),t.id=this.parseIdent(),this.checkLValSimple(t.id,w),this.$1())t.typeParameters=this.$7();return this.$9(()=>{if(this.eat(s._extends))t.extends=this.$1j();let e=this.startNode();e.body=this.$1f(),t.body=this.finishNode(e,"TSInterfaceBody")}),this.finishNode(t,"TSInterfaceDeclaration")}$2g(t){if(this.next(),t.id=this.parseIdent(),this.checkLValSimple(t.id,N),this.$1())t.typeParameters=this.$7();return t.typeAnnotation=this.$9(()=>(this.expect(s.eq),this.$0())),this.semicolon(),this.finishNode(t,"TSTypeAliasDeclaration")}$y(t){if(this.type===s._const)t.const=!0,this.next();this.next(),t.id=this.parseIdent(),this.checkLValSimple(t.id,Y),this.expect(s.braceL),t.members=[];while(!this.eat(s.braceR)){let e=this.startNode();if(e.id=this.type===s.string?this.parseExprAtom():this.parseIdent(!0),this.eat(s.eq))e.initializer=this.parseMaybeAssign();if(t.members.push(this.finishNode(e,"TSEnumMember")),this.type!==s.braceR)this.expect(s.comma)}return this.finishNode(t,"TSEnumDeclaration")}$2h(t){if(this.next(),this.type===s.string){if(t.id=this.parseExprAtom(),this.type===s.braceL)t.body=this.$z();else this.semicolon();return this.finishNode(t,"TSModuleDeclaration")}return t.id=this.parseIdent(),this.checkLValSimple(t.id,W),this.$1o(t)}$1o(t){if(this.eat(s.dot)){let e=this.startNode();e.id=this.parseIdent(),t.body=this.$1o(e)}else t.body=this.$z();return this.finishNode(t,"TSModuleDeclaration")}$z(){this.enterScope(U);let t=this.startNode();this.enterScope(0),this.expect(s.braceL),t.body=[];while(!this.eat(s.braceR))t.body.push(this.parseStatement(null,!0));return this.exitScope(),this.exitScope(),this.finishNode(t,"TSModuleBlock")}$1p(t,e){if(t.isExport=e,t.id=this.parseIdent(),this.checkLValSimple(t.id,d),this.expect(s.eq),this.isContextual("require")&&this.$2()===P){let r=this.startNode();this.next(),r.expression=this.$1e(),t.moduleReference=this.finishNode(r,"TSExternalModuleReference")}else t.moduleReference=this.$j();return this.semicolon(),this.finishNode(t,"TSImportEqualsDeclaration")}$2i(){let t=this.$d();if(this.input.charCodeAt(t)!==f)return!1;let e=this.input.charCodeAt(t+1);return e!==f&&e!==62}parseStatement(t,e,r){if(this.type===u)this.$1q(!0);let i=this.$1k();if(i)return i;return super.parseStatement(t,e,r)}parseVarStatement(t,e,r){return super.parseVarStatement(t,e,r||this.$6)}parseVarId(t,e){if(super.parseVarId(t,e),t.id.type==="Identifier"&&this.$s()&&!this.hasPrecedingLineBreak())this.next(),t.definite=!0;this.$g(t.id,!1)}parseCatchClauseParam(){let t=this.$g(this.parseBindingAtom(),!1),e=t.type==="Identifier";return this.enterScope(e?H:0),this.checkLValPattern(t,e?Q:d),this.expect(s.parenR),t}parseImport(t){if(this.next(),t.importKind="value",this.type===s.string)t.specifiers=[],t.source=this.parseExprAtom();else{if(this.isContextual("type")){let e=this.$2();if(e===y||e===S||c(e)&&this.$3()!=="from")t.importKind="type",this.next()}if(this.type===s.name&&this.$2i())return this.$1p(t,!1);t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.$x()}return this.$1r(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseWithClause(){if(this.isContextual("assert")&&!this.hasPrecedingLineBreak())this.type=s._with;return this.type===s._with?super.parseWithClause():void 0}$1r(t){let e=this.parseWithClause();if(e)t.attributes=e}parseImportSpecifier(){return this.$1s("importKind",()=>super.parseImportSpecifier())}parseExportSpecifier(t){return this.$1s("exportKind",()=>super.parseExportSpecifier(t))}$1s(t,e){let r=this.isContextual("type")?this.$2():-1;if(r===b||r===E||c(r)&&this.$3()!=="as"){let n=this.startNode();this.next();let a=e();return this.$l(a,n),a[t]="type",a}let i=e();return i[t]="value",i}parseExport(t,e){if(this.next(),this.eat(s._import)){if(t.importKind="value",this.isContextual("type")&&c(this.$2())&&this.$3()!=="from")t.importKind="type",this.next();return this.$1p(t,!0)}if(this.eat(s.eq))return t.expression=this.parseExpression(),this.semicolon(),this.finishNode(t,"TSExportAssignment");if(this.eatContextual("as"))return this.expectContextual("namespace"),t.id=this.parseIdent(),this.semicolon(),this.finishNode(t,"TSNamespaceExportDeclaration");if(t.exportKind="value",this.isContextual("type")){let n=this.$2();if(n===y||n===S)t.exportKind="type",this.next()}if(this.eat(s.star))return this.parseExportAllDeclaration(t,e);if(this.eat(s._default)){if(this.isContextual("interface")&&this.$14())t.declaration=this.$1m(this.startNode());else if(this.isContextual("abstract")&&this.$3()==="class")t.declaration=this.$1n(this.startNode(),"nullableID");else t.declaration=this.parseExportDefaultDeclaration();return this.finishNode(t,"ExportDefaultDeclaration")}let r=this.isContextual("declare"),i=this.$1k(!0);if(i||this.shouldParseExportStatement()){if(t.declaration=i??this.parseStatement(null),r||t.declaration.type==="TSInterfaceDeclaration"||t.declaration.type==="TSTypeAliasDeclaration")t.exportKind="type";return t.specifiers=[],t.source=null,this.finishNode(t,"ExportNamedDeclaration")}if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))t.source=this.$x(),this.$1r(t);else{for(let n of t.specifiers)if(this.checkUnreserved(n.local),this.checkLocalExport(n.local),n.local.type==="Literal")this.raise(n.local.start,"A string literal cannot be used as an exported binding without `from`.");t.source=null}return this.semicolon(),this.finishNode(t,"ExportNamedDeclaration")}parseFunction(t,e,r,i,n){let a=e&I;if(a)this.$i=t;super.parseFunction(t,e,r,i,n),this.$i=null;let h=!t.body;if(h)t.type="TSDeclareFunction";if(a&&t.id){if(h){if(this.$6&&this.currentScope().flags&C)this.declareName(t.id.name,g,t.id.start);this.checkLValSimple(t.id,j)}else if(!(e&X)){let o=G;if(this.strict||t.generator||t.async)o=this.treatFunctionsAsVar?z:d;this.checkLValSimple(t.id,o)}}return t}parseFunctionParams(t){if(this.$1())t.typeParameters=this.$7();if(super.parseFunctionParams(t),this.type===s.colon)t.returnType=this.$4(!0)}parseFunctionBody(t,e,r,i){if(r&&this.type===s.colon)t.returnType=this.$4(!0);if(e||this.type===s.braceL){super.parseFunctionBody(t,e,r,i);return}this.semicolon(),this.exitScope()}parseMethod(t,e,r){let i=this.$o;this.$o=null;let n=super.parseMethod(t,e,r);if(!n.body)n.type="TSDeclareMethod";if(i)n.typeParameters=i;return n}parseBindingList(t,e,r,i){let n=i===!0||this.$p;return this.$p=!1,super.parseBindingList(t,e,r,n)}$n(t){if(!t&&!this.$a())return!1;let e=this.$2();return e===tt||e===y||e===S||e===_||e===et||e===b||e===E||e>=48&&e<=57||c(e)}parseAssignableListItem(t){let e=this.$10(),r=this.start,i=this.startLoc,n,a=!1,h=!1;if(t)while(this.type===s.name&&O.has(this.value)&&!this.containsEsc&&this.$n(!1)){if(this.value==="readonly")a=!0;else if(this.value==="override")h=!0;else n=this.value;this.next()}let o;if(this.type===s._this)o=this.startNode(),o.name="this",this.next(),this.finishNode(o,"Identifier");else o=this.parseBindingAtom();let l=this.type===s.eq?this.parseMaybeDefault(r,i,o):this.parseMaybeDefault(o.start,o.loc?.start,this.$g(o,!0));if(e.length>0)l.decorators=e;if(!n&&!a&&!h)return l;let p=this.startNodeAt(r,i);if(n)p.accessibility=n;if(a)p.readonly=!0;if(h)p.override=!0;return p.parameter=l,this.finishNode(p,"TSParameterProperty")}parseBindingListItem(t){if(t.type==="RestElement")this.$g(t,!0);return t}checkLValSimple(t,e,r){if(this.$i&&t===this.$i.id){this.$i=null;return}if(!e&&L.has(t.type)){this.checkLValSimple(t.expression,e,r);return}switch(t.type){case"TSParameterProperty":this.checkLValInnerPattern(t.parameter,e,r);return;case"Identifier":if(t.name==="this")return}super.checkLValSimple(t,e,r)}toAssignable(t,e,r){if(t&&!e&&L.has(t.type))return t;return super.toAssignable(t,e,r)}declareName(t,e,r){let i=this.currentScope();if(e&g){this.$1t(i,t),i.$1u??=[],i.$1u.push(t);return}if(e===N||e===w){if(i.$11??=[],e===N&&i.$11.includes(t))this.raise(r,`type '${t}' has already been declared.`);i.$11.push(t),this.$1t(i,t);return}if(e&D){if(i.$1v??=[],i.$1v.includes(t))return;super.declareName(t,d,r),i.$1v.push(t);return}super.declareName(t,e,r)}$1t(t,e){if(this.inModule&&t.flags&C)delete this.undefinedExports[e]}checkLocalExport(t){for(let e=this.scopeStack.length-1;e>=0;e--){let r=this.scopeStack[e];if(r.$11?.includes(t.name)||r.$1u?.includes(t.name))return}super.checkLocalExport(t)}checkExport(){}raiseRecoverable(t,e){if(e==="Duplicate constructor in the same class")return;super.raiseRecoverable(t,e)}$10(){let t=[];while(this.type===u)t.push(this.$1w());return t}$1q(t){let e=this.$b[this.$b.length-1];while(this.type===u)e.push(this.$1w());if(this.type===s._export){if(!t)this.unexpected()}else if(this.type!==s._class&&!((this.isContextual("abstract")||this.isContextual("declare"))&&this.$3()==="class"))this.raise(this.start,"Leading decorators must be attached to a class declaration.")}$1w(){let t=this.startNode();this.next(),this.$b.push([]);let e=this.start,r=this.startLoc,i;if(this.type===s.parenL){if(this.next(),i=this.parseExpression(),this.expect(s.parenR),this.options.preserveParens){let a=this.startNodeAt(e,r);a.expression=i,i=this.finishNode(a,"ParenthesizedExpression")}}else{i=this.parseIdent(!1);while(this.eat(s.dot)){let a=this.startNodeAt(e,r);a.object=i,a.property=this.parseIdent(!0),a.computed=!1,i=this.finishNode(a,"MemberExpression")}}let n=this.$k()?this.$e():void 0;if(this.eat(s.parenL)){let a=this.startNodeAt(i.start,i.loc?.start);if(a.callee=i,a.arguments=this.parseExprList(s.parenR,!1,!1),n)a.typeArguments=n;i=this.finishNode(a,"CallExpression")}else if(n){let a=this.startNodeAt(i.start,i.loc?.start);a.expression=i,a.typeArguments=n,i=this.finishNode(a,"TSInstantiationExpression")}return t.expression=i,this.$b.pop(),this.finishNode(t,"Decorator")}shouldParseExportStatement(){return this.type===u||super.shouldParseExportStatement()}parseExprAtom(t,e,r){if(this.type===u)this.$1q(!1);return super.parseExprAtom(t,e,r)}parseProperty(t,e){if(t||this.type!==u)return super.parseProperty(t,e);let r=this.$10(),i=super.parseProperty(t,e);if(i.type==="SpreadElement")this.raise(i.start,"Decorators can't be used with SpreadElement");return i.decorators=r,i}parseClassId(t,e){let r=this.$b.length-1,i=this.$b[r];if(i.length>0)t.decorators=i,this.$l(t,i[0]),this.$b[r]=[];if(!this.isContextual("implements")||e===!0)super.parseClassId(t,e);if(this.$1())t.typeParameters=this.$7()}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass&&this.$1())t.superTypeParameters=this.$e();if(this.eatContextual("implements"))t.implements=this.$9(()=>this.$1j())}parseClassElement(t){if(this.type===u){let h=this.$10();if(this.type===s.braceR)this.raise(this.start,"Decorators must be attached to a class element.");let o=this.parseClassElement(t);return o.decorators=h,this.$l(o,h[0]),o}if(this.eat(s.semi))return null;let e=this.startNode();while(this.type===s.name&&q.has(this.value)&&!this.containsEsc&&this.$n(this.value==="static")){let h=this.value;if(this.next(),h==="static"&&this.type===s.braceL)return this.next(),this.parseClassStaticBlock(e),e;if(h==="public"||h==="private"||h==="protected")e.accessibility=h;else e[h]=!0}if(this.type===s.bracketL&&this.$1g())return this.$1h(e);e.static??=!1;let r="",i=!1,n=!1,a="method";if(this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===s.star)&&!this.canInsertSemicolon())n=!0;else r="async";if(!r&&this.eat(s.star))i=!0;if(!r&&!n&&!i){let h=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())a=h;else r=h}if(r)e.computed=!1,e.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),e.key.name=r,this.finishNode(e.key,"Identifier");else this.parseClassElementName(e);if(this.eat(s.question))e.optional=!0;if(this.type===s.parenL||this.$1()||a!=="method"||i||n){let h=e.key,o=!e.static&&!e.computed&&(h.type==="Identifier"&&h.name==="constructor"||h.type==="Literal"&&h.value==="constructor");if(e.kind=o?"constructor":a,this.$1())e.typeParameters=this.$7();this.$p=o,this.parseClassMethod(e,i,n,o&&t)}else{if(!e.optional&&this.$s())this.next(),e.definite=!0;if(this.type===s.colon)e.typeAnnotation=this.$4();this.parseClassField(e)}return e}parseMaybeAssign(t,e,r){if(this.$k()){let i=this.$f(()=>{let n=this.$7(),a=super.parseMaybeAssign(t,e,r);if(a.type!=="ArrowFunctionExpression")return;return a.typeParameters=n,this.$l(a,n),a});if(i)return i}return super.parseMaybeAssign(t,e,r)}parseMaybeUnary(t,e,r,i){if(this.$k()){let n=this.startNode();return n.typeAnnotation=this.$9(()=>{this.next();let a=this.$0();if(!this.$c())this.unexpected();return this.next(),a}),n.expression=this.parseMaybeUnary(null,!1,!1,i),this.finishNode(n,"TSTypeAssertion")}return super.parseMaybeUnary(t,e,r,i)}parseMaybeConditional(t,e){let r=this.start,i=this.startLoc,n=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return n;if(this.type===s.question&&!(n.type==="ArrowFunctionExpression"&&n.start===r)&&!this.$2j()){this.next();let a=this.startNodeAt(r,i);return a.test=n,a.consequent=this.parseMaybeAssign(),this.expect(s.colon),a.alternate=this.parseMaybeAssign(t),this.finishNode(a,"ConditionalExpression")}return n}$2j(){let t=this.$d(),e=this.input.charCodeAt(t);if(e===v||e===Z||e===J)return!0;return e===f&&this.input.charCodeAt(t+1)!==f}parseParenItem(t){return this.$g(t,!0)}$1x(){if(this.type!==s.colon)return!0;let t=this.$f(()=>{let e=this.$4(!0);return this.type===s.arrow&&!this.canInsertSemicolon()?e:void 0});if(!t)return!1;return this.$8=t,!0}shouldParseArrow(t){return this.$1x()&&super.shouldParseArrow(t)}shouldParseAsyncArrow(){return this.$1x()&&super.shouldParseAsyncArrow()}parseArrowExpression(t,e,r,i){if(this.$8)t.returnType=this.$8,this.$8=null;return super.parseArrowExpression(t,e,r,i)}parseExprList(t,e,r,i){if(!this.$q)return super.parseExprList(t,e,r,i);this.$q=!1;let n=[],a=!0;while(!this.eat(t)){if(a)a=!1;else if(this.expect(s.comma),e&&this.afterTrailingComma(t))break;if(this.type===s.ellipsis){let h=this.parseSpread(i);if(this.eat(s.question))h.optional=!0;if(this.type===s.colon)h.typeAnnotation=this.$4();n.push(h)}else n.push(this.parseMaybeAssign(!1,i,this.parseParenItem))}return n}parseSubscript(t,e,r,i,n,a,h){if(this.$s()&&!this.hasPrecedingLineBreak()){let l=this.startNodeAt(e,r);return this.exprAllowed=!1,this.next(),l.expression=t,this.finishNode(l,"TSNonNullExpression")}if(n&&this.$1()){let l=this.$f(()=>this.$2k(e,r,h));if(l)return l}let o=this.type===s.questionDot&&this.$2()===R;if(this.$1()||o||this.type===s.bitShift&&this.value==="<<"){let l=this.$f(()=>{if(o)this.next();this.$k();let p=this.$e();if(this.type===s.parenL&&!i)return p;if(this.type===s.backQuote)return o?void 0:p;if(o)return;if(this.$c()||this.type===s.bitShift||this.type.startsExpr&&this.type!==s.parenL&&!this.hasPrecedingLineBreak())return;return p});if(l){let p=this.startNodeAt(e,r);if(this.type===s.parenL&&!i){if(this.next(),p.callee=t,p.arguments=this.parseExprList(s.parenR,!0,!1),p.typeArguments=l,o)t.optional=!0;if(o||a)p.optional=o;return this.finishNode(p,"CallExpression")}if(this.type===s.backQuote)return p.tag=t,p.quasi=this.parseTemplate({isTagged:!0}),p.typeArguments=l,this.finishNode(p,"TaggedTemplateExpression");return p.expression=t,p.typeArguments=l,this.finishNode(p,"TSInstantiationExpression")}}if(n&&this.type===s.parenL)this.$q=!0;return super.parseSubscript(t,e,r,i,n,a,h)}$2k(t,e,r){let i=this.startNodeAt(t,e);if(i.typeParameters=this.$7(),this.expect(s.parenL),i.params=this.parseBindingList(s.parenR,!1,!0),this.type===s.colon)i.returnType=this.$4(!0);if(this.type!==s.arrow||this.canInsertSemicolon())return;return this.next(),this.parseArrowExpression(i,i.params,!0,r)}parseDynamicImport(t){if(this.next(),t.source=this.parseMaybeAssign(),this.eat(s.comma)&&this.type!==s.parenR)t.arguments=[this.parseExpression()];return this.expect(s.parenR),this.finishNode(t,"ImportExpression")}parseNew(){let t=super.parseNew();if(t.callee?.type!=="TSInstantiationExpression")return t;let e=this.startNodeAt(t.start,t.loc?.start);return e.callee=t.callee.expression,e.typeArguments=t.callee.typeArguments,e.arguments=t.arguments,this.finishNodeAt(e,"NewExpression",t.end,t.loc?.end)}parseExprOp(t,e,r,i,n){if(s._in.binop>i&&this.type===s.name&&(this.value==="as"||this.value==="satisfies")&&!this.containsEsc&&!this.hasPrecedingLineBreak()){let a=this.value==="satisfies",h=this.startNodeAt(e,r);return h.expression=t,h.typeAnnotation=this.$9(()=>{if(this.next(),!a&&this.type===s._const){let o=this.startNode();return o.typeName=this.parseIdent(!0),this.finishNode(o,"TSTypeReference")}return this.$0()}),this.finishNode(h,a?"TSSatisfiesExpression":"TSAsExpression"),this.parseExprOp(h,e,r,i,n)}return super.parseExprOp(t,e,r,i,n)}parseGetterSetter(t){t.kind=t.key.name,super.parseGetterSetter(t)}parsePropertyValue(t,e,r,i,n,a,h,o){if(!e&&this.$1()){if(this.$o=this.$7(),this.type!==s.parenL)this.unexpected();t.kind="init"}return super.parsePropertyValue(t,e,r,i,n,a,h,o)}}return k});
|
|
2
|
+
export{T};
|
package/typescript.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-as9can03.js";import"./shared-pyjcz2f8.js";import"./shared-yr6e6h72.js";import{s}from"./shared-mwp38arc.js";import{Oe}from"./shared-pt7hcxxy.js";var t=Oe(s);export{t as typescript};
|
package/walk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{l,m}from"./shared-drsxcq8p.js";function g(t){let e=[];return s(t,e),e}function s(t,e){switch(t.type){case"Identifier":e.push(t);return;case"ObjectPattern":for(let r of t.properties)s(r.type==="RestElement"?r.argument:r.value,e);return;case"ArrayPattern":for(let r of t.elements)if(r!==null)s(r,e);return;case"RestElement":s(t.argument,e);return;case"AssignmentPattern":s(t.left,e);return;case"TSParameterProperty":s(t.parameter,e);return;case"TSAsExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":s(t.expression,e)}}function b(t,e){if(t.type!=="Identifier")return!1;if(e===null)return!0;switch(e.type){case"MemberExpression":return e.computed||t===e.object;case"MethodDefinition":return e.computed;case"Property":case"PropertyDefinition":return e.computed||t===e.value;case"ExportSpecifier":case"ImportSpecifier":return t===e.local;case"MetaProperty":case"ImportAttribute":case"ExportAllDeclaration":case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":case"TSExportAssignment":return t===e.expression;case"TSEnumMember":return t===e.initializer;case"TSParameterProperty":case"TSEnumDeclaration":case"TSImportEqualsDeclaration":return!0;default:return!e.type.startsWith("TS")}}var y={Root:["module","instance","fragment","css"],Script:["attributes","content"],Fragment:["nodes"],Text:[],Comment:[],ExpressionTag:["expression"],HtmlTag:["expression"],ConstTag:["declaration"],DeclarationTag:["declaration"],DebugTag:["identifiers"],RenderTag:["expression"],AttachTag:["expression"],Attribute:["value"],SpreadAttribute:["expression"],AnimateDirective:["expression"],BindDirective:["expression"],ClassDirective:["expression"],LetDirective:["expression"],OnDirective:["expression"],StyleDirective:["value"],TransitionDirective:["expression"],UseDirective:["expression"],Component:["attributes","fragment"],TitleElement:["attributes","fragment"],SlotElement:["attributes","fragment"],RegularElement:["attributes","fragment"],SvelteBody:["attributes","fragment"],SvelteBoundary:["attributes","fragment"],SvelteComponent:["expression","attributes","fragment"],SvelteDocument:["attributes","fragment"],SvelteElement:["tag","attributes","fragment"],SvelteFragment:["attributes","fragment"],SvelteHead:["attributes","fragment"],SvelteOptions:["attributes","fragment"],SvelteSelf:["attributes","fragment"],SvelteWindow:["attributes","fragment"],IfBlock:["test","consequent","alternate"],EachBlock:["expression","context","key","body","fallback"],AwaitBlock:["expression","pending","value","then","error","catch"],KeyBlock:["expression","fragment"],SnippetBlock:["expression","parameters","body"],StyleSheet:["attributes","children"],Rule:["prelude","block"],Atrule:["block"],SelectorList:["children"],ComplexSelector:["children"],RelativeSelector:["combinator","selectors"],Combinator:[],TypeSelector:[],IdSelector:[],ClassSelector:[],AttributeSelector:[],PseudoElementSelector:["args"],PseudoClassSelector:["args"],Percentage:[],Nth:[],NestingSelector:[],Block:["children"],Declaration:[],Program:["body"],ExpressionStatement:["expression"],BlockStatement:["body"],StaticBlock:["body"],EmptyStatement:[],DebuggerStatement:[],WithStatement:["object","body"],ReturnStatement:["argument"],LabeledStatement:["label","body"],BreakStatement:["label"],ContinueStatement:["label"],IfStatement:["test","consequent","alternate"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],CatchClause:["param","body"],WhileStatement:["test","body"],DoWhileStatement:["body","test"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","typeParameters","params","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],ArrowFunctionExpression:["typeParameters","params","returnType","body"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassBody:["body"],MethodDefinition:["decorators","key","typeParameters","value"],PropertyDefinition:["decorators","key","typeAnnotation","value"],Property:["decorators","key","value"],ThisExpression:[],Super:[],Literal:[],Identifier:["decorators","typeAnnotation"],PrivateIdentifier:[],ArrayExpression:["elements"],ObjectExpression:["properties"],UnaryExpression:["argument"],UpdateExpression:["argument"],BinaryExpression:["left","right"],LogicalExpression:["left","right"],AssignmentExpression:["left","right"],MemberExpression:["object","property"],ConditionalExpression:["test","consequent","alternate"],CallExpression:["callee","typeArguments","arguments"],NewExpression:["callee","typeArguments","arguments"],SequenceExpression:["expressions"],TemplateLiteral:["quasis","expressions"],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:[],SpreadElement:["argument"],RestElement:["decorators","argument","typeAnnotation"],YieldExpression:["argument"],AwaitExpression:["argument"],ImportExpression:["source","options","arguments"],ChainExpression:["expression"],MetaProperty:["meta","property"],ObjectPattern:["decorators","properties","typeAnnotation"],ArrayPattern:["decorators","elements","typeAnnotation"],AssignmentPattern:["decorators","left","right"],ImportDeclaration:["specifiers","source","attributes"],ImportSpecifier:["imported","local"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportAttribute:["key","value"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ExportDefaultDeclaration:["declaration"],ExportAllDeclaration:["exported","source","attributes"],Decorator:["expression"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterDeclaration:["params"],TSTypeParameterInstantiation:["params"],TSTypeParameter:["constraint","default"],TSAnyKeyword:[],TSBigIntKeyword:[],TSBooleanKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSNamedTupleMember:["label","elementType"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSLiteralType:["literal"],TSTypeReference:["typeName","typeArguments"],TSQualifiedName:["left","right"],TSTypeQuery:["exprName","typeArguments"],TSImportType:["argument","qualifier","typeArguments"],TSTypeLiteral:["members"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSFunctionType:["typeParameters","parameters","typeAnnotation"],TSConstructorType:["typeParameters","parameters","typeAnnotation"],TSIndexSignature:["decorators","parameters","typeAnnotation"],TSTypePredicate:["parameterName","typeAnnotation"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSDeclareFunction:["id","typeParameters","params","returnType"],TSDeclareMethod:["typeParameters","params","returnType"],TSParameterProperty:["parameter"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSNonNullExpression:["expression"],TSInstantiationExpression:["expression","typeArguments"]},A=Object.assign(Object.create(null),y),E=[],f=Symbol("sveast.walk.stop"),P=Symbol("sveast.walk.skip");function w(t,e){u(t,null,null,null,e)}function u(t,e,r,a,o){let i=v(t);if(i===void 0)throw Error(`unknown node type: ${t.type}`);let n=o.enter?.(t,e,r,a);if(n===f)return!0;if(n!==P){if(n!==t&&l(n))return h(n,e,r,a,o);let x=m(t);for(let S=0;S<i.length;S++){let T=i[S],p=x[T];if(Array.isArray(p))for(let c=0;c<p.length;c++){let d=p[c];if(l(d)&&u(d,t,T,c,o))return!0}else if(l(p)&&u(p,t,T,null,o))return!0}}return o.leave?.(t,e,r,a)===f}function v(t){let e=t.type;if(e==="Identifier")return t.typeAnnotation===void 0&&t.decorators===void 0?E:y.Identifier;if(e==="Literal")return y.Literal;if(e==="Text")return y.Text;return A[e]}function h(t,e,r,a,o){if(e===null||r===null)throw Error("walk can't replace the node it was called with");let i=m(e),n=i[r];if(a===null)i[r]=t;else if(Array.isArray(n))n[a]=t;return u(t,e,r,a,o)}export{P as SKIP,f as STOP,g as extractIdentifiers,b as isReference,y as visitorKeys,w as walk};
|
package/shared-0ehch67h.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function _e(t){return{support:"typescript",parser:t}}function Pe(t){return{support:"entities",names:t}}function Le(t){return t&&"parser"in t?t.parser:void 0}function Ie(t){return t&&"names"in t?t.names:void 0}function T(){throw Error('sveast: parsing TypeScript needs `typescript` from "sveast/typescript": createParser({ typescript })')}
|
|
2
|
-
export{_e,Pe,Le,Ie,T};
|
package/shared-3xek95jd.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{v,S}from"./shared-f8ty80r9.js";import{a,u,f}from"./shared-c1jf0gfc.js";import{T}from"./shared-0ehch67h.js";var We="",Le,$e=0;function p(t){We=t,Le=void 0,$e=0}function o(t){if(!Le){Le=[0];let l=We.indexOf(`
|
|
2
|
-
`);while(l!==-1)Le.push(l+1),l=We.indexOf(`
|
|
3
|
-
`,l+1)}let n=0,r=Le.length-1;if(t>=Le[$e])n=$e;else r=$e-1;if(n<r&&t<Le[n+1])r=n;while(n<r){let l=n+r+1>>>1;if(Le[l]<=t)n=l;else r=l-1}return $e=n,{line:n+1,column:t-Le[n],character:t}}function c(t){let{line:n,column:r}=o(t);return{line:n,column:r}}function ze(){return We.split(`
|
|
4
|
-
`)}var et=/^\t+/;class e extends Error{name="ParseError";code;reason;position;start;end;frame;constructor(t,n,r){super(`${r}
|
|
5
|
-
https://svelte.dev/e/${n}`);this.code=n,this.reason=r;let l=typeof t==="number"?t:t?.start,d=typeof t==="number"?t:t?.end;if(l!==void 0)this.position=[l,d??l],this.start=o(this.position[0]),this.end=o(this.position[1]),this.frame=tt(this.start.line-1,this.end.column)}}var Me=(t)=>t.replace(et,(n)=>" ".repeat(n.length));function tt(t,n){let r=ze(),l=Math.max(0,t-2),d=Math.min(t+3,r.length),w=String(d+1).length;return r.slice(l,d).map((m,g)=>{let k=String(g+l+1).padStart(w," ");if(l+g!==t)return`${k}: ${Me(m)}`;let x=`${" ".repeat(w+2+Me(m.slice(0,n)).length)}^`;return`${k}: ${Me(m)}
|
|
6
|
-
${x}`}).join(`
|
|
7
|
-
`)}function O(t){throw new e(t,"attribute_duplicate","Attributes need to be unique")}function D(t){throw new e(t,"attribute_empty_shorthand","Attribute shorthand cannot be empty")}function B(t,n){throw new e(t,"block_duplicate_clause",`${n} cannot appear more than once within a block`)}function F(t){throw new e(t,"block_invalid_continuation_placement","{:...} block is invalid at this position (did you forget to close the preceding element or block?)")}function V(t){throw new e(t,"block_invalid_elseif","'elseif' should be 'else if'")}function M(t,n,r){throw new e(t,"block_invalid_placement",`{#${n} ...} block cannot be ${r}`)}function j(t){throw new e(t,"block_unclosed","Block was left open")}function W(t){throw new e(t,"block_unexpected_close","Unexpected block closing tag")}function z(t){throw new e(t,"const_tag_invalid_expression","{@const ...} must consist of a single variable declaration")}function U(t){throw new e(t,"css_empty_declaration","Declaration cannot be empty")}function N(t){throw new e(t,"css_expected_identifier","Expected a valid CSS identifier")}function H(t){throw new e(t,"css_selector_invalid","Invalid selector")}function G(t){throw new e(t,"debug_tag_invalid_arguments","{@debug ...} arguments must be identifiers, not arbitrary expressions")}function C(t){throw new e(t,"declaration_tag_invalid_type","Declaration tags must be `let` or `const` declarations")}function K(t){throw new e(t,"directive_invalid_value","Directive value must be a JavaScript expression enclosed in curly braces")}function Q(t,n){throw new e(t,"directive_missing_name",`\`${n}\` name cannot be empty`)}function X(t,n){throw new e(t,"element_invalid_closing_tag",`\`</${n}>\` attempted to close an element that was not open`)}function Y(t,n,r){throw new e(t,"element_invalid_closing_tag_autoclosed",`\`</${n}>\` attempted to close element that was already automatically closed by \`<${r}>\` (cannot nest \`<${r}>\` inside \`<${n}>\`)`)}function A(t,n){throw new e(t,"element_unclosed",`\`<${n}>\` was left open`)}function _(t){throw new e(t,"expected_attribute_value","Expected attribute value")}function J(t){throw new e(t,"expected_block_type","Expected 'if', 'each', 'await', 'key' or 'snippet'")}function P(t){throw new e(t,"expected_identifier","Expected an identifier")}function Z(t){throw new e(t,"expected_pattern","Expected identifier or destructure pattern")}function ee(t){throw new e(t,"expected_tag","Expected 'html', 'render', 'attach', 'const', or 'debug'")}function s(t,n){throw new e(t,"expected_token",`Expected token ${n}`)}function te(t){throw new e(t,"expected_whitespace","Expected whitespace")}function Ue(t,n){throw new e(t,"js_parse_error",`${n}`)}function ie(t){throw new e(t,"render_tag_invalid_expression","`{@render ...}` tags can only contain call expressions")}function re(t){throw new e(t,"script_duplicate","A component can have a single top-level `<script>` element and/or a single top-level `<script module>` element")}function se(t,n){throw new e(t,"script_invalid_attribute_value",`If the \`${n}\` attribute is supplied, it must be a boolean attribute`)}function ne(t){throw new e(t,"script_invalid_context",'If the context attribute is supplied, its value must be "module"')}function oe(t,n){throw new e(t,"script_reserved_attribute",`The \`${n}\` attribute is reserved and cannot be used`)}function ae(t){throw new e(t,"style_duplicate","A component can have a single top-level `<style>` element")}function le(t){throw new e(t,"svelte_component_invalid_this","Invalid component definition — must be an `{expression}`")}function pe(t){throw new e(t,"svelte_component_missing_this","`<svelte:component>` must have a 'this' attribute")}function L(t){throw new e(t,"svelte_element_missing_this","`<svelte:element>` must have a 'this' attribute with a value")}function ce(t,n){throw new e(t,"svelte_meta_duplicate",`A component can only have one \`<${n}>\` element`)}function he(t,n){throw new e(t,"svelte_meta_invalid_content",`<${n}> cannot have children`)}function ue(t,n){throw new e(t,"svelte_meta_invalid_placement",`\`<${n}>\` tags cannot be inside elements or blocks`)}function fe(t,n){throw new e(t,"svelte_meta_invalid_tag",`Valid \`<svelte:...>\` tag names are ${n}`)}function de(t){throw new e(t,"svelte_options_deprecated_tag",'"tag" option is deprecated — use "customElement" instead')}function me(t){throw new e(t,"svelte_options_invalid_attribute","`<svelte:options>` can only receive static attributes")}function E(t,n){throw new e(t,"svelte_options_invalid_attribute_value",`Value must be ${n}, if specified`)}function ye(t){throw new e(t,"svelte_options_invalid_customelement",'"customElement" must be a string literal defining a valid custom element name or an object of the form { tag?: string; shadow?: "open" | "none" | `ShadowRootInit`; props?: { [key: string]: { attribute?: string; reflect?: boolean; type: .. } } }')}function xe(t){throw new e(t,"svelte_options_invalid_customelement_props",'"props" must be a statically analyzable object literal of the form "{ [key: string]: { attribute?: string; reflect?: boolean; type?: "String" | "Boolean" | "Number" | "Array" | "Object" }"')}function ge(t){throw new e(t,"svelte_options_invalid_customelement_shadow",'"shadow" must be either "open", "none" or `ShadowRootInit` object.')}function I(t){throw new e(t,"svelte_options_invalid_tagname","Tag name must be lowercase and hyphenated")}function be(t){throw new e(t,"svelte_options_reserved_tagname","Tag name is reserved")}function ve(t,n){throw new e(t,"svelte_options_unknown_attribute",`\`<svelte:options>\` unknown attribute '${n}'`)}function Se(t){throw new e(t,"tag_invalid_name","Expected a valid element or component name. Components must have a valid variable name or dot notation expression")}function ke(t,n,r){throw new e(t,"tag_invalid_placement",`{@${n} ...} tag cannot be ${r}`)}function i(t){throw new e(t,"unexpected_eof","Unexpected end of input")}function we(t,n){throw new e(t,"unexpected_reserved_word",`'${n}' is a reserved word in JavaScript and cannot be used here`)}function Te(t){throw new e(t,"unterminated_string_constant","Unterminated string constant")}function Ae(t){throw new e(t,"void_element_invalid_content","Void elements cannot have children or closing tags")}var Pe="",Ge=[],Ie=0;function Je(t,n){Pe=t,Ge=n,Ie=0}function Xe(){return Ie}function qe(t,n,r,l){Ie=l}function Ke(t,n,r,l,d,w){Ie=l;let m=n;if(t&&m.includes(`
|
|
8
|
-
`)){let k=Pe.lastIndexOf(`
|
|
9
|
-
`,r-1)+1,x=k,_e=Pe.charCodeAt(x);while(_e===32||_e===9)_e=Pe.charCodeAt(++x);if(x>k)m=nt(m,Pe.slice(k,x))}let g={type:t?"Block":"Line",value:m,start:r,end:l};if(d&&w)g.loc={start:d,end:w};Ge.push(g)}function nt(t,n){let r=t.startsWith(n)?n.length:0,l="",d=t.indexOf(`
|
|
10
|
-
`,r);while(d!==-1){if(l+=t.slice(r,d+1),r=d+1,t.startsWith(n,r))r+=n.length;d=t.indexOf(`
|
|
11
|
-
`,r)}return l+t.slice(r)}function Ye(t,n,r){let l=0,d=n.length;while(l<d){let w=l+d>>>1;if(n[w].start<r)l=w+1;else d=w}if(l>=n.length)return;if(y=n.slice(l).map(({type:w,value:m,start:g,end:k})=>({type:w,value:m,start:g,end:k})),R=0,Be(t,void 0,!1),R<y.length&&(y[R].start>=t.end||t.type==="Program")){t.trailingComments??=[];while(R<y.length)t.trailingComments.push(y[R++])}}var y=[],R=0,ot=new Map([["BlockStatement","body"],["Program","body"],["ArrayExpression","elements"],["ObjectExpression","properties"]]);function Ve(t,n){for(let r=t;r<n;r++){let l=Pe.charCodeAt(r);if(l!==44&&l!==41&&l!==32&&l!==9)return!0}return!1}function Be(t,n,r){while(R<y.length&&y[R].start<t.start)t.leadingComments??=[],t.leadingComments.push(y[R++]);if(R>=y.length)return;let l=y[R].start;if(l<t.end||!Ve(t.end,l)){let d=u(t),w=ot.get(t.type),m=w===void 0?void 0:d[w],g=Array.isArray(m)&&m.length===0;for(let k in d){if(R>=y.length)return;if(k==="type")continue;let x=d[k];if(Array.isArray(x)){let _e=k===w;for(let Ce=0;Ce<x.length;Ce++){let Fe=x[Ce];if(a(Fe))Be(Fe,t,_e?Ce===x.length-1:g)}}else if(a(x))Be(x,t,g)}if(R>=y.length)return}if(n!==void 0&&t.end===n.end)return;if(r)while(R<y.length){if(n&&y[R].start>=n.end)break;t.trailingComments??=[],t.trailingComments.push(y[R++])}else if(t.end<=y[R].start&&!Ve(t.end,y[R].start))t.trailingComments=[y[R++]]}var Re=!1,He=new Map;function je(t){if(!(t instanceof RegExp))return t;let n=He.get(t);if(!n){let r=new Set(t.source.slice(4,-2).split("|"));n={test:(l)=>r.has(l)},He.set(t,n)}return n}var q=v((t)=>{let{keywordTypes:n,tokTypes:r}=t.acorn,l=new Map("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this const class extends export import super".split(" ").map((d)=>[d,n[d]]));return class extends t{constructor(d,w,m){super(d,w,m);this.keywords=je(this.keywords),this.reservedWords=je(this.reservedWords),this.reservedWordsStrict=je(this.reservedWordsStrict),this.reservedWordsStrictBind=je(this.reservedWordsStrictBind)}parseParenAndDistinguishExpression(d,w){let m=super.parseParenAndDistinguishExpression(d,w);if(m.type==="ParenthesizedExpression")Re=!0;return m}checkLocalExport(){}skipSpace(){let d=this.input,w=this.options.locations,m=this.pos,g=d.charCodeAt(m);for(;;)if(g===32||g===9)g=d.charCodeAt(++m);else if(g===10){if(g=d.charCodeAt(++m),w)this.curLine++,this.lineStart=m}else break;if(this.pos=m,g===47||g<33||g>=128)super.skipSpace()}readWord1(){let d=this.input,w=this.pos,m=w,g=d.charCodeAt(m);while(g>=97&&g<=122||g>=65&&g<=90||g>=48&&g<=57||g===95||g===36)g=d.charCodeAt(++m);if(g>=128||g===92)return super.readWord1();return this.containsEsc=!1,this.pos=m,d.slice(w,m)}readWord(){let d=this.readWord1();return this.finishToken(l.get(d)??r.name,d)}}}),rt=S(q),it=/ \(\d+:\d+\)$/;function Oe(t){return t}function Qe(t){return t instanceof SyntaxError&&"pos"in t&&typeof t.pos==="number"}function De(t,n,r,l,d,w=t.root.comments.length){let m=t.root.comments;Je(n,m);let g={onComment:t.comments?Ke:qe,sourceType:"module",ecmaVersion:16,locations:t.loc,preserveParens:l};if(t.lfOnly)g.startLocation=o(r);let k=t.isTypeScript?t.typescript:rt;if(!k)T();let x;try{x=d(k,g)}catch(_e){if(!Qe(_e))throw _e;Ue(_e.pos,_e.message.replace(it,""))}if(m.length>w)Ye(Oe(x),m,r);return x}function b(t,n,r=0){return Oe(De(t,n,0,!1,(l,d)=>{if(r>0&&d.locations)d.startLocation=o(r);let w=new l(d,n,r).parse();return w.start=0,w},0))}var st={count:0};function h(t,n,r,l=!1){st.count+=1,Re=!1;let d=Oe(De(t,n,r,!0,(m,g)=>m.parseExpressionAt(n,r,g))),w=Math.max(d.end,Xe());return{node:Re&&!l?Ze(d):d,end:w}}function Ee(t,n,r){return Oe(De(t,n,r,!1,(l,d)=>{let w=new l(d,n,r);try{return w.nextToken(),w.parseStatement(null,!0,Object.create(null))}catch(m){if(Qe(m)&&m.pos===n.length)i(n.length);throw m}}))}function Ne(t,n,r){let l=De(t,n,0,!1,(d,w)=>{let m=new d(w,n,0),g=m.startNode(),k=[],x=Object.create(null);return r((_e)=>{m.pos=_e,m.context=m.initialContext(),m.exprAllowed=!0,m.nextToken();let Ce=m.parseStatement(null,!0,x);return k.push(Ce),Ce.end}),g.body=k,m.finishNode(g,"Program")});return Oe(l).body}function Ze(t){let n=t;while(n.type==="ParenthesizedExpression")n=n.expression;return f(n,Ze),n}
|
|
12
|
-
export{p,o,c,e,O,D,B,F,V,M,j,W,z,U,N,H,G,C,K,Q,X,Y,A,_,J,P,Z,ee,s,te,ie,re,se,ne,oe,ae,le,pe,L,ce,he,ue,fe,de,me,E,ye,xe,ge,I,be,ve,Se,ke,i,we,Te,Ae,q,b,h,Ee,Ne};
|
package/shared-88pt6me6.js
DELETED
package/shared-c1jf0gfc.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function a(e){return typeof e==="object"&&e!==null&&typeof u(e).type==="string"}function u(e){return e}function f(e,t){let n=u(e);for(let o in n){let s=n[o];if(Array.isArray(s)){for(let r=0;r<s.length;r++)if(a(s[r]))s[r]=t(s[r])}else if(a(s))n[o]=t(s)}}function d(e,...t){if(!t.some((n)=>n===e.type))throw Error(`expected ${t.join(" or ")}, got ${e.type}`)}
|
|
2
|
-
export{a,u,f,d};
|
package/shared-etx1q7m5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{p,Ne}from"./shared-3xek95jd.js";var O=0,s=1,d=2,f=3,U=0,P=1,j=2,W=3,K=4,b=4,M=5,g=6,z={await:s,case:s,default:s,delete:s,extends:s,in:s,instanceof:s,new:s,of:s,return:s,throw:s,typeof:s,void:s,yield:s,do:d,else:d,finally:d,try:d,for:b,if:b,while:b,with:b,import:M,export:g},N=10,w=Array(T(128,0)).fill(null);for(let t of Object.entries(z)){let o=T(t[0].charCodeAt(0),t[0].length),n=w[o]??[];n.push(t),w[o]=n}function T(t,o){return t*(N+1)+o}function G(t,o,n){let r=t.charCodeAt(o);if(r>=128||n-o>N)return f;let i=T(r,n-o),e=w[i];if(e===null)return f;for(let a=0;a<e.length;a++)if(t.startsWith(e[a][0],o))return e[a][1];return f}var L=/\s/,Y=new Uint8Array(128);for(let t of["az","AZ","09","__","$$","\\\\"])for(let o=t.charCodeAt(0);o<=t.charCodeAt(1);o++)Y[o]=1;function u(t){return t<128?Y[t]===1:!L.test(String.fromCharCode(t))}function D(t){return t<128?t===32||t>=9&&t<=13:L.test(String.fromCharCode(t))}function J(t,o,n){let r=t.length,i=[],e=t.startsWith("#!")?R(t,2):0,a=O,C=!1,E=!1,m=-1,k=()=>{if(a=O,i.length===0)m=-1};while(e<r){let h=t.charCodeAt(e);if(h===32||h===10||D(h)){e++;continue}if(h===47){let l=t.charCodeAt(e+1);if(l===47){e=R(t,e+2);continue}if(l===42){let c=t.indexOf("*/",e+2);e=c===-1?r:c+2;continue}}let B=C,H=E;if(C=!1,E=!1,u(h)||h===35){let l=e;e++;while(e<r){let S=t.charCodeAt(e);if(S===92)e+=2;else if(u(S))e++;else break}let c=B?f:G(t,l,e);if(i.length===0&&(c===g?o||Z(t,e):c===M&&X(t,e)))e=Math.max(e,n(m!==-1&&c===g?m:l)),k();else if(c===g)a=d;else if(c===b)E=!0,a=f;else a=c===s||c===d?c:f;continue}switch(e++,h){case 34:case 39:e=v(t,e,h),a=f;break;case 96:e=I(t,e,i),a=t.charCodeAt(e-1)===123?s:f;break;case 47:{let l=a===f?-1:V(t,e);if(l===-1)a=s;else{e=l;while(e<r&&u(t.charCodeAt(e)))e++;a=f}break}case 40:i.push(H?P:U),a=s;break;case 41:a=i.pop()===P?d:f;break;case 123:i.push(a===s?W:j),a=O;break;case 125:{let l=i.pop();if(l===K)e=I(t,e,i),a=t.charCodeAt(e-1)===123?s:f;else if(l===W)a=f;else k();break}case 59:k();break;case 93:a=f;break;case 46:if(_(t.charCodeAt(e))){while(e<r&&u(t.charCodeAt(e)))e++;a=f}else if(t.startsWith("..",e))e+=2,a=s;else C=!0,a=s;break;case 63:if(t.charCodeAt(e)===46&&!_(t.charCodeAt(e+1)))e++,C=!0;a=s;break;case 33:a=a===f&&!D(t.charCodeAt(e-2))?f:s;break;case 43:case 45:if(t.charCodeAt(e)===h&&a===f)e++;else a=s;break;case 61:if(a=t.charCodeAt(e)===62?d:s,a===d)e++;break;case 64:if(i.length===0&&m===-1)m=e-1;a=s;break;default:a=s}}}function _(t){return t>=48&&t<=57}function R(t,o){for(let n=o;n<t.length;n++){let r=t.charCodeAt(n);if(r===10||r===13||r===8232||r===8233)return n}return t.length}function v(t,o,n){for(let r=o;r<t.length;r++){let i=t.charCodeAt(r);if(i===n)return r+1;if(i===92)r+=t.startsWith(`\r
|
|
2
|
-
`,r+1)?2:1;else if(i===10||i===13)return r}return t.length}function I(t,o,n){for(let r=o;r<t.length;r++){let i=t.charCodeAt(r);if(i===96)return r+1;if(i===92)r++;else if(i===36&&t.charCodeAt(r+1)===123)return n.push(K),r+2}return t.length}function V(t,o){let n=!1;for(let r=o;r<t.length;r++){let i=t.charCodeAt(r);if(i===10||i===13||i===8232||i===8233)return-1;if(i===92)r++;else if(i===91)n=!0;else if(i===93)n=!1;else if(i===47&&!n)return r+1}return-1}function A(t,o){for(let n=o;n<t.length;n++){let r=t.charCodeAt(n);if(D(r))continue;if(r===47){let i=t.charCodeAt(n+1);if(i===47){n=R(t,n+2)-1;continue}if(i===42){let e=t.indexOf("*/",n+2);if(e===-1)return t.length;n=e+1;continue}}return n}return t.length}function y(t,o,n){return t.startsWith(n,o)&&!u(t.charCodeAt(o+n.length))}function X(t,o){let n=t.charCodeAt(A(t,o));return n!==40&&n!==46}function Z(t,o){let n=A(t,o);if(y(t,n,"import"))return!0;if(y(t,n,"type"))n=A(t,n+4);let r=t.charCodeAt(n);if(r===42)return!0;if(r!==123)return!1;for(n++;n<t.length;n++){let i=t.charCodeAt(n);if(i===125)break;if(i===34||i===39)n=v(t,n+1,i)-1;else if(i===47)n=Math.max(n,A(t,n)-1)}return y(t,A(t,n+1),"from")}function x(t,o,n){p(t);let r={isTypeScript:o.typescript??!1,typescript:n,loc:!1,comments:!1,root:{comments:[]}};return Ne(r,t,(i)=>J(t,o.localExports??!0,i))}
|
|
3
|
-
export{x};
|
package/shared-nqsechtt.js
DELETED