sveld 0.37.3 → 0.37.5
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/lib/browser.d.ts +41 -4
- package/lib/browser.js +150 -136
- package/lib/{chunk-m2bfvdte.js → chunk-8s0hjkmq.js} +5 -5
- package/lib/{chunk-s4f6b34h.js → chunk-a2krprqa.js} +1 -1
- package/lib/chunk-bxzbn9eg.js +1 -0
- package/lib/chunk-k2w5f49f.js +331 -0
- package/lib/chunk-x9qsjgpb.js +6 -0
- package/lib/chunk-znjmdeca.js +1 -0
- package/lib/cli-entry.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/schema/component-api.schema.json +20 -1
- package/lib/chunk-ag202nwj.js +0 -317
- package/lib/chunk-n14td14g.js +0 -1
- package/lib/chunk-te52wx32.js +0 -1
- package/lib/chunk-v4be4g6y.js +0 -6
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import{createRequire as id}from"node:module";var Ju=Object.create;var{getPrototypeOf:Yu,defineProperty:bi,getOwnPropertyNames:Qu}=Object;var ba=Object.prototype.hasOwnProperty;function Zu(i){return this[i]}var ed,td,De=(i,Ie,Re)=>{var Le=i!=null&&typeof i==="object";if(Le){var Oe=Ie?ed??=new WeakMap:td??=new WeakMap,$e=Oe.get(i);if($e)return $e}Re=i!=null?Ju(Yu(i)):{};let Me=Ie||!i||!i.__esModule||!ba.call(i,"default")?bi(Re,"default",{value:i,enumerable:!0}):Re;if(i&&typeof i==="object"||typeof i==="function"){for(let Fe of Qu(i))if(!ba.call(Me,Fe))bi(Me,Fe,{get:Zu.bind(i,Fe),enumerable:!0})}if(Le)Oe.set(i,Me);return Me};var a=(i,Ie)=>()=>(Ie||i((Ie={exports:{}}).exports,Ie),Ie.exports);var nd=(i)=>i;function rd(i,Ie){this[i]=nd.bind(null,Ie)}var sd=(i,Ie)=>{for(var Re in Ie)bi(i,Re,{get:Ie[Re],enumerable:!0,configurable:!0,set:rd.bind(Ie,Re)})};var C=id(import.meta.url);var od={li:{direct:["li"]},dt:{descendant:["dt","dd"]},dd:{descendant:["dt","dd"]},p:{descendant:["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"]},rt:{descendant:["rt","rp"]},rp:{descendant:["rt","rp"]},optgroup:{descendant:["optgroup"]},option:{descendant:["option","optgroup"]},thead:{direct:["tbody","tfoot"]},tbody:{direct:["tbody","tfoot"]},tfoot:{direct:["tbody"]},tr:{direct:["tr","tbody"]},td:{direct:["td","th","tr"]},th:{direct:["td","th","tr"]}};function Ea(i,Ie){let Re=od[i];if(!Re)return!1;if(!Ie)return!0;return(Re.direct??Re.descendant??[]).includes(Ie)}var Li={};sd(Li,{Node:()=>_r,Parser:()=>Ot,Position:()=>ar,SourceLocation:()=>Pr,TokContext:()=>hn,Token:()=>us,TokenType:()=>wt,defaultOptions:()=>ts,getLineInfo:()=>Ai,isIdentifierChar:()=>on,isIdentifierStart:()=>Zt,isNewLine:()=>zn,keywordTypes:()=>os,lineBreak:()=>en,lineBreakG:()=>Pa,nonASCIIwhitespace:()=>wi,parse:()=>Ri,parseExpressionAt:()=>Wd,tokContexts:()=>Lt,tokTypes:()=>He,tokenizer:()=>qd,version:()=>ac});var ad=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],ka=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],cd="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",wa="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ei={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Ci="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",ld={5:Ci,"5module":Ci+" export import",6:Ci+" const class extends export import super"},Aa=/^in(stanceof)?$/,pd=new RegExp("["+wa+"]"),ud=new RegExp("["+wa+cd+"]");function vi(i,Ie){var Re=65536;for(var Le=0;Le<Ie.length;Le+=2){if(Re+=Ie[Le],Re>i)return!1;if(Re+=Ie[Le+1],Re>=i)return!0}return!1}function Zt(i,Ie){if(i<65)return i===36;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&pd.test(String.fromCharCode(i));if(Ie===!1)return!1;return vi(i,ka)}function on(i,Ie){if(i<48)return i===36;if(i<58)return!0;if(i<65)return!1;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&ud.test(String.fromCharCode(i));if(Ie===!1)return!1;return vi(i,ka)||vi(i,ad)}var wt=function(Ie,Re){if(Re===void 0)Re={};this.label=Ie,this.keyword=Re.keyword,this.beforeExpr=!!Re.beforeExpr,this.startsExpr=!!Re.startsExpr,this.isLoop=!!Re.isLoop,this.isAssign=!!Re.isAssign,this.prefix=!!Re.prefix,this.postfix=!!Re.postfix,this.binop=Re.binop||null,this.updateContext=null};function dn(i,Ie){return new wt(i,{beforeExpr:!0,binop:Ie})}var fn={beforeExpr:!0},sn={startsExpr:!0},os={};function kt(i,Ie){if(Ie===void 0)Ie={};return Ie.keyword=i,os[i]=new wt(i,Ie)}var He={num:new wt("num",sn),regexp:new wt("regexp",sn),string:new wt("string",sn),name:new wt("name",sn),privateId:new wt("privateId",sn),eof:new wt("eof"),bracketL:new wt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new wt("]"),braceL:new wt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new wt("}"),parenL:new wt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new wt(")"),comma:new wt(",",fn),semi:new wt(";",fn),colon:new wt(":",fn),dot:new wt("."),question:new wt("?",fn),questionDot:new wt("?."),arrow:new wt("=>",fn),template:new wt("template"),invalidTemplate:new wt("invalidTemplate"),ellipsis:new wt("...",fn),backQuote:new wt("`",sn),dollarBraceL:new wt("${",{beforeExpr:!0,startsExpr:!0}),eq:new wt("=",{beforeExpr:!0,isAssign:!0}),assign:new wt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new wt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new wt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:dn("||",1),logicalAND:dn("&&",2),bitwiseOR:dn("|",3),bitwiseXOR:dn("^",4),bitwiseAND:dn("&",5),equality:dn("==/!=/===/!==",6),relational:dn("</>/<=/>=",7),bitShift:dn("<</>>/>>>",8),plusMin:new wt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:dn("%",10),star:dn("*",10),slash:dn("/",10),starstar:new wt("**",{beforeExpr:!0}),coalesce:dn("??",1),_break:kt("break"),_case:kt("case",fn),_catch:kt("catch"),_continue:kt("continue"),_debugger:kt("debugger"),_default:kt("default",fn),_do:kt("do",{isLoop:!0,beforeExpr:!0}),_else:kt("else",fn),_finally:kt("finally"),_for:kt("for",{isLoop:!0}),_function:kt("function",sn),_if:kt("if"),_return:kt("return",fn),_switch:kt("switch"),_throw:kt("throw",fn),_try:kt("try"),_var:kt("var"),_const:kt("const"),_while:kt("while",{isLoop:!0}),_with:kt("with"),_new:kt("new",{beforeExpr:!0,startsExpr:!0}),_this:kt("this",sn),_super:kt("super",sn),_class:kt("class",sn),_extends:kt("extends",fn),_export:kt("export"),_import:kt("import",sn),_null:kt("null",sn),_true:kt("true",sn),_false:kt("false",sn),_in:kt("in",{beforeExpr:!0,binop:7}),_instanceof:kt("instanceof",{beforeExpr:!0,binop:7}),_typeof:kt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},en=/\r\n?|\n|\u2028|\u2029/,Pa=new RegExp(en.source,"g");function zn(i){return i===10||i===13||i===8232||i===8233}function Na(i,Ie,Re){if(Re===void 0)Re=i.length;for(var Le=Ie;Le<Re;Le++){var Oe=i.charCodeAt(Le);if(zn(Oe))return Le<Re-1&&Oe===13&&i.charCodeAt(Le+1)===10?Le+2:Le+1}return-1}var wi=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Ut=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,_a=Object.prototype,{hasOwnProperty:dd,toString:fd}=_a,cr=Object.hasOwn||function(i,Ie){return dd.call(i,Ie)},Ca=Array.isArray||function(i){return fd.call(i)==="[object Array]"},va=Object.create(null);function Fn(i){return va[i]||(va[i]=new RegExp("^(?:"+i.replace(/ /g,"|")+")$"))}function _n(i){if(i<=65535)return String.fromCharCode(i);return i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320)}var hd=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ar=function(Ie,Re){this.line=Ie,this.column=Re};ar.prototype.offset=function(Ie){return new ar(this.line,this.column+Ie)};var Pr=function(Ie,Re,Le){if(this.start=Re,this.end=Le,Ie.sourceFile!==null)this.source=Ie.sourceFile};function Ai(i,Ie){for(var Re=1,Le=0;;){var Oe=Na(i,Le,Ie);if(Oe<0)return new ar(Re,Ie-Le);++Re,Le=Oe}}var ts={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Sa=!1;function md(i){var Ie={};for(var Re in ts)Ie[Re]=i&&cr(i,Re)?i[Re]:ts[Re];if(Ie.ecmaVersion==="latest")Ie.ecmaVersion=1e8;else if(Ie.ecmaVersion==null){if(!Sa&&typeof console==="object"&&console.warn)Sa=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
+
Defaulting to 2020, but this will stop working in the future.`);Ie.ecmaVersion=11}else if(Ie.ecmaVersion>=2015)Ie.ecmaVersion-=2009;if(Ie.allowReserved==null)Ie.allowReserved=Ie.ecmaVersion<5;if(!i||i.allowHashBang==null)Ie.allowHashBang=Ie.ecmaVersion>=14;if(Ca(Ie.onToken)){var Le=Ie.onToken;Ie.onToken=function(Oe){return Le.push(Oe)}}if(Ca(Ie.onComment))Ie.onComment=yd(Ie,Ie.onComment);if(Ie.sourceType==="commonjs"&&Ie.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return Ie}function yd(i,Ie){return function(Re,Le,Oe,$e,Me,Fe){var je={type:Re?"Block":"Line",value:Le,start:Oe,end:$e};if(i.locations)je.loc=new Pr(this,Me,Fe);if(i.ranges)je.range=[Oe,$e];Ie.push(je)}}var Kn=1,Xn=2,Pi=4,Da=8,Ni=16,Ia=32,as=64,Ra=128,Jn=256,Nr=512,La=1024,cs=Kn|Xn|Jn;function _i(i,Ie){return Xn|(i?Pi:0)|(Ie?Da:0)}var ns=0,Di=1,In=2,Oa=3,Ma=4,$a=5,Ot=function(Ie,Re,Le){this.options=Ie=md(Ie),this.sourceFile=Ie.sourceFile,this.keywords=Fn(ld[Ie.ecmaVersion>=6?6:Ie.sourceType==="module"?"5module":5]);var Oe="";if(Ie.allowReserved!==!0){if(Oe=Ei[Ie.ecmaVersion>=6?6:Ie.ecmaVersion===5?5:3],Ie.sourceType==="module")Oe+=" await"}this.reservedWords=Fn(Oe);var $e=(Oe?Oe+" ":"")+Ei.strict;if(this.reservedWordsStrict=Fn($e),this.reservedWordsStrictBind=Fn($e+" "+Ei.strictBind),this.input=String(Re),this.containsEsc=!1,this.pos=Le||0,this.curLine=1,Ie.startLocation)this.lineStart=this.pos-Ie.startLocation.column,this.curLine=Ie.startLocation.line;else if(Le){if(this.lineStart=this.input.lastIndexOf(`
|
|
3
|
+
`,Le-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(en).length}else this.lineStart=0;if(this.type=He.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=Ie.sourceType==="module",this.strict=this.inModule||Ie.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&Ie.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Xn:Kn),this.regexpState=null,this.privateNameStack=[]},yn={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};Ot.prototype.parse=function(){var Ie=this,Re=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return Ie.parseTopLevel(Re)})};yn.inFunction.get=function(){return(this.currentVarScope().flags&Xn)>0};yn.inGenerator.get=function(){return(this.currentVarScope().flags&Da)>0};yn.inAsync.get=function(){return(this.currentVarScope().flags&Pi)>0};yn.canAwait.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var Ie=this.scopeStack[i],Re=Ie.flags;if(Re&(Jn|Nr))return!1;if(Re&Xn)return(Re&Pi)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};yn.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Kn)return!0;return!1};yn.allowSuper.get=function(){var i=this.currentThisScope(),Ie=i.flags;return(Ie&as)>0||this.options.allowSuperOutsideMethod};yn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ra)>0};yn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};yn.allowNewDotTarget.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var Ie=this.scopeStack[i],Re=Ie.flags;if(Re&(Jn|Nr)||Re&Xn&&!(Re&Ni))return!0}return!1};yn.allowUsing.get=function(){var i=this.currentScope(),Ie=i.flags;if(Ie&La)return!1;if(!this.inModule&&Ie&Kn)return!1;return!0};yn.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Jn)>0};Ot.extend=function(){var Ie=[],Re=arguments.length;while(Re--)Ie[Re]=arguments[Re];var Le=this;for(var Oe=0;Oe<Ie.length;Oe++)Le=Ie[Oe](Le);return Le};Ot.parse=function(Ie,Re){return new this(Re,Ie).parse()};Ot.parseExpressionAt=function(Ie,Re,Le){var Oe=new this(Le,Ie,Re);return Oe.nextToken(),Oe.parseExpression()};Ot.tokenizer=function(Ie,Re){return new this(Re,Ie)};Object.defineProperties(Ot.prototype,yn);var Xt=Ot.prototype,gd=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Xt.strictDirective=function(i){if(this.options.ecmaVersion<5)return!1;for(;;){Ut.lastIndex=i,i+=Ut.exec(this.input)[0].length;var Ie=gd.exec(this.input.slice(i));if(!Ie)return!1;if((Ie[1]||Ie[2])==="use strict"){Ut.lastIndex=i+Ie[0].length;var Re=Ut.exec(this.input),Le=Re.index+Re[0].length,Oe=this.input.charAt(Le);return Oe===";"||Oe==="}"||en.test(Re[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Oe)||Oe==="!"&&this.input.charAt(Le+1)==="=")}if(i+=Ie[0].length,Ut.lastIndex=i,i+=Ut.exec(this.input)[0].length,this.input[i]===";")i++}};Xt.eat=function(i){if(this.type===i)return this.next(),!0;else return!1};Xt.isContextual=function(i){return this.type===He.name&&this.value===i&&!this.containsEsc};Xt.eatContextual=function(i){if(!this.isContextual(i))return!1;return this.next(),!0};Xt.catchStackOverflow=function(i){try{return i()}catch(Ie){if(Ie instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(Ie.message)||/\btoo much recursion\b/i.test(Ie.message)))this.raise(this.start,"Not enough stack space to parse input");else throw Ie}};Xt.expectContextual=function(i){if(!this.eatContextual(i))this.unexpected()};Xt.canInsertSemicolon=function(){return this.type===He.eof||this.type===He.braceR||en.test(this.input.slice(this.lastTokEnd,this.start))};Xt.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};Xt.semicolon=function(){if(!this.eat(He.semi)&&!this.insertSemicolon())this.unexpected()};Xt.afterTrailingComma=function(i,Ie){if(this.type===i){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!Ie)this.next();return!0}};Xt.expect=function(i){this.eat(i)||this.unexpected()};Xt.unexpected=function(i){this.raise(i!=null?i:this.start,"Unexpected token")};var ls=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Xt.checkPatternErrors=function(i,Ie){if(!i)return;if(i.trailingComma>-1)this.raiseRecoverable(i.trailingComma,"Comma is not permitted after the rest element");var Re=Ie?i.parenthesizedAssign:i.parenthesizedBind;if(Re>-1)this.raiseRecoverable(Re,Ie?"Assigning to rvalue":"Parenthesized pattern")};Xt.checkExpressionErrors=function(i,Ie){if(!i)return!1;var{shorthandAssign:Re,doubleProto:Le}=i;if(!Ie)return Re>=0||Le>=0;if(Re>=0)this.raise(Re,"Shorthand property assignments are valid only in destructuring patterns");if(Le>=0)this.raiseRecoverable(Le,"Redefinition of __proto__ property")};Xt.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};Xt.isSimpleAssignTarget=function(i){if(i.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(i.expression);return i.type==="Identifier"||i.type==="MemberExpression"};var ht=Ot.prototype;ht.parseTopLevel=function(i){var Ie=Object.create(null);if(!i.body)i.body=[];while(this.type!==He.eof){var Re=this.parseStatement(null,!0,Ie);i.body.push(Re)}if(this.inModule)for(var Le=0,Oe=Object.keys(this.undefinedExports);Le<Oe.length;Le+=1){var $e=Oe[Le];this.raiseRecoverable(this.undefinedExports[$e].start,"Export '"+$e+"' is not defined")}return this.adaptDirectivePrologue(i.body),this.next(),i.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(i,"Program")};var Ii={kind:"loop"},xd={kind:"switch"};ht.isLet=function(i){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Ut.lastIndex=this.pos;var Ie=Ut.exec(this.input),Re=this.pos+Ie[0].length,Le=this.fullCharCodeAt(Re);if(Le===91||Le===92)return!0;if(i)return!1;if(Le===123)return!0;if(Zt(Le)){var Oe=Re;do Re+=Le<=65535?1:2;while(on(Le=this.fullCharCodeAt(Re)));if(Le===92)return!0;var $e=this.input.slice(Oe,Re);if(!Aa.test($e))return!0}return!1};ht.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Ut.lastIndex=this.pos;var i=Ut.exec(this.input),Ie=this.pos+i[0].length,Re;return!en.test(this.input.slice(this.pos,Ie))&&this.input.slice(Ie,Ie+8)==="function"&&(Ie+8===this.input.length||!(on(Re=this.fullCharCodeAt(Ie+8))||Re===92))};ht.isUsingKeyword=function(i,Ie){if(this.options.ecmaVersion<17||!this.isContextual(i?"await":"using"))return!1;Ut.lastIndex=this.pos;var Re=Ut.exec(this.input),Le=this.pos+Re[0].length;if(en.test(this.input.slice(this.pos,Le)))return!1;if(i){var Oe=Le+5,$e;if(this.input.slice(Le,Oe)!=="using"||Oe===this.input.length||on($e=this.fullCharCodeAt(Oe))||$e===92)return!1;Ut.lastIndex=Oe;var Me=Ut.exec(this.input);if(Le=Oe+Me[0].length,Me&&en.test(this.input.slice(Oe,Le)))return!1}var Fe=this.fullCharCodeAt(Le);if(!Zt(Fe)&&Fe!==92)return!1;var je=Le;do Le+=Fe<=65535?1:2;while(on(Fe=this.fullCharCodeAt(Le)));if(Fe===92)return!0;var qe=this.input.slice(je,Le);if(Aa.test(qe))return!1;if(Ie&&!i&&qe==="of"){Ut.lastIndex=Le;var We=Ut.exec(this.input);if(Le=Le+We[0].length,this.input.charCodeAt(Le)!==61||(Fe=this.input.charCodeAt(Le+1))===61||Fe===62)return!1}return!0};ht.isAwaitUsing=function(i){return this.isUsingKeyword(!0,i)};ht.isUsing=function(i){return this.isUsingKeyword(!1,i)};ht.parseStatement=function(i,Ie,Re){var Le=this.type,Oe=this.startNode(),$e;if(this.isLet(i))Le=He._var,$e="let";switch(Le){case He._break:case He._continue:return this.parseBreakContinueStatement(Oe,Le.keyword);case He._debugger:return this.parseDebuggerStatement(Oe);case He._do:return this.parseDoStatement(Oe);case He._for:return this.parseForStatement(Oe);case He._function:if(i&&(this.strict||i!=="if"&&i!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(Oe,!1,!i);case He._class:if(i)this.unexpected();return this.parseClass(Oe,!0);case He._if:return this.parseIfStatement(Oe);case He._return:return this.parseReturnStatement(Oe);case He._switch:return this.parseSwitchStatement(Oe);case He._throw:return this.parseThrowStatement(Oe);case He._try:return this.parseTryStatement(Oe);case He._const:case He._var:if($e=$e||this.value,i&&$e!=="var")this.unexpected();return this.parseVarStatement(Oe,$e);case He._while:return this.parseWhileStatement(Oe);case He._with:return this.parseWithStatement(Oe);case He.braceL:return this.parseBlock(!0,Oe);case He.semi:return this.parseEmptyStatement(Oe);case He._export:case He._import:if(this.options.ecmaVersion>10&&Le===He._import){Ut.lastIndex=this.pos;var Me=Ut.exec(this.input),Fe=this.pos+Me[0].length,je=this.input.charCodeAt(Fe);if(je===40||je===46)return this.parseExpressionStatement(Oe,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!Ie)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return Le===He._import?this.parseImport(Oe):this.parseExport(Oe,Re);default:if(this.isAsyncFunction()){if(i)this.unexpected();return this.next(),this.parseFunctionStatement(Oe,!0,!i)}var qe=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(qe){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(i)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(qe==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(Oe,!1,qe),this.semicolon(),this.finishNode(Oe,"VariableDeclaration")}var We=this.value,Ge=this.parseExpression();if(Le===He.name&&Ge.type==="Identifier"&&this.eat(He.colon))return this.parseLabeledStatement(Oe,We,Ge,i);else return this.parseExpressionStatement(Oe,Ge)}};ht.parseBreakContinueStatement=function(i,Ie){var Re=Ie==="break";if(this.next(),this.eat(He.semi)||this.insertSemicolon())i.label=null;else if(this.type!==He.name)this.unexpected();else i.label=this.parseIdent(),this.semicolon();var Le=0;for(;Le<this.labels.length;++Le){var Oe=this.labels[Le];if(i.label==null||Oe.name===i.label.name){if(Oe.kind!=null&&(Re||Oe.kind==="loop"))break;if(i.label&&Re)break}}if(Le===this.labels.length)this.raise(i.start,"Unsyntactic "+Ie);return this.finishNode(i,Re?"BreakStatement":"ContinueStatement")};ht.parseDebuggerStatement=function(i){return this.next(),this.semicolon(),this.finishNode(i,"DebuggerStatement")};ht.parseDoStatement=function(i){if(this.next(),this.labels.push(Ii),i.body=this.parseStatement("do"),this.labels.pop(),this.expect(He._while),i.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(He.semi);else this.semicolon();return this.finishNode(i,"DoWhileStatement")};ht.parseForStatement=function(i){this.next();var Ie=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ii),this.enterScope(0),this.expect(He.parenL),this.type===He.semi){if(Ie>-1)this.unexpected(Ie);return this.parseFor(i,null)}var Re=this.isLet();if(this.type===He._var||this.type===He._const||Re){var Le=this.startNode(),Oe=Re?"let":this.value;return this.next(),this.parseVar(Le,!0,Oe),this.finishNode(Le,"VariableDeclaration"),this.parseForAfterInit(i,Le,Ie)}var $e=this.isContextual("let"),Me=!1,Fe=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Fe){var je=this.startNode();if(this.next(),Fe==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(je,!0,Fe),this.finishNode(je,"VariableDeclaration"),this.parseForAfterInit(i,je,Ie)}var qe=this.containsEsc,We=new ls,Ge=this.start,ze=Ie>-1?this.parseExprSubscripts(We,"await"):this.parseExpression(!0,We);if(this.type===He._in||(Me=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(Ie>-1){if(this.type===He._in)this.unexpected(Ie);i.await=!0}else if(Me&&this.options.ecmaVersion>=8){if(ze.start===Ge&&!qe&&ze.type==="Identifier"&&ze.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)i.await=!1}if($e&&Me)this.raise(ze.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(ze,!1,We),this.checkLValPattern(ze),this.parseForIn(i,ze)}else this.checkExpressionErrors(We,!0);if(Ie>-1)this.unexpected(Ie);return this.parseFor(i,ze)};ht.parseForAfterInit=function(i,Ie,Re){if((this.type===He._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Ie.declarations.length===1){if(this.type===He._in){if((Ie.kind==="using"||Ie.kind==="await using")&&!Ie.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&Re>-1)this.unexpected(Re)}else if(this.options.ecmaVersion>=9)i.await=Re>-1;return this.parseForIn(i,Ie)}if(Re>-1)this.unexpected(Re);return this.parseFor(i,Ie)};ht.parseFunctionStatement=function(i,Ie,Re){return this.next(),this.parseFunction(i,Ar|(Re?0:Si),!1,Ie)};ht.parseIfStatement=function(i){return this.next(),i.test=this.parseParenExpression(),i.consequent=this.parseStatement("if"),i.alternate=this.eat(He._else)?this.parseStatement("if"):null,this.finishNode(i,"IfStatement")};ht.parseReturnStatement=function(i){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(He.semi)||this.insertSemicolon())i.argument=null;else i.argument=this.parseExpression(),this.semicolon();return this.finishNode(i,"ReturnStatement")};ht.parseSwitchStatement=function(i){this.next(),i.discriminant=this.parseParenExpression(),i.cases=[],this.expect(He.braceL),this.labels.push(xd),this.enterScope(La);var Ie;for(var Re=!1;this.type!==He.braceR;)if(this.type===He._case||this.type===He._default){var Le=this.type===He._case;if(Ie)this.finishNode(Ie,"SwitchCase");if(i.cases.push(Ie=this.startNode()),Ie.consequent=[],this.next(),Le)Ie.test=this.parseExpression();else{if(Re)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");Re=!0,Ie.test=null}this.expect(He.colon)}else{if(!Ie)this.unexpected();Ie.consequent.push(this.parseStatement(null))}if(this.exitScope(),Ie)this.finishNode(Ie,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(i,"SwitchStatement")};ht.parseThrowStatement=function(i){if(this.next(),en.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return i.argument=this.parseExpression(),this.semicolon(),this.finishNode(i,"ThrowStatement")};var bd=[];ht.parseCatchClauseParam=function(){var i=this.parseBindingAtom(),Ie=i.type==="Identifier";return this.enterScope(Ie?Ia:0),this.checkLValPattern(i,Ie?Ma:In),this.expect(He.parenR),i};ht.parseTryStatement=function(i){if(this.next(),i.block=this.parseBlock(),i.handler=null,this.type===He._catch){var Ie=this.startNode();if(this.next(),this.eat(He.parenL))Ie.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();Ie.param=null,this.enterScope(0)}Ie.body=this.parseBlock(!1),this.exitScope(),i.handler=this.finishNode(Ie,"CatchClause")}if(i.finalizer=this.eat(He._finally)?this.parseBlock():null,!i.handler&&!i.finalizer)this.raise(i.start,"Missing catch or finally clause");return this.finishNode(i,"TryStatement")};ht.parseVarStatement=function(i,Ie,Re){return this.next(),this.parseVar(i,!1,Ie,Re),this.semicolon(),this.finishNode(i,"VariableDeclaration")};ht.parseWhileStatement=function(i){return this.next(),i.test=this.parseParenExpression(),this.labels.push(Ii),i.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(i,"WhileStatement")};ht.parseWithStatement=function(i){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),i.object=this.parseParenExpression(),i.body=this.parseStatement("with"),this.finishNode(i,"WithStatement")};ht.parseEmptyStatement=function(i){return this.next(),this.finishNode(i,"EmptyStatement")};ht.parseLabeledStatement=function(i,Ie,Re,Le){for(var Oe=0,$e=this.labels;Oe<$e.length;Oe+=1){var Me=$e[Oe];if(Me.name===Ie)this.raise(Re.start,"Label '"+Ie+"' is already declared")}var Fe=this.type.isLoop?"loop":this.type===He._switch?"switch":null;for(var je=this.labels.length-1;je>=0;je--){var qe=this.labels[je];if(qe.statementStart===i.start)qe.statementStart=this.start,qe.kind=Fe;else break}return this.labels.push({name:Ie,kind:Fe,statementStart:this.start}),i.body=this.parseStatement(Le?Le.indexOf("label")===-1?Le+"label":Le:"label"),this.labels.pop(),i.label=Re,this.finishNode(i,"LabeledStatement")};ht.parseExpressionStatement=function(i,Ie){return i.expression=Ie,this.semicolon(),this.finishNode(i,"ExpressionStatement")};ht.parseBlock=function(i,Ie,Re){if(i===void 0)i=!0;if(Ie===void 0)Ie=this.startNode();if(Ie.body=[],this.expect(He.braceL),i)this.enterScope(0);while(this.type!==He.braceR){var Le=this.parseStatement(null);Ie.body.push(Le)}if(Re)this.strict=!1;if(this.next(),i)this.exitScope();return this.finishNode(Ie,"BlockStatement")};ht.parseFor=function(i,Ie){return i.init=Ie,this.expect(He.semi),i.test=this.type===He.semi?null:this.parseExpression(),this.expect(He.semi),i.update=this.type===He.parenR?null:this.parseExpression(),this.expect(He.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,"ForStatement")};ht.parseForIn=function(i,Ie){var Re=this.type===He._in;if(this.next(),Ie.type==="VariableDeclaration"&&Ie.declarations[0].init!=null&&(!Re||this.options.ecmaVersion<8||this.strict||Ie.kind!=="var"||Ie.declarations[0].id.type!=="Identifier"))this.raise(Ie.start,(Re?"for-in":"for-of")+" loop variable declaration may not have an initializer");return i.left=Ie,i.right=Re?this.parseExpression():this.parseMaybeAssign(),this.expect(He.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,Re?"ForInStatement":"ForOfStatement")};ht.parseVar=function(i,Ie,Re,Le){i.declarations=[],i.kind=Re;for(;;){var Oe=this.startNode();if(this.parseVarId(Oe,Re),this.eat(He.eq))Oe.init=this.parseMaybeAssign(Ie);else if(!Le&&Re==="const"&&!(this.type===He._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!Le&&(Re==="using"||Re==="await using")&&this.options.ecmaVersion>=17&&this.type!==He._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+Re+" declaration");else if(!Le&&Oe.id.type!=="Identifier"&&!(Ie&&(this.type===He._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else Oe.init=null;if(i.declarations.push(this.finishNode(Oe,"VariableDeclarator")),!this.eat(He.comma))break}return i};ht.parseVarId=function(i,Ie){i.id=Ie==="using"||Ie==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(i.id,Ie==="var"?Di:In,!1)};var Ar=1,Si=2,Ba=4;ht.parseFunction=function(i,Ie,Re,Le,Oe){if(this.initFunction(i),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Le){if(this.type===He.star&&Ie&Si)this.unexpected();i.generator=this.eat(He.star)}if(this.options.ecmaVersion>=8)i.async=!!Le;if(Ie&Ar){if(i.id=Ie&Ba&&this.type!==He.name?null:this.parseIdent(),i.id&&!(Ie&Si))this.checkLValSimple(i.id,this.strict||i.generator||i.async?this.treatFunctionsAsVar?Di:In:Oa)}var $e=this.yieldPos,Me=this.awaitPos,Fe=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(_i(i.async,i.generator)),!(Ie&Ar))i.id=this.type===He.name?this.parseIdent():null;return this.parseFunctionParams(i),this.parseFunctionBody(i,Re,!1,Oe),this.yieldPos=$e,this.awaitPos=Me,this.awaitIdentPos=Fe,this.finishNode(i,Ie&Ar?"FunctionDeclaration":"FunctionExpression")};ht.parseFunctionParams=function(i){this.expect(He.parenL),i.params=this.parseBindingList(He.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};ht.parseClass=function(i,Ie){this.next();var Re=this.strict;this.strict=!0,this.parseClassId(i,Ie),this.parseClassSuper(i);var Le=this.enterClassBody(),Oe=this.startNode(),$e=!1;Oe.body=[],this.expect(He.braceL);while(this.type!==He.braceR){var Me=this.parseClassElement(i.superClass!==null);if(Me){if(Oe.body.push(Me),Me.type==="MethodDefinition"&&Me.kind==="constructor"){if($e)this.raiseRecoverable(Me.start,"Duplicate constructor in the same class");$e=!0}else if(Me.key&&Me.key.type==="PrivateIdentifier"&&Ed(Le,Me))this.raiseRecoverable(Me.key.start,"Identifier '#"+Me.key.name+"' has already been declared")}}return this.strict=Re,this.next(),i.body=this.finishNode(Oe,"ClassBody"),this.exitClassBody(),this.finishNode(i,Ie?"ClassDeclaration":"ClassExpression")};ht.parseClassElement=function(i){if(this.eat(He.semi))return null;var Ie=this.options.ecmaVersion,Re=this.startNode(),Le="",Oe=!1,$e=!1,Me="method",Fe=!1;if(this.eatContextual("static")){if(Ie>=13&&this.eat(He.braceL))return this.parseClassStaticBlock(Re),Re;if(this.isClassElementNameStart()||this.type===He.star)Fe=!0;else Le="static"}if(Re.static=Fe,!Le&&Ie>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===He.star)&&!this.canInsertSemicolon())$e=!0;else Le="async";if(!Le&&(Ie>=9||!$e)&&this.eat(He.star))Oe=!0;if(!Le&&!$e&&!Oe){var je=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Me=je;else Le=je}if(Le)Re.computed=!1,Re.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Re.key.name=Le,this.finishNode(Re.key,"Identifier");else this.parseClassElementName(Re);if(Ie<13||this.type===He.parenL||Me!=="method"||Oe||$e){var qe=!Re.static&&rs(Re,"constructor"),We=qe&&i;if(qe&&Me!=="method")this.raise(Re.key.start,"Constructor can't have get/set modifier");Re.kind=qe?"constructor":Me,this.parseClassMethod(Re,Oe,$e,We)}else this.parseClassField(Re);return Re};ht.isClassElementNameStart=function(){return this.type===He.name||this.type===He.privateId||this.type===He.num||this.type===He.string||this.type===He.bracketL||this.type.keyword};ht.parseClassElementName=function(i){if(this.type===He.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");i.computed=!1,i.key=this.parsePrivateIdent()}else this.parsePropertyName(i)};ht.parseClassMethod=function(i,Ie,Re,Le){var Oe=i.key;if(i.kind==="constructor"){if(Ie)this.raise(Oe.start,"Constructor can't be a generator");if(Re)this.raise(Oe.start,"Constructor can't be an async method")}else if(i.static&&rs(i,"prototype"))this.raise(Oe.start,"Classes may not have a static property named prototype");var $e=i.value=this.parseMethod(Ie,Re,Le);if(i.kind==="get"&&$e.params.length!==0)this.raiseRecoverable($e.start,"getter should have no params");if(i.kind==="set"&&$e.params.length!==1)this.raiseRecoverable($e.start,"setter should have exactly one param");if(i.kind==="set"&&$e.params[0].type==="RestElement")this.raiseRecoverable($e.params[0].start,"Setter cannot use rest params");return this.finishNode(i,"MethodDefinition")};ht.parseClassField=function(i){if(rs(i,"constructor"))this.raise(i.key.start,"Classes can't have a field named 'constructor'");else if(i.static&&rs(i,"prototype"))this.raise(i.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(He.eq))this.enterScope(Nr|as),i.value=this.parseMaybeAssign(),this.exitScope();else i.value=null;return this.semicolon(),this.finishNode(i,"PropertyDefinition")};ht.parseClassStaticBlock=function(i){i.body=[];var Ie=this.labels;this.labels=[],this.enterScope(Jn|as);while(this.type!==He.braceR){var Re=this.parseStatement(null);i.body.push(Re)}return this.next(),this.exitScope(),this.labels=Ie,this.finishNode(i,"StaticBlock")};ht.parseClassId=function(i,Ie){if(this.type===He.name){if(i.id=this.parseIdent(),Ie)this.checkLValSimple(i.id,In,!1)}else{if(Ie===!0)this.unexpected();i.id=null}};ht.parseClassSuper=function(i){i.superClass=this.eat(He._extends)?this.parseExprSubscripts(null,!1):null};ht.enterClassBody=function(){var i={declared:Object.create(null),used:[]};return this.privateNameStack.push(i),i.declared};ht.exitClassBody=function(){var i=this.privateNameStack.pop(),{declared:Ie,used:Re}=i;if(!this.options.checkPrivateFields)return;var Le=this.privateNameStack.length,Oe=Le===0?null:this.privateNameStack[Le-1];for(var $e=0;$e<Re.length;++$e){var Me=Re[$e];if(!cr(Ie,Me.name))if(Oe)Oe.used.push(Me);else this.raiseRecoverable(Me.start,"Private field '#"+Me.name+"' must be declared in an enclosing class")}};function Ed(i,Ie){var Re=Ie.key.name,Le=i[Re],Oe="true";if(Ie.type==="MethodDefinition"&&(Ie.kind==="get"||Ie.kind==="set"))Oe=(Ie.static?"s":"i")+Ie.kind;if(Le==="iget"&&Oe==="iset"||Le==="iset"&&Oe==="iget"||Le==="sget"&&Oe==="sset"||Le==="sset"&&Oe==="sget")return i[Re]="true",!1;else if(!Le)return i[Re]=Oe,!1;else return!0}function rs(i,Ie){var{computed:Re,key:Le}=i;return!Re&&(Le.type==="Identifier"&&Le.name===Ie||Le.type==="Literal"&&Le.value===Ie)}ht.parseExportAllDeclaration=function(i,Ie){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))i.exported=this.parseModuleExportName(),this.checkExport(Ie,i.exported,this.lastTokStart);else i.exported=null;if(this.expectContextual("from"),this.type!==He.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ExportAllDeclaration")};ht.parseExport=function(i,Ie){if(this.next(),this.eat(He.star))return this.parseExportAllDeclaration(i,Ie);if(this.eat(He._default))return this.checkExport(Ie,"default",this.lastTokStart),i.declaration=this.parseExportDefaultDeclaration(),this.finishNode(i,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(i.declaration=this.parseExportDeclaration(i),i.declaration.type==="VariableDeclaration")this.checkVariableExport(Ie,i.declaration.declarations);else this.checkExport(Ie,i.declaration.id,i.declaration.id.start);if(i.specifiers=[],i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}else{if(i.declaration=null,i.specifiers=this.parseExportSpecifiers(Ie),this.eatContextual("from")){if(this.type!==He.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause()}else{for(var Re=0,Le=i.specifiers;Re<Le.length;Re+=1){var Oe=Le[Re];if(this.checkUnreserved(Oe.local),this.checkLocalExport(Oe.local),Oe.local.type==="Literal")this.raise(Oe.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}this.semicolon()}return this.finishNode(i,"ExportNamedDeclaration")};ht.parseExportDeclaration=function(i){return this.parseStatement(null)};ht.parseExportDefaultDeclaration=function(){var i;if(this.type===He._function||(i=this.isAsyncFunction())){var Ie=this.startNode();if(this.next(),i)this.next();return this.parseFunction(Ie,Ar|Ba,!1,i)}else if(this.type===He._class){var Re=this.startNode();return this.parseClass(Re,"nullableID")}else{var Le=this.parseMaybeAssign();return this.semicolon(),Le}};ht.checkExport=function(i,Ie,Re){if(!i)return;if(typeof Ie!=="string")Ie=Ie.type==="Identifier"?Ie.name:Ie.value;if(cr(i,Ie))this.raiseRecoverable(Re,"Duplicate export '"+Ie+"'");i[Ie]=!0};ht.checkPatternExport=function(i,Ie){var Re=Ie.type;if(Re==="Identifier")this.checkExport(i,Ie,Ie.start);else if(Re==="ObjectPattern")for(var Le=0,Oe=Ie.properties;Le<Oe.length;Le+=1){var $e=Oe[Le];this.checkPatternExport(i,$e)}else if(Re==="ArrayPattern")for(var Me=0,Fe=Ie.elements;Me<Fe.length;Me+=1){var je=Fe[Me];if(je)this.checkPatternExport(i,je)}else if(Re==="Property")this.checkPatternExport(i,Ie.value);else if(Re==="AssignmentPattern")this.checkPatternExport(i,Ie.left);else if(Re==="RestElement")this.checkPatternExport(i,Ie.argument)};ht.checkVariableExport=function(i,Ie){if(!i)return;for(var Re=0,Le=Ie;Re<Le.length;Re+=1){var Oe=Le[Re];this.checkPatternExport(i,Oe.id)}};ht.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};ht.parseExportSpecifier=function(i){var Ie=this.startNode();return Ie.local=this.parseModuleExportName(),Ie.exported=this.eatContextual("as")?this.parseModuleExportName():Ie.local,this.checkExport(i,Ie.exported,Ie.exported.start),this.finishNode(Ie,"ExportSpecifier")};ht.parseExportSpecifiers=function(i){var Ie=[],Re=!0;this.expect(He.braceL);while(!this.eat(He.braceR)){if(!Re){if(this.expect(He.comma),this.afterTrailingComma(He.braceR))break}else Re=!1;Ie.push(this.parseExportSpecifier(i))}return Ie};ht.parseImport=function(i){if(this.next(),this.type===He.string)i.specifiers=bd,i.source=this.parseExprAtom();else i.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),i.source=this.type===He.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ImportDeclaration")};ht.parseImportSpecifier=function(){var i=this.startNode();if(i.imported=this.parseModuleExportName(),this.eatContextual("as"))i.local=this.parseIdent();else this.checkUnreserved(i.imported),i.local=i.imported;return this.checkLValSimple(i.local,In),this.finishNode(i,"ImportSpecifier")};ht.parseImportDefaultSpecifier=function(){var i=this.startNode();return i.local=this.parseIdent(),this.checkLValSimple(i.local,In),this.finishNode(i,"ImportDefaultSpecifier")};ht.parseImportNamespaceSpecifier=function(){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,In),this.finishNode(i,"ImportNamespaceSpecifier")};ht.parseImportSpecifiers=function(){var i=[],Ie=!0;if(this.type===He.name){if(i.push(this.parseImportDefaultSpecifier()),!this.eat(He.comma))return i}if(this.type===He.star)return i.push(this.parseImportNamespaceSpecifier()),i;this.expect(He.braceL);while(!this.eat(He.braceR)){if(!Ie){if(this.expect(He.comma),this.afterTrailingComma(He.braceR))break}else Ie=!1;i.push(this.parseImportSpecifier())}return i};ht.parseWithClause=function(){var i=[];if(!this.eat(He._with))return i;this.expect(He.braceL);var Ie={},Re=!0;while(!this.eat(He.braceR)){if(!Re){if(this.expect(He.comma),this.afterTrailingComma(He.braceR))break}else Re=!1;var Le=this.parseImportAttribute(),Oe=Le.key.type==="Identifier"?Le.key.name:Le.key.value;if(cr(Ie,Oe))this.raiseRecoverable(Le.key.start,"Duplicate attribute key '"+Oe+"'");Ie[Oe]=!0,i.push(Le)}return i};ht.parseImportAttribute=function(){var i=this.startNode();if(i.key=this.type===He.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(He.colon),this.type!==He.string)this.unexpected();return i.value=this.parseExprAtom(),this.finishNode(i,"ImportAttribute")};ht.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===He.string){var i=this.parseLiteral(this.value);if(hd.test(i.value))this.raise(i.start,"An export name cannot include a lone surrogate.");return i}return this.parseIdent(!0)};ht.adaptDirectivePrologue=function(i){for(var Ie=0;Ie<i.length&&this.isDirectiveCandidate(i[Ie]);++Ie)i[Ie].directive=i[Ie].expression.raw.slice(1,-1)};ht.isDirectiveCandidate=function(i){return this.options.ecmaVersion>=5&&i.type==="ExpressionStatement"&&i.expression.type==="Literal"&&typeof i.expression.value==="string"&&(this.input[i.start]==='"'||this.input[i.start]==="'")};var gn=Ot.prototype;gn.toAssignable=function(i,Ie,Re){if(this.options.ecmaVersion>=6&&i)switch(i.type){case"Identifier":if(this.inAsync&&i.name==="await")this.raise(i.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(i.type="ObjectPattern",Re)this.checkPatternErrors(Re,!0);for(var Le=0,Oe=i.properties;Le<Oe.length;Le+=1){var $e=Oe[Le];if(this.toAssignable($e,Ie),$e.type==="RestElement"&&($e.argument.type==="ArrayPattern"||$e.argument.type==="ObjectPattern"))this.raise($e.argument.start,"Unexpected token")}break;case"Property":if(i.kind!=="init")this.raise(i.key.start,"Object pattern can't contain getter or setter");this.toAssignable(i.value,Ie);break;case"ArrayExpression":if(i.type="ArrayPattern",Re)this.checkPatternErrors(Re,!0);this.toAssignableList(i.elements,Ie);break;case"SpreadElement":if(i.type="RestElement",this.toAssignable(i.argument,Ie),i.argument.type==="AssignmentPattern")this.raise(i.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(i.operator!=="=")this.raise(i.left.end,"Only '=' operator can be used for specifying default value.");i.type="AssignmentPattern",delete i.operator,this.toAssignable(i.left,Ie);break;case"ParenthesizedExpression":this.toAssignable(i.expression,Ie,Re);break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!Ie)break;default:this.raise(i.start,"Assigning to rvalue")}else if(Re)this.checkPatternErrors(Re,!0);return i};gn.toAssignableList=function(i,Ie){var Re=i.length;for(var Le=0;Le<Re;Le++){var Oe=i[Le];if(Oe)this.toAssignable(Oe,Ie)}if(Re){var $e=i[Re-1];if(this.options.ecmaVersion===6&&Ie&&$e&&$e.type==="RestElement"&&$e.argument.type!=="Identifier")this.unexpected($e.argument.start)}return i};gn.parseSpread=function(i){var Ie=this.startNode();return this.next(),Ie.argument=this.parseMaybeAssign(!1,i),this.finishNode(Ie,"SpreadElement")};gn.parseRestBinding=function(){var i=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==He.name)this.unexpected();return i.argument=this.parseBindingAtom(),this.finishNode(i,"RestElement")};gn.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case He.bracketL:var i=this.startNode();return this.next(),i.elements=this.parseBindingList(He.bracketR,!0,!0),this.finishNode(i,"ArrayPattern");case He.braceL:return this.parseObj(!0)}return this.parseIdent()};gn.parseBindingList=function(i,Ie,Re,Le){var Oe=[],$e=!0;while(!this.eat(i)){if($e)$e=!1;else this.expect(He.comma);if(Ie&&this.type===He.comma)Oe.push(null);else if(Re&&this.afterTrailingComma(i))break;else if(this.type===He.ellipsis){var Me=this.parseRestBinding();if(this.parseBindingListItem(Me),Oe.push(Me),this.type===He.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(i);break}else Oe.push(this.parseAssignableListItem(Le))}return Oe};gn.parseAssignableListItem=function(i){var Ie=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(Ie),Ie};gn.parseBindingListItem=function(i){return i};gn.parseMaybeDefault=function(i,Ie,Re){if(Re=Re||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(He.eq))return Re;var Le=this.startNodeAt(i,Ie);return Le.left=Re,Le.right=this.parseMaybeAssign(),this.finishNode(Le,"AssignmentPattern")};gn.checkLValSimple=function(i,Ie,Re){if(Ie===void 0)Ie=ns;var Le=Ie!==ns;switch(i.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(i.name))this.raiseRecoverable(i.start,(Le?"Binding ":"Assigning to ")+i.name+" in strict mode");if(Le){if(Ie===In&&i.name==="let")this.raiseRecoverable(i.start,"let is disallowed as a lexically bound name");if(Re){if(cr(Re,i.name))this.raiseRecoverable(i.start,"Argument name clash");Re[i.name]=!0}if(Ie!==$a)this.declareName(i.name,Ie,i.start)}break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(Le)this.raiseRecoverable(i.start,"Binding member expression");break;case"ParenthesizedExpression":if(Le)this.raiseRecoverable(i.start,"Binding parenthesized expression");return this.checkLValSimple(i.expression,Ie,Re);default:this.raise(i.start,(Le?"Binding":"Assigning to")+" rvalue")}};gn.checkLValPattern=function(i,Ie,Re){if(Ie===void 0)Ie=ns;switch(i.type){case"ObjectPattern":for(var Le=0,Oe=i.properties;Le<Oe.length;Le+=1){var $e=Oe[Le];this.checkLValInnerPattern($e,Ie,Re)}break;case"ArrayPattern":for(var Me=0,Fe=i.elements;Me<Fe.length;Me+=1){var je=Fe[Me];if(je)this.checkLValInnerPattern(je,Ie,Re)}break;default:this.checkLValSimple(i,Ie,Re)}};gn.checkLValInnerPattern=function(i,Ie,Re){if(Ie===void 0)Ie=ns;switch(i.type){case"Property":this.checkLValInnerPattern(i.value,Ie,Re);break;case"AssignmentPattern":this.checkLValPattern(i.left,Ie,Re);break;case"RestElement":this.checkLValPattern(i.argument,Ie,Re);break;default:this.checkLValPattern(i,Ie,Re)}};var hn=function(Ie,Re,Le,Oe,$e){this.token=Ie,this.isExpr=!!Re,this.preserveSpace=!!Le,this.override=Oe,this.generator=!!$e},Lt={b_stat:new hn("{",!1),b_expr:new hn("{",!0),b_tmpl:new hn("${",!1),p_stat:new hn("(",!1),p_expr:new hn("(",!0),q_tmpl:new hn("`",!0,!0,function(i){return i.tryReadTemplateToken()}),f_stat:new hn("function",!1),f_expr:new hn("function",!0),f_expr_gen:new hn("function",!0,!1,null,!0),f_gen:new hn("function",!1,!1,null,!0)},lr=Ot.prototype;lr.initialContext=function(){return[Lt.b_stat]};lr.curContext=function(){return this.context[this.context.length-1]};lr.braceIsBlock=function(i){var Ie=this.curContext();if(Ie===Lt.f_expr||Ie===Lt.f_stat)return!0;if(i===He.colon&&(Ie===Lt.b_stat||Ie===Lt.b_expr))return!Ie.isExpr;if(i===He._return||i===He.name&&this.exprAllowed)return en.test(this.input.slice(this.lastTokEnd,this.start));if(i===He._else||i===He.semi||i===He.eof||i===He.parenR||i===He.arrow)return!0;if(i===He.braceL)return Ie===Lt.b_stat;if(i===He._var||i===He._const||i===He.name)return!1;return!this.exprAllowed};lr.inGeneratorContext=function(){for(var i=this.context.length-1;i>=1;i--){var Ie=this.context[i];if(Ie.token==="function")return Ie.generator}return!1};lr.updateContext=function(i){var Ie,Re=this.type;if(Re.keyword&&i===He.dot)this.exprAllowed=!1;else if(Ie=Re.updateContext)Ie.call(this,i);else this.exprAllowed=Re.beforeExpr};lr.overrideContext=function(i){if(this.curContext()!==i)this.context[this.context.length-1]=i};He.parenR.updateContext=He.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var i=this.context.pop();if(i===Lt.b_stat&&this.curContext().token==="function")i=this.context.pop();this.exprAllowed=!i.isExpr};He.braceL.updateContext=function(i){this.context.push(this.braceIsBlock(i)?Lt.b_stat:Lt.b_expr),this.exprAllowed=!0};He.dollarBraceL.updateContext=function(){this.context.push(Lt.b_tmpl),this.exprAllowed=!0};He.parenL.updateContext=function(i){var Ie=i===He._if||i===He._for||i===He._with||i===He._while;this.context.push(Ie?Lt.p_stat:Lt.p_expr),this.exprAllowed=!0};He.incDec.updateContext=function(){};He._function.updateContext=He._class.updateContext=function(i){if(i.beforeExpr&&i!==He._else&&!(i===He.semi&&this.curContext()!==Lt.p_stat)&&!(i===He._return&&en.test(this.input.slice(this.lastTokEnd,this.start)))&&!((i===He.colon||i===He.braceL)&&this.curContext()===Lt.b_stat))this.context.push(Lt.f_expr);else this.context.push(Lt.f_stat);this.exprAllowed=!1};He.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};He.backQuote.updateContext=function(){if(this.curContext()===Lt.q_tmpl)this.context.pop();else this.context.push(Lt.q_tmpl);this.exprAllowed=!1};He.star.updateContext=function(i){if(i===He._function){var Ie=this.context.length-1;if(this.context[Ie]===Lt.f_expr)this.context[Ie]=Lt.f_expr_gen;else this.context[Ie]=Lt.f_gen}this.exprAllowed=!0};He.name.updateContext=function(i){var Ie=!1;if(this.options.ecmaVersion>=6&&i!==He.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())Ie=!0}this.exprAllowed=Ie};var xt=Ot.prototype;xt.checkPropClash=function(i,Ie,Re){if(this.options.ecmaVersion>=9&&i.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(i.computed||i.method||i.shorthand))return;var Le=i.key,Oe;switch(Le.type){case"Identifier":Oe=Le.name;break;case"Literal":Oe=String(Le.value);break;default:return}var $e=i.kind;if(this.options.ecmaVersion>=6){if(Oe==="__proto__"&&$e==="init"){if(Ie.proto)if(Re){if(Re.doubleProto<0)Re.doubleProto=Le.start}else this.raiseRecoverable(Le.start,"Redefinition of __proto__ property");Ie.proto=!0}return}Oe="$"+Oe;var Me=Ie[Oe];if(Me){var Fe;if($e==="init")Fe=this.strict&&Me.init||Me.get||Me.set;else Fe=Me.init||Me[$e];if(Fe)this.raiseRecoverable(Le.start,"Redefinition of property")}else Me=Ie[Oe]={init:!1,get:!1,set:!1};Me[$e]=!0};xt.parseExpression=function(i,Ie){var Re=this;return this.catchStackOverflow(function(){var{start:Le,startLoc:Oe}=Re,$e=Re.parseMaybeAssign(i,Ie);if(Re.type===He.comma){var Me=Re.startNodeAt(Le,Oe);Me.expressions=[$e];while(Re.eat(He.comma))Me.expressions.push(Re.parseMaybeAssign(i,Ie));return Re.finishNode(Me,"SequenceExpression")}return $e})};xt.parseMaybeAssign=function(i,Ie,Re){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(i);else this.exprAllowed=!1;var Le=!1,Oe=-1,$e=-1,Me=-1;if(Ie)Oe=Ie.parenthesizedAssign,$e=Ie.trailingComma,Me=Ie.doubleProto,Ie.parenthesizedAssign=Ie.trailingComma=-1;else Ie=new ls,Le=!0;var Fe=this.start,je=this.startLoc;if(this.type===He.parenL||this.type===He.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=i==="await";var qe=this.parseMaybeConditional(i,Ie);if(Re)qe=Re.call(this,qe,Fe,je);if(this.type.isAssign){var We=this.startNodeAt(Fe,je);if(We.operator=this.value,this.type===He.eq)qe=this.toAssignable(qe,!1,Ie);if(!Le)Ie.parenthesizedAssign=Ie.trailingComma=Ie.doubleProto=-1;if(Ie.shorthandAssign>=qe.start)Ie.shorthandAssign=-1;if(this.type===He.eq)this.checkLValPattern(qe);else this.checkLValSimple(qe);if(We.left=qe,this.next(),We.right=this.parseMaybeAssign(i),Me>-1)Ie.doubleProto=Me;return this.finishNode(We,"AssignmentExpression")}else if(Le)this.checkExpressionErrors(Ie,!0);if(Oe>-1)Ie.parenthesizedAssign=Oe;if($e>-1)Ie.trailingComma=$e;return qe};xt.parseMaybeConditional=function(i,Ie){var Re=this.start,Le=this.startLoc,Oe=this.parseExprOps(i,Ie);if(this.checkExpressionErrors(Ie))return Oe;if(!(Oe.type==="ArrowFunctionExpression"&&Oe.start===Re)&&this.eat(He.question)){var $e=this.startNodeAt(Re,Le);return $e.test=Oe,$e.consequent=this.parseMaybeAssign(),this.expect(He.colon),$e.alternate=this.parseMaybeAssign(i),this.finishNode($e,"ConditionalExpression")}return Oe};xt.parseExprOps=function(i,Ie){var Re=this.start,Le=this.startLoc,Oe=this.parseMaybeUnary(Ie,!1,!1,i);if(this.checkExpressionErrors(Ie))return Oe;return Oe.start===Re&&Oe.type==="ArrowFunctionExpression"?Oe:this.parseExprOp(Oe,Re,Le,-1,i)};xt.parseExprOp=function(i,Ie,Re,Le,Oe){var $e=this.type.binop;if($e!=null&&(!Oe||this.type!==He._in)){if($e>Le){var Me=this.type===He.logicalOR||this.type===He.logicalAND,Fe=this.type===He.coalesce;if(Fe)$e=He.logicalAND.binop;var je=this.value;this.next();var qe=this.start,We=this.startLoc,Ge=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Oe),qe,We,$e,Oe),ze=this.buildBinary(Ie,Re,i,Ge,je,Me||Fe);if(Me&&this.type===He.coalesce||Fe&&(this.type===He.logicalOR||this.type===He.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(ze,Ie,Re,Le,Oe)}}return i};xt.buildBinary=function(i,Ie,Re,Le,Oe,$e){if(Le.type==="PrivateIdentifier")this.raise(Le.start,"Private identifier can only be left side of binary expression");var Me=this.startNodeAt(i,Ie);return Me.left=Re,Me.operator=Oe,Me.right=Le,this.finishNode(Me,$e?"LogicalExpression":"BinaryExpression")};xt.parseMaybeUnary=function(i,Ie,Re,Le){var Oe=this.start,$e=this.startLoc,Me;if(this.isContextual("await")&&this.canAwait)Me=this.parseAwait(Le),Ie=!0;else if(this.type.prefix){var Fe=this.startNode(),je=this.type===He.incDec;if(Fe.operator=this.value,Fe.prefix=!0,this.next(),Fe.argument=this.parseMaybeUnary(null,!0,je,Le),this.checkExpressionErrors(i,!0),je)this.checkLValSimple(Fe.argument);else if(this.strict&&Fe.operator==="delete"&&Fa(Fe.argument))this.raiseRecoverable(Fe.start,"Deleting local variable in strict mode");else if(Fe.operator==="delete"&&Ti(Fe.argument))this.raiseRecoverable(Fe.start,"Private fields can not be deleted");else Ie=!0;Me=this.finishNode(Fe,je?"UpdateExpression":"UnaryExpression")}else if(!Ie&&this.type===He.privateId){if((Le||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Me=this.parsePrivateIdent(),this.type!==He._in)this.unexpected()}else{if(Me=this.parseExprSubscripts(i,Le),this.checkExpressionErrors(i))return Me;while(this.type.postfix&&!this.canInsertSemicolon()){var qe=this.startNodeAt(Oe,$e);qe.operator=this.value,qe.prefix=!1,qe.argument=Me,this.checkLValSimple(Me),this.next(),Me=this.finishNode(qe,"UpdateExpression")}}if(!Re&&!(Me.type==="ArrowFunctionExpression"&&Me.start===Oe)&&this.eat(He.starstar))if(Ie)this.unexpected(this.lastTokStart);else return this.buildBinary(Oe,$e,Me,this.parseMaybeUnary(null,!1,!1,Le),"**",!1);else return Me};function Fa(i){return i.type==="Identifier"||i.type==="ParenthesizedExpression"&&Fa(i.expression)}function Ti(i){return i.type==="MemberExpression"&&i.property.type==="PrivateIdentifier"||i.type==="ChainExpression"&&Ti(i.expression)||i.type==="ParenthesizedExpression"&&Ti(i.expression)}xt.parseExprSubscripts=function(i,Ie){var Re=this.start,Le=this.startLoc,Oe=this.parseExprAtom(i,Ie);if(Oe.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Oe;var $e=this.parseSubscripts(Oe,Re,Le,!1,Ie);if(i&&$e.type==="MemberExpression"){if(i.parenthesizedAssign>=$e.start)i.parenthesizedAssign=-1;if(i.parenthesizedBind>=$e.start)i.parenthesizedBind=-1;if(i.trailingComma>=$e.start)i.trailingComma=-1}return $e};xt.parseSubscripts=function(i,Ie,Re,Le,Oe){var $e=this.options.ecmaVersion>=8&&i.type==="Identifier"&&i.name==="async"&&this.lastTokEnd===i.end&&!this.canInsertSemicolon()&&i.end-i.start===5&&this.potentialArrowAt===i.start,Me=!1;while(!0){var Fe=this.parseSubscript(i,Ie,Re,Le,$e,Me,Oe);if(Fe.optional)Me=!0;if(Fe===i||Fe.type==="ArrowFunctionExpression"){if(Me){var je=this.startNodeAt(Ie,Re);je.expression=Fe,Fe=this.finishNode(je,"ChainExpression")}return Fe}i=Fe}};xt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(He.arrow)};xt.parseSubscriptAsyncArrow=function(i,Ie,Re,Le){return this.parseArrowExpression(this.startNodeAt(i,Ie),Re,!0,Le)};xt.parseSubscript=function(i,Ie,Re,Le,Oe,$e,Me){var Fe=this.options.ecmaVersion>=11,je=Fe&&this.eat(He.questionDot);if(Le&&je)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var qe=this.eat(He.bracketL);if(qe||je&&this.type!==He.parenL&&this.type!==He.backQuote||this.eat(He.dot)){var We=this.startNodeAt(Ie,Re);if(We.object=i,qe)We.property=this.parseExpression(),this.expect(He.bracketR);else if(this.type===He.privateId&&i.type!=="Super")We.property=this.parsePrivateIdent();else We.property=this.parseIdent(this.options.allowReserved!=="never");if(We.computed=!!qe,Fe)We.optional=je;i=this.finishNode(We,"MemberExpression")}else if(!Le&&this.eat(He.parenL)){var Ge=new ls,ze=this.yieldPos,Xe=this.awaitPos,Qe=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Ze=this.parseExprList(He.parenR,this.options.ecmaVersion>=8,!1,Ge);if(Oe&&!je&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Ge,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=ze,this.awaitPos=Xe,this.awaitIdentPos=Qe,this.parseSubscriptAsyncArrow(Ie,Re,Ze,Me)}this.checkExpressionErrors(Ge,!0),this.yieldPos=ze||this.yieldPos,this.awaitPos=Xe||this.awaitPos,this.awaitIdentPos=Qe||this.awaitIdentPos;var nt=this.startNodeAt(Ie,Re);if(nt.callee=i,nt.arguments=Ze,Fe)nt.optional=je;i=this.finishNode(nt,"CallExpression")}else if(this.type===He.backQuote){if(je||$e)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var at=this.startNodeAt(Ie,Re);at.tag=i,at.quasi=this.parseTemplate({isTagged:!0}),i=this.finishNode(at,"TaggedTemplateExpression")}return i};xt.parseExprAtom=function(i,Ie,Re){if(this.type===He.slash)this.readRegexp();var Le,Oe=this.potentialArrowAt===this.start;switch(this.type){case He._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(Le=this.startNode(),this.next(),this.type===He.parenL&&!this.allowDirectSuper)this.raise(Le.start,"super() call outside constructor of a subclass");if(this.type!==He.dot&&this.type!==He.bracketL&&this.type!==He.parenL)this.unexpected();return this.finishNode(Le,"Super");case He._this:return Le=this.startNode(),this.next(),this.finishNode(Le,"ThisExpression");case He.name:var $e=this.start,Me=this.startLoc,Fe=this.containsEsc,je=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Fe&&je.name==="async"&&!this.canInsertSemicolon()&&this.eat(He._function))return this.overrideContext(Lt.f_expr),this.parseFunction(this.startNodeAt($e,Me),0,!1,!0,Ie);if(Oe&&!this.canInsertSemicolon()){if(this.eat(He.arrow))return this.parseArrowExpression(this.startNodeAt($e,Me),[je],!1,Ie);if(this.options.ecmaVersion>=8&&je.name==="async"&&this.type===He.name&&!Fe&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(je=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(He.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt($e,Me),[je],!0,Ie)}}return je;case He.regexp:var qe=this.value;return Le=this.parseLiteral(qe.value),Le.regex={pattern:qe.pattern,flags:qe.flags},Le;case He.num:case He.string:return this.parseLiteral(this.value);case He._null:case He._true:case He._false:return Le=this.startNode(),Le.value=this.type===He._null?null:this.type===He._true,Le.raw=this.type.keyword,this.next(),this.finishNode(Le,"Literal");case He.parenL:var We=this.start,Ge=this.parseParenAndDistinguishExpression(Oe,Ie);if(i){if(i.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ge))i.parenthesizedAssign=We;if(i.parenthesizedBind<0)i.parenthesizedBind=We}return Ge;case He.bracketL:return Le=this.startNode(),this.next(),Le.elements=this.parseExprList(He.bracketR,!0,!0,i),this.finishNode(Le,"ArrayExpression");case He.braceL:return this.overrideContext(Lt.b_expr),this.parseObj(!1,i);case He._function:return Le=this.startNode(),this.next(),this.parseFunction(Le,0);case He._class:return this.parseClass(this.startNode(),!1);case He._new:return this.parseNew();case He.backQuote:return this.parseTemplate();case He._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(Re);else return this.unexpected();default:return this.parseExprAtomDefault()}};xt.parseExprAtomDefault=function(){this.unexpected()};xt.parseExprImport=function(i){var Ie=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===He.parenL&&!i)return this.parseDynamicImport(Ie);else if(this.type===He.dot){var Re=this.startNodeAt(Ie.start,Ie.loc&&Ie.loc.start);return Re.name="import",Ie.meta=this.finishNode(Re,"Identifier"),this.parseImportMeta(Ie)}else this.unexpected()};xt.parseDynamicImport=function(i){if(this.next(),i.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(He.parenR))if(this.expect(He.comma),!this.afterTrailingComma(He.parenR)){if(i.options=this.parseMaybeAssign(),!this.eat(He.parenR)){if(this.expect(He.comma),!this.afterTrailingComma(He.parenR))this.unexpected()}}else i.options=null;else i.options=null;else if(!this.eat(He.parenR)){var Ie=this.start;if(this.eat(He.comma)&&this.eat(He.parenR))this.raiseRecoverable(Ie,"Trailing comma is not allowed in import()");else this.unexpected(Ie)}return this.finishNode(i,"ImportExpression")};xt.parseImportMeta=function(i){this.next();var Ie=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="meta")this.raiseRecoverable(i.property.start,"The only valid meta property for import is 'import.meta'");if(Ie)this.raiseRecoverable(i.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(i.start,"Cannot use 'import.meta' outside a module");return this.finishNode(i,"MetaProperty")};xt.parseLiteral=function(i){var Ie=this.startNode();if(Ie.value=i,Ie.raw=this.input.slice(this.start,this.end),Ie.raw.charCodeAt(Ie.raw.length-1)===110)Ie.bigint=Ie.value!=null?Ie.value.toString():Ie.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(Ie,"Literal")};xt.parseParenExpression=function(){this.expect(He.parenL);var i=this.parseExpression();return this.expect(He.parenR),i};xt.shouldParseArrow=function(i){return!this.canInsertSemicolon()};xt.parseParenAndDistinguishExpression=function(i,Ie){var Re=this.start,Le=this.startLoc,Oe,$e=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Me=this.start,Fe=this.startLoc,je=[],qe=!0,We=!1,Ge=new ls,ze=this.yieldPos,Xe=this.awaitPos,Qe;this.yieldPos=0,this.awaitPos=0;while(this.type!==He.parenR)if(qe?qe=!1:this.expect(He.comma),$e&&this.afterTrailingComma(He.parenR,!0)){We=!0;break}else if(this.type===He.ellipsis){if(Qe=this.start,je.push(this.parseParenItem(this.parseRestBinding())),this.type===He.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else je.push(this.parseMaybeAssign(!1,Ge,this.parseParenItem));var Ze=this.lastTokEnd,nt=this.lastTokEndLoc;if(this.expect(He.parenR),i&&this.shouldParseArrow(je)&&this.eat(He.arrow))return this.checkPatternErrors(Ge,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=ze,this.awaitPos=Xe,this.parseParenArrowList(Re,Le,je,Ie);if(!je.length||We)this.unexpected(this.lastTokStart);if(Qe)this.unexpected(Qe);if(this.checkExpressionErrors(Ge,!0),this.yieldPos=ze||this.yieldPos,this.awaitPos=Xe||this.awaitPos,je.length>1)Oe=this.startNodeAt(Me,Fe),Oe.expressions=je,this.finishNodeAt(Oe,"SequenceExpression",Ze,nt);else Oe=je[0]}else Oe=this.parseParenExpression();if(this.options.preserveParens){var at=this.startNodeAt(Re,Le);return at.expression=Oe,this.finishNode(at,"ParenthesizedExpression")}else return Oe};xt.parseParenItem=function(i){return i};xt.parseParenArrowList=function(i,Ie,Re,Le){return this.parseArrowExpression(this.startNodeAt(i,Ie),Re,!1,Le)};var Cd=[];xt.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var i=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===He.dot){var Ie=this.startNodeAt(i.start,i.loc&&i.loc.start);Ie.name="new",i.meta=this.finishNode(Ie,"Identifier"),this.next();var Re=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="target")this.raiseRecoverable(i.property.start,"The only valid meta property for new is 'new.target'");if(Re)this.raiseRecoverable(i.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(i.start,"'new.target' can only be used in functions and class static block");return this.finishNode(i,"MetaProperty")}var Le=this.start,Oe=this.startLoc;if(i.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Le,Oe,!0,!1),i.callee.type==="Super")this.raiseRecoverable(Le,"Invalid use of 'super'");if(this.eat(He.parenL))i.arguments=this.parseExprList(He.parenR,this.options.ecmaVersion>=8,!1);else i.arguments=Cd;return this.finishNode(i,"NewExpression")};xt.parseTemplateElement=function(i){var Ie=i.isTagged,Re=this.startNode();if(this.type===He.invalidTemplate){if(!Ie)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");Re.value={raw:this.value.replace(/\r\n?/g,`
|
|
4
|
+
`),cooked:null}}else Re.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
5
|
+
`),cooked:this.value};return this.next(),Re.tail=this.type===He.backQuote,this.finishNode(Re,"TemplateElement")};xt.parseTemplate=function(i){if(i===void 0)i={};var Ie=i.isTagged;if(Ie===void 0)Ie=!1;var Re=this.startNode();this.next(),Re.expressions=[];var Le=this.parseTemplateElement({isTagged:Ie});Re.quasis=[Le];while(!Le.tail){if(this.type===He.eof)this.raise(this.pos,"Unterminated template literal");this.expect(He.dollarBraceL),Re.expressions.push(this.parseExpression()),this.expect(He.braceR),Re.quasis.push(Le=this.parseTemplateElement({isTagged:Ie}))}return this.next(),this.finishNode(Re,"TemplateLiteral")};xt.isAsyncProp=function(i){return!i.computed&&i.key.type==="Identifier"&&i.key.name==="async"&&(this.type===He.name||this.type===He.num||this.type===He.string||this.type===He.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===He.star)&&!en.test(this.input.slice(this.lastTokEnd,this.start))};xt.parseObj=function(i,Ie){var Re=this.startNode(),Le=!0,Oe={};Re.properties=[],this.next();while(!this.eat(He.braceR)){if(!Le){if(this.expect(He.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(He.braceR))break}else Le=!1;var $e=this.parseProperty(i,Ie);if(!i)this.checkPropClash($e,Oe,Ie);Re.properties.push($e)}return this.finishNode(Re,i?"ObjectPattern":"ObjectExpression")};xt.parseProperty=function(i,Ie){var Re=this.startNode(),Le,Oe,$e,Me;if(this.options.ecmaVersion>=9&&this.eat(He.ellipsis)){if(i){if(Re.argument=this.parseIdent(!1),this.type===He.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(Re,"RestElement")}if(Re.argument=this.parseMaybeAssign(!1,Ie),this.type===He.comma&&Ie&&Ie.trailingComma<0)Ie.trailingComma=this.start;return this.finishNode(Re,"SpreadElement")}if(this.options.ecmaVersion>=6){if(Re.method=!1,Re.shorthand=!1,i||Ie)$e=this.start,Me=this.startLoc;if(!i)Le=this.eat(He.star)}var Fe=this.containsEsc;if(this.parsePropertyName(Re),!i&&!Fe&&this.options.ecmaVersion>=8&&!Le&&this.isAsyncProp(Re))Oe=!0,Le=this.options.ecmaVersion>=9&&this.eat(He.star),this.parsePropertyName(Re);else Oe=!1;return this.parsePropertyValue(Re,i,Le,Oe,$e,Me,Ie,Fe),this.finishNode(Re,"Property")};xt.parseGetterSetter=function(i){var Ie=i.key.name;this.parsePropertyName(i),i.value=this.parseMethod(!1),i.kind=Ie;var Re=i.kind==="get"?0:1;if(i.value.params.length!==Re){var Le=i.value.start;if(i.kind==="get")this.raiseRecoverable(Le,"getter should have no params");else this.raiseRecoverable(Le,"setter should have exactly one param")}else if(i.kind==="set"&&i.value.params[0].type==="RestElement")this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params")};xt.parsePropertyValue=function(i,Ie,Re,Le,Oe,$e,Me,Fe){if((Re||Le)&&this.type===He.colon)this.unexpected();if(this.eat(He.colon))i.value=Ie?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Me),i.kind="init";else if(this.options.ecmaVersion>=6&&this.type===He.parenL){if(Ie)this.unexpected();i.method=!0,i.value=this.parseMethod(Re,Le),i.kind="init"}else if(!Ie&&!Fe&&this.options.ecmaVersion>=5&&!i.computed&&i.key.type==="Identifier"&&(i.key.name==="get"||i.key.name==="set")&&(this.type!==He.comma&&this.type!==He.braceR&&this.type!==He.eq)){if(Re||Le)this.unexpected();this.parseGetterSetter(i)}else if(this.options.ecmaVersion>=6&&!i.computed&&i.key.type==="Identifier"){if(Re||Le)this.unexpected();if(this.checkUnreserved(i.key),i.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=Oe;if(Ie)i.value=this.parseMaybeDefault(Oe,$e,this.copyNode(i.key));else if(this.type===He.eq&&Me){if(Me.shorthandAssign<0)Me.shorthandAssign=this.start;i.value=this.parseMaybeDefault(Oe,$e,this.copyNode(i.key))}else i.value=this.copyNode(i.key);i.kind="init",i.shorthand=!0}else this.unexpected()};xt.parsePropertyName=function(i){if(this.options.ecmaVersion>=6)if(this.eat(He.bracketL))return i.computed=!0,i.key=this.parseMaybeAssign(),this.expect(He.bracketR),i.key;else i.computed=!1;return i.key=this.type===He.num||this.type===He.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};xt.initFunction=function(i){if(i.id=null,this.options.ecmaVersion>=6)i.generator=i.expression=!1;if(this.options.ecmaVersion>=8)i.async=!1};xt.parseMethod=function(i,Ie,Re){var Le=this.startNode(),Oe=this.yieldPos,$e=this.awaitPos,Me=this.awaitIdentPos;if(this.initFunction(Le),this.options.ecmaVersion>=6)Le.generator=i;if(this.options.ecmaVersion>=8)Le.async=!!Ie;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(_i(Ie,Le.generator)|as|(Re?Ra:0)),this.expect(He.parenL),Le.params=this.parseBindingList(He.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Le,!1,!0,!1),this.yieldPos=Oe,this.awaitPos=$e,this.awaitIdentPos=Me,this.finishNode(Le,"FunctionExpression")};xt.parseArrowExpression=function(i,Ie,Re,Le){var Oe=this.yieldPos,$e=this.awaitPos,Me=this.awaitIdentPos;if(this.enterScope(_i(Re,!1)|Ni),this.initFunction(i),this.options.ecmaVersion>=8)i.async=!!Re;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,i.params=this.toAssignableList(Ie,!0),this.parseFunctionBody(i,!0,!1,Le),this.yieldPos=Oe,this.awaitPos=$e,this.awaitIdentPos=Me,this.finishNode(i,"ArrowFunctionExpression")};xt.parseFunctionBody=function(i,Ie,Re,Le){var Oe=Ie&&this.type!==He.braceL,$e=this.strict,Me=!1;if(Oe)i.body=this.parseMaybeAssign(Le),i.expression=!0,this.checkParams(i,!1);else{var Fe=this.options.ecmaVersion>=7&&!this.isSimpleParamList(i.params);if(!$e||Fe){if(Me=this.strictDirective(this.end),Me&&Fe)this.raiseRecoverable(i.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var je=this.labels;if(this.labels=[],Me)this.strict=!0;if(this.checkParams(i,!$e&&!Me&&!Ie&&!Re&&this.isSimpleParamList(i.params)),this.strict&&i.id)this.checkLValSimple(i.id,$a);i.body=this.parseBlock(!1,void 0,Me&&!$e),i.expression=!1,this.adaptDirectivePrologue(i.body.body),this.labels=je}this.exitScope()};xt.isSimpleParamList=function(i){for(var Ie=0,Re=i;Ie<Re.length;Ie+=1){var Le=Re[Ie];if(Le.type!=="Identifier")return!1}return!0};xt.checkParams=function(i,Ie){var Re=Object.create(null);for(var Le=0,Oe=i.params;Le<Oe.length;Le+=1){var $e=Oe[Le];this.checkLValInnerPattern($e,Di,Ie?null:Re)}};xt.parseExprList=function(i,Ie,Re,Le){var Oe=[],$e=!0;while(!this.eat(i)){if(!$e){if(this.expect(He.comma),Ie&&this.afterTrailingComma(i))break}else $e=!1;var Me=void 0;if(Re&&this.type===He.comma)Me=null;else if(this.type===He.ellipsis){if(Me=this.parseSpread(Le),Le&&this.type===He.comma&&Le.trailingComma<0)Le.trailingComma=this.start}else Me=this.parseMaybeAssign(!1,Le);Oe.push(Me)}return Oe};xt.checkUnreserved=function(i){var{start:Ie,end:Re,name:Le}=i;if(this.inGenerator&&Le==="yield")this.raiseRecoverable(Ie,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&Le==="await")this.raiseRecoverable(Ie,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&cs)&&Le==="arguments")this.raiseRecoverable(Ie,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(Le==="arguments"||Le==="await"))this.raise(Ie,"Cannot use "+Le+" in class static initialization block");if(this.keywords.test(Le))this.raise(Ie,"Unexpected keyword '"+Le+"'");if(this.options.ecmaVersion<6&&this.input.slice(Ie,Re).indexOf("\\")!==-1)return;var Oe=this.strict?this.reservedWordsStrict:this.reservedWords;if(Oe.test(Le)){if(!this.inAsync&&Le==="await")this.raiseRecoverable(Ie,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(Ie,"The keyword '"+Le+"' is reserved")}};xt.parseIdent=function(i){var Ie=this.parseIdentNode();if(this.next(!!i),this.finishNode(Ie,"Identifier"),!i){if(this.checkUnreserved(Ie),Ie.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=Ie.start}return Ie};xt.parseIdentNode=function(){var i=this.startNode();if(this.type===He.name)i.name=this.value;else if(this.type.keyword){if(i.name=this.type.keyword,(i.name==="class"||i.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=He.name}else this.unexpected();return i};xt.parsePrivateIdent=function(){var i=this.startNode();if(this.type===He.privateId)i.name=this.value;else this.unexpected();if(this.next(),this.finishNode(i,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(i.start,"Private field '#"+i.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(i);return i};xt.parseYield=function(i){if(!this.yieldPos)this.yieldPos=this.start;var Ie=this.startNode();if(this.next(),this.type===He.semi||this.canInsertSemicolon()||this.type!==He.star&&!this.type.startsExpr)Ie.delegate=!1,Ie.argument=null;else Ie.delegate=this.eat(He.star),Ie.argument=this.parseMaybeAssign(i);return this.finishNode(Ie,"YieldExpression")};xt.parseAwait=function(i){if(!this.awaitPos)this.awaitPos=this.start;var Ie=this.startNode();return this.next(),Ie.argument=this.parseMaybeUnary(null,!0,!1,i),this.finishNode(Ie,"AwaitExpression")};var ss=Ot.prototype;ss.raise=function(i,Ie){var Re=Ai(this.input,i);if(Ie+=" ("+Re.line+":"+Re.column+")",this.sourceFile)Ie+=" in "+this.sourceFile;var Le=SyntaxError(Ie);throw Le.pos=i,Le.loc=Re,Le.raisedAt=this.pos,Le};ss.raiseRecoverable=ss.raise;ss.curPosition=function(){if(this.options.locations)return new ar(this.curLine,this.pos-this.lineStart)};var jn=Ot.prototype,vd=function(Ie){this.flags=Ie,this.var=[],this.lexical=[],this.functions=[]};jn.enterScope=function(i){this.scopeStack.push(new vd(i))};jn.exitScope=function(){this.scopeStack.pop()};jn.treatFunctionsAsVarInScope=function(i){return i.flags&Xn||!this.inModule&&i.flags&Kn};jn.declareName=function(i,Ie,Re){var Le=!1;if(Ie===In){var Oe=this.currentScope();if(Le=Oe.lexical.indexOf(i)>-1||Oe.functions.indexOf(i)>-1||Oe.var.indexOf(i)>-1,Oe.lexical.push(i),this.inModule&&Oe.flags&Kn)delete this.undefinedExports[i]}else if(Ie===Ma){var $e=this.currentScope();$e.lexical.push(i)}else if(Ie===Oa){var Me=this.currentScope();if(this.treatFunctionsAsVar)Le=Me.lexical.indexOf(i)>-1;else Le=Me.lexical.indexOf(i)>-1||Me.var.indexOf(i)>-1;Me.functions.push(i)}else for(var Fe=this.scopeStack.length-1;Fe>=0;--Fe){var je=this.scopeStack[Fe];if(je.lexical.indexOf(i)>-1&&!(je.flags&Ia&&je.lexical[0]===i)||!this.treatFunctionsAsVarInScope(je)&&je.functions.indexOf(i)>-1){Le=!0;break}if(je.var.push(i),this.inModule&&je.flags&Kn)delete this.undefinedExports[i];if(je.flags&cs)break}if(Le)this.raiseRecoverable(Re,"Identifier '"+i+"' has already been declared")};jn.checkLocalExport=function(i){if(this.scopeStack[0].lexical.indexOf(i.name)===-1&&this.scopeStack[0].var.indexOf(i.name)===-1)this.undefinedExports[i.name]=i};jn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};jn.currentVarScope=function(){for(var i=this.scopeStack.length-1;;i--){var Ie=this.scopeStack[i];if(Ie.flags&(cs|Nr|Jn))return Ie}};jn.currentThisScope=function(){for(var i=this.scopeStack.length-1;;i--){var Ie=this.scopeStack[i];if(Ie.flags&(cs|Nr|Jn)&&!(Ie.flags&Ni))return Ie}};var _r=function(Ie,Re,Le){if(this.type="",this.start=Re,this.end=0,Ie.options.locations)this.loc=new Pr(Ie,Le);if(Ie.options.directSourceFile)this.sourceFile=Ie.options.directSourceFile;if(Ie.options.ranges)this.range=[Re,0]},Dr=Ot.prototype;Dr.startNode=function(){return new _r(this,this.start,this.startLoc)};Dr.startNodeAt=function(i,Ie){return new _r(this,i,Ie)};function ja(i,Ie,Re,Le){if(i.type=Ie,i.end=Re,this.options.locations)i.loc.end=Le;if(this.options.ranges)i.range[1]=Re;return i}Dr.finishNode=function(i,Ie){return ja.call(this,i,Ie,this.lastTokEnd,this.lastTokEndLoc)};Dr.finishNodeAt=function(i,Ie,Re,Le){return ja.call(this,i,Ie,Re,Le)};Dr.copyNode=function(i){var Ie=new _r(this,i.start,this.startLoc);for(var Re in i)Ie[Re]=i[Re];return Ie};var Sd="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",Va="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Wa=Va+" Extended_Pictographic",qa=Wa,Ga=qa+" EBase EComp EMod EPres ExtPict",Ua=Ga,Td=Ua,kd={9:Va,10:Wa,11:qa,12:Ga,13:Ua,14:Td},wd="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Ad={9:"",10:"",11:"",12:"",13:"",14:wd},Ta="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ha="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ka=Ha+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",za=Ka+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Xa=za+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Ja=Xa+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Pd=Ja+" "+Sd,Nd={9:Ha,10:Ka,11:za,12:Xa,13:Ja,14:Pd},Ya={};function _d(i){var Ie=Ya[i]={binary:Fn(kd[i]+" "+Ta),binaryOfStrings:Fn(Ad[i]),nonBinary:{General_Category:Fn(Ta),Script:Fn(Nd[i])}};Ie.nonBinary.Script_Extensions=Ie.nonBinary.Script,Ie.nonBinary.gc=Ie.nonBinary.General_Category,Ie.nonBinary.sc=Ie.nonBinary.Script,Ie.nonBinary.scx=Ie.nonBinary.Script_Extensions}for(wr=0,es=[9,10,11,12,13,14];wr<es.length;wr+=1)ki=es[wr],_d(ki);var ki,wr,es,dt=Ot.prototype,is=function(Ie,Re){this.parent=Ie,this.base=Re||this};is.prototype.separatedFrom=function(Ie){for(var Re=this;Re;Re=Re.parent)for(var Le=Ie;Le;Le=Le.parent)if(Re.base===Le.base&&Re!==Le)return!0;return!1};is.prototype.sibling=function(){return new is(this.parent,this.base)};var Tn=function(Ie){this.parser=Ie,this.validFlags="gim"+(Ie.options.ecmaVersion>=6?"uy":"")+(Ie.options.ecmaVersion>=9?"s":"")+(Ie.options.ecmaVersion>=13?"d":"")+(Ie.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ya[Ie.options.ecmaVersion>=14?14:Ie.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};Tn.prototype.reset=function(Ie,Re,Le){var Oe=Le.indexOf("v")!==-1,$e=Le.indexOf("u")!==-1;if(this.start=Ie|0,this.source=Re+"",this.flags=Le,Oe&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=$e&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=$e&&this.parser.options.ecmaVersion>=9};Tn.prototype.raise=function(Ie){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+Ie)};Tn.prototype.at=function(Ie,Re){if(Re===void 0)Re=!1;var Le=this.source,Oe=Le.length;if(Ie>=Oe)return-1;var $e=Le.charCodeAt(Ie);if(!(Re||this.switchU)||$e<=55295||$e>=57344||Ie+1>=Oe)return $e;var Me=Le.charCodeAt(Ie+1);return Me>=56320&&Me<=57343?($e<<10)+Me-56613888:$e};Tn.prototype.nextIndex=function(Ie,Re){if(Re===void 0)Re=!1;var Le=this.source,Oe=Le.length;if(Ie>=Oe)return Oe;var $e=Le.charCodeAt(Ie),Me;if(!(Re||this.switchU)||$e<=55295||$e>=57344||Ie+1>=Oe||(Me=Le.charCodeAt(Ie+1))<56320||Me>57343)return Ie+1;return Ie+2};Tn.prototype.current=function(Ie){if(Ie===void 0)Ie=!1;return this.at(this.pos,Ie)};Tn.prototype.lookahead=function(Ie){if(Ie===void 0)Ie=!1;return this.at(this.nextIndex(this.pos,Ie),Ie)};Tn.prototype.advance=function(Ie){if(Ie===void 0)Ie=!1;this.pos=this.nextIndex(this.pos,Ie)};Tn.prototype.eat=function(Ie,Re){if(Re===void 0)Re=!1;if(this.current(Re)===Ie)return this.advance(Re),!0;return!1};Tn.prototype.eatChars=function(Ie,Re){if(Re===void 0)Re=!1;var Le=this.pos;for(var Oe=0,$e=Ie;Oe<$e.length;Oe+=1){var Me=$e[Oe],Fe=this.at(Le,Re);if(Fe===-1||Fe!==Me)return!1;Le=this.nextIndex(Le,Re)}return this.pos=Le,!0};dt.validateRegExpFlags=function(i){var{validFlags:Ie,flags:Re}=i,Le=!1,Oe=!1;for(var $e=0;$e<Re.length;$e++){var Me=Re.charAt($e);if(Ie.indexOf(Me)===-1)this.raise(i.start,"Invalid regular expression flag");if(Re.indexOf(Me,$e+1)>-1)this.raise(i.start,"Duplicate regular expression flag");if(Me==="u")Le=!0;if(Me==="v")Oe=!0}if(this.options.ecmaVersion>=15&&Le&&Oe)this.raise(i.start,"Invalid regular expression flag")};function Dd(i){for(var Ie in i)return!0;return!1}dt.validateRegExpPattern=function(i){if(this.regexp_pattern(i),!i.switchN&&this.options.ecmaVersion>=9&&Dd(i.groupNames))i.switchN=!0,this.regexp_pattern(i)};dt.regexp_pattern=function(i){if(i.pos=0,i.lastIntValue=0,i.lastStringValue="",i.lastAssertionIsQuantifiable=!1,i.numCapturingParens=0,i.maxBackReference=0,i.groupNames=Object.create(null),i.backReferenceNames.length=0,i.branchID=null,this.regexp_disjunction(i),i.pos!==i.source.length){if(i.eat(41))i.raise("Unmatched ')'");if(i.eat(93)||i.eat(125))i.raise("Lone quantifier brackets")}if(i.maxBackReference>i.numCapturingParens)i.raise("Invalid escape");for(var Ie=0,Re=i.backReferenceNames;Ie<Re.length;Ie+=1){var Le=Re[Ie];if(!i.groupNames[Le])i.raise("Invalid named capture referenced")}};dt.regexp_disjunction=function(i){var Ie=this.options.ecmaVersion>=16;if(Ie)i.branchID=new is(i.branchID,null);this.regexp_alternative(i);while(i.eat(124)){if(Ie)i.branchID=i.branchID.sibling();this.regexp_alternative(i)}if(Ie)i.branchID=i.branchID.parent;if(this.regexp_eatQuantifier(i,!0))i.raise("Nothing to repeat");if(i.eat(123))i.raise("Lone quantifier brackets")};dt.regexp_alternative=function(i){while(i.pos<i.source.length&&this.regexp_eatTerm(i));};dt.regexp_eatTerm=function(i){if(this.regexp_eatAssertion(i)){if(i.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(i)){if(i.switchU)i.raise("Invalid quantifier")}return!0}if(i.switchU?this.regexp_eatAtom(i):this.regexp_eatExtendedAtom(i))return this.regexp_eatQuantifier(i),!0;return!1};dt.regexp_eatAssertion=function(i){var Ie=i.pos;if(i.lastAssertionIsQuantifiable=!1,i.eat(94)||i.eat(36))return!0;if(i.eat(92)){if(i.eat(66)||i.eat(98))return!0;i.pos=Ie}if(i.eat(40)&&i.eat(63)){var Re=!1;if(this.options.ecmaVersion>=9)Re=i.eat(60);if(i.eat(61)||i.eat(33)){if(this.regexp_disjunction(i),!i.eat(41))i.raise("Unterminated group");return i.lastAssertionIsQuantifiable=!Re,!0}}return i.pos=Ie,!1};dt.regexp_eatQuantifier=function(i,Ie){if(Ie===void 0)Ie=!1;if(this.regexp_eatQuantifierPrefix(i,Ie))return i.eat(63),!0;return!1};dt.regexp_eatQuantifierPrefix=function(i,Ie){return i.eat(42)||i.eat(43)||i.eat(63)||this.regexp_eatBracedQuantifier(i,Ie)};dt.regexp_eatBracedQuantifier=function(i,Ie){var Re=i.pos;if(i.eat(123)){var Le=0,Oe=-1;if(this.regexp_eatDecimalDigits(i)){if(Le=i.lastIntValue,i.eat(44)&&this.regexp_eatDecimalDigits(i))Oe=i.lastIntValue;if(i.eat(125)){if(Oe!==-1&&Oe<Le&&!Ie)i.raise("numbers out of order in {} quantifier");return!0}}if(i.switchU&&!Ie)i.raise("Incomplete quantifier");i.pos=Re}return!1};dt.regexp_eatAtom=function(i){return this.regexp_eatPatternCharacters(i)||i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)};dt.regexp_eatReverseSolidusAtomEscape=function(i){var Ie=i.pos;if(i.eat(92)){if(this.regexp_eatAtomEscape(i))return!0;i.pos=Ie}return!1};dt.regexp_eatUncapturingGroup=function(i){var Ie=i.pos;if(i.eat(40)){if(i.eat(63)){if(this.options.ecmaVersion>=16){var Re=this.regexp_eatModifiers(i),Le=i.eat(45);if(Re||Le){for(var Oe=0;Oe<Re.length;Oe++){var $e=Re.charAt(Oe);if(Re.indexOf($e,Oe+1)>-1)i.raise("Duplicate regular expression modifiers")}if(Le){var Me=this.regexp_eatModifiers(i);if(!Re&&!Me&&i.current()===58)i.raise("Invalid regular expression modifiers");for(var Fe=0;Fe<Me.length;Fe++){var je=Me.charAt(Fe);if(Me.indexOf(je,Fe+1)>-1||Re.indexOf(je)>-1)i.raise("Duplicate regular expression modifiers")}}}}if(i.eat(58)){if(this.regexp_disjunction(i),i.eat(41))return!0;i.raise("Unterminated group")}}i.pos=Ie}return!1};dt.regexp_eatCapturingGroup=function(i){if(i.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(i);else if(i.current()===63)i.raise("Invalid group");if(this.regexp_disjunction(i),i.eat(41))return i.numCapturingParens+=1,!0;i.raise("Unterminated group")}return!1};dt.regexp_eatModifiers=function(i){var Ie="",Re=0;while((Re=i.current())!==-1&&Id(Re))Ie+=_n(Re),i.advance();return Ie};function Id(i){return i===105||i===109||i===115}dt.regexp_eatExtendedAtom=function(i){return i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)||this.regexp_eatInvalidBracedQuantifier(i)||this.regexp_eatExtendedPatternCharacter(i)};dt.regexp_eatInvalidBracedQuantifier=function(i){if(this.regexp_eatBracedQuantifier(i,!0))i.raise("Nothing to repeat");return!1};dt.regexp_eatSyntaxCharacter=function(i){var Ie=i.current();if(Qa(Ie))return i.lastIntValue=Ie,i.advance(),!0;return!1};function Qa(i){return i===36||i>=40&&i<=43||i===46||i===63||i>=91&&i<=94||i>=123&&i<=125}dt.regexp_eatPatternCharacters=function(i){var Ie=i.pos,Re=0;while((Re=i.current())!==-1&&!Qa(Re))i.advance();return i.pos!==Ie};dt.regexp_eatExtendedPatternCharacter=function(i){var Ie=i.current();if(Ie!==-1&&Ie!==36&&!(Ie>=40&&Ie<=43)&&Ie!==46&&Ie!==63&&Ie!==91&&Ie!==94&&Ie!==124)return i.advance(),!0;return!1};dt.regexp_groupSpecifier=function(i){if(i.eat(63)){if(!this.regexp_eatGroupName(i))i.raise("Invalid group");var Ie=this.options.ecmaVersion>=16,Re=i.groupNames[i.lastStringValue];if(Re)if(Ie)for(var Le=0,Oe=Re;Le<Oe.length;Le+=1){var $e=Oe[Le];if(!$e.separatedFrom(i.branchID))i.raise("Duplicate capture group name")}else i.raise("Duplicate capture group name");if(Ie)(Re||(i.groupNames[i.lastStringValue]=[])).push(i.branchID);else i.groupNames[i.lastStringValue]=!0}};dt.regexp_eatGroupName=function(i){if(i.lastStringValue="",i.eat(60)){if(this.regexp_eatRegExpIdentifierName(i)&&i.eat(62))return!0;i.raise("Invalid capture group name")}return!1};dt.regexp_eatRegExpIdentifierName=function(i){if(i.lastStringValue="",this.regexp_eatRegExpIdentifierStart(i)){i.lastStringValue+=_n(i.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(i))i.lastStringValue+=_n(i.lastIntValue);return!0}return!1};dt.regexp_eatRegExpIdentifierStart=function(i){var Ie=i.pos,Re=this.options.ecmaVersion>=11,Le=i.current(Re);if(i.advance(Re),Le===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Re))Le=i.lastIntValue;if(Rd(Le))return i.lastIntValue=Le,!0;return i.pos=Ie,!1};function Rd(i){return Zt(i,!0)||i===36||i===95}dt.regexp_eatRegExpIdentifierPart=function(i){var Ie=i.pos,Re=this.options.ecmaVersion>=11,Le=i.current(Re);if(i.advance(Re),Le===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Re))Le=i.lastIntValue;if(Ld(Le))return i.lastIntValue=Le,!0;return i.pos=Ie,!1};function Ld(i){return on(i,!0)||i===36||i===95||i===8204||i===8205}dt.regexp_eatAtomEscape=function(i){if(this.regexp_eatBackReference(i)||this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)||i.switchN&&this.regexp_eatKGroupName(i))return!0;if(i.switchU){if(i.current()===99)i.raise("Invalid unicode escape");i.raise("Invalid escape")}return!1};dt.regexp_eatBackReference=function(i){var Ie=i.pos;if(this.regexp_eatDecimalEscape(i)){var Re=i.lastIntValue;if(i.switchU){if(Re>i.maxBackReference)i.maxBackReference=Re;return!0}if(Re<=i.numCapturingParens)return!0;i.pos=Ie}return!1};dt.regexp_eatKGroupName=function(i){if(i.eat(107)){if(this.regexp_eatGroupName(i))return i.backReferenceNames.push(i.lastStringValue),!0;i.raise("Invalid named reference")}return!1};dt.regexp_eatCharacterEscape=function(i){return this.regexp_eatControlEscape(i)||this.regexp_eatCControlLetter(i)||this.regexp_eatZero(i)||this.regexp_eatHexEscapeSequence(i)||this.regexp_eatRegExpUnicodeEscapeSequence(i,!1)||!i.switchU&&this.regexp_eatLegacyOctalEscapeSequence(i)||this.regexp_eatIdentityEscape(i)};dt.regexp_eatCControlLetter=function(i){var Ie=i.pos;if(i.eat(99)){if(this.regexp_eatControlLetter(i))return!0;i.pos=Ie}return!1};dt.regexp_eatZero=function(i){if(i.current()===48&&!ps(i.lookahead()))return i.lastIntValue=0,i.advance(),!0;return!1};dt.regexp_eatControlEscape=function(i){var Ie=i.current();if(Ie===116)return i.lastIntValue=9,i.advance(),!0;if(Ie===110)return i.lastIntValue=10,i.advance(),!0;if(Ie===118)return i.lastIntValue=11,i.advance(),!0;if(Ie===102)return i.lastIntValue=12,i.advance(),!0;if(Ie===114)return i.lastIntValue=13,i.advance(),!0;return!1};dt.regexp_eatControlLetter=function(i){var Ie=i.current();if(Za(Ie))return i.lastIntValue=Ie%32,i.advance(),!0;return!1};function Za(i){return i>=65&&i<=90||i>=97&&i<=122}dt.regexp_eatRegExpUnicodeEscapeSequence=function(i,Ie){if(Ie===void 0)Ie=!1;var Re=i.pos,Le=Ie||i.switchU;if(i.eat(117)){if(this.regexp_eatFixedHexDigits(i,4)){var Oe=i.lastIntValue;if(Le&&Oe>=55296&&Oe<=56319){var $e=i.pos;if(i.eat(92)&&i.eat(117)&&this.regexp_eatFixedHexDigits(i,4)){var Me=i.lastIntValue;if(Me>=56320&&Me<=57343)return i.lastIntValue=(Oe-55296)*1024+(Me-56320)+65536,!0}i.pos=$e,i.lastIntValue=Oe}return!0}if(Le&&i.eat(123)&&this.regexp_eatHexDigits(i)&&i.eat(125)&&Od(i.lastIntValue))return!0;if(Le)i.raise("Invalid unicode escape");i.pos=Re}return!1};function Od(i){return i>=0&&i<=1114111}dt.regexp_eatIdentityEscape=function(i){if(i.switchU){if(this.regexp_eatSyntaxCharacter(i))return!0;if(i.eat(47))return i.lastIntValue=47,!0;return!1}var Ie=i.current();if(Ie!==99&&(!i.switchN||Ie!==107))return i.lastIntValue=Ie,i.advance(),!0;return!1};dt.regexp_eatDecimalEscape=function(i){i.lastIntValue=0;var Ie=i.current();if(Ie>=49&&Ie<=57){do i.lastIntValue=10*i.lastIntValue+(Ie-48),i.advance();while((Ie=i.current())>=48&&Ie<=57);return!0}return!1};var ec=0,Dn=1,mn=2;dt.regexp_eatCharacterClassEscape=function(i){var Ie=i.current();if(Md(Ie))return i.lastIntValue=-1,i.advance(),Dn;var Re=!1;if(i.switchU&&this.options.ecmaVersion>=9&&((Re=Ie===80)||Ie===112)){i.lastIntValue=-1,i.advance();var Le;if(i.eat(123)&&(Le=this.regexp_eatUnicodePropertyValueExpression(i))&&i.eat(125)){if(Re&&Le===mn)i.raise("Invalid property name");return Le}i.raise("Invalid property name")}return ec};function Md(i){return i===100||i===68||i===115||i===83||i===119||i===87}dt.regexp_eatUnicodePropertyValueExpression=function(i){var Ie=i.pos;if(this.regexp_eatUnicodePropertyName(i)&&i.eat(61)){var Re=i.lastStringValue;if(this.regexp_eatUnicodePropertyValue(i)){var Le=i.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(i,Re,Le),Dn}}if(i.pos=Ie,this.regexp_eatLoneUnicodePropertyNameOrValue(i)){var Oe=i.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(i,Oe)}return ec};dt.regexp_validateUnicodePropertyNameAndValue=function(i,Ie,Re){if(!cr(i.unicodeProperties.nonBinary,Ie))i.raise("Invalid property name");if(!i.unicodeProperties.nonBinary[Ie].test(Re))i.raise("Invalid property value")};dt.regexp_validateUnicodePropertyNameOrValue=function(i,Ie){if(i.unicodeProperties.binary.test(Ie))return Dn;if(i.switchV&&i.unicodeProperties.binaryOfStrings.test(Ie))return mn;i.raise("Invalid property name")};dt.regexp_eatUnicodePropertyName=function(i){var Ie=0;i.lastStringValue="";while(tc(Ie=i.current()))i.lastStringValue+=_n(Ie),i.advance();return i.lastStringValue!==""};function tc(i){return Za(i)||i===95}dt.regexp_eatUnicodePropertyValue=function(i){var Ie=0;i.lastStringValue="";while($d(Ie=i.current()))i.lastStringValue+=_n(Ie),i.advance();return i.lastStringValue!==""};function $d(i){return tc(i)||ps(i)}dt.regexp_eatLoneUnicodePropertyNameOrValue=function(i){return this.regexp_eatUnicodePropertyValue(i)};dt.regexp_eatCharacterClass=function(i){if(i.eat(91)){var Ie=i.eat(94),Re=this.regexp_classContents(i);if(!i.eat(93))i.raise("Unterminated character class");if(Ie&&Re===mn)i.raise("Negated character class may contain strings");return!0}return!1};dt.regexp_classContents=function(i){if(i.current()===93)return Dn;if(i.switchV)return this.regexp_classSetExpression(i);return this.regexp_nonEmptyClassRanges(i),Dn};dt.regexp_nonEmptyClassRanges=function(i){while(this.regexp_eatClassAtom(i)){var Ie=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassAtom(i)){var Re=i.lastIntValue;if(i.switchU&&(Ie===-1||Re===-1))i.raise("Invalid character class");if(Ie!==-1&&Re!==-1&&Ie>Re)i.raise("Range out of order in character class")}}};dt.regexp_eatClassAtom=function(i){var Ie=i.pos;if(i.eat(92)){if(this.regexp_eatClassEscape(i))return!0;if(i.switchU){var Re=i.current();if(Re===99||sc(Re))i.raise("Invalid class escape");i.raise("Invalid escape")}i.pos=Ie}var Le=i.current();if(Le!==93)return i.lastIntValue=Le,i.advance(),!0;return!1};dt.regexp_eatClassEscape=function(i){var Ie=i.pos;if(i.eat(98))return i.lastIntValue=8,!0;if(i.switchU&&i.eat(45))return i.lastIntValue=45,!0;if(!i.switchU&&i.eat(99)){if(this.regexp_eatClassControlLetter(i))return!0;i.pos=Ie}return this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)};dt.regexp_classSetExpression=function(i){var Ie=Dn,Re;if(this.regexp_eatClassSetRange(i));else if(Re=this.regexp_eatClassSetOperand(i)){if(Re===mn)Ie=mn;var Le=i.pos;while(i.eatChars([38,38])){if(i.current()!==38&&(Re=this.regexp_eatClassSetOperand(i))){if(Re!==mn)Ie=Dn;continue}i.raise("Invalid character in character class")}if(Le!==i.pos)return Ie;while(i.eatChars([45,45])){if(this.regexp_eatClassSetOperand(i))continue;i.raise("Invalid character in character class")}if(Le!==i.pos)return Ie}else i.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(i))continue;if(Re=this.regexp_eatClassSetOperand(i),!Re)return Ie;if(Re===mn)Ie=mn}};dt.regexp_eatClassSetRange=function(i){var Ie=i.pos;if(this.regexp_eatClassSetCharacter(i)){var Re=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassSetCharacter(i)){var Le=i.lastIntValue;if(Re!==-1&&Le!==-1&&Re>Le)i.raise("Range out of order in character class");return!0}i.pos=Ie}return!1};dt.regexp_eatClassSetOperand=function(i){if(this.regexp_eatClassSetCharacter(i))return Dn;return this.regexp_eatClassStringDisjunction(i)||this.regexp_eatNestedClass(i)};dt.regexp_eatNestedClass=function(i){var Ie=i.pos;if(i.eat(91)){var Re=i.eat(94),Le=this.regexp_classContents(i);if(i.eat(93)){if(Re&&Le===mn)i.raise("Negated character class may contain strings");return Le}i.pos=Ie}if(i.eat(92)){var Oe=this.regexp_eatCharacterClassEscape(i);if(Oe)return Oe;i.pos=Ie}return null};dt.regexp_eatClassStringDisjunction=function(i){var Ie=i.pos;if(i.eatChars([92,113])){if(i.eat(123)){var Re=this.regexp_classStringDisjunctionContents(i);if(i.eat(125))return Re}else i.raise("Invalid escape");i.pos=Ie}return null};dt.regexp_classStringDisjunctionContents=function(i){var Ie=this.regexp_classString(i);while(i.eat(124))if(this.regexp_classString(i)===mn)Ie=mn;return Ie};dt.regexp_classString=function(i){var Ie=0;while(this.regexp_eatClassSetCharacter(i))Ie++;return Ie===1?Dn:mn};dt.regexp_eatClassSetCharacter=function(i){var Ie=i.pos;if(i.eat(92)){if(this.regexp_eatCharacterEscape(i)||this.regexp_eatClassSetReservedPunctuator(i))return!0;if(i.eat(98))return i.lastIntValue=8,!0;return i.pos=Ie,!1}var Re=i.current();if(Re<0||Re===i.lookahead()&&Bd(Re))return!1;if(Fd(Re))return!1;return i.advance(),i.lastIntValue=Re,!0};function Bd(i){return i===33||i>=35&&i<=38||i>=42&&i<=44||i===46||i>=58&&i<=64||i===94||i===96||i===126}function Fd(i){return i===40||i===41||i===45||i===47||i>=91&&i<=93||i>=123&&i<=125}dt.regexp_eatClassSetReservedPunctuator=function(i){var Ie=i.current();if(jd(Ie))return i.lastIntValue=Ie,i.advance(),!0;return!1};function jd(i){return i===33||i===35||i===37||i===38||i===44||i===45||i>=58&&i<=62||i===64||i===96||i===126}dt.regexp_eatClassControlLetter=function(i){var Ie=i.current();if(ps(Ie)||Ie===95)return i.lastIntValue=Ie%32,i.advance(),!0;return!1};dt.regexp_eatHexEscapeSequence=function(i){var Ie=i.pos;if(i.eat(120)){if(this.regexp_eatFixedHexDigits(i,2))return!0;if(i.switchU)i.raise("Invalid escape");i.pos=Ie}return!1};dt.regexp_eatDecimalDigits=function(i){var Ie=i.pos,Re=0;i.lastIntValue=0;while(ps(Re=i.current()))i.lastIntValue=10*i.lastIntValue+(Re-48),i.advance();return i.pos!==Ie};function ps(i){return i>=48&&i<=57}dt.regexp_eatHexDigits=function(i){var Ie=i.pos,Re=0;i.lastIntValue=0;while(nc(Re=i.current()))i.lastIntValue=16*i.lastIntValue+rc(Re),i.advance();return i.pos!==Ie};function nc(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}function rc(i){if(i>=65&&i<=70)return 10+(i-65);if(i>=97&&i<=102)return 10+(i-97);return i-48}dt.regexp_eatLegacyOctalEscapeSequence=function(i){if(this.regexp_eatOctalDigit(i)){var Ie=i.lastIntValue;if(this.regexp_eatOctalDigit(i)){var Re=i.lastIntValue;if(Ie<=3&&this.regexp_eatOctalDigit(i))i.lastIntValue=Ie*64+Re*8+i.lastIntValue;else i.lastIntValue=Ie*8+Re}else i.lastIntValue=Ie;return!0}return!1};dt.regexp_eatOctalDigit=function(i){var Ie=i.current();if(sc(Ie))return i.lastIntValue=Ie-48,i.advance(),!0;return i.lastIntValue=0,!1};function sc(i){return i>=48&&i<=55}dt.regexp_eatFixedHexDigits=function(i,Ie){var Re=i.pos;i.lastIntValue=0;for(var Le=0;Le<Ie;++Le){var Oe=i.current();if(!nc(Oe))return i.pos=Re,!1;i.lastIntValue=16*i.lastIntValue+rc(Oe),i.advance()}return!0};var us=function(Ie){if(this.type=Ie.type,this.value=Ie.value,this.start=Ie.start,this.end=Ie.end,Ie.options.locations)this.loc=new Pr(Ie,Ie.startLoc,Ie.endLoc);if(Ie.options.ranges)this.range=[Ie.start,Ie.end]},St=Ot.prototype;St.next=function(i){if(!i&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new us(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};St.getToken=function(){return this.next(),new us(this)};if(typeof Symbol<"u")St[Symbol.iterator]=function(){var i=this;return{next:function(){var Ie=i.getToken();return{done:Ie.type===He.eof,value:Ie}}}};St.nextToken=function(){var i=this.curContext();if(!i||!i.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(He.eof);if(i.override)return i.override(this);else this.readToken(this.fullCharCodeAtPos())};St.readToken=function(i){if(Zt(i,this.options.ecmaVersion>=6)||i===92)return this.readWord();return this.getTokenFromCode(i)};St.fullCharCodeAt=function(i){var Ie=this.input.charCodeAt(i);if(Ie<=55295||Ie>=56320)return Ie;var Re=this.input.charCodeAt(i+1);return Re<=56319||Re>=57344?Ie:(Ie<<10)+Re-56613888};St.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};St.skipBlockComment=function(){var i=this.options.onComment&&this.curPosition(),Ie=this.pos,Re=this.input.indexOf("*/",this.pos+=2);if(Re===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Re+2,this.options.locations)for(var Le=void 0,Oe=Ie;(Le=Na(this.input,Oe,this.pos))>-1;)++this.curLine,Oe=this.lineStart=Le;if(this.options.onComment)this.options.onComment(!0,this.input.slice(Ie+2,Re),Ie,this.pos,i,this.curPosition())};St.skipLineComment=function(i){var Ie=this.pos,Re=this.options.onComment&&this.curPosition(),Le=this.input.charCodeAt(this.pos+=i);while(this.pos<this.input.length&&!zn(Le))Le=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(Ie+i,this.pos),Ie,this.pos,Re,this.curPosition())};St.skipSpace=function(){e:while(this.pos<this.input.length){var i=this.input.charCodeAt(this.pos);switch(i){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(i>8&&i<14||i>=5760&&wi.test(String.fromCharCode(i)))++this.pos;else break e}}};St.finishToken=function(i,Ie){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var Re=this.type;this.type=i,this.value=Ie,this.updateContext(Re)};St.readToken_dot=function(){var i=this.input.charCodeAt(this.pos+1);if(i>=48&&i<=57)return this.readNumber(!0);var Ie=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&i===46&&Ie===46)return this.pos+=3,this.finishToken(He.ellipsis);else return++this.pos,this.finishToken(He.dot)};St.readToken_slash=function(){var i=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(i===61)return this.finishOp(He.assign,2);return this.finishOp(He.slash,1)};St.readToken_mult_modulo_exp=function(i){var Ie=this.input.charCodeAt(this.pos+1),Re=1,Le=i===42?He.star:He.modulo;if(this.options.ecmaVersion>=7&&i===42&&Ie===42)++Re,Le=He.starstar,Ie=this.input.charCodeAt(this.pos+2);if(Ie===61)return this.finishOp(He.assign,Re+1);return this.finishOp(Le,Re)};St.readToken_pipe_amp=function(i){var Ie=this.input.charCodeAt(this.pos+1);if(Ie===i){if(this.options.ecmaVersion>=12){var Re=this.input.charCodeAt(this.pos+2);if(Re===61)return this.finishOp(He.assign,3)}return this.finishOp(i===124?He.logicalOR:He.logicalAND,2)}if(Ie===61)return this.finishOp(He.assign,2);return this.finishOp(i===124?He.bitwiseOR:He.bitwiseAND,1)};St.readToken_caret=function(){var i=this.input.charCodeAt(this.pos+1);if(i===61)return this.finishOp(He.assign,2);return this.finishOp(He.bitwiseXOR,1)};St.readToken_plus_min=function(i){var Ie=this.input.charCodeAt(this.pos+1);if(Ie===i){if(Ie===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||en.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(He.incDec,2)}if(Ie===61)return this.finishOp(He.assign,2);return this.finishOp(He.plusMin,1)};St.readToken_lt_gt=function(i){var Ie=this.input.charCodeAt(this.pos+1),Re=1;if(Ie===i){if(Re=i===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Re)===61)return this.finishOp(He.assign,Re+1);return this.finishOp(He.bitShift,Re)}if(Ie===33&&i===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(Ie===61)Re=2;return this.finishOp(He.relational,Re)};St.readToken_eq_excl=function(i){var Ie=this.input.charCodeAt(this.pos+1);if(Ie===61)return this.finishOp(He.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(i===61&&Ie===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(He.arrow);return this.finishOp(i===61?He.eq:He.prefix,1)};St.readToken_question=function(){var i=this.options.ecmaVersion;if(i>=11){var Ie=this.input.charCodeAt(this.pos+1);if(Ie===46){var Re=this.input.charCodeAt(this.pos+2);if(Re<48||Re>57)return this.finishOp(He.questionDot,2)}if(Ie===63){if(i>=12){var Le=this.input.charCodeAt(this.pos+2);if(Le===61)return this.finishOp(He.assign,3)}return this.finishOp(He.coalesce,2)}}return this.finishOp(He.question,1)};St.readToken_numberSign=function(){var i=this.options.ecmaVersion,Ie=35;if(i>=13){if(++this.pos,Ie=this.fullCharCodeAtPos(),Zt(Ie,!0)||Ie===92)return this.finishToken(He.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+_n(Ie)+"'")};St.getTokenFromCode=function(i){switch(i){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(He.parenL);case 41:return++this.pos,this.finishToken(He.parenR);case 59:return++this.pos,this.finishToken(He.semi);case 44:return++this.pos,this.finishToken(He.comma);case 91:return++this.pos,this.finishToken(He.bracketL);case 93:return++this.pos,this.finishToken(He.bracketR);case 123:return++this.pos,this.finishToken(He.braceL);case 125:return++this.pos,this.finishToken(He.braceR);case 58:return++this.pos,this.finishToken(He.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(He.backQuote);case 48:var Ie=this.input.charCodeAt(this.pos+1);if(Ie===120||Ie===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(Ie===111||Ie===79)return this.readRadixNumber(8);if(Ie===98||Ie===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(i);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(i);case 124:case 38:return this.readToken_pipe_amp(i);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(i);case 60:case 62:return this.readToken_lt_gt(i);case 61:case 33:return this.readToken_eq_excl(i);case 63:return this.readToken_question();case 126:return this.finishOp(He.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+_n(i)+"'")};St.finishOp=function(i,Ie){var Re=this.input.slice(this.pos,this.pos+Ie);return this.pos+=Ie,this.finishToken(i,Re)};St.readRegexp=function(){var i,Ie,Re=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(Re,"Unterminated regular expression");var Le=this.input.charAt(this.pos);if(en.test(Le))this.raise(Re,"Unterminated regular expression");if(!i){if(Le==="[")Ie=!0;else if(Le==="]"&&Ie)Ie=!1;else if(Le==="/"&&!Ie)break;i=Le==="\\"}else i=!1;++this.pos}var Oe=this.input.slice(Re,this.pos);++this.pos;var $e=this.pos,Me=this.readWord1();if(this.containsEsc)this.unexpected($e);var Fe=this.regexpState||(this.regexpState=new Tn(this));Fe.reset(Re,Oe,Me),this.validateRegExpFlags(Fe),this.validateRegExpPattern(Fe);var je=null;try{je=new RegExp(Oe,Me)}catch(qe){}return this.finishToken(He.regexp,{pattern:Oe,flags:Me,value:je})};St.readInt=function(i,Ie,Re){var Le=this.options.ecmaVersion>=12&&Ie===void 0,Oe=Re&&this.input.charCodeAt(this.pos)===48,$e=this.pos,Me=0,Fe=0;for(var je=0,qe=Ie==null?1/0:Ie;je<qe;++je,++this.pos){var We=this.input.charCodeAt(this.pos),Ge=void 0;if(Le&&We===95){if(Oe)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(Fe===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(je===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");Fe=We;continue}if(We>=97)Ge=We-97+10;else if(We>=65)Ge=We-65+10;else if(We>=48&&We<=57)Ge=We-48;else Ge=1/0;if(Ge>=i)break;Fe=We,Me=Me*i+Ge}if(Le&&Fe===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===$e||Ie!=null&&this.pos-$e!==Ie)return null;return Me};function Vd(i,Ie){if(Ie)return parseInt(i,8);return parseFloat(i.replace(/_/g,""))}function ic(i){if(typeof BigInt!=="function")return null;return BigInt(i.replace(/_/g,""))}St.readRadixNumber=function(i){var Ie=this.pos;this.pos+=2;var Re=this.readInt(i);if(Re==null)this.raise(this.start+2,"Expected number in radix "+i);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)Re=ic(this.input.slice(Ie,this.pos)),++this.pos;else if(Zt(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(He.num,Re)};St.readNumber=function(i){var Ie=this.pos;if(!i&&this.readInt(10,void 0,!0)===null)this.raise(Ie,"Invalid number");var Re=this.pos-Ie>=2&&this.input.charCodeAt(Ie)===48;if(Re&&this.strict)this.raise(Ie,"Invalid number");var Le=this.input.charCodeAt(this.pos);if(!Re&&!i&&this.options.ecmaVersion>=11&&Le===110){var Oe=ic(this.input.slice(Ie,this.pos));if(++this.pos,Zt(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(He.num,Oe)}if(Re&&/[89]/.test(this.input.slice(Ie,this.pos)))Re=!1;if(Le===46&&!Re)++this.pos,this.readInt(10),Le=this.input.charCodeAt(this.pos);if((Le===69||Le===101)&&!Re){if(Le=this.input.charCodeAt(++this.pos),Le===43||Le===45)++this.pos;if(this.readInt(10)===null)this.raise(Ie,"Invalid number")}if(Zt(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var $e=Vd(this.input.slice(Ie,this.pos),Re);return this.finishToken(He.num,$e)};St.readCodePoint=function(){var i=this.input.charCodeAt(this.pos),Ie;if(i===123){if(this.options.ecmaVersion<6)this.unexpected();var Re=++this.pos;if(Ie=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,Ie>1114111)this.invalidStringToken(Re,"Code point out of bounds")}else Ie=this.readHexChar(4);return Ie};St.readString=function(i){var Ie="",Re=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var Le=this.input.charCodeAt(this.pos);if(Le===i)break;if(Le===92)Ie+=this.input.slice(Re,this.pos),Ie+=this.readEscapedChar(!1),Re=this.pos;else if(Le===8232||Le===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(zn(Le))this.raise(this.start,"Unterminated string constant");++this.pos}}return Ie+=this.input.slice(Re,this.pos++),this.finishToken(He.string,Ie)};var oc={};St.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(i){if(i===oc)this.readInvalidTemplateToken();else throw i}this.inTemplateElement=!1};St.invalidStringToken=function(i,Ie){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw oc;else this.raise(i,Ie)};St.readTmplToken=function(){var i="",Ie=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var Re=this.input.charCodeAt(this.pos);if(Re===96||Re===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===He.template||this.type===He.invalidTemplate))if(Re===36)return this.pos+=2,this.finishToken(He.dollarBraceL);else return++this.pos,this.finishToken(He.backQuote);return i+=this.input.slice(Ie,this.pos),this.finishToken(He.template,i)}if(Re===92)i+=this.input.slice(Ie,this.pos),i+=this.readEscapedChar(!0),Ie=this.pos;else if(zn(Re)){switch(i+=this.input.slice(Ie,this.pos),++this.pos,Re){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:i+=`
|
|
6
|
+
`;break;default:i+=String.fromCharCode(Re);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;Ie=this.pos}else++this.pos}};St.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(He.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
|
|
7
|
+
`)++this.pos;case`
|
|
8
|
+
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};St.readEscapedChar=function(i){var Ie=this.input.charCodeAt(++this.pos);switch(++this.pos,Ie){case 110:return`
|
|
9
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return _n(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(i){var Re=this.pos-1;this.invalidStringToken(Re,"Invalid escape sequence in template string")}default:if(Ie>=48&&Ie<=55){var Le=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],Oe=parseInt(Le,8);if(Oe>255)Le=Le.slice(0,-1),Oe=parseInt(Le,8);if(this.pos+=Le.length-1,Ie=this.input.charCodeAt(this.pos),(Le!=="0"||Ie===56||Ie===57)&&(this.strict||i))this.invalidStringToken(this.pos-1-Le.length,i?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(Oe)}if(zn(Ie)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(Ie)}};St.readHexChar=function(i){var Ie=this.pos,Re=this.readInt(16,i);if(Re===null)this.invalidStringToken(Ie,"Bad character escape sequence");return Re};St.readWord1=function(){this.containsEsc=!1;var i="",Ie=!0,Re=this.pos,Le=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var Oe=this.fullCharCodeAtPos();if(on(Oe,Le))this.pos+=Oe<=65535?1:2;else if(Oe===92){this.containsEsc=!0,i+=this.input.slice(Re,this.pos);var $e=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Me=this.readCodePoint();if(!(Ie?Zt:on)(Me,Le))this.invalidStringToken($e,"Invalid Unicode escape");i+=_n(Me),Re=this.pos}else break;Ie=!1}return i+this.input.slice(Re,this.pos)};St.readWord=function(){var i=this.readWord1(),Ie=He.name;if(this.keywords.test(i))Ie=os[i];return this.finishToken(Ie,i)};var ac="8.18.0";Ot.acorn={Parser:Ot,version:ac,defaultOptions:ts,Position:ar,SourceLocation:Pr,getLineInfo:Ai,Node:_r,TokenType:wt,tokTypes:He,keywordTypes:os,TokContext:hn,tokContexts:Lt,isIdentifierChar:on,isIdentifierStart:Zt,Token:us,isNewLine:zn,lineBreak:en,lineBreakG:Pa,nonASCIIwhitespace:wi};function Ri(i,Ie){return Ot.parse(i,Ie)}function Wd(i,Ie,Re){return Ot.parseExpressionAt(i,Ie,Re)}function qd(i,Ie){return Ot.tokenizer(i,Ie)}var pn=!0,Gd=new WeakMap;function Ud(i){let Ie=i.Parser.acorn||i,Re=Gd.get(Ie);if(!Re){let Fe=function(ct){return ct===Xe.name||ct===Xe.string||ct===Xe.num||Ze.includes(ct)||at.includes(ct)},je=function(ct){return ct===Xe.name||Ze.includes(ct)||at.includes(ct)},qe=function(ct){return ct===Xe.name||at.includes(ct)},We=function(ct){return ct===nt.abstract||ct===nt.declare||ct===nt.enum||ct===nt.module||ct===nt.namespace||ct===nt.interface||ct===nt.type},Ge=function(ct){return ct===nt.keyof||ct===nt.readonly||ct===nt.unique},ze=function(ct){return ct===Xe.invalidTemplate},{tokTypes:Xe,keywordTypes:Qe}=Ie,Ze=Object.values(Qe),nt=Me(),at=Object.values(nt),pt=$e(),tt=Oe(),lt=new RegExp(`^(?:${Object.keys(nt).join("|")})$`);pt.jsxTagStart.updateContext=function(){this.context.push(tt.tc_expr),this.context.push(tt.tc_oTag),this.exprAllowed=!1},pt.jsxTagEnd.updateContext=function(ct){let Nt=this.context.pop();if(Nt===tt.tc_oTag&&ct===Xe.slash||Nt===tt.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===tt.tc_expr;else this.exprAllowed=!0},Re={tokTypes:{...nt,...pt},tokContexts:{...tt},keywordsRegExp:lt,tokenIsLiteralPropertyName:Fe,tokenIsKeywordOrIdentifier:je,tokenIsIdentifier:qe,tokenIsTSDeclarationStart:We,tokenIsTSTypeOperator:Ge,tokenIsTemplate:ze}}return Re;function Le(Fe,je={}){return new Ie.TokenType("name",je)}function Oe(){return{tc_oTag:new Ie.TokContext("<tag",!1,!1),tc_cTag:new Ie.TokContext("</tag",!1,!1),tc_expr:new Ie.TokContext("<tag>...</tag>",!0,!0)}}function $e(){return{at:new Ie.TokenType("@"),jsxName:new Ie.TokenType("jsxName"),jsxText:new Ie.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new Ie.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new Ie.TokenType("jsxTagEnd")}}function Me(){return{assert:Le("assert",{startsExpr:pn}),asserts:Le("asserts",{startsExpr:pn}),global:Le("global",{startsExpr:pn}),keyof:Le("keyof",{startsExpr:pn}),readonly:Le("readonly",{startsExpr:pn}),unique:Le("unique",{startsExpr:pn}),abstract:Le("abstract",{startsExpr:pn}),declare:Le("declare",{startsExpr:pn}),enum:Le("enum",{startsExpr:pn}),module:Le("module",{startsExpr:pn}),namespace:Le("namespace",{startsExpr:pn}),interface:Le("interface",{startsExpr:pn}),type:Le("type",{startsExpr:pn})}}}var Hd=1048576,Ir=2097152,ur=1,hs=2,Kd=4,Bi=8,zd=16,mc=64,yc=128,Xd=256,Jd=512,gc=1024,Nb=ur|hs|Bi|yc,_b=ur|0|Bi|0,Db=ur|0|Kd|0,Ib=ur|0|zd|0,Rb=0|hs|0|yc,Lb=0|hs|0|0,Yd=ur|hs|Bi|Xd,Ob=0|gc,Mb=0|mc,$b=ur|0|0|mc,Bb=Yd|Jd,Fb=0|gc,xc=4,bc=2,Ec=1,jb=bc|Ec,Vb=bc|xc,Wb=Ec|xc,Qd=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,cc=new RegExp("(?=("+Qd.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),Rr=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function Zd(i,Ie){let Re="true";if(Ie.type==="MethodDefinition"&&(Ie.kind==="get"||Ie.kind==="set"))Re=(Ie.static?"s":"i")+Ie.kind;if(i==="iget"&&Re==="iset"||i==="iset"&&Re==="iget"||i==="sget"&&Re==="sset"||i==="sset"&&Re==="sget")return[!1,"true"];if(!i)return[!1,Re];return[!0,i]}function lc(i,Ie){let{computed:Re,key:Le}=i;return!Re&&(Le.type==="Identifier"&&Le.name===Ie||Le.type==="Literal"&&Le.value===Ie)}var ft={AbstractMethodHasImplementation:({methodName:i})=>`Method '${i}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:i})=>`Property '${i}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",CannotFindName:({name:i})=>`Cannot find name '${i}'.`,ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:i})=>`'declare' is not allowed in ${i}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:()=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:i})=>`Duplicate modifier: '${i}'.`,EmptyHeritageClauseType:({token:i})=>`'${i}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",IncompatibleModifiers:({modifiers:i})=>`'${i[0]}' modifier cannot be used with '${i[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:i})=>`Index signatures cannot have an accessibility modifier ('${i}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:i})=>`'${i}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:i})=>`'${i}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:i})=>`'${i}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:i})=>`'${i[0]}' modifier must precede '${i[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:i})=>`Private elements cannot have an accessibility modifier ('${i}').`,PrivateMethodsHasAccessibility:({modifier:i})=>`Private methods cannot have an accessibility modifier ('${i}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:i})=>`Single type parameter ${i} should have a trailing comma. Example usage: <${i},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",GenericsEndWithComma:"Trailing comma is not allowed at the end of generics.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:i})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${i}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},fs={UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",TrailingDecorator:"Decorators must be attached to a class element.",SpreadElementDecorator:"Decorators can't be used with SpreadElement"};function ef(i,Ie,Re){let{tokTypes:Le}=Re,{tokTypes:Oe}=Ie;return class extends i{takeDecorators(Me){let Fe=this.decoratorStack[this.decoratorStack.length-1];if(Fe.length)Me.decorators=Fe,this.resetStartLocationFromNode(Me,Fe[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(Me){let Fe=this.decoratorStack[this.decoratorStack.length-1];while(this.match(Oe.at)){let je=this.parseDecorator();Fe.push(je)}if(this.match(Le._export)){if(!Me)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,fs.UnexpectedLeadingDecorator)}parseDecorator(){let Me=this.startNode();this.next(),this.decoratorStack.push([]);let Fe=this.start,je=this.startLoc,qe;if(this.match(Le.parenL)){let We=this.start,Ge=this.startLoc;if(this.next(),qe=this.parseExpression(),this.expect(Le.parenR),this.options.preserveParens){let ze=this.startNodeAt(We,Ge);ze.expression=qe,qe=this.finishNode(ze,"ParenthesizedExpression")}}else{qe=this.parseIdent(!1);while(this.eat(Le.dot)){let We=this.startNodeAt(Fe,je);We.object=qe,We.property=this.parseIdent(!0),We.computed=!1,qe=this.finishNode(We,"MemberExpression")}}return Me.expression=this.parseMaybeDecoratorArguments(qe),this.decoratorStack.pop(),this.finishNode(Me,"Decorator")}parseMaybeDecoratorArguments(Me){if(this.eat(Le.parenL)){let Fe=this.startNodeAtNode(Me);return Fe.callee=Me,Fe.arguments=this.parseExprList(Le.parenR,!1),this.finishNode(Fe,"CallExpression")}return Me}}}var pc={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},tf=/^[\da-fA-F]+$/,nf=/^\d+$/;function Lr(i){if(!i)return i;if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return Lr(i.object)+"."+Lr(i.property)}function rf(i,Ie,Re,Le){let Oe=i.tokTypes,$e=Ie.tokTypes,{isNewLine:Me,isIdentifierChar:Fe}=i,je=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},Le||{});return class extends Re{jsx_readToken(){let We="",Ge=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");let ze=this.input.charCodeAt(this.pos);switch(ze){case 60:case 123:if(this.pos===this.start){if(ze===60&&this.exprAllowed)return++this.pos,this.finishToken($e.jsxTagStart);return this.getTokenFromCode(ze)}return We+=this.input.slice(Ge,this.pos),this.finishToken($e.jsxText,We);case 38:We+=this.input.slice(Ge,this.pos),We+=this.jsx_readEntity(),Ge=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(ze===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(Me(ze))We+=this.input.slice(Ge,this.pos),We+=this.jsx_readNewLine(!0),Ge=this.pos;else++this.pos}}}jsx_readNewLine(We){let Ge=this.input.charCodeAt(this.pos),ze;if(++this.pos,Ge===13&&this.input.charCodeAt(this.pos)===10)++this.pos,ze=We?`
|
|
10
|
+
`:`\r
|
|
11
|
+
`;else ze=String.fromCharCode(Ge);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return ze}jsx_readString(We){let Ge="",ze=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let Xe=this.input.charCodeAt(this.pos);if(Xe===We)break;if(Xe===38)Ge+=this.input.slice(ze,this.pos),Ge+=this.jsx_readEntity(),ze=this.pos;else if(Me(Xe))Ge+=this.input.slice(ze,this.pos),Ge+=this.jsx_readNewLine(!1),ze=this.pos;else++this.pos}return Ge+=this.input.slice(ze,this.pos++),this.finishToken(Oe.string,Ge)}jsx_readEntity(){let We="",Ge=0,ze,Xe=this.input[this.pos];if(Xe!=="&")this.raise(this.pos,"Entity must start with an ampersand");let Qe=++this.pos;while(this.pos<this.input.length&&Ge++<10){if(Xe=this.input[this.pos++],Xe===";"){if(We[0]==="#"){let Ze;if(We[1]==="x"||We[1]==="X"){if(We=We.substr(2),tf.test(We))Ze=parseInt(We,16)}else if(We=We.substr(1),nf.test(We))Ze=parseInt(We,10);if(Ze!==void 0&&Ze<=1114111)ze=String.fromCodePoint(Ze)}else if(Object.prototype.hasOwnProperty.call(pc,We))ze=pc[We];break}We+=Xe}if(ze===void 0)return this.pos=Qe,"&";return ze}jsx_readWord(){let We,Ge=this.pos;do We=this.input.charCodeAt(++this.pos);while(Fe(We)||We===45);return this.finishToken($e.jsxName,this.input.slice(Ge,this.pos))}jsx_parseIdentifier(){let We=this.startNode();if(this.type===$e.jsxName)We.name=this.value;else if(this.type.keyword)We.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(We,"JSXIdentifier")}jsx_parseNamespacedName(){let We=this.start,Ge=this.startLoc,ze=this.jsx_parseIdentifier();if(!je.allowNamespaces||!this.eat(Oe.colon))return ze;var Xe=this.startNodeAt(We,Ge);return Xe.namespace=ze,Xe.name=this.jsx_parseIdentifier(),this.finishNode(Xe,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===$e.jsxTagEnd)return"";let We=this.start,Ge=this.startLoc,ze=this.jsx_parseNamespacedName();if(this.type===Oe.dot&&ze.type==="JSXNamespacedName"&&!je.allowNamespacedObjects)this.unexpected();while(this.eat(Oe.dot)){let Xe=this.startNodeAt(We,Ge);Xe.object=ze,Xe.property=this.jsx_parseIdentifier(),ze=this.finishNode(Xe,"JSXMemberExpression")}return ze}jsx_parseAttributeValue(){switch(this.type){case Oe.braceL:let We=this.jsx_parseExpressionContainer();if(We.expression.type==="JSXEmptyExpression")this.raise(We.start,"JSX attributes must only be assigned a non-empty expression");return We;case $e.jsxTagStart:case Oe.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let We=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(We,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let We=this.startNode();if(this.next(),this.eat(Oe.ellipsis))return We.expression=this.parseExpression(),this.expect(Oe.braceR),this.finishNode(We,"JSXSpreadChild");return We.expression=this.type===Oe.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(Oe.braceR),this.finishNode(We,"JSXExpressionContainer")}jsx_parseAttribute(){let We=this.startNode();if(this.eat(Oe.braceL))return this.expect(Oe.ellipsis),We.argument=this.parseMaybeAssign(),this.expect(Oe.braceR),this.finishNode(We,"JSXSpreadAttribute");return We.name=this.jsx_parseNamespacedName(),We.value=this.eat(Oe.eq)?this.jsx_parseAttributeValue():null,this.finishNode(We,"JSXAttribute")}jsx_parseOpeningElementAt(We,Ge){let ze=this.startNodeAt(We,Ge);ze.attributes=[];let Xe=this.jsx_parseElementName();if(Xe)ze.name=Xe;while(this.type!==Oe.slash&&this.type!==$e.jsxTagEnd)ze.attributes.push(this.jsx_parseAttribute());return ze.selfClosing=this.eat(Oe.slash),this.expect($e.jsxTagEnd),this.finishNode(ze,Xe?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(We,Ge){let ze=this.startNodeAt(We,Ge),Xe=this.jsx_parseElementName();if(Xe)ze.name=Xe;return this.expect($e.jsxTagEnd),this.finishNode(ze,Xe?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(We,Ge){let ze=this.startNodeAt(We,Ge),Xe=[],Qe=this.jsx_parseOpeningElementAt(We,Ge),Ze=null;if(!Qe.selfClosing){e:for(;;)switch(this.type){case $e.jsxTagStart:if(We=this.start,Ge=this.startLoc,this.next(),this.eat(Oe.slash)){Ze=this.jsx_parseClosingElementAt(We,Ge);break e}Xe.push(this.jsx_parseElementAt(We,Ge));break;case $e.jsxText:Xe.push(this.parseExprAtom());break;case Oe.braceL:Xe.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(Lr(Ze.name)!==Lr(Qe.name))this.raise(Ze.start,"Expected corresponding JSX closing tag for <"+Lr(Qe.name)+">")}let nt=Qe.name?"Element":"Fragment";if(ze["opening"+nt]=Qe,ze["closing"+nt]=Ze,ze.children=Xe,this.type===Oe.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(ze,"JSX"+nt)}jsx_parseText(){let We=this.parseLiteral(this.value);return We.type="JSXText",We}jsx_parseElement(){let We=this.start,Ge=this.startLoc;return this.next(),this.jsx_parseElementAt(We,Ge)}}}function sf(i,Ie,Re){let{tokTypes:Le}=Ie,{tokTypes:Oe}=Re;return class extends i{parseMaybeImportAttributes(Me){if(this.type===Oe._with||this.type===Le.assert){this.next();let Fe=this.parseImportAttributes();if(Fe)Me.attributes=Fe}}parseImportAttributes(){this.expect(Oe.braceL);let Me=this.parseWithEntries();return this.expect(Oe.braceR),Me}parseWithEntries(){let Me=[],Fe=new Set;do{if(this.type===Oe.braceR)break;let je=this.startNode(),qe;if(this.type===Oe.string)qe=this.parseLiteral(this.value);else qe=this.parseIdent(!0);if(this.next(),je.key=qe,Fe.has(je.key.name))this.raise(this.pos,"Duplicated key in attributes");if(Fe.add(je.key.name),this.type!==Oe.string)this.raise(this.pos,"Only string is supported as an attribute value");je.value=this.parseLiteral(this.value),Me.push(this.finishNode(je,"ImportAttribute"))}while(this.eat(Oe.comma));return Me}}}var Oi=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function Cc(){return{_tag:"BufferedParserEvents",segments:[]}}var of=Cc();function uc(i){return i.segments.length>0}var af=class{constructor(i,Ie){this.options=i,this.state=Ie,this.callbacks={},this.callbackWrappers={},this.frames=[],this.undoLog=[],this.hasCallbacks=this.captureCallbacks()}get active(){return this.frames.length>0}begin(){let i={_tag:"ParseEffectFrame",depth:this.frames.length,undoMark:this.undoLog.length,checkpoint:this.state?.capture()};if(this.frames.push(i),i.depth===0&&this.hasCallbacks)this.activateCallbacks();return i}commit(i){this.close(i);let Ie=this.currentFrame();if(Ie){if(i.output)this.appendOutput(this.outputFor(Ie),i.output);return}if(this.undoLog.length=i.undoMark,i.output)this.flush(i.output)}rollback(i){this.close(i),this.unwind(i.undoMark),this.restore(i)}rollbackWithEvents(i){return this.close(i),this.unwind(i.undoMark),this.restore(i),i.output??of}replay(i){if(!uc(i))return;let Ie=this.currentFrame();if(Ie){this.appendOutput(this.outputFor(Ie),i);return}this.flush(i)}set(i,Ie,Re){this.willSet(i,Ie),i[Ie]=Re}remove(i,Ie){this.willSet(i,Ie),delete i[Ie]}append(i,Ie){this.willAppend(i),i.push(Ie)}pop(i){return this.willMutateTail(i,1),i.pop()}truncate(i,Ie){if(Ie<i.length)this.willMutateTail(i,i.length-Ie);else this.willAppend(i);i.length=Ie}modify(i,Ie,Re){let[Le,Oe]=Re(i[Ie]);return this.set(i,Ie,Oe),Le}willAppend(i){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:i,length:i.length})}willMutateTail(i,Ie){if(!this.active)return;let Re=Math.max(0,i.length-Ie);this.undoLog.push({_tag:"ArrayTail",target:i,start:Re,values:i.slice(Re)})}willSet(i,Ie){if(!this.active)return;let Re=i;this.undoLog.push({_tag:"Property",target:Re,key:Ie,had:Object.prototype.hasOwnProperty.call(Re,Ie),value:Re[Ie]})}captureCallbacks(){let i=!1;for(let Ie of Oi){let Re=this.options[Ie];if(!Re)continue;i=!0,this.callbacks[Ie]=Re,this.callbackWrappers[Ie]=(...Le)=>{this.emit({name:Ie,args:Le})}}return i}activateCallbacks(){for(let i of Oi){let Ie=this.callbackWrappers[i];if(Ie)this.options[i]=Ie}}deactivateCallbacks(){for(let i of Oi){let Ie=this.callbacks[i];if(Ie)this.options[i]=Ie}}emit(i){let Ie=this.currentFrame();if(!Ie){this.invoke(i);return}let Re=this.outputFor(Ie).segments,Le=Re[Re.length-1];if(Array.isArray(Le))Le.push(i);else Re.push([i])}appendOutput(i,Ie){if(uc(Ie))i.segments.push(Ie)}outputFor(i){return i.output??=Cc()}flush(i){let Ie=[];for(let Re=i.segments.length-1;Re>=0;Re--)Ie.push(i.segments[Re]);while(Ie.length>0){let Re=Ie.pop();if(Array.isArray(Re)){for(let Le of Re)this.invoke(Le);continue}for(let Le=Re.segments.length-1;Le>=0;Le--)Ie.push(Re.segments[Le])}}invoke(i){this.callbacks[i.name]?.apply(this.options,i.args)}currentFrame(){return this.frames[this.frames.length-1]}close(i){if(this.currentFrame()!==i||i.depth!==this.frames.length-1)throw Error("Parse effect scopes must be closed in order");if(this.frames.pop(),this.frames.length===0&&this.hasCallbacks)this.deactivateCallbacks()}restore(i){if(this.state)this.state.restore(i.checkpoint)}unwind(i){for(let Ie=this.undoLog.length-1;Ie>=i;Ie--){let Re=this.undoLog[Ie];switch(Re._tag){case"ArrayLength":if(Re.target.length<Re.length)throw Error("A parse effect shortened an append-only array");Re.target.length=Re.length;break;case"ArrayTail":Re.target.length=Re.start;for(let Le of Re.values)Re.target.push(Le);break;case"Property":if(Re.had)Re.target[Re.key]=Re.value;else delete Re.target[Re.key];break}}this.undoLog.length=i}};function pr(i,Ie,Re){if(i.length===Ie)return i;if(i.length<Ie)throw Error(`A parse branch shortened the ${Re} below its checkpoint`);return i.length=Ie,i}function cf(i){return{lookahead:i.getCurLookaheadState(),context:i.context,contextLength:i.context.length,scopeStack:i.scopeStack,scopeStackLength:i.scopeStack.length,importsStack:i.importsStack,importsStackLength:i.importsStack.length,labels:i.labels,labelsLength:i.labels.length,privateNameStack:i.privateNameStack,privateNameStackLength:i.privateNameStack.length,decoratorStack:i.decoratorStack,decoratorStackLength:i.decoratorStack.length,strict:i.strict,potentialArrowAt:i.potentialArrowAt,potentialArrowInForAwait:i.potentialArrowInForAwait,yieldPos:i.yieldPos,awaitPos:i.awaitPos,awaitIdentPos:i.awaitIdentPos,preValue:i.preValue,preToken:i.preToken,isLookahead:i.isLookahead,isAmbientContext:i.isAmbientContext,inAbstractClass:i.inAbstractClass,inType:i.inType,inDisallowConditionalTypesContext:i.inDisallowConditionalTypesContext,maybeInArrowParameters:i.maybeInArrowParameters,shouldParseArrowReturnType:i.shouldParseArrowReturnType,shouldParseAsyncArrowReturnType:i.shouldParseAsyncArrowReturnType,importOrExportOuterKind:i.importOrExportOuterKind}}function lf(i,Ie){i.setLookaheadTokenState(Ie.lookahead),i.context=pr(Ie.context,Ie.contextLength,"token context stack"),i.scopeStack=pr(Ie.scopeStack,Ie.scopeStackLength,"scope stack"),i.importsStack=pr(Ie.importsStack,Ie.importsStackLength,"import stack"),i.labels=pr(Ie.labels,Ie.labelsLength,"label stack"),i.privateNameStack=pr(Ie.privateNameStack,Ie.privateNameStackLength,"private-name stack"),i.decoratorStack=pr(Ie.decoratorStack,Ie.decoratorStackLength,"decorator stack"),i.strict=Ie.strict,i.potentialArrowAt=Ie.potentialArrowAt,i.potentialArrowInForAwait=Ie.potentialArrowInForAwait,i.yieldPos=Ie.yieldPos,i.awaitPos=Ie.awaitPos,i.awaitIdentPos=Ie.awaitIdentPos,i.regexpState=null,i.preValue=Ie.preValue,i.preToken=Ie.preToken,i.isLookahead=Ie.isLookahead,i.isAmbientContext=Ie.isAmbientContext,i.inAbstractClass=Ie.inAbstractClass,i.inType=Ie.inType,i.inDisallowConditionalTypesContext=Ie.inDisallowConditionalTypesContext,i.maybeInArrowParameters=Ie.maybeInArrowParameters,i.shouldParseArrowReturnType=Ie.shouldParseArrowReturnType,i.shouldParseAsyncArrowReturnType=Ie.shouldParseAsyncArrowReturnType,i.importOrExportOuterKind=Ie.importOrExportOuterKind}function pf(i){return{capture:()=>cf(i),restore:(Ie)=>lf(i,Ie)}}function uf(i,Ie){let{acornTokenTypes:Re,typeScriptTokenTypes:Le,scope:Oe}=Ie,$e=Oe.SCOPE_TOP|Oe.SCOPE_FUNCTION|Oe.SCOPE_CLASS_STATIC_BLOCK;return class extends i{constructor(Fe,je,qe){super(Fe,je,qe);this.parseEffects=new af(this.options,pf(this))}overrideContext(Fe){if(this.curContext()!==Fe)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(Fe)}takeDecorators(Fe){let je=this.decoratorStack.length-1;if(this.decoratorStack[je].length>0)this.parseEffects?.willSet(this.decoratorStack,String(je));return super.takeDecorators(Fe)}parseDecorators(Fe){let je=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(je),super.parseDecorators(Fe)}parseDecorator(){return this.parseEffects?.willAppend(this.decoratorStack),super.parseDecorator()}parseIdentNode(){if((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.parseEffects?.willMutateTail(this.context,1);return super.parseIdentNode()}parseLabeledStatement(Fe,je,qe,We){for(let Ge=this.labels.length-1;Ge>=0;Ge--){let ze=this.labels[Ge];if(ze.statementStart!==Fe.start)break;this.parseEffects?.willSet(ze,"statementStart"),this.parseEffects?.willSet(ze,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(Fe,je,qe,We)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let Fe=this.privateNameStack[this.privateNameStack.length-2];if(Fe)this.parseEffects?.willAppend(Fe.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let Fe=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(Fe.used)}return super.parsePrivateIdent()}parseClassField(Fe){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(Fe)}updateContext(Fe){let{type:je}=this;if(je===Re.parenR||je===Re.braceR||je===Re.braceL||je===Re.dollarBraceL||je===Re.parenL||je===Re._function||je===Re._class||je===Re.colon||je===Re.backQuote||je===Re.star||je===Le.jsxTagStart||je===Le.jsxTagEnd||je===Re.slash&&Fe===Le.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(Fe)}enterScope(Fe){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(Fe)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(Fe,je,qe){let We=this.parseEffects;if(We?.active)if(je===Oe.BIND_LEXICAL){let Ge=this.currentScope();if(We.willAppend(Ge.lexical),this.inModule&&Ge.flags&Oe.SCOPE_TOP)We.willSet(this.undefinedExports,Fe)}else if(je===Oe.BIND_SIMPLE_CATCH)We.willAppend(this.currentScope().lexical);else if(je===Oe.BIND_FUNCTION)We.willAppend(this.currentScope().functions);else for(let Ge=this.scopeStack.length-1;Ge>=0;Ge--){let ze=this.scopeStack[Ge];if(We.willAppend(ze.var),this.inModule&&ze.flags&Oe.SCOPE_TOP)We.willSet(this.undefinedExports,Fe);if(ze.flags&$e)break}return super.declareName(Fe,je,qe)}checkLocalExport(Fe){return this.parseEffects?.willSet(this.undefinedExports,Fe.name),super.checkLocalExport(Fe)}}}var Mi=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function dc(i){if(!i)throw Error("Assert fail")}function df(i){return i==="accessor"}function ff(i){return i==="in"||i==="out"}var ds=1,fc=2,hf=4,Tt={SCOPE_TOP:1,SCOPE_FUNCTION:2,SCOPE_ASYNC:4,SCOPE_GENERATOR:8,SCOPE_ARROW:16,SCOPE_SIMPLE_CATCH:32,SCOPE_SUPER:64,SCOPE_DIRECT_SUPER:128,SCOPE_CLASS_STATIC_BLOCK:256,SCOPE_VAR:256,BIND_NONE:0,BIND_VAR:1,BIND_LEXICAL:2,BIND_FUNCTION:3,BIND_SIMPLE_CATCH:4,BIND_OUTSIDE:5,BIND_TS_TYPE:6,BIND_TS_INTERFACE:7,BIND_TS_NAMESPACE:1032,BIND_FLAGS_TS_EXPORT_ONLY:1024,BIND_FLAGS_TS_IMPORT:4096,BIND_FLAGS_TS_ENUM:256,BIND_FLAGS_TS_CONST_ENUM:512,BIND_TS_ENUM:258,BIND_TS_CONST_ENUM:770,BIND_FLAGS_CLASS:128};function $i(i,Ie){return Tt.SCOPE_FUNCTION|(i?Tt.SCOPE_ASYNC:0)|(Ie?Tt.SCOPE_GENERATOR:0)}function mf(i){if(i.type!=="MemberExpression")return!1;let{computed:Ie,property:Re}=i;if(Ie&&(Re.type!=="TemplateLiteral"||Re.expressions.length>0))return!1;return vc(i.object)}function yf(i){return i.type==="UnaryExpression"&&(i.operator==="-"||i.operator==="+")&&i.argument.type==="Literal"&&(typeof i.argument.value==="number"||typeof i.argument.value==="bigint")}function vc(i){if(i.type==="Identifier")return!0;if(i.type!=="MemberExpression")return!1;if(i.computed)return!1;return vc(i.object)}function hc(i){return i==="private"||i==="public"||i==="protected"}function gf(i){return Boolean(i.startsExpr)}function xf(i){if(i==null)throw Error(`Unexpected ${i} value.`);return i}function bf(i){switch(i){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function Sc(i){let{dts:Ie=!1}=i||{},Re=!!i?.jsx;return function(Le){let Oe=Le.acorn||Li,$e=Ud(Oe),{tokTypes:Me,keywordTypes:Fe,isIdentifierStart:je,lineBreak:qe,isNewLine:We,tokContexts:Ge,isIdentifierChar:ze}=Oe,{tokTypes:Xe,tokContexts:Qe,keywordsRegExp:Ze,tokenIsLiteralPropertyName:nt,tokenIsTemplate:at,tokenIsTSDeclarationStart:pt,tokenIsIdentifier:tt,tokenIsKeywordOrIdentifier:lt,tokenIsTSTypeOperator:ct}=$e;function Nt(Be,Ve,Ue=Be.length){for(let Ke=Ve;Ke<Ue;Ke++){let Je=Be.charCodeAt(Ke);if(We(Je))return Ke<Ue-1&&Je===13&&Be.charCodeAt(Ke+1)===10?Ke+2:Ke+1}return-1}if(Le=ef(Le,$e,Oe),i?.jsx)Le=rf(Oe,$e,Le,typeof i.jsx==="boolean"?{}:i.jsx);Le=sf(Le,$e,Oe);let Et=uf(Le,{acornTokenTypes:Me,typeScriptTokenTypes:Xe,scope:Tt});class vt extends Et{constructor(Be,Ve,Ue){super(Be,Ve,Ue);this.preValue=null,this.preToken=null,this.isLookahead=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inType=!1,this.inDisallowConditionalTypesContext=!1,this.maybeInArrowParameters=!1,this.shouldParseArrowReturnType=void 0,this.shouldParseAsyncArrowReturnType=void 0,this.decoratorStack=[[]],this.importsStack=[[]],this.importOrExportOuterKind=void 0,this.tsParseConstModifier=(Ke)=>{this.tsParseModifiers({modified:Ke,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:ft.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return $e}get acornTypeScript(){return $e}getTokenFromCodeInType(Be){if(Be===62)return this.finishOp(Me.relational,1);if(Be===60)return this.finishOp(Me.relational,1);return super.getTokenFromCode(Be)}readToken(Be){if(!this.inType){let Ve=this.curContext();if(Ve===Qe.tc_expr)return this.jsx_readToken();if(Ve===Qe.tc_oTag||Ve===Qe.tc_cTag){if(je(Be))return this.jsx_readWord();if(Be==62)return++this.pos,this.finishToken(Xe.jsxTagEnd);if((Be===34||Be===39)&&Ve==Qe.tc_oTag)return this.jsx_readString(Be)}if(Be===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,i?.jsx)return this.finishToken(Xe.jsxTagStart);else return this.finishToken(Me.relational,"<")}return super.readToken(Be)}getTokenFromCode(Be){if(this.inType)return this.getTokenFromCodeInType(Be);if(Be===64)return++this.pos,this.finishToken(Xe.at);return super.getTokenFromCode(Be)}isAbstractClass(){return this.ts_isContextual(Xe.abstract)&&this.lookahead().type===Me._class}isDeclareClass(){if(!this.ts_isContextual(Xe.declare))return!1;let Be=this.nextTokenStart();if(this.isUnparsedContextual(Be,"class"))return!0;if(!this.isUnparsedContextual(Be,"abstract"))return!1;let Ve=this.nextTokenStartSince(Be+8);return this.isUnparsedContextual(Ve,"class")}finishNode(Be,Ve){if(Be.type!==""&&Be.end!==0)return Be;return super.finishNode(Be,Ve)}tryParse(Be){let Ve={},Ue=this.beginParseEffectScope(),Ke;try{Ke=Be(()=>{throw Ve})}catch(Je){let Ye=Je===Ve;if(!Ye&&!(Je instanceof SyntaxError))throw this.parseEffects.rollback(Ue),Je;let rt={events:this.parseEffects.rollbackWithEvents(Ue),selected:!1};return Ye?{node:null,error:null,thrown:!1,aborted:!0,failState:rt}:{node:null,error:Je,thrown:!0,aborted:!1,failState:rt}}return this.parseEffects.commit(Ue),{node:Ke,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError(Be,Ve){Be.optionalParametersLoc=Ve?.loc??this.startLoc}reScan_lt_gt(){if(this.type===Me.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:Be}=this;if(Be===Me.bitShift)return this.pos-=2,this.finishOp(Me.relational,1),Me.relational;return Be}resetEndLocation(Be,Ve=this.lastTokEnd,Ue=this.lastTokEndLoc){if(Be.end=Ve,Be.loc.end=Ue,this.options.ranges)Be.range[1]=Ve}startNodeAtNode(Be){return super.startNodeAt(Be.start,Be.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(Be,Ve){return Ve.some((Ue)=>{if(hc(Ue))return Be.accessibility===Ue;return!!Be[Ue]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(Be){Be.forEach((Ve)=>{if(Ve?.type==="TSTypeCastExpression")this.raise(Ve.typeAnnotation.start,ft.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(Be){return Be.type==="Identifier"&&Be.name==="async"&&this.lastTokEnd===Be.end&&!this.canInsertSemicolon()&&Be.end-Be.start===5&&Be.start===this.potentialArrowAt}tsIsIdentifier(){return tt(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(Me.colon)?this.tsParseTypeOrTypePredicateAnnotation(Me.colon):void 0}tsTryParseGenericAsyncArrowFunction(Be,Ve,Ue){if(!this.tsMatchLeftRelational())return;let Ke=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let Je=this.tsTryParseAndCatch(()=>{let Ye=this.startNodeAt(Be,Ve);return Ye.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(Ye),Ye.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(Me.arrow),Ye});if(this.maybeInArrowParameters=Ke,!Je)return;return this.parseArrowExpression(Je,Je.params,!0,Ue)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==Me.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext(Be){let Ve=this.context;this.context=[Ve[0]];try{return Be()}finally{this.context=Ve}}tsTryParseTypeAnnotation(){return this.match(Me.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(Be,Ve){let Ue=Be+Ve.length;if(this.input.slice(Be,Ue)===Ve){let Ke=this.input.charCodeAt(Ue);return!(ze(Ke)||(Ke&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(Xe.abstract)&&this.lookahead().type===Me._new}nextTokenStartSince(Be){return Mi.lastIndex=Be,Mi.test(this.input)?Mi.lastIndex:Be}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}createLookaheadState(){this.value=null,this.context=[this.curContext()]}getCurLookaheadState(){return{endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,pos:this.pos,value:this.value,type:this.type,exprAllowed:this.exprAllowed,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,containsEsc:this.containsEsc}}setLookaheadTokenState(Be){this.pos=Be.pos,this.value=Be.value,this.exprAllowed=Be.exprAllowed,this.endLoc=Be.endLoc,this.lastTokEnd=Be.lastTokEnd,this.lastTokStart=Be.lastTokStart,this.lastTokStartLoc=Be.lastTokStartLoc,this.type=Be.type,this.start=Be.start,this.end=Be.end,this.startLoc=Be.startLoc,this.lastTokEndLoc=Be.lastTokEndLoc,this.curLine=Be.curLine,this.lineStart=Be.lineStart,this.containsEsc=Be.containsEsc}setLookaheadState(Be){this.setLookaheadTokenState(Be),this.context=Be.context&&Be.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult(Be){let Ve=Be.failState;if(!Ve)return;if(Ve.selected)throw Error("A parse branch result can only be selected once");Ve.selected=!0,this.parseEffects.replay(Ve.events)}tsLookAhead(Be){let Ve=this.beginParseEffectScope();try{return Be()}finally{this.parseEffects.rollback(Ve)}}lookahead(Be){let Ve=this.getCurLookaheadState(),Ue=this.context,Ke=this.preValue,Je=this.preToken,Ye=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,Be!==void 0)for(let rt=0;rt<Be;rt++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(Ve),this.context=Ue,this.preValue=Ke,this.preToken=Je,this.isLookahead=Ye}}readWord(){let Be=this.readWord1(),Ve=Me.name;if(this.keywords.test(Be))Ve=Fe[Be];else if(new RegExp(Ze).test(Be))Ve=Xe[Be];return this.finishToken(Ve,Be)}skipBlockComment(){let Be;if(!this.isLookahead)Be=this.options.onComment&&this.curPosition();let Ve=this.pos,Ue=this.input.indexOf("*/",this.pos+=2);if(Ue===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Ue+2,this.options.locations)for(let Ke,Je=Ve;(Ke=Nt(this.input,Je,this.pos))>-1;)++this.curLine,Je=this.lineStart=Ke;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice(Ve+2,Ue),Ve,this.pos,Be,this.curPosition())}skipLineComment(Be){let Ve=this.pos,Ue;if(!this.isLookahead)Ue=this.options.onComment&&this.curPosition();let Ke=this.input.charCodeAt(this.pos+=Be);while(this.pos<this.input.length&&!We(Ke))Ke=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice(Ve+Be,this.pos),Ve,this.pos,Ue,this.curPosition())}finishToken(Be,Ve){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let Ue=this.type;if(this.type=Be,this.value=Ve,!this.isLookahead)this.updateContext(Ue)}resetStartLocation(Be,Ve,Ue){if(Be.start=Ve,Be.loc.start=Ue,this.options.ranges)Be.range[0]=Ve}isLineTerminator(){return this.eat(Me.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return cc.lastIndex=this.end,cc.test(this.input)}addExtra(Be,Ve,Ue,Ke=!0){if(!Be)return;let Je=Be.extra=Be.extra||{};if(Ke)Je[Ve]=Ue;else Object.defineProperty(Je,Ve,{enumerable:Ke,value:Ue})}isLiteralPropertyName(){return nt(this.type)}hasPrecedingLineBreak(){return qe.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(Be,Ve){return Be.name=Ve,this.finishNode(Be,"Identifier")}resetStartLocationFromNode(Be,Ve){this.resetStartLocation(Be,Ve.start,Ve.loc.start)}isThisParam(Be){return Be.type==="Identifier"&&Be.name==="this"}isLookaheadContextual(Be){let Ve=this.nextTokenStart();return this.isUnparsedContextual(Ve,Be)}ts_type_isContextual(Be,Ve){return Be===Ve&&!this.containsEsc}ts_isContextual(Be){return this.type===Be&&!this.containsEsc}ts_isContextualWithState(Be,Ve){return Be.type===Ve&&!Be.containsEsc}isContextualWithState(Be,Ve){return Ve.type===Me.name&&Ve.value===Be&&!Ve.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(Me.plusMin))return this.ts_isContextual(Xe.readonly);if(this.ts_isContextual(Xe.readonly))this.next();if(!this.match(Me.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(Me._in)}tsInDisallowConditionalTypesContext(Be){let Ve=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return Be()}finally{this.inDisallowConditionalTypesContext=Ve}}tsTryParseType(){return this.tsEatThenParseType(Me.colon)}match(Be){return this.type===Be}matchJsx(Be){return this.type===$e.tokTypes[Be]}ts_eatWithState(Be,Ve,Ue){let Ke=Ue.type;if(Be===Ke){for(let Je=0;Je<Ve;Je++)this.next();return!0}else return!1}ts_eatContextualWithState(Be,Ve,Ue){if(Ze.test(Be)){if(this.ts_isContextualWithState(Ue,Xe[Be])){for(let Ke=0;Ke<Ve;Ke++)this.next();return!0}return!1}else{if(!this.isContextualWithState(Be,Ue))return!1;for(let Ke=0;Ke<Ve;Ke++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(Me._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual(Be){if(Ze.test(Be)){if(this.ts_isContextual(Xe[Be]))return this.next(),!0;return!1}else return super.eatContextual(Be)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let Be=this.startNode();if(this.expectContextual("require"),this.expect(Me.parenL),!this.match(Me.string))this.unexpected();return Be.expression=this.parseExprAtom(),this.expect(Me.parenR),this.finishNode(Be,"TSExternalModuleReference")}tsParseEntityName(Be=!0){let Ve=this.parseIdent(Be);while(this.eat(Me.dot)){let Ue=this.startNodeAtNode(Ve);Ue.left=Ve,Ue.right=this.parseIdent(Be),Ve=this.finishNode(Ue,"TSQualifiedName")}return Ve}tsParseEnumMember(){let Be=this.startNode();if(Be.id=this.match(Me.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(Me.eq))Be.initializer=this.parseMaybeAssign();return this.finishNode(Be,"TSEnumMember")}tsParseEnumDeclaration(Be,Ve={}){if(Ve.const)Be.const=!0;if(Ve.declare)Be.declare=!0;this.expectContextual("enum"),Be.id=this.parseIdent();let Ue=Ve.const?Tt.BIND_TS_CONST_ENUM:Tt.BIND_TS_ENUM;return this.checkLValSimple(Be.id,Ue),this.expect(Me.braceL),Be.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(Me.braceR),this.finishNode(Be,"TSEnumDeclaration")}tsParseModuleBlock(){let Be=this.startNode();this.enterScope(Hd),this.expect(Me.braceL),Be.body=[];while(this.type!==Me.braceR){let Ve=this.parseStatement(null,!0);Be.body.push(Ve)}return this.next(),super.exitScope(),this.finishNode(Be,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration(Be){if(this.ts_isContextual(Xe.global))Be.global=!0,Be.id=this.parseIdent();else if(this.match(Me.string))Be.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(Me.braceL))this.enterScope(Ir),Be.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode(Be,"TSModuleDeclaration")}tsTryParseDeclare(Be){if(this.isLineTerminator())return;let Ve=this.type,Ue;if(this.isContextual("let"))Ve=Me._var,Ue="let";return this.tsInAmbientContext(()=>{if(Ve===Me._function)return Be.declare=!0,this.parseFunctionStatement(Be,!1,!0);if(Ve===Me._class)return Be.declare=!0,this.parseClass(Be,!0);if(Ve===Xe.enum)return this.tsParseEnumDeclaration(Be,{declare:!0});if(Ve===Xe.global)return this.tsParseAmbientExternalModuleDeclaration(Be);if(Ve===Me._const||Ve===Me._var){if(!this.match(Me._const)||!this.isLookaheadContextual("enum"))return Be.declare=!0,this.parseVarStatement(Be,Ue||this.value,!0);return this.expect(Me._const),this.tsParseEnumDeclaration(Be,{const:!0,declare:!0})}if(Ve===Xe.interface){let Ke=this.tsParseInterfaceDeclaration(Be,{declare:!0});if(Ke)return Ke}if(tt(Ve))return this.tsParseDeclaration(Be,this.value,!0)})}tsIsListTerminator(Be){switch(Be){case"EnumMembers":case"TypeMembers":return this.match(Me.braceR);case"HeritageClauseElement":return this.match(Me.braceL);case"TupleElementTypes":return this.match(Me.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(Be,Ve,Ue,Ke){let Je=[],Ye=-1;for(;;){if(this.tsIsListTerminator(Be))break;Ye=-1;let rt=Ve();if(rt==null)return;if(Je.push(rt),this.eat(Me.comma)){Ye=this.lastTokStart;continue}if(this.tsIsListTerminator(Be))break;if(Ue)this.expect(Me.comma);return}if(Ke)Ke.value=Ye;return Je}tsParseDelimitedList(Be,Ve,Ue){return xf(this.tsParseDelimitedListWorker(Be,Ve,!0,Ue))}tsParseBracketedList(Be,Ve,Ue,Ke,Je){if(!Ke)if(Ue)this.expect(Me.bracketL);else this.expect(Me.relational);let Ye=this.tsParseDelimitedList(Be,Ve,Je);if(Ue)this.expect(Me.bracketR);else this.expect(Me.relational);return Ye}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(Be){return!this.match(Be)?void 0:this.tsNextThenParseType()}tsExpectThenParseType(Be){return this.tsDoThenParseType(()=>this.expect(Be))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(Be){return this.tsInType(()=>(Be(),this.tsParseType()))}tsSkipParameterStart(){if(tt(this.type)||this.match(Me._this))return this.next(),!0;if(this.match(Me.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(Me.bracketL)){this.next();try{return this.parseBindingList(Me.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(Me.parenR)||this.match(Me.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(Me.colon)||this.match(Me.comma)||this.match(Me.question)||this.match(Me.eq))return!0;if(this.match(Me.parenR)){if(this.next(),this.match(Me.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(Me.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(Be){let Ve=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return Be()}finally{this.inDisallowConditionalTypesContext=Ve}}tsParseBindingListForSignature(){return super.parseBindingList(Me.parenR,!0,!0).map((Be)=>{if(Be.type!=="Identifier"&&Be.type!=="RestElement"&&Be.type!=="ObjectPattern"&&Be.type!=="ArrayPattern")this.raise(Be.start,ft.UnsupportedSignatureParameterKind({type:Be.type}));return Be})}tsParseTypePredicateAsserts(){if(this.type!==Xe.asserts)return!1;let Be=this.containsEsc;if(this.next(),!tt(this.type)&&!this.match(Me._this))return!1;if(Be)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let Be=this.startNode();return this.next(),this.finishNode(Be,"TSThisType")}tsParseTypeAnnotation(Be=!0,Ve=this.startNode()){return this.tsInType(()=>{if(Be)this.expect(Me.colon);Ve.typeAnnotation=this.tsParseType()}),this.finishNode(Ve,"TSTypeAnnotation")}tsParseThisTypePredicate(Be){this.next();let Ve=this.startNodeAtNode(Be);return Ve.parameterName=Be,Ve.typeAnnotation=this.tsParseTypeAnnotation(!1),Ve.asserts=!1,this.finishNode(Ve,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let Be=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(Be);else return Be}tsParseTypePredicatePrefix(){let Be=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),Be}tsParseTypeOrTypePredicateAnnotation(Be){return this.tsInType(()=>{let Ve=this.startNode();this.expect(Be);let Ue=this.startNode(),Ke=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(Ke){let it=this.tsParseTypeAnnotation(!1);return Ue.parameterName=Ke,Ue.typeAnnotation=it,Ue.asserts=!1,Ve.typeAnnotation=this.finishNode(Ue,"TSTypePredicate"),this.finishNode(Ve,"TSTypeAnnotation")}let Je=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(Je&&this.match(Me._this)){let it=this.tsParseThisTypeOrThisTypePredicate();if(it.type==="TSThisType")Ue.parameterName=it,Ue.asserts=!0,Ue.typeAnnotation=null,it=this.finishNode(Ue,"TSTypePredicate");else this.resetStartLocationFromNode(it,Ue),it.asserts=!0;return Ve.typeAnnotation=it,this.finishNode(Ve,"TSTypeAnnotation")}let Ye=Je&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!Ye){if(!Je)return this.tsParseTypeAnnotation(!1,Ve);return Ue.parameterName=this.parseIdent(),Ue.asserts=Je,Ue.typeAnnotation=null,Ve.typeAnnotation=this.finishNode(Ue,"TSTypePredicate"),this.finishNode(Ve,"TSTypeAnnotation")}let rt=this.tsParseTypeAnnotation(!1);return Ue.parameterName=Ye,Ue.typeAnnotation=rt,Ue.asserts=Je,Ve.typeAnnotation=this.finishNode(Ue,"TSTypePredicate"),this.finishNode(Ve,"TSTypeAnnotation")})}tsFillSignature(Be,Ve){let Ue=Be===Me.arrow,Ke="parameters",Je="typeAnnotation";if(Ve.typeParameters=this.tsTryParseTypeParameters(),this.expect(Me.parenL),Ve.parameters=this.tsParseBindingListForSignature(),Ue)Ve.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(Be);else if(this.match(Be))Ve.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(Be)}tsTryNextParseConstantContext(){if(this.lookahead().type!==Me._const)return null;this.next();let Be=this.tsParseTypeReference();if(Be.typeParameters||Be.typeArguments)this.raise(Be.typeName.start,ft.CannotFindName({name:"const"}));return Be}tsParseFunctionOrConstructorType(Be,Ve){let Ue=this.startNode();if(Be==="TSConstructorType"){if(Ue.abstract=!!Ve,Ve)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(Me.arrow,Ue)),this.finishNode(Ue,Be)}tsParseUnionOrIntersectionType(Be,Ve,Ue){let Ke=this.startNode(),Je=this.eat(Ue),Ye=[];do Ye.push(Ve());while(this.eat(Ue));if(Ye.length===1&&!Je)return Ye[0];return Ke.types=Ye,this.finishNode(Ke,Be)}tsCheckTypeAnnotationForReadOnly(Be){switch(Be.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(Be.start,ft.UnexpectedReadonly)}}tsParseTypeOperator(){let Be=this.startNode(),Ve=this.value;if(this.next(),Be.operator=Ve,Be.typeAnnotation=this.tsParseTypeOperatorOrHigher(),Ve==="readonly")this.tsCheckTypeAnnotationForReadOnly(Be);return this.finishNode(Be,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(Me._extends)){let Be=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(Me.question))return Be}}tsParseInferType(){let Be=this.startNode();this.expectContextual("infer");let Ve=this.startNode();return Ve.name=this.tsParseTypeParameterName(),Ve.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),Be.typeParameter=this.finishNode(Ve,"TSTypeParameter"),this.finishNode(Be,"TSInferType")}tsParseLiteralTypeNode(){let Be=this.startNode();return Be.literal=(()=>{switch(this.type){case Me.num:case Me.string:case Me._true:case Me._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(Be,"TSLiteralType")}tsParseImportType(){let Be=this.startNode();if(this.expect(Me._import),this.expect(Me.parenL),!this.match(Me.string))this.raise(this.start,ft.UnsupportedImportTypeArgument);if(Be.argument=this.parseExprAtom(),this.expect(Me.parenR),this.eat(Me.dot))Be.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())Be.typeArguments=this.tsParseTypeArguments();return this.finishNode(Be,"TSImportType")}tsParseTypeQuery(){let Be=this.startNode();if(this.expect(Me._typeof),this.match(Me._import))Be.exprName=this.tsParseImportType();else Be.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())Be.typeArguments=this.tsParseTypeArguments();return this.finishNode(Be,"TSTypeQuery")}tsParseMappedTypeParameter(){let Be=this.startNode();return Be.name=this.tsParseTypeParameterName(),Be.constraint=this.tsExpectThenParseType(Me._in),this.finishNode(Be,"TSTypeParameter")}tsParseMappedType(){let Be=this.startNode();if(this.expect(Me.braceL),this.match(Me.plusMin))Be.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))Be.readonly=!0;if(this.expect(Me.bracketL),Be.typeParameter=this.tsParseMappedTypeParameter(),Be.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(Me.bracketR),this.match(Me.plusMin))Be.optional=this.value,this.next(),this.expect(Me.question);else if(this.eat(Me.question))Be.optional=!0;return Be.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(Me.braceR),this.finishNode(Be,"TSMappedType")}tsParseTypeLiteral(){let Be=this.startNode();return Be.members=this.tsParseObjectTypeMembers(),this.finishNode(Be,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!lt(this.type))return!1;let Be=this.lookahead();if(Be.type===Me.colon)return!0;if(Be.type!==Me.question)return!1;return this.lookahead(2).type===Me.colon}tsParseTupleElementType(){let Be=this.startLoc,Ve=this.start,Ue=this.eat(Me.ellipsis),Ke;if(this.tsIsTupleElementLabel()){let Je=this.startNode();Je.label=this.parseIdent(!0),Je.optional=this.eat(Me.question),this.expect(Me.colon),Je.elementType=this.tsParseType(),Ke=this.finishNode(Je,"TSNamedTupleMember")}else{Ke=this.tsParseType();let Je=this.eat(Me.question);if(this.eat(Me.colon))this.raise(Ke.start,ft.InvalidTupleMemberLabel);if(Je){let Ye=this.startNodeAtNode(Ke);Ye.typeAnnotation=Ke,Ke=this.finishNode(Ye,"TSOptionalType")}}if(Ue){let Je=this.startNodeAt(Ve,Be);Je.typeAnnotation=Ke,Ke=this.finishNode(Je,"TSRestType")}return Ke}tsParseTupleType(){let Be=this.startNode();Be.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let Ve=!1;return Be.elementTypes.forEach((Ue)=>{let{type:Ke}=Ue;if(Ve&&Ke!=="TSRestType"&&Ke!=="TSOptionalType"&&!(Ke==="TSNamedTupleMember"&&Ue.optional))this.raise(Ue.start,ft.OptionalTypeBeforeRequired);if(Ve||=Ke==="TSNamedTupleMember"&&Ue.optional||Ke==="TSOptionalType",Ke==="TSRestType")Ue=Ue.typeAnnotation}),this.finishNode(Be,"TSTupleType")}tsParseTemplateLiteralType(){let Be=this.startNode();return Be.literal=this.parseTemplate({isTagged:!1}),this.finishNode(Be,"TSLiteralType")}tsParseTypeReference(){let Be=this.startNode();if(Be.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())Be.typeArguments=this.tsParseTypeArguments();return this.finishNode(Be,"TSTypeReference")}tsMatchLeftRelational(){return this.match(Me.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(Me.relational)&&this.value===">"}tsParseParenthesizedType(){let Be=this.startNode();return this.expect(Me.parenL),Be.typeAnnotation=this.tsParseType(),this.expect(Me.parenR),this.finishNode(Be,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case Me.string:case Me.num:case Me._true:case Me._false:return this.tsParseLiteralTypeNode();case Me.plusMin:if(this.value==="-"){let Be=this.startNode();if(this.lookahead().type!==Me.num)this.unexpected();return Be.literal=this.parseMaybeUnary(),this.finishNode(Be,"TSLiteralType")}break;case Me._this:return this.tsParseThisTypeOrThisTypePredicate();case Me._typeof:return this.tsParseTypeQuery();case Me._import:return this.tsParseImportType();case Me.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case Me.bracketL:return this.tsParseTupleType();case Me.parenL:return this.tsParseParenthesizedType();case Me.backQuote:case Me.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:Be}=this;if(lt(Be)||Be===Me._void||Be===Me._null){let Ve=Be===Me._void?"TSVoidKeyword":Be===Me._null?"TSNullKeyword":bf(this.value);if(Ve!==void 0&&this.lookaheadCharCode()!==46){let Ue=this.startNode();return this.next(),this.finishNode(Ue,Ve)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let Be=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(Me.bracketL))if(this.match(Me.bracketR)){let Ve=this.startNodeAtNode(Be);Ve.elementType=Be,this.expect(Me.bracketR),Be=this.finishNode(Ve,"TSArrayType")}else{let Ve=this.startNodeAtNode(Be);Ve.objectType=Be,Ve.indexType=this.tsParseType(),this.expect(Me.bracketR),Be=this.finishNode(Ve,"TSIndexedAccessType")}return Be}tsParseTypeOperatorOrHigher(){return ct(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),Me.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),Me.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(Me._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){dc(this.inType);let Be=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(Me._extends))return Be;let Ve=this.startNodeAtNode(Be);return Ve.checkType=Be,Ve.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(Me.question),Ve.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(Me.colon),Ve.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(Ve,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),tt(this.type))return this.next(),this.match(Me.colon);return!1}tsInType(Be){let Ve=this.inType;this.inType=!0;try{return Be()}finally{this.inType=Ve}}tsTryParseIndexSignature(Be){if(!(this.match(Me.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(Me.bracketL);let Ve=this.parseIdent();Ve.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(Ve),this.expect(Me.bracketR),Be.parameters=[Ve];let Ue=this.tsTryParseTypeAnnotation();if(Ue)Be.typeAnnotation=Ue;return this.tsParseTypeMemberSemicolon(),this.finishNode(Be,"TSIndexSignature")}tsParseNoneModifiers(Be){this.tsParseModifiers({modified:Be,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:ft.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(Be=this.tsParseNoneModifiers.bind(this)){let Ve=this.startNode();return Be(Ve),Ve.name=this.tsParseTypeParameterName(),Ve.constraint=this.tsEatThenParseType(Me._extends),Ve.default=this.tsEatThenParseType(Me.eq),this.finishNode(Ve,"TSTypeParameter")}tsParseTypeParameters(Be){let Ve=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let Ue={value:-1};if(Ve.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,Be),!1,!0,Ue),Ve.params.length===0)this.raise(this.start,ft.EmptyTypeParameters);if(Ue.value!==-1)this.addExtra(Ve,"trailingComma",Ue.value);return this.finishNode(Ve,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(Be){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(Be)}tsTryParse(Be){let Ve=this.beginParseEffectScope(),Ue;try{Ue=Be()}catch(Ke){throw this.parseEffects.rollback(Ve),Ke}if(Ue!==void 0&&Ue!==!1)return this.parseEffects.commit(Ve),Ue;this.parseEffects.rollback(Ve);return}tsTokenCanFollowModifier(){return(this.match(Me.bracketL)||this.match(Me.braceL)||this.match(Me.star)||this.match(Me.ellipsis)||this.match(Me.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(Be,Ve){let Ue=this.value;if(Be.indexOf(Ue)!==-1&&!this.containsEsc){if(Ve&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return Ue}return}tsParseModifiersByMap({modified:Be,map:Ve}){for(let Ue of Object.keys(Ve))Be[Ue]=Ve[Ue]}tsParseModifiers({modified:Be,allowedModifiers:Ve,disallowedModifiers:Ue,stopOnStartOfClassStaticBlock:Ke,errorTemplate:Je=ft.InvalidModifierOnTypeMember}){let Ye={},rt=(st,et,ot,ut)=>{if(et===ot&&Be[ut])this.raise(st.column,ft.InvalidModifiersOrder({orderedModifiers:[ot,ut]}))},it=(st,et,ot,ut)=>{if(Be[ot]&&et===ut||Be[ut]&&et===ot)this.raise(st.column,ft.IncompatibleModifiers({modifiers:[ot,ut]}))};for(;;){let st=this.startLoc,et=this.tsParseModifier(Ve.concat(Ue??[]),Ke);if(!et)break;if(hc(et))if(Be.accessibility)this.raise(this.start,ft.DuplicateAccessibilityModifier());else rt(st,et,et,"override"),rt(st,et,et,"static"),rt(st,et,et,"readonly"),rt(st,et,et,"accessor"),Ye.accessibility=et,Be.accessibility=et;else if(ff(et))if(Be[et])this.raise(this.start,ft.DuplicateModifier({modifier:et}));else rt(st,et,"in","out"),Ye[et]=et,Be[et]=!0;else if(df(et))if(Be[et])this.raise(this.start,ft.DuplicateModifier({modifier:et}));else it(st,et,"accessor","readonly"),it(st,et,"accessor","override"),Ye[et]=et,Be[et]=!0;else if(et==="const")if(Be[et])this.raise(this.start,ft.DuplicateModifier({modifier:et}));else Ye[et]=et,Be[et]=!0;else if(Object.hasOwnProperty.call(Be,et))this.raise(this.start,ft.DuplicateModifier({modifier:et}));else rt(st,et,"static","readonly"),rt(st,et,"static","override"),rt(st,et,"override","readonly"),rt(st,et,"abstract","override"),it(st,et,"declare","override"),it(st,et,"static","abstract"),Ye[et]=et,Be[et]=!0;if(Ue?.includes(et))this.raise(this.start,Je)}return Ye}tsParseInOutModifiers(Be){this.tsParseModifiers({modified:Be,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:ft.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(Be){this.tsParseModifiers({modified:Be,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:ft.InvalidModifierOnTypeParameter})}parseMaybeUnary(Be,Ve,Ue,Ke){if(!i?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(Be,Ve,Ue,Ke)}tsParseTypeAssertion(){if(Re)this.raise(this.start,ft.ReservedTypeAssertion);let Be=this.tryParse(()=>{let Ve=this.startNode(),Ue=this.tsTryNextParseConstantContext();return Ve.typeAnnotation=Ue||this.tsNextThenParseType(),this.expect(Me.relational),Ve.expression=this.parseMaybeUnary(),this.finishNode(Ve,"TSTypeAssertion")});if(Be.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return Be.node}tsParseTypeArguments(Be=!1){let Ve=this.startNode();if(Ve.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(Me.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),Ve.params.length===0)this.raise(this.start,ft.EmptyTypeArguments);if(Be&&this.curContext()!==Qe.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode(Ve,"TSTypeParameterInstantiation")}tsParseHeritageClause(Be){let Ve=this.start,Ue=this.tsParseDelimitedList("HeritageClauseElement",()=>{let Ke=this.startNode();if(Ke.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())Ke.typeParameters=this.tsParseTypeArguments();return this.finishNode(Ke,"TSExpressionWithTypeArguments")});if(!Ue.length)this.raise(Ve,ft.EmptyHeritageClauseType({token:Be}));return Ue}tsParseTypeMemberSemicolon(){if(!this.eat(Me.comma)&&!this.isLineTerminator())this.expect(Me.semi)}tsTryParseAndCatch(Be){let Ve=this.tryParse((Ue)=>Be()||Ue());if(Ve.aborted||!Ve.node)return;return Ve.node}tsParseSignatureMember(Be,Ve){return this.tsFillSignature(Me.colon,Ve),this.tsParseTypeMemberSemicolon(),this.finishNode(Ve,Be)}tsParsePropertyOrMethodSignature(Be,Ve){if(this.eat(Me.question))Be.optional=!0;let Ue=Be;if(this.match(Me.parenL)||this.tsMatchLeftRelational()){if(Ve)this.raise(Be.start,ft.ReadonlyForMethodSignature);let Ke=Ue;if(Ke.kind&&this.tsMatchLeftRelational())this.raise(this.start,ft.AccesorCannotHaveTypeParameters);this.tsFillSignature(Me.colon,Ke),this.tsParseTypeMemberSemicolon();let Je="parameters",Ye="typeAnnotation";if(Ke.kind==="get"){if(Ke[Je].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(Ke[Je][0]))this.raise(this.start,ft.AccesorCannotDeclareThisParameter)}}else if(Ke.kind==="set"){if(Ke[Je].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let rt=Ke[Je][0];if(this.isThisParam(rt))this.raise(this.start,ft.AccesorCannotDeclareThisParameter);if(rt.type==="Identifier"&&rt.optional)this.raise(this.start,ft.SetAccesorCannotHaveOptionalParameter);if(rt.type==="RestElement")this.raise(this.start,ft.SetAccesorCannotHaveRestParameter)}if(Ke[Ye])this.raise(Ke[Ye].start,ft.SetAccesorCannotHaveReturnType)}else Ke.kind="method";return this.finishNode(Ke,"TSMethodSignature")}else{let Ke=Ue;if(Ve)Ke.readonly=!0;let Je=this.tsTryParseTypeAnnotation();if(Je)Ke.typeAnnotation=Je;return this.tsParseTypeMemberSemicolon(),this.finishNode(Ke,"TSPropertySignature")}}tsParseTypeMember(){let Be=this.startNode();if(this.match(Me.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",Be);if(this.match(Me._new)){let Ue=this.startNode();if(this.next(),this.match(Me.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",Be);else return Be.key=this.createIdentifier(Ue,"new"),this.tsParsePropertyOrMethodSignature(Be,!1)}this.tsParseModifiers({modified:Be,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let Ve=this.tsTryParseIndexSignature(Be);if(Ve)return Ve;if(this.parsePropertyName(Be),!Be.computed&&Be.key.type==="Identifier"&&(Be.key.name==="get"||Be.key.name==="set")&&this.tsTokenCanFollowModifier())Be.kind=Be.key.name,this.parsePropertyName(Be);return this.tsParsePropertyOrMethodSignature(Be,!!Be.readonly)}tsParseList(Be,Ve){let Ue=[];while(!this.tsIsListTerminator(Be))Ue.push(Ve());return Ue}tsParseObjectTypeMembers(){this.expect(Me.braceL);let Be=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(Me.braceR),Be}tsParseInterfaceDeclaration(Be,Ve={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),Ve.declare)Be.declare=!0;if(tt(this.type)){Be.id=this.parseIdent(),this.checkLValSimple(Be.id,Tt.BIND_TS_INTERFACE);let Ke=this.currentScope();this.maybeExportDefined(Ke,Be.id.name)}else Be.id=null,this.raise(this.start,ft.MissingInterfaceName);if(Be.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(Me._extends))Be.extends=this.tsParseHeritageClause("extends");let Ue=this.startNode();return Ue.body=this.tsParseInterfaceBody(),Be.body=this.finishNode(Ue,"TSInterfaceBody"),this.finishNode(Be,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(Me.braceL);let Be=this.inType;this.inType=!0;let Ve=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=Be,this.expect(Me.braceR),Ve}tsParseAbstractDeclaration(Be){if(this.match(Me._class))return Be.abstract=!0,this.parseClass(Be,!0);else if(this.ts_isContextual(Xe.interface)){if(!this.hasFollowingLineBreak())return Be.abstract=!0,this.tsParseInterfaceDeclaration(Be)}else this.unexpected(Be.start)}tsIsDeclarationStart(){return pt(this.type)}tsParseExpressionStatement(Be,Ve){switch(Ve.name){case"declare":{let Ue=this.tsTryParseDeclare(Be);if(Ue)return Ue.declare=!0,Ue;break}case"global":if(this.match(Me.braceL)){this.enterScope(Ir);let Ue=Be;return Ue.global=!0,Ue.id=Ve,Ue.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(Ue,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(Be,Ve.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:Be}=this,Ve=this.isAsyncFunction(),Ue=this.isLet();if(tt(Be)){if(Ve&&!this.containsEsc||Ue)return!1;if((Be===Xe.type||Be===Xe.interface)&&!this.containsEsc){let Ye=this.lookahead();if(tt(Ye.type)&&!this.isContextualWithState("from",Ye)||Ye.type===Me.braceL)return!1}}else if(!this.match(Me._default))return!1;let Ke=this.nextTokenStart(),Je=this.isUnparsedContextual(Ke,"from");if(this.input.charCodeAt(Ke)===44||tt(this.type)&&Je)return!0;if(this.match(Me._default)&&Je){let Ye=this.input.charCodeAt(this.nextTokenStartSince(Ke+4));return Ye===34||Ye===39}return!1}tsInAmbientContext(Be){let Ve=this.isAmbientContext;this.isAmbientContext=!0;try{return Be()}finally{this.isAmbientContext=Ve}}tsCheckLineTerminator(Be){if(Be){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(Be,Ve=!1){if(Be.id=this.parseIdent(),!Ve)this.checkLValSimple(Be.id,Tt.BIND_TS_NAMESPACE);if(this.eat(Me.dot)){let Ue=this.startNode();this.tsParseModuleOrNamespaceDeclaration(Ue,!0),Be.body=Ue}else this.enterScope(Ir),Be.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(Be,"TSModuleDeclaration")}checkLValSimple(Be,Ve=Tt.BIND_NONE,Ue){while(Be.type==="TSNonNullExpression"||Be.type==="TSAsExpression"||Be.type==="TSSatisfiesExpression"||Be.type==="TSTypeAssertion")Be=Be.expression;return super.checkLValSimple(Be,Ve,Ue)}isSimpleAssignTarget(Be){while(Be.type==="TSNonNullExpression"||Be.type==="TSAsExpression"||Be.type==="TSSatisfiesExpression"||Be.type==="TSTypeAssertion")Be=Be.expression;return super.isSimpleAssignTarget(Be)}tsParseTypeAliasDeclaration(Be){Be.id=this.parseIdent(),this.checkLValSimple(Be.id,Tt.BIND_TS_TYPE);let Ve=this.currentScope();return this.maybeExportDefined(Ve,Be.id.name),Be.typeAnnotation=this.tsInType(()=>{if(Be.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(Me.eq),this.ts_isContextual(Xe.interface)&&this.lookahead().type!==Me.dot){let Ue=this.startNode();return this.next(),this.finishNode(Ue,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(Be,"TSTypeAliasDeclaration")}tsParseDeclaration(Be,Ve,Ue){switch(Ve){case"abstract":if(this.tsCheckLineTerminator(Ue)&&(this.match(Me._class)||tt(this.type)))return this.tsParseAbstractDeclaration(Be);break;case"module":if(this.tsCheckLineTerminator(Ue)){if(this.match(Me.string))return this.tsParseAmbientExternalModuleDeclaration(Be);else if(tt(this.type))return this.tsParseModuleOrNamespaceDeclaration(Be)}break;case"namespace":if(this.tsCheckLineTerminator(Ue)&&tt(this.type))return this.tsParseModuleOrNamespaceDeclaration(Be);break;case"type":if(this.tsCheckLineTerminator(Ue)&&tt(this.type))return this.tsParseTypeAliasDeclaration(Be);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(Be,Ve){Be.isExport=Ve||!1,Be.id=this.parseIdent(),this.checkLValSimple(Be.id,Tt.BIND_LEXICAL),super.expect(Me.eq);let Ue=this.tsParseModuleReference();if(Be.importKind==="type"&&Ue.type!=="TSExternalModuleReference")this.raise(Ue.start,ft.ImportAliasHasImportType);return Be.moduleReference=Ue,super.semicolon(),this.finishNode(Be,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:Be}=this;if(tt(Be)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((Be===Xe.type||Be===Xe.interface)&&!this.containsEsc){let Ke=this.lookahead();if(tt(Ke.type)&&!this.isContextualWithState("from",Ke)||Ke.type===Me.braceL)return!1}}else if(!this.match(Me._default))return!1;let Ve=this.nextTokenStart(),Ue=this.isUnparsedContextual(Ve,"from");if(this.input.charCodeAt(Ve)===44||tt(this.type)&&Ue)return!0;if(this.match(Me._default)&&Ue){let Ke=this.input.charCodeAt(this.nextTokenStartSince(Ve+4));return Ke===34||Ke===39}return!1}parseTemplate({isTagged:Be=!1}={}){let Ve=this.startNode();this.next(),Ve.expressions=[];let Ue=this.parseTemplateElement({isTagged:Be});Ve.quasis=[Ue];while(!Ue.tail){if(this.type===Me.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Me.dollarBraceL),Ve.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(Me.braceR),Ve.quasis.push(Ue=this.parseTemplateElement({isTagged:Be}))}return this.next(),this.finishNode(Ve,"TemplateLiteral")}parseFunction(Be,Ve,Ue,Ke,Je){if(this.initFunction(Be),this.ecmaVersion>=9||this.ecmaVersion>=6&&!Ke){if(this.type===Me.star&&Ve&fc)this.unexpected();Be.generator=this.eat(Me.star)}if(this.ecmaVersion>=8)Be.async=!!Ke;if(Ve&ds)Be.id=Ve&hf&&this.type!==Me.name?null:this.parseIdent();let Ye=this.yieldPos,rt=this.awaitPos,it=this.awaitIdentPos,st=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope($i(Be.async,Be.generator)),!(Ve&ds))Be.id=this.type===Me.name?this.parseIdent():null;this.parseFunctionParams(Be);let et=Ve&ds;if(this.parseFunctionBody(Be,Ue,!1,Je,{isFunctionDeclaration:et}),et&&this.isAmbientContext&&Be.id){if(this.currentScope().flags&Tt.SCOPE_TOP)this.declareName(Be.id.name,Tt.BIND_FLAGS_TS_EXPORT_ONLY,Be.id.start)}if(this.yieldPos=Ye,this.awaitPos=rt,this.awaitIdentPos=it,Ve&ds&&Be.id&&!(Ve&fc))if(Be.body)this.checkLValSimple(Be.id,this.strict||Be.generator||Be.async?this.treatFunctionsAsVar?Tt.BIND_VAR:Tt.BIND_LEXICAL:Tt.BIND_FUNCTION);else this.checkLValSimple(Be.id,Tt.BIND_NONE);return this.maybeInArrowParameters=st,this.finishNode(Be,et?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(Be,Ve=!1,Ue=!1,Ke=!1,Je){if(this.match(Me.colon))Be.returnType=this.tsParseTypeOrTypePredicateAnnotation(Me.colon);let Ye=Je?.isFunctionDeclaration?"TSDeclareFunction":Je?.isClassMethod?"TSDeclareMethod":void 0;if(Ye&&!this.match(Me.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode(Be,Ye);if(Ye==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise(Be.start,ft.DeclareFunctionHasImplementation),Be.declare)return super.parseFunctionBody(Be,Ve,Ue,!1),this.finishNode(Be,Ye)}return super.parseFunctionBody(Be,Ve,Ue,Ke),Be}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let Be=this.startNode(),Ve=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(Me.dot)){Be.meta=Ve;let rt=this.containsEsc;if(Be.property=this.parseIdent(!0),Be.property.name!=="target")this.raiseRecoverable(Be.property.start,"The only valid meta property for new is 'new.target'");if(rt)this.raiseRecoverable(Be.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(Be.start,"'new.target' can only be used in functions and class static block");return this.finishNode(Be,"MetaProperty")}let Ue=this.start,Ke=this.startLoc,Je=this.type===Me._import;if(Be.callee=this.parseSubscripts(this.parseExprAtom(),Ue,Ke,!0,!1),Je&&Be.callee.type==="ImportExpression")this.raise(Ue,"Cannot use new with import()");let{callee:Ye}=Be;if(Ye.type==="TSInstantiationExpression"&&!Ye.extra?.parenthesized)Be.typeArguments=Ye.typeArguments,Be.callee=Ye.expression;if(this.eat(Me.parenL))Be.arguments=this.parseExprList(Me.parenR,this.ecmaVersion>=8,!1);else Be.arguments=[];return this.finishNode(Be,"NewExpression")}parseExprOp(Be,Ve,Ue,Ke,Je){if(Me._in.binop>Ke&&!this.hasPrecedingLineBreak()){let Ye;if(this.isContextual("as"))Ye="TSAsExpression";if(this.isContextual("satisfies"))Ye="TSSatisfiesExpression";if(Ye){let rt=this.startNodeAt(Ve,Ue);rt.expression=Be;let it=this.tsTryNextParseConstantContext();if(it)rt.typeAnnotation=it;else rt.typeAnnotation=this.tsNextThenParseType();return this.finishNode(rt,Ye),this.reScan_lt_gt(),this.parseExprOp(rt,Ve,Ue,Ke,Je)}}return super.parseExprOp(Be,Ve,Ue,Ke,Je)}parseImportSpecifiers(){let Be=[],Ve=!0;if($e.tokenIsIdentifier(this.type)){if(Be.push(this.parseImportDefaultSpecifier()),!this.eat(Me.comma))return Be}if(this.type===Me.star)return Be.push(this.parseImportNamespaceSpecifier()),Be;this.expect(Me.braceL);while(!this.eat(Me.braceR)){if(!Ve){if(this.expect(Me.comma),this.afterTrailingComma(Me.braceR))break}else Ve=!1;Be.push(this.parseImportSpecifier())}return Be}parseImport(Be){let Ve=this.lookahead();if(Be.importKind="value",this.importOrExportOuterKind="value",tt(Ve.type)||this.match(Me.star)||this.match(Me.braceL)){let Ue=this.lookahead(2);if(Ue.type!==Me.comma&&!this.isContextualWithState("from",Ue)&&Ue.type!==Me.eq&&this.ts_eatContextualWithState("type",1,Ve))this.importOrExportOuterKind="type",Be.importKind="type",Ve=this.lookahead(),Ue=this.lookahead(2);if(tt(Ve.type)&&Ue.type===Me.eq){this.next();let Ke=this.tsParseImportEqualsDeclaration(Be);return this.importOrExportOuterKind="value",Ke}}if(this.next(),this.type===Me.string)Be.specifiers=[],Be.source=this.parseExprAtom();else Be.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),Be.source=this.type===Me.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes(Be),this.semicolon(),this.finishNode(Be,"ImportDeclaration"),this.importOrExportOuterKind="value",Be.importKind==="type"&&Be.specifiers.length>1&&Be.specifiers[0].type==="ImportDefaultSpecifier")this.raise(Be.start,ft.TypeImportCannotSpecifyDefaultAndNamed);return Be}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let Be=this.startNode();return this.next(),Be.abstract=!0,this.parseClass(Be,!0)}if(this.match(Xe.interface)){let Be=this.tsParseInterfaceDeclaration(this.startNode());if(Be)return Be}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(Be,Ve){if(this.ecmaVersion>=11)if(this.eatContextual("as"))Be.exported=this.parseModuleExportName(),this.checkExport(Ve,Be.exported,this.lastTokStart);else Be.exported=null;if(this.expectContextual("from"),this.type!==Me.string)this.unexpected();return Be.source=this.parseExprAtom(),this.parseMaybeImportAttributes(Be),this.semicolon(),this.finishNode(Be,"ExportAllDeclaration")}parseDynamicImport(Be){if(this.next(),Be.source=this.parseMaybeAssign(),this.eat(Me.comma)){let Ve=this.parseExpression();Be.arguments=[Ve]}if(!this.eat(Me.parenR)){let Ve=this.start;if(this.eat(Me.comma)&&this.eat(Me.parenR))this.raiseRecoverable(Ve,"Trailing comma is not allowed in import()");else this.unexpected(Ve)}return this.finishNode(Be,"ImportExpression")}parseExport(Be,Ve){let Ue=this.lookahead();if(this.ts_eatWithState(Me._import,2,Ue)){if(this.ts_isContextual(Xe.type)&&this.lookaheadCharCode()!==61)Be.importKind="type",this.importOrExportOuterKind="type",this.next();else Be.importKind="value",this.importOrExportOuterKind="value";let Ke=this.tsParseImportEqualsDeclaration(Be,!0);return this.importOrExportOuterKind=void 0,Ke}else if(this.ts_eatWithState(Me.eq,2,Ue)){let Ke=Be;return Ke.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(Ke,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,Ue)){let Ke=Be;return this.expectContextual("namespace"),Ke.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(Ke,"TSNamespaceExportDeclaration")}else{let Ke=this.lookahead(2).type;if(this.ts_isContextualWithState(Ue,Xe.type)&&(Ke===Me.braceL||Ke===Me.star))this.next(),this.importOrExportOuterKind="type",Be.exportKind="type";else this.importOrExportOuterKind="value",Be.exportKind="value";if(this.next(),this.eat(Me.star))return this.parseExportAllDeclaration(Be,Ve);if(this.eat(Me._default))return this.checkExport(Ve,"default",this.lastTokStart),Be.declaration=this.parseExportDefaultDeclaration(),this.finishNode(Be,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(Be.declaration=this.parseExportDeclaration(Be),Be.declaration.type==="VariableDeclaration")this.checkVariableExport(Ve,Be.declaration.declarations);else this.checkExport(Ve,Be.declaration.id,Be.declaration.id.start);Be.specifiers=[],Be.source=null}else{if(Be.declaration=null,Be.specifiers=this.parseExportSpecifiers(Ve),this.eatContextual("from")){if(this.type!==Me.string)this.unexpected();Be.source=this.parseExprAtom(),this.parseMaybeImportAttributes(Be)}else{for(let Je of Be.specifiers)if(this.checkUnreserved(Je.local),this.checkLocalExport(Je.local),Je.local.type==="Literal")this.raise(Je.local.start,"A string literal cannot be used as an exported binding without `from`.");Be.source=null}this.semicolon()}return this.finishNode(Be,"ExportNamedDeclaration")}}checkExport(Be,Ve,Ue){if(!Be)return;if(typeof Ve!=="string")Ve=Ve.type==="Identifier"?Ve.name:Ve.value;Be[Ve]=!0}parseMaybeDefault(Be,Ve,Ue){let Ke=super.parseMaybeDefault(Be,Ve,Ue);if(Ke.type==="AssignmentPattern"&&Ke.typeAnnotation&&Ke.right.start<Ke.typeAnnotation.start)this.raise(Ke.typeAnnotation.start,ft.TypeAnnotationAfterAssign);return Ke}typeCastToParameter(Be){return Be.expression.typeAnnotation=Be.typeAnnotation,this.resetEndLocation(Be.expression,Be.typeAnnotation.end,Be.typeAnnotation.loc?.end),Be.expression}toAssignableList(Be,Ve){if(!Be)Be=[];for(let Ue=0;Ue<Be.length;Ue++){let Ke=Be[Ue];if(Ke?.type==="TSTypeCastExpression")Be[Ue]=this.typeCastToParameter(Ke)}return super.toAssignableList(Be,Ve)}reportReservedArrowTypeParam(Be){if(Be.params.length===1&&!Be.extra?.trailingComma&&Re)this.raise(Be.start,ft.ReservedArrowTypeParam)}parseExprAtom(Be,Ve,Ue){if(this.type===Xe.jsxText)return this.jsx_parseText();else if(this.type===Xe.jsxTagStart)return this.jsx_parseElement();else if(this.type===Xe.at)return this.parseDecorators(),this.parseExprAtom();else if(tt(this.type)){let Ke=this.potentialArrowAt===this.start,Je=this.start,Ye=this.startLoc,rt=this.containsEsc,it=this.parseIdent(!1);if(this.ecmaVersion>=8&&!rt&&it.name==="async"&&!this.canInsertSemicolon()&&this.eat(Me._function))return this.overrideContext(Ge.f_expr),this.parseFunction(this.startNodeAt(Je,Ye),0,!1,!0,Ve);if(Ke&&!this.canInsertSemicolon()){if(this.eat(Me.arrow))return this.parseArrowExpression(this.startNodeAt(Je,Ye),[it],!1,Ve);if(this.ecmaVersion>=8&&it.name==="async"&&this.type===Me.name&&!rt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(it=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Me.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(Je,Ye),[it],!0,Ve)}}return it}else return super.parseExprAtom(Be,Ve,Ue)}parseExprAtomDefault(){if(tt(this.type)){let Be=this.potentialArrowAt===this.start,Ve=this.containsEsc,Ue=this.parseIdent();if(!Ve&&Ue.name==="async"&&!this.canInsertSemicolon()){let{type:Ke}=this;if(Ke===Me._function)return this.next(),this.parseFunction(this.startNodeAtNode(Ue),void 0,!0,!0);else if(tt(Ke))if(this.lookaheadCharCode()===61){let Je=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(Me.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(Ue),[Je],!0)}else return Ue}if(Be&&this.match(Me.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(Ue),[Ue],!1);return Ue}else this.unexpected()}parseIdentNode(){let Be=this.startNode();if(lt(this.type)&&!((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)))Be.name=this.value;else return super.parseIdentNode();return Be}parseVarStatement(Be,Ve,Ue=!1){let{isAmbientContext:Ke}=this;this.next(),super.parseVar(Be,!1,Ve,Ue||Ke),this.semicolon();let Je=this.finishNode(Be,"VariableDeclaration");if(!Ke)return Je;for(let{id:Ye,init:rt}of Je.declarations){if(!rt)continue;if(Ve!=="const"||!!Ye.typeAnnotation)this.raise(rt.start,ft.InitializerNotAllowedInAmbientContext);else if(rt.type!=="Literal"&&(rt.type!=="TemplateLiteral"||rt.expressions.length>0)&&!yf(rt)&&!mf(rt))this.raise(rt.start,ft.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return Je}parseStatement(Be,Ve,Ue){if(this.match(Xe.at))this.parseDecorators(!0);if(this.match(Me._const)&&this.isLookaheadContextual("enum")){let Ke=this.startNode();return this.expect(Me._const),this.tsParseEnumDeclaration(Ke,{const:!0})}if(this.ts_isContextual(Xe.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(Xe.interface)){let Ke=this.tsParseInterfaceDeclaration(this.startNode());if(Ke)return Ke}return super.parseStatement(Be,Ve,Ue)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(Be){if(this.eat(Me.question))Be.optional=!0;if(Be.readonly&&this.match(Me.parenL))this.raise(Be.start,ft.ClassMethodHasReadonly);if(Be.declare&&this.match(Me.parenL))this.raise(Be.start,ft.ClassMethodHasDeclare)}parseExpressionStatement(Be,Ve){return(Ve.type==="Identifier"?this.tsParseExpressionStatement(Be,Ve):void 0)||super.parseExpressionStatement(Be,Ve)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(Xe.at))return!0;return super.shouldParseExportStatement()}parseConditional(Be,Ve,Ue,Ke,Je){if(this.eat(Me.question)){let Ye=this.startNodeAt(Ve,Ue);return Ye.test=Be,Ye.consequent=this.parseMaybeAssign(),this.expect(Me.colon),Ye.alternate=this.parseMaybeAssign(Ke),this.finishNode(Ye,"ConditionalExpression")}return Be}parseMaybeConditional(Be,Ve){let Ue=this.start,Ke=this.startLoc,Je=this.parseExprOps(Be,Ve);if(this.checkExpressionErrors(Ve))return Je;if(!this.maybeInArrowParameters||!this.match(Me.question))return this.parseConditional(Je,Ue,Ke,Be,Ve);let Ye=this.tryParse(()=>this.parseConditional(Je,Ue,Ke,Be,Ve));if(!Ye.node){if(Ye.error)this.setOptionalParametersError(Ve,Ye.error);return Je}return Ye.node}parseParenItem(Be){let Ve=this.start,Ue=this.startLoc;if(Be=super.parseParenItem(Be),this.eat(Me.question))Be.optional=!0,this.resetEndLocation(Be);if(this.match(Me.colon)){let Ke=this.startNodeAt(Ve,Ue);return Ke.expression=Be,Ke.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(Ke,"TSTypeCastExpression")}return Be}parseExportDeclaration(Be){if(!this.isAmbientContext&&this.ts_isContextual(Xe.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(Be));let Ve=this.start,Ue=this.startLoc,Ke=this.eatContextual("declare");if(Ke&&(this.ts_isContextual(Xe.declare)||!this.shouldParseExportStatement()))this.raise(this.start,ft.ExpectedAmbientAfterExportDeclare);let Ye=tt(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!Ye)return null;if(Ye.type==="TSInterfaceDeclaration"||Ye.type==="TSTypeAliasDeclaration"||Ke)Be.exportKind="type";if(Ke)this.resetStartLocation(Ye,Ve,Ue),Ye.declare=!0;return Ye}parseClassId(Be,Ve){if(!Ve&&this.isContextual("implements"))return;super.parseClassId(Be,Ve);let Ue=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if(Ue)Be.typeParameters=Ue}parseClassPropertyAnnotation(Be){if(!Be.optional){if(this.value==="!"&&this.eat(Me.prefix))Be.definite=!0;else if(this.eat(Me.question))Be.optional=!0}let Ve=this.tsTryParseTypeAnnotation();if(Ve)Be.typeAnnotation=Ve}parseClassField(Be){if(Be.key.type==="PrivateIdentifier"){if(Be.abstract)this.raise(Be.start,ft.PrivateElementHasAbstract);if(Be.accessibility)this.raise(Be.start,ft.PrivateElementHasAccessibility({modifier:Be.accessibility}));this.parseClassPropertyAnnotation(Be)}else{if(this.parseClassPropertyAnnotation(Be),this.isAmbientContext&&!(Be.readonly&&!Be.typeAnnotation)&&this.match(Me.eq))this.raise(this.start,ft.DeclareClassFieldHasInitializer);if(Be.abstract&&this.match(Me.eq)){let{key:Ue}=Be;this.raise(this.start,ft.AbstractPropertyHasInitializer({propertyName:Ue.type==="Identifier"&&!Be.computed?Ue.name:`[${this.input.slice(Ue.start,Ue.end)}]`}))}}return super.parseClassField(Be)}parseClassMethod(Be,Ve,Ue,Ke){let Je=Be.kind==="constructor",Ye=Be.key.type==="PrivateIdentifier",rt=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Ye){if(rt)Be.typeParameters=rt;if(Be.accessibility)this.raise(Be.start,ft.PrivateMethodsHasAccessibility({modifier:Be.accessibility}))}else if(rt&&Je)this.raise(rt.start,ft.ConstructorHasTypeParameters);let{declare:it=!1,kind:st}=Be;if(it&&(st==="get"||st==="set"))this.raise(Be.start,ft.DeclareAccessor({kind:st}));if(rt)Be.typeParameters=rt;let et=Be.key;if(Be.kind==="constructor"){if(Ve)this.raise(et.start,"Constructor can't be a generator");if(Ue)this.raise(et.start,"Constructor can't be an async method")}else if(Be.static&&lc(Be,"prototype"))this.raise(et.start,"Classes may not have a static property named prototype");let ot=Be.value=this.parseMethod(Ve,Ue,Ke,!0,Be);if(Be.kind==="get"&&ot.params.length!==0)this.raiseRecoverable(ot.start,"getter should have no params");if(Be.kind==="set"&&ot.params.length!==1)this.raiseRecoverable(ot.start,"setter should have exactly one param");if(Be.kind==="set"&&ot.params[0].type==="RestElement")this.raiseRecoverable(ot.params[0].start,"Setter cannot use rest params");return this.finishNode(Be,"MethodDefinition")}isClassMethod(){return this.match(Me.relational)}parseClassElement(Be){if(this.eat(Me.semi))return null;let Ve=this.startNode(),Ue="",Ke=!1,Je=!1,Ye="method",rt=!1,it=["declare","private","public","protected","accessor","override","abstract","readonly","static"],st=this.tsParseModifiers({modified:Ve,allowedModifiers:it,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:ft.InvalidModifierOnTypeParameterPositions});rt=Boolean(st.static);let et=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(Ve,it))this.raise(this.start,ft.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(Ve),Ve}else{let ot=this.tsTryParseIndexSignature(Ve);if(ot){if(Ve.abstract)this.raise(Ve.start,ft.IndexSignatureHasAbstract);if(Ve.accessibility)this.raise(Ve.start,ft.IndexSignatureHasAccessibility({modifier:Ve.accessibility}));if(Ve.declare)this.raise(Ve.start,ft.IndexSignatureHasDeclare);if(Ve.override)this.raise(Ve.start,ft.IndexSignatureHasOverride);return ot}if(!this.inAbstractClass&&Ve.abstract)this.raise(Ve.start,ft.NonAbstractClassHasAbstractMethod);if(Ve.override){if(!Be)this.raise(Ve.start,ft.OverrideNotInSubClass)}if(Ve.static=rt,rt){if(!(this.isClassElementNameStart()||this.type===Me.star))Ue="static"}if(!Ue&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Me.star)&&!this.canInsertSemicolon())Je=!0;else Ue="async";if(!Ue&&(this.ecmaVersion>=9||!Je)&&this.eat(Me.star))Ke=!0;if(!Ue&&!Je&&!Ke){let ut=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Ye=ut;else Ue=ut}if(Ue)Ve.computed=!1,Ve.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Ve.key.name=Ue,this.finishNode(Ve.key,"Identifier");else this.parseClassElementName(Ve);if(this.parsePostMemberNameModifiers(Ve),this.isClassMethod()||this.ecmaVersion<13||this.type===Me.parenL||Ye!=="method"||Ke||Je){let ut=!Ve.static&&lc(Ve,"constructor"),mt=ut&&Be;if(ut&&Ye!=="method")this.raise(Ve.key.start,"Constructor can't have get/set modifier");Ve.kind=ut?"constructor":Ye,this.parseClassMethod(Ve,Ke,Je,mt)}else this.parseClassField(Ve);return Ve}};if(Ve.declare)this.tsInAmbientContext(et);else et();return Ve}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper(Be){if(super.parseClassSuper(Be),Be.superClass&&(this.tsMatchLeftRelational()||this.match(Me.bitShift)))Be.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))Be.implements=this.tsParseHeritageClause("implements")}parseFunctionParams(Be){let Ve=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Ve)Be.typeParameters=Ve;super.parseFunctionParams(Be)}parseVarId(Be,Ve){if(super.parseVarId(Be,Ve),Be.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(Me.prefix))Be.definite=!0;let Ue=this.tsTryParseTypeAnnotation();if(Ue)Be.id.typeAnnotation=Ue,this.resetEndLocation(Be.id)}parseArrowExpression(Be,Ve,Ue,Ke){if(this.match(Me.colon))Be.returnType=this.tsParseTypeAnnotation();let Je=this.yieldPos,Ye=this.awaitPos,rt=this.awaitIdentPos;this.enterScope($i(Ue,!1)|Tt.SCOPE_ARROW),this.initFunction(Be);let it=this.maybeInArrowParameters;if(this.ecmaVersion>=8)Be.async=!!Ue;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,Be.params=this.toAssignableList(Ve,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(Be,!0,!1,Ke),this.yieldPos=Je,this.awaitPos=Ye,this.awaitIdentPos=rt,this.maybeInArrowParameters=it,this.finishNode(Be,"ArrowFunctionExpression")}parseYield(Be){if(!this.yieldPos)this.yieldPos=this.start;let Ve=this.startNode();this.next();let Ue=this.tsMatchLeftRelational();if(!(!this.match(Me.semi)&&!this.canInsertSemicolon()&&(this.match(Me.star)||this.type.startsExpr||Ue)))return Ve.delegate=!1,Ve.argument=null,this.finishNode(Ve,"YieldExpression");return Ve.delegate=this.eat(Me.star),Ve.argument=this.parseMaybeAssign(Be),this.finishNode(Ve,"YieldExpression")}parseMaybeAssignOrigin(Be,Ve,Ue){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(Be);else this.exprAllowed=!1;let Ke=!1,Je=-1,Ye=-1,rt=-1;if(Ve)Je=Ve.parenthesizedAssign,Ye=Ve.trailingComma,rt=Ve.doubleProto,Ve.parenthesizedAssign=Ve.trailingComma=-1;else Ve=new Rr,Ke=!0;let it=this.start,st=this.startLoc;if(this.type===Me.parenL||tt(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=Be==="await";let et=this.parseMaybeConditional(Be,Ve);if(Ue)et=Ue.call(this,et,it,st);if(this.type.isAssign){let ot=this.startNodeAt(it,st);if(ot.operator=this.value,this.type===Me.eq)et=this.toAssignable(et,!0,Ve,!0);if(!Ke)Ve.parenthesizedAssign=Ve.trailingComma=Ve.doubleProto=-1;if(Ve.shorthandAssign>=et.start)Ve.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===Me.eq)this.checkLValPattern(et);else this.checkLValSimple(et);if(ot.left=et,this.next(),ot.right=this.parseMaybeAssign(Be),rt>-1)Ve.doubleProto=rt;return this.finishNode(ot,"AssignmentExpression")}else if(Ke)this.checkExpressionErrors(Ve,!0);if(Je>-1)Ve.parenthesizedAssign=Je;if(Ye>-1)Ve.trailingComma=Ye;return et}parseMaybeAssign(Be,Ve,Ue){let Ke,Je;if(i?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(Ke=this.tryParse(()=>this.parseMaybeAssignOrigin(Be,Ve,Ue)),!Ke.error)return Ke.node;let it=this.context,st=it[it.length-1],et=it[it.length-2];if(st===$e.tokContexts.tc_oTag&&et===$e.tokContexts.tc_expr)this.parseEffects.pop(it),this.parseEffects.pop(it);else if(st===$e.tokContexts.tc_oTag||st===$e.tokContexts.tc_expr)this.parseEffects.pop(it)}if(!Ke?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(Be,Ve,Ue);let Ye,rt=this.tryParse((it)=>{Ye=this.tsParseTypeParameters(this.tsParseConstModifier);let st=this.parseMaybeAssignOrigin(Be,Ve,Ue);if(st.type!=="ArrowFunctionExpression"||st.extra?.parenthesized)it();if(Ye?.params.length!==0)this.resetStartLocationFromNode(st,Ye);return st.typeParameters=Ye,st});if(!rt.error&&!rt.aborted){if(Ye)this.reportReservedArrowTypeParam(Ye);return rt.node}if(!Ke){if(dc(!0),Je=this.tryParse(()=>this.parseMaybeAssignOrigin(Be,Ve,Ue)),!Je.error)return Je.node}if(Ke?.thrown)throw this.selectTryParseResult(Ke),Ke.error;if(rt.thrown)throw this.selectTryParseResult(rt),rt.error;if(Je?.thrown)throw this.selectTryParseResult(Je),Je.error;throw Ke?.error||rt.error||Je?.error}parseAssignableListItem(Be){let Ve=[];while(this.match(Xe.at))Ve.push(this.parseDecorator());let Ue=this.start,Ke=this.startLoc,Je,Ye=!1,rt=!1;if(Be!==void 0){let et={};if(this.tsParseModifiers({modified:et,allowedModifiers:["public","private","protected","override","readonly"]}),Je=et.accessibility,rt=et.override,Ye=et.readonly,Be===!1&&(Je||Ye||rt))this.raise(Ke.column,ft.UnexpectedParameterModifier)}let it=this.parseMaybeDefault(Ue,Ke);this.parseBindingListItem(it);let st=this.parseMaybeDefault(it.start,it.loc.start,it);if(Ve.length)st.decorators=Ve;if(Je||Ye||rt){let et=this.startNodeAt(Ue,Ke);if(Je)et.accessibility=Je;if(Ye)et.readonly=Ye;if(rt)et.override=rt;if(st.type!=="Identifier"&&st.type!=="AssignmentPattern")this.raise(et.start,ft.UnsupportedParameterPropertyKind);return et.parameter=st,this.finishNode(et,"TSParameterProperty")}return st}checkLValInnerPattern(Be,Ve=Tt.BIND_NONE,Ue){switch(Be.type){case"TSParameterProperty":this.checkLValInnerPattern(Be.parameter,Ve,Ue);break;default:{super.checkLValInnerPattern(Be,Ve,Ue);break}}}parseBindingListItem(Be){if(this.eat(Me.question)){if(Be.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise(Be.start,ft.PatternIsOptional);Be.optional=!0}let Ve=this.tsTryParseTypeAnnotation();if(Ve)Be.typeAnnotation=Ve;return this.resetEndLocation(Be),Be}isAssignable(Be,Ve){switch(Be.type){case"TSTypeCastExpression":return this.isAssignable(Be.expression,Ve);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let Ue=Be.properties.length-1;return Be.properties.every((Ke,Je)=>Ke.type!=="ObjectMethod"&&(Je===Ue||Ke.type!=="SpreadElement")&&this.isAssignable(Ke))}case"Property":case"ObjectProperty":return this.isAssignable(Be.value);case"SpreadElement":return this.isAssignable(Be.argument);case"ArrayExpression":return Be.elements.every((Ue)=>Ue===null||this.isAssignable(Ue));case"AssignmentExpression":return Be.operator==="=";case"ParenthesizedExpression":return this.isAssignable(Be.expression);case"MemberExpression":case"OptionalMemberExpression":return!Ve;default:return!1}}toAssignable(Be,Ve=!1,Ue=new Rr,Ke=!1){switch(Be.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(Be,Ve,Ue,Ke);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(Ve);else this.raise(Be.start,ft.UnexpectedTypeCastInParameter);let Je=this.toAssignable(Be.expression,Ve,Ue,Ke);if(Ke)return Be.expression=Je,Be;return Je;case"MemberExpression":break;case"AssignmentExpression":if(!Ve&&Be.left.type==="TSTypeCastExpression")Be.left=this.typeCastToParameter(Be.left);return super.toAssignable(Be,Ve,Ue);case"TSTypeCastExpression":return this.typeCastToParameter(Be);default:return super.toAssignable(Be,Ve,Ue)}return Be}toAssignableParenthesizedExpression(Be,Ve,Ue,Ke=!1){switch(Be.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let Je=this.toAssignable(Be.expression,Ve,Ue,Ke);if(Ke)return Be.expression=Je,Be;return Je;default:return super.toAssignable(Be,Ve,Ue)}}parseBindingAtom(){switch(this.type){case Me._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(Be){let Ve;if(this.match(Me.colon))Ve=Be.every((Ue)=>this.isAssignable(Ue,!0));else Ve=!this.canInsertSemicolon();if(Ve){if(this.match(Me.colon)){let Ue=this.tryParse((Ke)=>{let Je=this.tsParseTypeOrTypePredicateAnnotation(Me.colon);if(this.canInsertSemicolon()||!this.match(Me.arrow))Ke();return Je});if(Ue.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!Ue.thrown)this.shouldParseArrowReturnType=Ue.node}if(!this.match(Me.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,Ve}parseParenArrowList(Be,Ve,Ue,Ke){let Je=this.startNodeAt(Be,Ve);return Je.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(Je,Ue,!1,Ke)}parseParenAndDistinguishExpression(Be,Ve){let Ue=this.start,Ke=this.startLoc,Je,Ye=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let rt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let it=this.start,st=this.startLoc,et=[],ot=!0,ut=!1,mt=new Rr,gt=this.yieldPos,Ct=this.awaitPos,$t;this.yieldPos=0,this.awaitPos=0;while(this.type!==Me.parenR)if(ot?ot=!1:this.expect(Me.comma),Ye&&this.afterTrailingComma(Me.parenR,!0)){ut=!0;break}else if(this.type===Me.ellipsis){if($t=this.start,et.push(this.parseParenItem(this.parseRestBinding())),this.type===Me.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else et.push(this.parseMaybeAssign(!1,mt,this.parseParenItem));let Wt=this.lastTokEnd,Kt=this.lastTokEndLoc;if(this.expect(Me.parenR),this.maybeInArrowParameters=rt,Be&&this.shouldParseArrow(et)&&this.eat(Me.arrow))return this.checkPatternErrors(mt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=gt,this.awaitPos=Ct,this.parseParenArrowList(Ue,Ke,et,Ve);if(!et.length||ut)this.unexpected(this.lastTokStart);if($t)this.unexpected($t);if(this.checkExpressionErrors(mt,!0),this.yieldPos=gt||this.yieldPos,this.awaitPos=Ct||this.awaitPos,et.length>1)Je=this.startNodeAt(it,st),Je.expressions=et,this.finishNodeAt(Je,"SequenceExpression",Wt,Kt);else Je=et[0]}else Je=this.parseParenExpression();if(this.options.preserveParens){let rt=this.startNodeAt(Ue,Ke);return rt.expression=Je,this.finishNode(rt,"ParenthesizedExpression")}else return Je}parseTaggedTemplateExpression(Be,Ve,Ue,Ke){let Je=this.startNodeAt(Ve,Ue);if(Je.tag=Be,Je.quasi=this.parseTemplate({isTagged:!0}),Ke)this.raise(Ve,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(Je,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(Me.colon)){let Be=this.tryParse((Ve)=>{let Ue=this.tsParseTypeOrTypePredicateAnnotation(Me.colon);if(this.canInsertSemicolon()||!this.match(Me.arrow))Ve();return Ue});if(Be.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!Be.thrown)return this.shouldParseAsyncArrowReturnType=Be.node,!this.canInsertSemicolon()&&this.eat(Me.arrow)}else return!this.canInsertSemicolon()&&this.eat(Me.arrow)}parseSubscriptAsyncArrow(Be,Ve,Ue,Ke){let Je=this.startNodeAt(Be,Ve);return Je.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(Je,Ue,!0,Ke)}parseExprList(Be,Ve,Ue,Ke){let Je=[],Ye=!0;while(!this.eat(Be)){if(!Ye){if(this.expect(Me.comma),Ve&&this.afterTrailingComma(Be))break}else Ye=!1;let rt;if(Ue&&this.type===Me.comma)rt=null;else if(this.type===Me.ellipsis){if(rt=this.parseSpread(Ke),this.maybeInArrowParameters&&this.match(Me.colon))rt.typeAnnotation=this.tsParseTypeAnnotation();if(Ke&&this.type===Me.comma&&Ke.trailingComma<0)Ke.trailingComma=this.start}else rt=this.parseMaybeAssign(!1,Ke,this.parseParenItem);Je.push(rt)}return Je}parseMaybeDecoratorArguments(Be){let Ve=this.tsMatchLeftRelational()||this.match(Me.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(Me.parenL)){let Ue=this.startNodeAtNode(Be);if(Ue.callee=Be,Ue.arguments=this.parseExprList(Me.parenR,!1),Ve)Ue.typeArguments=Ve;return this.finishNode(Ue,"CallExpression")}if(Ve){let Ue=this.startNodeAtNode(Be);return Ue.expression=Be,Ue.typeArguments=Ve,this.finishNode(Ue,"TSInstantiationExpression")}return Be}parseSubscript(Be,Ve,Ue,Ke,Je,Ye,rt){let it=Ye;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(Me.prefix)){this.exprAllowed=!1,this.next();let mt=this.startNodeAt(Ve,Ue);return mt.expression=Be,Be=this.finishNode(mt,"TSNonNullExpression"),Be}let st=!1;if(this.match(Me.questionDot)&&this.lookaheadCharCode()===60){if(Ke)return Be;Be.optional=!0,it=st=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(Me.bitShift)){let mt,gt=this.tsTryParseAndCatch(()=>{if(!Ke&&this.atPossibleAsyncArrow(Be)){let Kt=this.tsTryParseGenericAsyncArrowFunction(Ve,Ue,rt);if(Kt)return Be=Kt,Be}let Ct=this.tsParseTypeArgumentsInExpression();if(!Ct)return Be;if(st&&!this.match(Me.parenL))return mt=this.curPosition(),Be;if(at(this.type)||this.type===Me.backQuote){let Kt=this.parseTaggedTemplateExpression(Be,Ve,Ue,it);return Kt.typeArguments=Ct,Kt}if(!Ke&&this.eat(Me.parenL)){let Kt=new Rr,qt=this.startNodeAt(Ve,Ue);if(qt.callee=Be,qt.arguments=this.parseExprList(Me.parenR,this.ecmaVersion>=8,!1,Kt),this.tsCheckForInvalidTypeCasts(qt.arguments),qt.typeArguments=Ct,it)qt.optional=st;return this.checkExpressionErrors(Kt,!0),Be=this.finishNode(qt,"CallExpression"),Be}let $t=this.type;if(this.tsMatchRightRelational()||$t===Me.bitShift||$t!==Me.parenL&&gf($t)&&!this.hasPrecedingLineBreak())return;let Wt=this.startNodeAt(Ve,Ue);return Wt.expression=Be,Wt.typeArguments=Ct,this.finishNode(Wt,"TSInstantiationExpression")});if(mt)this.unexpected(mt);if(gt){if(gt.type==="TSInstantiationExpression"&&(this.match(Me.dot)||this.match(Me.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,ft.InvalidPropertyAccessAfterInstantiationExpression);return Be=gt,Be}}let et=this.ecmaVersion>=11,ot=et&&this.eat(Me.questionDot);if(Ke&&ot)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let ut=this.eat(Me.bracketL);if(ut||ot&&this.type!==Me.parenL&&this.type!==Me.backQuote||this.eat(Me.dot)){let mt=this.startNodeAt(Ve,Ue);if(mt.object=Be,ut)mt.property=this.parseExpression(),this.expect(Me.bracketR);else if(this.type===Me.privateId&&Be.type!=="Super")mt.property=this.parsePrivateIdent();else mt.property=this.parseIdent(this.options.allowReserved!=="never");if(mt.computed=!!ut,et)mt.optional=ot;Be=this.finishNode(mt,"MemberExpression")}else if(!Ke&&this.eat(Me.parenL)){let mt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let gt=new Rr,Ct=this.yieldPos,$t=this.awaitPos,Wt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let Kt=this.parseExprList(Me.parenR,this.ecmaVersion>=8,!1,gt);if(Je&&!ot&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(gt,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=Ct,this.awaitPos=$t,this.awaitIdentPos=Wt,Be=this.parseSubscriptAsyncArrow(Ve,Ue,Kt,rt)}else{this.checkExpressionErrors(gt,!0),this.yieldPos=Ct||this.yieldPos,this.awaitPos=$t||this.awaitPos,this.awaitIdentPos=Wt||this.awaitIdentPos;let qt=this.startNodeAt(Ve,Ue);if(qt.callee=Be,qt.arguments=Kt,et)qt.optional=ot;Be=this.finishNode(qt,"CallExpression")}this.maybeInArrowParameters=mt}else if(this.type===Me.backQuote){if(ot||it)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let mt=this.startNodeAt(Ve,Ue);mt.tag=Be,mt.quasi=this.parseTemplate({isTagged:!0}),Be=this.finishNode(mt,"TaggedTemplateExpression")}return Be}parseGetterSetter(Be){Be.kind=Be.key.name,this.parsePropertyName(Be);let Ve=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Be.value=this.parseMethod(!1),Ve)Be.value.typeParameters=Ve;let Ue=Be.kind==="get"?0:1,Ke=Be.value.params[0];if(Ue=Ke&&this.isThisParam(Ke)?Ue+1:Ue,Be.value.params.length!==Ue){let Ye=Be.value.start;if(Be.kind==="get")this.raiseRecoverable(Ye,"getter should have no params");else this.raiseRecoverable(Ye,"setter should have exactly one param")}else if(Be.kind==="set"&&Be.value.params[0].type==="RestElement")this.raiseRecoverable(Be.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue(Be,Ve,Ue,Ke,Je,Ye,rt,it){if(this.tsMatchLeftRelational()){if(Ve)this.unexpected();Be.kind="init",Be.method=!0;let st=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Be.value=this.parseMethod(Ue,Ke),st)Be.value.typeParameters=st;return}return super.parsePropertyValue(Be,Ve,Ue,Ke,Je,Ye,rt,it)}parseProperty(Be,Ve){if(!Be){let Ue=[];if(this.match(Xe.at))while(this.match(Xe.at))Ue.push(this.parseDecorator());let Ke=super.parseProperty(Be,Ve);if(Ke.type==="SpreadElement"){if(Ue.length)this.raise(Ke.start,fs.SpreadElementDecorator)}if(Ue.length)Ke.decorators=Ue,Ue=[];return Ke}return super.parseProperty(Be,Ve)}parseCatchClauseParam(){let Be=this.parseBindingAtom(),Ve=Be.type==="Identifier";this.enterScope(Ve?Tt.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(Be,Ve?Tt.BIND_SIMPLE_CATCH:Tt.BIND_LEXICAL);let Ue=this.tsTryParseTypeAnnotation();if(Ue)Be.typeAnnotation=Ue,this.resetEndLocation(Be);return this.expect(Me.parenR),Be}parseClass(Be,Ve){let Ue=this.inAbstractClass;this.inAbstractClass=!!Be.abstract;try{this.next(),this.takeDecorators(Be);let Ke=this.strict;this.strict=!0,this.parseClassId(Be,Ve),this.parseClassSuper(Be);let Je=this.enterClassBody(),Ye=this.startNode(),rt=!1;Ye.body=[];let it=[];this.expect(Me.braceL);while(this.type!==Me.braceR){if(this.match(Xe.at)){it.push(this.parseDecorator());continue}let st=this.parseClassElement(Be.superClass!==null);if(it.length)st.decorators=it,this.resetStartLocationFromNode(st,it[0]),it=[];if(st){if(Ye.body.push(st),st.type==="MethodDefinition"&&st.kind==="constructor"&&st.value.type==="FunctionExpression"){if(rt)this.raiseRecoverable(st.start,"Duplicate constructor in the same class");if(rt=!0,st.decorators&&st.decorators.length>0)this.raise(st.start,fs.DecoratorConstructor)}else if(st.key&&st.key.type==="PrivateIdentifier"&&st.value?.type!=="TSDeclareMethod"){let et=st.key.name;if(this.parseEffects.modify(Je,et,(ut)=>Zd(ut,st)))this.raiseRecoverable(st.key.start,`Identifier '#${et}' has already been declared`)}}}if(this.strict=Ke,this.next(),it.length)this.raise(this.start,fs.TrailingDecorator);return Be.body=this.finishNode(Ye,"ClassBody"),this.exitClassBody(),this.finishNode(Be,Ve?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=Ue}}parseClassFunctionParams(){let Be=this.tsTryParseTypeParameters(),Ve=this.parseBindingList(Me.parenR,!1,this.ecmaVersion>=8,!0);if(Be)Ve.typeParameters=Be;return Ve}parseMethod(Be,Ve,Ue,Ke,Je){let Ye=this.startNode(),rt=this.yieldPos,it=this.awaitPos,st=this.awaitIdentPos;if(this.initFunction(Ye),this.ecmaVersion>=6)Ye.generator=Be;if(this.ecmaVersion>=8)Ye.async=!!Ve;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope($i(Ve,Ye.generator)|Tt.SCOPE_SUPER|(Ue?Tt.SCOPE_DIRECT_SUPER:0)),this.expect(Me.parenL),Ye.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Ye,!1,!0,!1,{isClassMethod:Ke}),this.yieldPos=rt,this.awaitPos=it,this.awaitIdentPos=st,Je&&Je.abstract){if(!!Ye.body){let{key:ot}=Je;this.raise(Je.start,ft.AbstractMethodHasImplementation({methodName:ot.type==="Identifier"&&!Je.computed?ot.name:`[${this.input.slice(ot.start,ot.end)}]`}))}}return this.finishNode(Ye,"FunctionExpression")}static parse(Be,Ve){if(Ve.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else Ve.locations=!0;let Ue=new this(Ve,Be);if(Ie)Ue.isAmbientContext=!0;return Ue.parse()}static parseExpressionAt(Be,Ve,Ue){if(Ue.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else Ue.locations=!0;let Ke=new this(Ue,Be,Ve);if(Ie)Ke.isAmbientContext=!0;return Ke.nextToken(),Ke.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(Xe.type)){let Ve=this.startNode();return Ve.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(Ve,!0,this.importOrExportOuterKind==="type"),this.finishNode(Ve,"ImportSpecifier")}else{let Ve=super.parseImportSpecifier();return Ve.importKind="value",Ve}}parseExportSpecifier(Be){let Ve=this.ts_isContextual(Xe.type);if(!this.match(Me.string)&&Ve){let Ke=this.startNode();return Ke.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(Ke,!1,this.importOrExportOuterKind==="type"),this.finishNode(Ke,"ExportSpecifier"),this.checkExport(Be,Ke.exported,Ke.exported.start),Ke}else{let Ke=super.parseExportSpecifier(Be);return Ke.exportKind="value",Ke}}parseTypeOnlyImportExportSpecifier(Be,Ve,Ue){let Ke=Ve?"imported":"local",Je=Ve?"local":"exported",Ye=Be[Ke],rt,it=!1,st=!0,et=Ye.start;if(this.isContextual("as")){let ut=this.parseIdent();if(this.isContextual("as")){let mt=this.parseIdent();if(lt(this.type))it=!0,Ye=ut,rt=Ve?this.parseIdent():this.parseModuleExportName(),st=!1;else rt=mt,st=!1}else if(lt(this.type))st=!1,rt=Ve?this.parseIdent():this.parseModuleExportName();else it=!0,Ye=ut}else if(lt(this.type))if(it=!0,Ve){if(Ye=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(Ye)}else Ye=this.parseModuleExportName();if(it&&Ue)this.raise(et,Ve?ft.TypeModifierIsUsedInTypeImports:ft.TypeModifierIsUsedInTypeExports);Be[Ke]=Ye,Be[Je]=rt;let ot=Ve?"importKind":"exportKind";if(Be[ot]=it?"type":"value",st&&this.eatContextual("as"))Be[Je]=Ve?this.parseIdent():this.parseModuleExportName();if(!Be[Je])Be[Je]=this.copyNode(Be[Ke]);if(Ve)this.checkLValSimple(Be[Je],Tt.BIND_LEXICAL)}raiseCommonCheck(Be,Ve,Ue){switch(Ve){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(Me.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(Be,Ve)}return Ue?super.raiseRecoverable(Be,Ve):super.raise(Be,Ve)}raiseRecoverable(Be,Ve){return this.raiseCommonCheck(Be,Ve,!0)}raise(Be,Ve){return this.raiseCommonCheck(Be,Ve,!0)}updateContext(Be){let{type:Ve}=this;if(Ve==Me.braceL){var Ue=this.curContext();if(Ue==Qe.tc_oTag)this.parseEffects.append(this.context,Ge.b_expr);else if(Ue==Qe.tc_expr)this.parseEffects.append(this.context,Ge.b_tmpl);else super.updateContext(Be);this.exprAllowed=!0}else if(Ve===Me.slash&&Be===Xe.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,Qe.tc_cTag),this.exprAllowed=!1;else return super.updateContext(Be)}jsx_parseOpeningElementAt(Be,Ve){let Ue=this.startNodeAt(Be,Ve),Ke=this.jsx_parseElementName();if(Ke)Ue.name=Ke;if(this.match(Me.relational)||this.match(Me.bitShift)){let Je=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(Je)Ue.typeArguments=Je}Ue.attributes=[];while(this.type!==Me.slash&&this.type!==Xe.jsxTagEnd)Ue.attributes.push(this.jsx_parseAttribute());return Ue.selfClosing=this.eat(Me.slash),this.expect(Xe.jsxTagEnd),this.finishNode(Ue,Ke?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(Be){let Ve=Be===Ir;if(Ve)this.parseEffects.append(this.importsStack,[]);let Ue=Ve?Be|Tt.SCOPE_CLASS_STATIC_BLOCK:Be;super.enterScope(Ue);let Ke=super.currentScope();Ke.types=[],Ke.enums=[],Ke.constEnums=[],Ke.classes=[],Ke.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&Ir)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport(Be,Ve){let Ue=this.importsStack.length;if(this.importsStack[Ue-1].indexOf(Be)>-1)return!0;if(!Ve&&Ue>1){for(let Ke=0;Ke<Ue-1;Ke++)if(this.importsStack[Ke].indexOf(Be)>-1)return!0}return!1}maybeExportDefined(Be,Ve){if(this.inModule&&Be.flags&Tt.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,Ve)}declareName(Be,Ve,Ue){if(Ve&Tt.BIND_FLAGS_TS_IMPORT){if(this.hasImport(Be,!0))this.raise(Ue,`Identifier '${Be}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],Be);return}let Ke=this.currentScope();if(Ve&Tt.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(Ke,Be),this.parseEffects.append(Ke.exportOnlyBindings,Be);return}if(Ve===Tt.BIND_TS_TYPE||Ve===Tt.BIND_TS_INTERFACE){if(Ve===Tt.BIND_TS_TYPE&&Ke.types.includes(Be))this.raise(Ue,`type '${Be}' has already been declared.`);this.parseEffects.append(Ke.types,Be)}else if(Ve&Tt.BIND_FLAGS_TS_ENUM){if(Ke.enums.includes(Be))return;super.declareName(Be,Tt.BIND_LEXICAL,Ue)}else super.declareName(Be,Ve,Ue);if(Ve&Tt.BIND_FLAGS_TS_ENUM)this.parseEffects.append(Ke.enums,Be);if(Ve&Tt.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(Ke.constEnums,Be);if(Ve&Tt.BIND_FLAGS_CLASS)this.parseEffects.append(Ke.classes,Be)}checkLocalExport(Be){let{name:Ve}=Be;if(this.hasImport(Ve))return;let Ue=this.scopeStack.length;for(let Ke=Ue-1;Ke>=0;Ke--){let Je=this.scopeStack[Ke];if(Je.types.indexOf(Ve)>-1||Je.exportOnlyBindings.indexOf(Ve)>-1)return}super.checkLocalExport(Be)}}return vt}}var Ef=/\n/,Cf=/[ \t]/,vf=/^[,) \t]*$/,ms="",Tc=[];function ys(i,Ie){ms=i,Tc=Ie}function gs(i,Ie,Re,Le){let Oe=Ie;if(i&&Ef.test(Oe)){let $e=Re;while($e>0&&ms[$e-1]!==`
|
|
12
|
+
`)$e-=1;let Me=$e;while(Cf.test(ms[Me]))Me+=1;let Fe=ms.slice($e,Me);Oe=Sf(Oe,Fe)}Tc.push({type:i?"Block":"Line",value:Oe,start:Re,end:Le})}function Sf(i,Ie){if(Ie==="")return i;return(i.startsWith(Ie)?i.slice(Ie.length):i).replaceAll(`
|
|
13
|
+
${Ie}`,`
|
|
14
|
+
`)}function Vi(i,Ie,Re,Le){let Oe=Tf(Re,Le);if(Oe>=Re.length)return;ji(i,void 0,Re,{index:Oe},Ie)}function Tf(i,Ie){let Re=0,Le=i.length;while(Re<Le){let Oe=Re+Le>>>1;if(i[Oe].start<Ie)Re=Oe+1;else Le=Oe}return Re}function ji(i,Ie,Re,Le,Oe){while(Le.index<Re.length&&Re[Le.index].start<(i.start??0))i.leadingComments??=[],i.leadingComments.push(Re[Le.index]),Le.index++;if(Le.index>=Re.length)return;let $e=Re[Le.index].start,Me=i.end,je=Me===void 0||Me>$e?Object.keys(i):[];for(let qe=0;qe<je.length;qe++){let We=je[qe];if(We==="type"||We==="leadingComments")continue;let Ge=i[We];if(!Ge||typeof Ge!=="object")continue;if(Array.isArray(Ge)){for(let ze of Ge)if(ze&&typeof ze==="object"&&typeof ze.type==="string"){if(ji(ze,i,Re,Le,Oe),Le.index>=Re.length)return}}else if(typeof Ge.type==="string"){if(ji(Ge,i,Re,Le,Oe),Le.index>=Re.length)return}}if(Le.index<Re.length){let qe=Re[Le.index];if(Ie===void 0||i.end!==Ie.end){let We=Oe.slice(i.end??0,qe.start);if((Ie?.type==="BlockStatement"||Ie?.type==="Program")&&Fi(Ie.body,i)||Ie?.type==="ArrayExpression"&&Fi(Ie.elements,i)||Ie?.type==="ObjectExpression"&&Fi(Ie.properties,i))while(Le.index<Re.length){if(Ie&&Re[Le.index].start>=(Ie.end??Number.POSITIVE_INFINITY))break;Le.index++}else if((i.end??0)<=qe.start&&vf.test(We))Le.index++}}}function Fi(i,Ie){return!!i&&i.indexOf(Ie)===i.length-1}var xs={sawParenthesized:!1},Ac=(i)=>class extends i{parseParenAndDistinguishExpression(Ie,Re){let Le=super.parseParenAndDistinguishExpression(Ie,Re);if(Le.type==="ParenthesizedExpression")xs.sawParenthesized=!0;return Le}parseDecorator(){return xs.sawParenthesized=!0,super.parseDecorator()}},kf=Ot.extend(Ac),wf=Ot.extend(Sc(),Ac);function Ui(i){return i?wf:kf}var Af={onComment:gs,sourceType:"module",ecmaVersion:16},Pc={onComment:gs,sourceType:"module",ecmaVersion:16,preserveParens:!0},Pf={onComment:gs,sourceType:"module",ecmaVersion:16},kc={...Pc,startLocation:null},Wi=/\r\n?|\n|\u2028|\u2029/g;function Nf(i,Ie){if(Ie?.breakEnds)return Ie.breakEnds;let Re=[];Wi.lastIndex=0;while(Wi.test(i))Re.push(Wi.lastIndex);if(Ie)Ie.breakEnds=Re;return Re}function _f(i,Ie,Re){let Le=i.lastIndexOf(`
|
|
15
|
+
`,Ie-1)+1,Oe=Nf(i,Re),$e=0,Me=Oe.length;while($e<Me){let Fe=$e+Me>>>1;if(Oe[Fe]<=Le)$e=Fe+1;else Me=Fe}return{line:$e+1,column:Ie-Le}}function Nc(i,Ie,Re,Le,Oe){if(Re.length===Oe)return;Vi(i,Ie,Re,Le)}function dr(i,Ie,Re){let Le=Re.length;ys(i,Re);let Oe=Ui(Ie).parse(i,Af);if(Re.length>0)Vi(Oe,i,Re,Le);return Oe}var Df={count:0};function fr(i,Ie,Re,Le,Oe){Df.count+=1;let $e=Le.length;ys(i,Le),xs.sawParenthesized=!1;let Me=Pc;if(Re)kc.startLocation=_f(i,Ie,Oe),Me=kc;let Fe=Ui(Re).parseExpressionAt(i,Ie,Me);Nc(Fe,i,Le,Ie,$e);let je=Le.length>$e?Le.at(-1):void 0,qe=je&&je.end>(Fe.end??0)?je.end:Fe.end??0;return{node:xs.sawParenthesized?If(Fe):Fe,end:qe}}function _c(i,Ie,Re,Le){let Oe=Le.length,$e=Ui(Re);ys(i,Le);let Me=new $e(Pf,i,Ie);Me.nextToken();let Fe=Me.parseStatement(null,!0,Object.create(null));return Nc(Fe,i,Le,Ie,Oe),Fe}function wc(i){return i!==null&&typeof i==="object"&&typeof i.type==="string"}function qi(i){let Ie=i;while(Ie.type==="ParenthesizedExpression"&&Ie.expression)Ie=Ie.expression;return Ie}function If(i){let Ie=qi(i);return Gi(Ie),Ie}function Gi(i){for(let Ie in i){let Re=i[Ie];if(!Re||typeof Re!=="object")continue;if(Array.isArray(Re))for(let Le=0;Le<Re.length;Le++){let Oe=Re[Le];if(!wc(Oe))continue;let $e=qi(Oe);if($e!==Oe)Re[Le]=$e;Gi($e)}else if(wc(Re)){let Le=qi(Re);if(Le!==Re)i[Ie]=Le;Gi(Le)}}}function Yn(i){if(i===32||i<=13&&i>=9)return!0;if(i<160)return!1;return i===160||i===5760||i>=8192&&i<=8202||i===8232||i===8233||i===8239||i===8287||i===12288||i===65279}class Hi{source;index=0;constructor(i){this.source=i}match(i){if(i.length===1)return this.source.charCodeAt(this.index)===i.charCodeAt(0);return this.source.startsWith(i,this.index)}matchRegex(i){i.lastIndex=this.index;let Ie=i.exec(this.source);if(!Ie||Ie.index!==this.index)return null;return Ie[0]}eat(i,Ie=!1){if(this.match(i))return this.index+=i.length,!0;if(Ie)throw new Vn(`Expected token ${JSON.stringify(i)}`,this.index);return!1}read(i){let Ie=this.matchRegex(i);if(Ie)this.index+=Ie.length;return Ie}readUntil(i){if(this.index>=this.source.length)throw new Vn("Unexpected end of input",this.source.length);let Ie=this.index;i.lastIndex=Ie;let Re=i.exec(this.source);if(Re)return this.index=Re.index,this.source.slice(Ie,this.index);return this.index=this.source.length,this.source.slice(Ie)}readUntilString(i){if(this.index>=this.source.length)throw new Vn("Unexpected end of input",this.source.length);let Ie=this.source.indexOf(i,this.index),Re=Ie===-1?this.source.length:Ie,Le=this.source.slice(this.index,Re);return this.index=Re,Le}allowWhitespace(){while(this.index<this.source.length&&Yn(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!Yn(this.source.charCodeAt(this.index)))throw new Vn("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let i=this.index,Ie=i,Re="",Le=this.source.codePointAt(this.index);if(Le!==void 0&&Zt(Le,!0)){Ie+=Le<=65535?1:2;while(Ie<this.source.length){let Oe=this.source.codePointAt(Ie);if(Oe===void 0||!on(Oe,!0))break;Ie+=Oe<=65535?1:2}Re=this.source.slice(i,Ie),this.index=Ie}return{type:"Identifier",name:Re,start:i,end:Ie}}}class Vn extends Error{position;constructor(i,Ie){super(`${i} (at index ${Ie})`);this.name="TemplateSyntaxError",this.position=Ie}}function tn(){return{type:"Fragment",nodes:[]}}var Rf=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","finally","for","function","if","implements","import","in","instanceof","interface","let","new","package","private","protected","public","return","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"]),Lf=["&&","||","??"],Of=["===","!==","==","!="];function Dc(i,Ie){let Re=i.codePointAt(Ie);if(Re===void 0||!Zt(Re,!0))return Ie;let Le=Ie+(Re<=65535?1:2);while(Le<i.length){let Oe=i.codePointAt(Le);if(!on(Oe,!0))break;Le+=Oe<=65535?1:2}return Le}function Mf(i,Ie){let Re=Ie;while(Re<i.length){let Le=i.charCodeAt(Re);if(Le<48||Le>57)break;Re++}return Re}function bs(i,Ie){let Re=Ie;while(Re<i.length&&Yn(i.charCodeAt(Re)))Re++;return Re}function Ic(i,Ie){let Re=Mf(i,Ie);if(Re===Ie)return null;if(i.charCodeAt(Ie)===48&&Re-Ie>1)return null;if(Re<i.length){let Oe=i.codePointAt(Re);if(Oe===46||on(Oe,!0))return null}let Le=i.slice(Ie,Re);return{type:"Literal",start:Ie,end:Re,value:Number(Le),raw:Le}}function Rc(i,Ie){let Re=i.charCodeAt(Ie),Le=Ie+1;while(Le<i.length){let Oe=i.charCodeAt(Le);if(Oe===Re){let $e=i.slice(Ie,Le+1);return{type:"Literal",start:Ie,end:Le+1,value:i.slice(Ie+1,Le),raw:$e}}if(Oe===92||Oe===10||Oe===13)return null;Le++}return null}function $f(i,Ie){let Re=i.charCodeAt(Ie);if(Re===34||Re===39)return Rc(i,Ie);let Le=Dc(i,Ie);if(Le===Ie)return Ic(i,Ie);let Oe=i.slice(Ie,Le);if(Oe==="true"||Oe==="false")return{type:"Literal",start:Ie,end:Le,value:Oe==="true",raw:Oe};if(Oe==="null")return{type:"Literal",start:Ie,end:Le,value:null,raw:Oe};if(Rf.has(Oe))return null;let $e={type:"Identifier",start:Ie,end:Le,name:Oe},Me=Le;while(Me<i.length){let Fe=i.charCodeAt(Me);if(Fe===46){let je=Me+1,qe=Dc(i,je);if(qe===je)return null;let We={type:"Identifier",start:je,end:qe,name:i.slice(je,qe)};$e={type:"MemberExpression",start:Ie,end:qe,object:$e,property:We,computed:!1,optional:!1},Me=qe}else if(Fe===91){let je=Me+1,qe=i.charCodeAt(je),We=qe===34||qe===39?Rc(i,je):Ic(i,je);if(!We||i.charCodeAt(We.end)!==93)return null;$e={type:"MemberExpression",start:Ie,end:We.end+1,object:$e,property:We,computed:!0,optional:!1},Me=We.end+1}else break}return $e}function Ki(i,Ie){if(i.charCodeAt(Ie)!==33||i.charCodeAt(Ie+1)===61)return $f(i,Ie);let Re=Ki(i,bs(i,Ie+1));if(!Re)return null;return{type:"UnaryExpression",start:Ie,end:Re.end,operator:"!",prefix:!0,argument:Re}}function Bf(i,Ie){for(let Re of Of)if(i.startsWith(Re,Ie))return{operator:Re,logical:!1};for(let Re of Lf)if(i.startsWith(Re,Ie))return{operator:Re,logical:!0};return null}function Lc(i,Ie){let Re=bs(i,Ie);if(Re>=i.length)return!1;let Le=i.charCodeAt(Re);return Le===125||Le===41}function Ff(i){let Ie=i.source,Re=Ki(Ie,i.index);if(!Re)return null;if(Lc(Ie,Re.end))return i.index=Re.end,Re;let Le=bs(Ie,Re.end),Oe=Bf(Ie,Le);if(!Oe)return null;let $e=Ki(Ie,bs(Ie,Le+Oe.operator.length));if(!$e||!Lc(Ie,$e.end))return null;return i.index=$e.end,{type:Oe.logical?"LogicalExpression":"BinaryExpression",start:Re.start,end:$e.end,left:Re,operator:Oe.operator,right:$e}}function Ht(i){let Ie=Ff(i);if(Ie)return Ie;let{node:Re,end:Le}=fr(i.source,i.index,i.isTypeScript,i.root.comments,i.lineTable);return i.index=Le,Re}var jf={"CounterClockwiseContourIntegral;":8755,"ClockwiseContourIntegral;":8754,"DoubleLongLeftRightArrow;":10234,"NotNestedGreaterGreater;":10914,"DiacriticalDoubleAcute;":733,"NotSquareSupersetEqual;":8931,"CloseCurlyDoubleQuote;":8221,"DoubleContourIntegral;":8751,"FilledVerySmallSquare;":9642,"NegativeVeryThinSpace;":8203,"NotPrecedesSlantEqual;":8928,"NotRightTriangleEqual;":8941,"NotSucceedsSlantEqual;":8929,"CapitalDifferentialD;":8517,"DoubleLeftRightArrow;":8660,"DoubleLongRightArrow;":10233,"EmptyVerySmallSquare;":9643,"NestedGreaterGreater;":8811,"NotDoubleVerticalBar;":8742,"NotGreaterSlantEqual;":10878,"NotLeftTriangleEqual;":8940,"NotSquareSubsetEqual;":8930,"OpenCurlyDoubleQuote;":8220,"ReverseUpEquilibrium;":10607,"DoubleLongLeftArrow;":10232,"DownLeftRightVector;":10576,"LeftArrowRightArrow;":8646,"NegativeMediumSpace;":8203,"NotGreaterFullEqual;":8807,"NotRightTriangleBar;":10704,"RightArrowLeftArrow;":8644,"SquareSupersetEqual;":8850,"leftrightsquigarrow;":8621,"DownRightTeeVector;":10591,"DownRightVectorBar;":10583,"LongLeftRightArrow;":10231,"Longleftrightarrow;":10234,"NegativeThickSpace;":8203,"NotLeftTriangleBar;":10703,"PrecedesSlantEqual;":8828,"ReverseEquilibrium;":8651,"RightDoubleBracket;":10215,"RightDownTeeVector;":10589,"RightDownVectorBar;":10581,"RightTriangleEqual;":8885,"SquareIntersection;":8851,"SucceedsSlantEqual;":8829,"blacktriangleright;":9656,"longleftrightarrow;":10231,"DoubleUpDownArrow;":8661,"DoubleVerticalBar;":8741,"DownLeftTeeVector;":10590,"DownLeftVectorBar;":10582,"FilledSmallSquare;":9724,"GreaterSlantEqual;":10878,"LeftDoubleBracket;":10214,"LeftDownTeeVector;":10593,"LeftDownVectorBar;":10585,"LeftTriangleEqual;":8884,"NegativeThinSpace;":8203,"NotGreaterGreater;":8811,"NotLessSlantEqual;":10877,"NotNestedLessLess;":10913,"NotReverseElement;":8716,"NotSquareSuperset;":8848,"NotTildeFullEqual;":8775,"RightAngleBracket;":10217,"RightUpDownVector;":10575,"SquareSubsetEqual;":8849,"VerticalSeparator;":10072,"blacktriangledown;":9662,"blacktriangleleft;":9666,"leftrightharpoons;":8651,"rightleftharpoons;":8652,"twoheadrightarrow;":8608,"DiacriticalAcute;":180,"DiacriticalGrave;":96,"DiacriticalTilde;":732,"DoubleRightArrow;":8658,"DownArrowUpArrow;":8693,"EmptySmallSquare;":9723,"GreaterEqualLess;":8923,"GreaterFullEqual;":8807,"LeftAngleBracket;":10216,"LeftUpDownVector;":10577,"LessEqualGreater;":8922,"NonBreakingSpace;":160,"NotPrecedesEqual;":10927,"NotRightTriangle;":8939,"NotSucceedsEqual;":10928,"NotSucceedsTilde;":8831,"NotSupersetEqual;":8841,"RightTriangleBar;":10704,"RightUpTeeVector;":10588,"RightUpVectorBar;":10580,"UnderParenthesis;":9181,"UpArrowDownArrow;":8645,"circlearrowright;":8635,"downharpoonright;":8642,"ntrianglerighteq;":8941,"rightharpoondown;":8641,"rightrightarrows;":8649,"twoheadleftarrow;":8606,"vartriangleright;":8883,"CloseCurlyQuote;":8217,"ContourIntegral;":8750,"DoubleDownArrow;":8659,"DoubleLeftArrow;":8656,"DownRightVector;":8641,"LeftRightVector;":10574,"LeftTriangleBar;":10703,"LeftUpTeeVector;":10592,"LeftUpVectorBar;":10584,"LowerRightArrow;":8600,"NotGreaterEqual;":8817,"NotGreaterTilde;":8821,"NotHumpDownHump;":8782,"NotLeftTriangle;":8938,"NotSquareSubset;":8847,"OverParenthesis;":9180,"RightDownVector;":8642,"ShortRightArrow;":8594,"UpperRightArrow;":8599,"bigtriangledown;":9661,"circlearrowleft;":8634,"curvearrowright;":8631,"downharpoonleft;":8643,"leftharpoondown;":8637,"leftrightarrows;":8646,"nLeftrightarrow;":8654,"nleftrightarrow;":8622,"ntrianglelefteq;":8940,"rightleftarrows;":8644,"rightsquigarrow;":8605,"rightthreetimes;":8908,"straightepsilon;":1013,"trianglerighteq;":8885,"vartriangleleft;":8882,"DiacriticalDot;":729,"DoubleRightTee;":8872,"DownLeftVector;":8637,"GreaterGreater;":10914,"HorizontalLine;":9472,"InvisibleComma;":8291,"InvisibleTimes;":8290,"LeftDownVector;":8643,"LeftRightArrow;":8596,"Leftrightarrow;":8660,"LessSlantEqual;":10877,"LongRightArrow;":10230,"Longrightarrow;":10233,"LowerLeftArrow;":8601,"NestedLessLess;":8810,"NotGreaterLess;":8825,"NotLessGreater;":8824,"NotSubsetEqual;":8840,"NotVerticalBar;":8740,"OpenCurlyQuote;":8216,"ReverseElement;":8715,"RightTeeVector;":10587,"RightVectorBar;":10579,"ShortDownArrow;":8595,"ShortLeftArrow;":8592,"SquareSuperset;":8848,"TildeFullEqual;":8773,"UpperLeftArrow;":8598,"ZeroWidthSpace;":8203,"curvearrowleft;":8630,"doublebarwedge;":8966,"downdownarrows;":8650,"hookrightarrow;":8618,"leftleftarrows;":8647,"leftrightarrow;":8596,"leftthreetimes;":8907,"longrightarrow;":10230,"looparrowright;":8620,"nshortparallel;":8742,"ntriangleright;":8939,"rightarrowtail;":8611,"rightharpoonup;":8640,"trianglelefteq;":8884,"upharpoonright;":8638,"ApplyFunction;":8289,"DifferentialD;":8518,"DoubleLeftTee;":10980,"DoubleUpArrow;":8657,"LeftTeeVector;":10586,"LeftVectorBar;":10578,"LessFullEqual;":8806,"LongLeftArrow;":10229,"Longleftarrow;":10232,"NotEqualTilde;":8770,"NotTildeEqual;":8772,"NotTildeTilde;":8777,"Poincareplane;":8460,"PrecedesEqual;":10927,"PrecedesTilde;":8830,"RightArrowBar;":8677,"RightTeeArrow;":8614,"RightTriangle;":8883,"RightUpVector;":8638,"SucceedsEqual;":10928,"SucceedsTilde;":8831,"SupersetEqual;":8839,"UpEquilibrium;":10606,"VerticalTilde;":8768,"VeryThinSpace;":8202,"bigtriangleup;":9651,"blacktriangle;":9652,"divideontimes;":8903,"fallingdotseq;":8786,"hookleftarrow;":8617,"leftarrowtail;":8610,"leftharpoonup;":8636,"longleftarrow;":10229,"looparrowleft;":8619,"measuredangle;":8737,"ntriangleleft;":8938,"shortparallel;":8741,"smallsetminus;":8726,"triangleright;":9657,"upharpoonleft;":8639,"varsubsetneqq;":10955,"varsupsetneqq;":10956,"DownArrowBar;":10515,"DownTeeArrow;":8615,"ExponentialE;":8519,"GreaterEqual;":8805,"GreaterTilde;":8819,"HilbertSpace;":8459,"HumpDownHump;":8782,"Intersection;":8898,"LeftArrowBar;":8676,"LeftTeeArrow;":8612,"LeftTriangle;":8882,"LeftUpVector;":8639,"NotCongruent;":8802,"NotHumpEqual;":8783,"NotLessEqual;":8816,"NotLessTilde;":8820,"Proportional;":8733,"RightCeiling;":8969,"RoundImplies;":10608,"ShortUpArrow;":8593,"SquareSubset;":8847,"UnderBracket;":9141,"VerticalLine;":124,"blacklozenge;":10731,"exponentiale;":8519,"risingdotseq;":8787,"triangledown;":9663,"triangleleft;":9667,"varsubsetneq;":8842,"varsupsetneq;":8843,"CircleMinus;":8854,"CircleTimes;":8855,"Equilibrium;":8652,"GreaterLess;":8823,"LeftCeiling;":8968,"LessGreater;":8822,"MediumSpace;":8287,"NotLessLess;":8810,"NotPrecedes;":8832,"NotSucceeds;":8833,"NotSuperset;":8835,"OverBracket;":9140,"RightVector;":8640,"Rrightarrow;":8667,"RuleDelayed;":10740,"SmallCircle;":8728,"SquareUnion;":8852,"SubsetEqual;":8838,"UpDownArrow;":8597,"Updownarrow;":8661,"VerticalBar;":8739,"backepsilon;":1014,"blacksquare;":9642,"circledcirc;":8858,"circleddash;":8861,"curlyeqprec;":8926,"curlyeqsucc;":8927,"diamondsuit;":9830,"eqslantless;":10901,"expectation;":8496,"nRightarrow;":8655,"nrightarrow;":8603,"preccurlyeq;":8828,"precnapprox;":10937,"quaternions;":8461,"straightphi;":981,"succcurlyeq;":8829,"succnapprox;":10938,"thickapprox;":8776,"updownarrow;":8597,"Bernoullis;":8492,"CirclePlus;":8853,"EqualTilde;":8770,"Fouriertrf;":8497,"ImaginaryI;":8520,"Laplacetrf;":8466,"LeftVector;":8636,"Lleftarrow;":8666,"NotElement;":8713,"NotGreater;":8815,"Proportion;":8759,"RightArrow;":8594,"RightFloor;":8971,"Rightarrow;":8658,"ThickSpace;":8287,"TildeEqual;":8771,"TildeTilde;":8776,"UnderBrace;":9183,"UpArrowBar;":10514,"UpTeeArrow;":8613,"circledast;":8859,"complement;":8705,"curlywedge;":8911,"eqslantgtr;":10902,"gtreqqless;":10892,"lessapprox;":10885,"lesseqqgtr;":10891,"lmoustache;":9136,"longmapsto;":10236,"mapstodown;":8615,"mapstoleft;":8612,"nLeftarrow;":8653,"nleftarrow;":8602,"nsubseteqq;":10949,"nsupseteqq;":10950,"precapprox;":10935,"rightarrow;":8594,"rmoustache;":9137,"sqsubseteq;":8849,"sqsupseteq;":8850,"subsetneqq;":10955,"succapprox;":10936,"supsetneqq;":10956,"upuparrows;":8648,"varepsilon;":1013,"varnothing;":8709,"Backslash;":8726,"CenterDot;":183,"CircleDot;":8857,"Congruent;":8801,"Coproduct;":8720,"DoubleDot;":168,"DownArrow;":8595,"DownBreve;":785,"Downarrow;":8659,"HumpEqual;":8783,"LeftArrow;":8592,"LeftFloor;":8970,"Leftarrow;":8656,"LessTilde;":8818,"Mellintrf;":8499,"MinusPlus;":8723,"NotCupCap;":8813,"NotExists;":8708,"NotSubset;":8834,"OverBrace;":9182,"PlusMinus;":177,"Therefore;":8756,"ThinSpace;":8201,"TripleDot;":8411,"UnionPlus;":8846,"backprime;":8245,"backsimeq;":8909,"bigotimes;":10754,"centerdot;":183,"checkmark;":10003,"complexes;":8450,"dotsquare;":8865,"downarrow;":8595,"gtrapprox;":10886,"gtreqless;":8923,"gvertneqq;":8809,"heartsuit;":9829,"leftarrow;":8592,"lesseqgtr;":8922,"lvertneqq;":8808,"ngeqslant;":10878,"nleqslant;":10877,"nparallel;":8742,"nshortmid;":8740,"nsubseteq;":8840,"nsupseteq;":8841,"pitchfork;":8916,"rationals;":8474,"spadesuit;":9824,"subseteqq;":10949,"subsetneq;":8842,"supseteqq;":10950,"supsetneq;":8843,"therefore;":8756,"triangleq;":8796,"varpropto;":8733,"DDotrahd;":10513,"DotEqual;":8784,"Integral;":8747,"LessLess;":10913,"NotEqual;":8800,"NotTilde;":8769,"PartialD;":8706,"Precedes;":8826,"RightTee;":8866,"Succeeds;":8827,"SuchThat;":8715,"Superset;":8835,"Uarrocir;":10569,"UnderBar;":95,"andslope;":10840,"angmsdaa;":10664,"angmsdab;":10665,"angmsdac;":10666,"angmsdad;":10667,"angmsdae;":10668,"angmsdaf;":10669,"angmsdag;":10670,"angmsdah;":10671,"angrtvbd;":10653,"approxeq;":8778,"awconint;":8755,"backcong;":8780,"barwedge;":8965,"bbrktbrk;":9142,"bigoplus;":10753,"bigsqcup;":10758,"biguplus;":10756,"bigwedge;":8896,"boxminus;":8863,"boxtimes;":8864,"bsolhsub;":10184,"capbrcup;":10825,"circledR;":174,"circledS;":9416,"cirfnint;":10768,"clubsuit;":9827,"cupbrcap;":10824,"curlyvee;":8910,"cwconint;":8754,"doteqdot;":8785,"dotminus;":8760,"drbkarow;":10512,"dzigrarr;":10239,"elinters;":9191,"emptyset;":8709,"eqvparsl;":10725,"fpartint;":10765,"geqslant;":10878,"gesdotol;":10884,"gnapprox;":10890,"hksearow;":10533,"hkswarow;":10534,"imagline;":8464,"imagpart;":8465,"infintie;":10717,"integers;":8484,"intercal;":8890,"intlarhk;":10775,"laemptyv;":10676,"ldrushar;":10571,"leqslant;":10877,"lesdotor;":10883,"llcorner;":8990,"lnapprox;":10889,"lrcorner;":8991,"lurdshar;":10570,"mapstoup;":8613,"multimap;":8888,"naturals;":8469,"ncongdot;":10861,"notindot;":8949,"otimesas;":10806,"parallel;":8741,"plusacir;":10787,"pointint;":10773,"precneqq;":10933,"precnsim;":8936,"profalar;":9006,"profline;":8978,"profsurf;":8979,"raemptyv;":10675,"realpart;":8476,"rppolint;":10770,"rtriltri;":10702,"scpolint;":10771,"setminus;":8726,"shortmid;":8739,"smeparsl;":10724,"sqsubset;":8847,"sqsupset;":8848,"subseteq;":8838,"succneqq;":10934,"succnsim;":8937,"supseteq;":8839,"thetasym;":977,"thicksim;":8764,"timesbar;":10801,"triangle;":9653,"triminus;":10810,"trpezium;":9186,"ulcorner;":8988,"urcorner;":8989,"varkappa;":1008,"varsigma;":962,"vartheta;":977,"Because;":8757,"Cayleys;":8493,"Cconint;":8752,"Cedilla;":184,"Diamond;":8900,"DownTee;":8868,"Element;":8712,"Epsilon;":917,"Implies;":8658,"LeftTee;":8867,"NewLine;":10,"NoBreak;":8288,"NotLess;":8814,"Omicron;":927,"OverBar;":8254,"Product;":8719,"UpArrow;":8593,"Uparrow;":8657,"Upsilon;":933,"alefsym;":8501,"angrtvb;":8894,"angzarr;":9084,"asympeq;":8781,"backsim;":8765,"because;":8757,"bemptyv;":10672,"between;":8812,"bigcirc;":9711,"bigodot;":10752,"bigstar;":9733,"bnequiv;":8801,"boxplus;":8862,"ccupssm;":10832,"cemptyv;":10674,"cirscir;":10690,"coloneq;":8788,"congdot;":10861,"cudarrl;":10552,"cudarrr;":10549,"cularrp;":10557,"curarrm;":10556,"dbkarow;":10511,"ddagger;":8225,"ddotseq;":10871,"demptyv;":10673,"diamond;":8900,"digamma;":989,"dotplus;":8724,"dwangle;":10662,"epsilon;":949,"eqcolon;":8789,"equivDD;":10872,"gesdoto;":10882,"gtquest;":10876,"gtrless;":8823,"harrcir;":10568,"intprod;":10812,"isindot;":8949,"larrbfs;":10527,"larrsim;":10611,"lbrksld;":10639,"lbrkslu;":10637,"ldrdhar;":10599,"lesdoto;":10881,"lessdot;":8918,"lessgtr;":8822,"lesssim;":8818,"lotimes;":10804,"lozenge;":9674,"ltquest;":10875,"luruhar;":10598,"maltese;":10016,"minusdu;":10794,"napprox;":8777,"natural;":9838,"nearrow;":8599,"nexists;":8708,"notinva;":8713,"notinvb;":8951,"notinvc;":8950,"notniva;":8716,"notnivb;":8958,"notnivc;":8957,"npolint;":10772,"npreceq;":10927,"nsqsube;":8930,"nsqsupe;":8931,"nsubset;":8834,"nsucceq;":10928,"nsupset;":8835,"nvinfin;":10718,"nvltrie;":8884,"nvrtrie;":8885,"nwarrow;":8598,"olcross;":10683,"omicron;":959,"orderof;":8500,"orslope;":10839,"pertenk;":8241,"planckh;":8462,"pluscir;":10786,"plussim;":10790,"plustwo;":10791,"precsim;":8830,"quatint;":10774,"questeq;":8799,"rarrbfs;":10528,"rarrsim;":10612,"rbrksld;":10638,"rbrkslu;":10640,"rdldhar;":10601,"realine;":8475,"rotimes;":10805,"ruluhar;":10600,"searrow;":8600,"simplus;":10788,"simrarr;":10610,"subedot;":10947,"submult;":10945,"subplus;":10943,"subrarr;":10617,"succsim;":8831,"supdsub;":10968,"supedot;":10948,"suphsol;":10185,"suphsub;":10967,"suplarr;":10619,"supmult;":10946,"supplus;":10944,"swarrow;":8601,"topfork;":10970,"triplus;":10809,"tritime;":10811,"uparrow;":8593,"upsilon;":965,"uwangle;":10663,"vzigzag;":10650,"zigrarr;":8669,"Aacute;":193,"Abreve;":258,"Agrave;":192,"Assign;":8788,"Atilde;":195,"Barwed;":8966,"Bumpeq;":8782,"Cacute;":262,"Ccaron;":268,"Ccedil;":199,"Colone;":10868,"Conint;":8751,"CupCap;":8781,"Dagger;":8225,"Dcaron;":270,"DotDot;":8412,"Dstrok;":272,"Eacute;":201,"Ecaron;":282,"Egrave;":200,"Exists;":8707,"ForAll;":8704,"Gammad;":988,"Gbreve;":286,"Gcedil;":290,"HARDcy;":1066,"Hstrok;":294,"Iacute;":205,"Igrave;":204,"Itilde;":296,"Jsercy;":1032,"Kcedil;":310,"Lacute;":313,"Lambda;":923,"Lcaron;":317,"Lcedil;":315,"Lmidot;":319,"Lstrok;":321,"Nacute;":323,"Ncaron;":327,"Ncedil;":325,"Ntilde;":209,"Oacute;":211,"Odblac;":336,"Ograve;":210,"Oslash;":216,"Otilde;":213,"Otimes;":10807,"Racute;":340,"Rarrtl;":10518,"Rcaron;":344,"Rcedil;":342,"SHCHcy;":1065,"SOFTcy;":1068,"Sacute;":346,"Scaron;":352,"Scedil;":350,"Square;":9633,"Subset;":8912,"Supset;":8913,"Tcaron;":356,"Tcedil;":354,"Tstrok;":358,"Uacute;":218,"Ubreve;":364,"Udblac;":368,"Ugrave;":217,"Utilde;":360,"Vdashl;":10982,"Verbar;":8214,"Vvdash;":8874,"Yacute;":221,"Zacute;":377,"Zcaron;":381,"aacute;":225,"abreve;":259,"agrave;":224,"andand;":10837,"angmsd;":8737,"angsph;":8738,"apacir;":10863,"approx;":8776,"atilde;":227,"barvee;":8893,"barwed;":8965,"becaus;":8757,"bernou;":8492,"bigcap;":8898,"bigcup;":8899,"bigvee;":8897,"bkarow;":10509,"bottom;":8869,"bowtie;":8904,"boxbox;":10697,"bprime;":8245,"brvbar;":166,"bullet;":8226,"bumpeq;":8783,"cacute;":263,"capand;":10820,"capcap;":10827,"capcup;":10823,"capdot;":10816,"ccaron;":269,"ccedil;":231,"circeq;":8791,"cirmid;":10991,"colone;":8788,"commat;":64,"compfn;":8728,"conint;":8750,"coprod;":8720,"copysr;":8471,"cularr;":8630,"cupcap;":10822,"cupcup;":10826,"cupdot;":8845,"curarr;":8631,"curren;":164,"cylcty;":9005,"dagger;":8224,"daleth;":8504,"dcaron;":271,"dfisht;":10623,"divide;":247,"divonx;":8903,"dlcorn;":8990,"dlcrop;":8973,"dollar;":36,"drcorn;":8991,"drcrop;":8972,"dstrok;":273,"eacute;":233,"easter;":10862,"ecaron;":283,"ecolon;":8789,"egrave;":232,"egsdot;":10904,"elsdot;":10903,"emptyv;":8709,"emsp13;":8196,"emsp14;":8197,"eparsl;":10723,"eqcirc;":8790,"equals;":61,"equest;":8799,"female;":9792,"ffilig;":64259,"ffllig;":64260,"forall;":8704,"frac12;":189,"frac13;":8531,"frac14;":188,"frac15;":8533,"frac16;":8537,"frac18;":8539,"frac23;":8532,"frac25;":8534,"frac34;":190,"frac35;":8535,"frac38;":8540,"frac45;":8536,"frac56;":8538,"frac58;":8541,"frac78;":8542,"gacute;":501,"gammad;":989,"gbreve;":287,"gesdot;":10880,"gesles;":10900,"gtlPar;":10645,"gtrarr;":10616,"gtrdot;":8919,"gtrsim;":8819,"hairsp;":8202,"hamilt;":8459,"hardcy;":1098,"hearts;":9829,"hellip;":8230,"hercon;":8889,"homtht;":8763,"horbar;":8213,"hslash;":8463,"hstrok;":295,"hybull;":8259,"hyphen;":8208,"iacute;":237,"igrave;":236,"iiiint;":10764,"iinfin;":10716,"incare;":8453,"inodot;":305,"intcal;":8890,"iquest;":191,"isinsv;":8947,"itilde;":297,"jsercy;":1112,"kappav;":1008,"kcedil;":311,"kgreen;":312,"lAtail;":10523,"lacute;":314,"lagran;":8466,"lambda;":955,"langle;":10216,"larrfs;":10525,"larrhk;":8617,"larrlp;":8619,"larrpl;":10553,"larrtl;":8610,"latail;":10521,"lbrace;":123,"lbrack;":91,"lcaron;":318,"lcedil;":316,"ldquor;":8222,"lesdot;":10879,"lesges;":10899,"lfisht;":10620,"lfloor;":8970,"lharul;":10602,"llhard;":10603,"lmidot;":320,"lmoust;":9136,"loplus;":10797,"lowast;":8727,"lowbar;":95,"lparlt;":10643,"lrhard;":10605,"lsaquo;":8249,"lsquor;":8218,"lstrok;":322,"lthree;":8907,"ltimes;":8905,"ltlarr;":10614,"ltrPar;":10646,"mapsto;":8614,"marker;":9646,"mcomma;":10793,"midast;":42,"midcir;":10992,"middot;":183,"minusb;":8863,"minusd;":8760,"mnplus;":8723,"models;":8871,"mstpos;":8766,"nVDash;":8879,"nVdash;":8878,"nacute;":324,"nbumpe;":8783,"ncaron;":328,"ncedil;":326,"nearhk;":10532,"nequiv;":8802,"nesear;":10536,"nexist;":8708,"nltrie;":8940,"notinE;":8953,"nparsl;":11005,"nprcue;":8928,"nrarrc;":10547,"nrarrw;":8605,"nrtrie;":8941,"nsccue;":8929,"nsimeq;":8772,"ntilde;":241,"numero;":8470,"nvDash;":8877,"nvHarr;":10500,"nvdash;":8876,"nvlArr;":10498,"nvrArr;":10499,"nwarhk;":10531,"nwnear;":10535,"oacute;":243,"odblac;":337,"odsold;":10684,"ograve;":242,"ominus;":8854,"origof;":8886,"oslash;":248,"otilde;":245,"otimes;":8855,"parsim;":10995,"percnt;":37,"period;":46,"permil;":8240,"phmmat;":8499,"planck;":8463,"plankv;":8463,"plusdo;":8724,"plusdu;":10789,"plusmn;":177,"preceq;":10927,"primes;":8473,"prnsim;":8936,"propto;":8733,"prurel;":8880,"puncsp;":8200,"qprime;":8279,"rAtail;":10524,"racute;":341,"rangle;":10217,"rarrap;":10613,"rarrfs;":10526,"rarrhk;":8618,"rarrlp;":8620,"rarrpl;":10565,"rarrtl;":8611,"ratail;":10522,"rbrace;":125,"rbrack;":93,"rcaron;":345,"rcedil;":343,"rdquor;":8221,"rfisht;":10621,"rfloor;":8971,"rharul;":10604,"rmoust;":9137,"roplus;":10798,"rpargt;":10644,"rsaquo;":8250,"rsquor;":8217,"rthree;":8908,"rtimes;":8906,"sacute;":347,"scaron;":353,"scedil;":351,"scnsim;":8937,"searhk;":10533,"seswar;":10537,"sfrown;":8994,"shchcy;":1097,"sigmaf;":962,"sigmav;":962,"simdot;":10858,"smashp;":10803,"softcy;":1100,"solbar;":9023,"spades;":9824,"sqcaps;":8851,"sqcups;":8852,"sqsube;":8849,"sqsupe;":8850,"square;":9633,"squarf;":9642,"ssetmn;":8726,"ssmile;":8995,"sstarf;":8902,"subdot;":10941,"subset;":8834,"subsim;":10951,"subsub;":10965,"subsup;":10963,"succeq;":10928,"supdot;":10942,"supset;":8835,"supsim;":10952,"supsub;":10964,"supsup;":10966,"swarhk;":10534,"swnwar;":10538,"target;":8982,"tcaron;":357,"tcedil;":355,"telrec;":8981,"there4;":8756,"thetav;":977,"thinsp;":8201,"thksim;":8764,"timesb;":8864,"timesd;":10800,"topbot;":9014,"topcir;":10993,"tprime;":8244,"tridot;":9708,"tstrok;":359,"uacute;":250,"ubreve;":365,"udblac;":369,"ufisht;":10622,"ugrave;":249,"ulcorn;":8988,"ulcrop;":8975,"urcorn;":8989,"urcrop;":8974,"utilde;":361,"vangrt;":10652,"varphi;":981,"varrho;":1009,"veebar;":8891,"vellip;":8942,"verbar;":124,"vsubnE;":10955,"vsubne;":8842,"vsupnE;":10956,"vsupne;":8843,"wedbar;":10847,"wedgeq;":8793,"weierp;":8472,"wreath;":8768,"xoplus;":10753,"xotime;":10754,"xsqcup;":10758,"xuplus;":10756,"xwedge;":8896,"yacute;":253,"zacute;":378,"zcaron;":382,"zeetrf;":8488,"AElig;":198,Aacute:193,"Acirc;":194,Agrave:192,"Alpha;":913,"Amacr;":256,"Aogon;":260,"Aring;":197,Atilde:195,"Breve;":728,Ccedil:199,"Ccirc;":264,"Colon;":8759,"Cross;":10799,"Dashv;":10980,"Delta;":916,Eacute:201,"Ecirc;":202,Egrave:200,"Emacr;":274,"Eogon;":280,"Equal;":10869,"Gamma;":915,"Gcirc;":284,"Hacek;":711,"Hcirc;":292,"IJlig;":306,Iacute:205,"Icirc;":206,Igrave:204,"Imacr;":298,"Iogon;":302,"Iukcy;":1030,"Jcirc;":308,"Jukcy;":1028,"Kappa;":922,Ntilde:209,"OElig;":338,Oacute:211,"Ocirc;":212,Ograve:210,"Omacr;":332,"Omega;":937,Oslash:216,Otilde:213,"Prime;":8243,"RBarr;":10512,"Scirc;":348,"Sigma;":931,"THORN;":222,"TRADE;":8482,"TSHcy;":1035,"Theta;":920,"Tilde;":8764,Uacute:218,"Ubrcy;":1038,"Ucirc;":219,Ugrave:217,"Umacr;":362,"Union;":8899,"Uogon;":370,"UpTee;":8869,"Uring;":366,"VDash;":8875,"Vdash;":8873,"Wcirc;":372,"Wedge;":8896,Yacute:221,"Ycirc;":374,aacute:225,"acirc;":226,"acute;":180,"aelig;":230,agrave:224,"aleph;":8501,"alpha;":945,"amacr;":257,"amalg;":10815,"angle;":8736,"angrt;":8735,"angst;":197,"aogon;":261,"aring;":229,"asymp;":8776,atilde:227,"awint;":10769,"bcong;":8780,"bdquo;":8222,"bepsi;":1014,"blank;":9251,"blk12;":9618,"blk14;":9617,"blk34;":9619,"block;":9608,"boxDL;":9559,"boxDR;":9556,"boxDl;":9558,"boxDr;":9555,"boxHD;":9574,"boxHU;":9577,"boxHd;":9572,"boxHu;":9575,"boxUL;":9565,"boxUR;":9562,"boxUl;":9564,"boxUr;":9561,"boxVH;":9580,"boxVL;":9571,"boxVR;":9568,"boxVh;":9579,"boxVl;":9570,"boxVr;":9567,"boxdL;":9557,"boxdR;":9554,"boxdl;":9488,"boxdr;":9484,"boxhD;":9573,"boxhU;":9576,"boxhd;":9516,"boxhu;":9524,"boxuL;":9563,"boxuR;":9560,"boxul;":9496,"boxur;":9492,"boxvH;":9578,"boxvL;":9569,"boxvR;":9566,"boxvh;":9532,"boxvl;":9508,"boxvr;":9500,"breve;":728,brvbar:166,"bsemi;":8271,"bsime;":8909,"bsolb;":10693,"bumpE;":10926,"bumpe;":8783,"caret;":8257,"caron;":711,"ccaps;":10829,ccedil:231,"ccirc;":265,"ccups;":10828,"cedil;":184,"check;":10003,"clubs;":9827,"colon;":58,"comma;":44,"crarr;":8629,"cross;":10007,"csube;":10961,"csupe;":10962,"ctdot;":8943,"cuepr;":8926,"cuesc;":8927,"cupor;":10821,curren:164,"cuvee;":8910,"cuwed;":8911,"cwint;":8753,"dashv;":8867,"dblac;":733,"ddarr;":8650,"delta;":948,"dharl;":8643,"dharr;":8642,"diams;":9830,"disin;":8946,divide:247,"doteq;":8784,"dtdot;":8945,"dtrif;":9662,"duarr;":8693,"duhar;":10607,"eDDot;":10871,eacute:233,"ecirc;":234,"efDot;":8786,egrave:232,"emacr;":275,"empty;":8709,"eogon;":281,"eplus;":10865,"epsiv;":1013,"eqsim;":8770,"equiv;":8801,"erDot;":8787,"erarr;":10609,"esdot;":8784,"exist;":8707,"fflig;":64256,"filig;":64257,"fjlig;":102,"fllig;":64258,"fltns;":9649,"forkv;":10969,frac12:189,frac14:188,frac34:190,"frasl;":8260,"frown;":8994,"gamma;":947,"gcirc;":285,"gescc;":10921,"gimel;":8503,"gneqq;":8809,"gnsim;":8935,"grave;":96,"gsime;":10894,"gsiml;":10896,"gtcir;":10874,"gtdot;":8919,"harrw;":8621,"hcirc;":293,"hoarr;":8703,iacute:237,"icirc;":238,"iexcl;":161,igrave:236,"iiint;":8749,"iiota;":8489,"ijlig;":307,"imacr;":299,"image;":8465,"imath;":305,"imped;":437,"infin;":8734,"iogon;":303,"iprod;":10812,iquest:191,"isinE;":8953,"isins;":8948,"isinv;":8712,"iukcy;":1110,"jcirc;":309,"jmath;":567,"jukcy;":1108,"kappa;":954,"lAarr;":8666,"lBarr;":10510,"langd;":10641,"laquo;":171,"larrb;":8676,"lates;":10925,"lbarr;":10508,"lbbrk;":10098,"lbrke;":10635,"lceil;":8968,"ldquo;":8220,"lescc;":10920,"lhard;":8637,"lharu;":8636,"lhblk;":9604,"llarr;":8647,"lltri;":9722,"lneqq;":8808,"lnsim;":8934,"loang;":10220,"loarr;":8701,"lobrk;":10214,"lopar;":10629,"lrarr;":8646,"lrhar;":8651,"lrtri;":8895,"lsime;":10893,"lsimg;":10895,"lsquo;":8216,"ltcir;":10873,"ltdot;":8918,"ltrie;":8884,"ltrif;":9666,"mDDot;":8762,"mdash;":8212,"micro;":181,middot:183,"minus;":8722,"mumap;":8888,"nabla;":8711,"napid;":8779,"napos;":329,"natur;":9838,"nbump;":8782,"ncong;":8775,"ndash;":8211,"neArr;":8663,"nearr;":8599,"nedot;":8784,"nesim;":8770,"ngeqq;":8807,"ngsim;":8821,"nhArr;":8654,"nharr;":8622,"nhpar;":10994,"nlArr;":8653,"nlarr;":8602,"nleqq;":8806,"nless;":8814,"nlsim;":8820,"nltri;":8938,"notin;":8713,"notni;":8716,"npart;":8706,"nprec;":8832,"nrArr;":8655,"nrarr;":8603,"nrtri;":8939,"nsime;":8772,"nsmid;":8740,"nspar;":8742,"nsubE;":10949,"nsube;":8840,"nsucc;":8833,"nsupE;":10950,"nsupe;":8841,ntilde:241,"numsp;":8199,"nvsim;":8764,"nwArr;":8662,"nwarr;":8598,oacute:243,"ocirc;":244,"odash;":8861,"oelig;":339,"ofcir;":10687,ograve:242,"ohbar;":10677,"olarr;":8634,"olcir;":10686,"oline;":8254,"omacr;":333,"omega;":969,"operp;":10681,"oplus;":8853,"orarr;":8635,"order;":8500,oslash:248,otilde:245,"ovbar;":9021,"parsl;":11005,"phone;":9742,"plusb;":8862,"pluse;":10866,plusmn:177,"pound;":163,"prcue;":8828,"prime;":8242,"prnap;":10937,"prsim;":8830,"quest;":63,"rAarr;":8667,"rBarr;":10511,"radic;":8730,"rangd;":10642,"range;":10661,"raquo;":187,"rarrb;":8677,"rarrc;":10547,"rarrw;":8605,"ratio;":8758,"rbarr;":10509,"rbbrk;":10099,"rbrke;":10636,"rceil;":8969,"rdquo;":8221,"reals;":8477,"rhard;":8641,"rharu;":8640,"rlarr;":8644,"rlhar;":8652,"rnmid;":10990,"roang;":10221,"roarr;":8702,"robrk;":10215,"ropar;":10630,"rrarr;":8649,"rsquo;":8217,"rtrie;":8885,"rtrif;":9656,"sbquo;":8218,"sccue;":8829,"scirc;":349,"scnap;":10938,"scsim;":8831,"sdotb;":8865,"sdote;":10854,"seArr;":8664,"searr;":8600,"setmn;":8726,"sharp;":9839,"sigma;":963,"simeq;":8771,"simgE;":10912,"simlE;":10911,"simne;":8774,"slarr;":8592,"smile;":8995,"smtes;":10924,"sqcap;":8851,"sqcup;":8852,"sqsub;":8847,"sqsup;":8848,"srarr;":8594,"starf;":9733,"strns;":175,"subnE;":10955,"subne;":8842,"supnE;":10956,"supne;":8843,"swArr;":8665,"swarr;":8601,"szlig;":223,"theta;":952,"thkap;":8776,"thorn;":254,"tilde;":732,"times;":215,"trade;":8482,"trisb;":10701,"tshcy;":1115,"twixt;":8812,uacute:250,"ubrcy;":1118,"ucirc;":251,"udarr;":8645,"udhar;":10606,ugrave:249,"uharl;":8639,"uharr;":8638,"uhblk;":9600,"ultri;":9720,"umacr;":363,"uogon;":371,"uplus;":8846,"upsih;":978,"uring;":367,"urtri;":9721,"utdot;":8944,"utrif;":9652,"uuarr;":8648,"vBarv;":10985,"vDash;":8872,"varpi;":982,"vdash;":8866,"veeeq;":8794,"vltri;":8882,"vnsub;":8834,"vnsup;":8835,"vprop;":8733,"vrtri;":8883,"wcirc;":373,"wedge;":8743,"xcirc;":9711,"xdtri;":9661,"xhArr;":10234,"xharr;":10231,"xlArr;":10232,"xlarr;":10229,"xodot;":10752,"xrArr;":10233,"xrarr;":10230,"xutri;":9651,yacute:253,"ycirc;":375,AElig:198,Acirc:194,"Aopf;":120120,Aring:197,"Ascr;":119964,"Auml;":196,"Barv;":10983,"Beta;":914,"Bopf;":120121,"Bscr;":8492,"CHcy;":1063,"COPY;":169,"Cdot;":266,"Copf;":8450,"Cscr;":119966,"DJcy;":1026,"DScy;":1029,"DZcy;":1039,"Darr;":8609,"Dopf;":120123,"Dscr;":119967,Ecirc:202,"Edot;":278,"Eopf;":120124,"Escr;":8496,"Esim;":10867,"Euml;":203,"Fopf;":120125,"Fscr;":8497,"GJcy;":1027,"Gdot;":288,"Gopf;":120126,"Gscr;":119970,"Hopf;":8461,"Hscr;":8459,"IEcy;":1045,"IOcy;":1025,Icirc:206,"Idot;":304,"Iopf;":120128,"Iota;":921,"Iscr;":8464,"Iuml;":207,"Jopf;":120129,"Jscr;":119973,"KHcy;":1061,"KJcy;":1036,"Kopf;":120130,"Kscr;":119974,"LJcy;":1033,"Lang;":10218,"Larr;":8606,"Lopf;":120131,"Lscr;":8466,"Mopf;":120132,"Mscr;":8499,"NJcy;":1034,"Nopf;":8469,"Nscr;":119977,Ocirc:212,"Oopf;":120134,"Oscr;":119978,"Ouml;":214,"Popf;":8473,"Pscr;":119979,"QUOT;":34,"Qopf;":8474,"Qscr;":119980,"Rang;":10219,"Rarr;":8608,"Ropf;":8477,"Rscr;":8475,"SHcy;":1064,"Sopf;":120138,"Sqrt;":8730,"Sscr;":119982,"Star;":8902,THORN:222,"TScy;":1062,"Topf;":120139,"Tscr;":119983,"Uarr;":8607,Ucirc:219,"Uopf;":120140,"Upsi;":978,"Uscr;":119984,"Uuml;":220,"Vbar;":10987,"Vert;":8214,"Vopf;":120141,"Vscr;":119985,"Wopf;":120142,"Wscr;":119986,"Xopf;":120143,"Xscr;":119987,"YAcy;":1071,"YIcy;":1031,"YUcy;":1070,"Yopf;":120144,"Yscr;":119988,"Yuml;":376,"ZHcy;":1046,"Zdot;":379,"Zeta;":918,"Zopf;":8484,"Zscr;":119989,acirc:226,acute:180,aelig:230,"andd;":10844,"andv;":10842,"ange;":10660,"aopf;":120146,"apid;":8779,"apos;":39,aring:229,"ascr;":119990,"auml;":228,"bNot;":10989,"bbrk;":9141,"beta;":946,"beth;":8502,"bnot;":8976,"bopf;":120147,"boxH;":9552,"boxV;":9553,"boxh;":9472,"boxv;":9474,"bscr;":119991,"bsim;":8765,"bsol;":92,"bull;":8226,"bump;":8782,"caps;":8745,"cdot;":267,cedil:184,"cent;":162,"chcy;":1095,"cirE;":10691,"circ;":710,"cire;":8791,"comp;":8705,"cong;":8773,"copf;":120148,"copy;":169,"cscr;":119992,"csub;":10959,"csup;":10960,"cups;":8746,"dArr;":8659,"dHar;":10597,"darr;":8595,"dash;":8208,"diam;":8900,"djcy;":1106,"dopf;":120149,"dscr;":119993,"dscy;":1109,"dsol;":10742,"dtri;":9663,"dzcy;":1119,"eDot;":8785,"ecir;":8790,ecirc:234,"edot;":279,"emsp;":8195,"ensp;":8194,"eopf;":120150,"epar;":8917,"epsi;":949,"escr;":8495,"esim;":8770,"euml;":235,"euro;":8364,"excl;":33,"flat;":9837,"fnof;":402,"fopf;":120151,"fork;":8916,"fscr;":119995,"gdot;":289,"geqq;":8807,"gesl;":8923,"gjcy;":1107,"gnap;":10890,"gneq;":10888,"gopf;":120152,"gscr;":8458,"gsim;":8819,"gtcc;":10919,"gvnE;":8809,"hArr;":8660,"half;":189,"harr;":8596,"hbar;":8463,"hopf;":120153,"hscr;":119997,icirc:238,"iecy;":1077,iexcl:161,"imof;":8887,"iocy;":1105,"iopf;":120154,"iota;":953,"iscr;":119998,"isin;":8712,"iuml;":239,"jopf;":120155,"jscr;":119999,"khcy;":1093,"kjcy;":1116,"kopf;":120156,"kscr;":120000,"lArr;":8656,"lHar;":10594,"lang;":10216,laquo:171,"larr;":8592,"late;":10925,"lcub;":123,"ldca;":10550,"ldsh;":8626,"leqq;":8806,"lesg;":8922,"ljcy;":1113,"lnap;":10889,"lneq;":10887,"lopf;":120157,"lozf;":10731,"lpar;":40,"lscr;":120001,"lsim;":8818,"lsqb;":91,"ltcc;":10918,"ltri;":9667,"lvnE;":8808,"macr;":175,"male;":9794,"malt;":10016,micro:181,"mlcp;":10971,"mldr;":8230,"mopf;":120158,"mscr;":120002,"nGtv;":8811,"nLtv;":8810,"nang;":8736,"napE;":10864,"nbsp;":160,"ncap;":10819,"ncup;":10818,"ngeq;":8817,"nges;":10878,"ngtr;":8815,"nisd;":8954,"njcy;":1114,"nldr;":8229,"nleq;":8816,"nles;":10877,"nmid;":8740,"nopf;":120159,"npar;":8742,"npre;":10927,"nsce;":10928,"nscr;":120003,"nsim;":8769,"nsub;":8836,"nsup;":8837,"ntgl;":8825,"ntlg;":8824,"nvap;":8781,"nvge;":8805,"nvgt;":62,"nvle;":8804,"nvlt;":60,"oast;":8859,"ocir;":8858,ocirc:244,"odiv;":10808,"odot;":8857,"ogon;":731,"oint;":8750,"omid;":10678,"oopf;":120160,"opar;":10679,"ordf;":170,"ordm;":186,"oror;":10838,"oscr;":8500,"osol;":8856,"ouml;":246,"para;":182,"part;":8706,"perp;":8869,"phiv;":981,"plus;":43,"popf;":120161,pound:163,"prap;":10935,"prec;":8826,"prnE;":10933,"prod;":8719,"prop;":8733,"pscr;":120005,"qint;":10764,"qopf;":120162,"qscr;":120006,"quot;":34,"rArr;":8658,"rHar;":10596,"race;":8765,"rang;":10217,raquo:187,"rarr;":8594,"rcub;":125,"rdca;":10551,"rdsh;":8627,"real;":8476,"rect;":9645,"rhov;":1009,"ring;":730,"ropf;":120163,"rpar;":41,"rscr;":120007,"rsqb;":93,"rtri;":9657,"scap;":10936,"scnE;":10934,"sdot;":8901,"sect;":167,"semi;":59,"sext;":10038,"shcy;":1096,"sime;":8771,"simg;":10910,"siml;":10909,"smid;":8739,"smte;":10924,"solb;":10692,"sopf;":120164,"spar;":8741,"squf;":9642,"sscr;":120008,"star;":9734,"subE;":10949,"sube;":8838,"succ;":8827,"sung;":9834,"sup1;":185,"sup2;":178,"sup3;":179,"supE;":10950,"supe;":8839,szlig:223,"tbrk;":9140,"tdot;":8411,thorn:254,times:215,"tint;":8749,"toea;":10536,"topf;":120165,"tosa;":10537,"trie;":8796,"tscr;":120009,"tscy;":1094,"uArr;":8657,"uHar;":10595,"uarr;":8593,ucirc:251,"uopf;":120166,"upsi;":965,"uscr;":120010,"utri;":9653,"uuml;":252,"vArr;":8661,"vBar;":10984,"varr;":8597,"vert;":124,"vopf;":120167,"vscr;":120011,"wopf;":120168,"wscr;":120012,"xcap;":8898,"xcup;":8899,"xmap;":10236,"xnis;":8955,"xopf;":120169,"xscr;":120013,"xvee;":8897,"yacy;":1103,"yicy;":1111,"yopf;":120170,"yscr;":120014,"yucy;":1102,"yuml;":255,"zdot;":380,"zeta;":950,"zhcy;":1078,"zopf;":120171,"zscr;":120015,"zwnj;":8204,"AMP;":38,"Acy;":1040,"Afr;":120068,"And;":10835,Auml:196,"Bcy;":1041,"Bfr;":120069,COPY:169,"Cap;":8914,"Cfr;":8493,"Chi;":935,"Cup;":8915,"Dcy;":1044,"Del;":8711,"Dfr;":120071,"Dot;":168,"ENG;":330,"ETH;":208,"Ecy;":1069,"Efr;":120072,"Eta;":919,Euml:203,"Fcy;":1060,"Ffr;":120073,"Gcy;":1043,"Gfr;":120074,"Hat;":94,"Hfr;":8460,"Icy;":1048,"Ifr;":8465,"Int;":8748,Iuml:207,"Jcy;":1049,"Jfr;":120077,"Kcy;":1050,"Kfr;":120078,"Lcy;":1051,"Lfr;":120079,"Lsh;":8624,"Map;":10501,"Mcy;":1052,"Mfr;":120080,"Ncy;":1053,"Nfr;":120081,"Not;":10988,"Ocy;":1054,"Ofr;":120082,Ouml:214,"Pcy;":1055,"Pfr;":120083,"Phi;":934,"Psi;":936,QUOT:34,"Qfr;":120084,"REG;":174,"Rcy;":1056,"Rfr;":8476,"Rho;":929,"Rsh;":8625,"Scy;":1057,"Sfr;":120086,"Sub;":8912,"Sum;":8721,"Sup;":8913,"Tab;":9,"Tau;":932,"Tcy;":1058,"Tfr;":120087,"Ucy;":1059,"Ufr;":120088,Uuml:220,"Vcy;":1042,"Vee;":8897,"Vfr;":120089,"Wfr;":120090,"Xfr;":120091,"Ycy;":1067,"Yfr;":120092,"Zcy;":1047,"Zfr;":8488,"acE;":8766,"acd;":8767,"acy;":1072,"afr;":120094,"amp;":38,"and;":8743,"ang;":8736,"apE;":10864,"ape;":8778,"ast;":42,auml:228,"bcy;":1073,"bfr;":120095,"bne;":61,"bot;":8869,"cap;":8745,cent:162,"cfr;":120096,"chi;":967,"cir;":9675,copy:169,"cup;":8746,"dcy;":1076,"deg;":176,"dfr;":120097,"die;":168,"div;":247,"dot;":729,"ecy;":1101,"efr;":120098,"egs;":10902,"ell;":8467,"els;":10901,"eng;":331,"eta;":951,"eth;":240,euml:235,"fcy;":1092,"ffr;":120099,"gEl;":10892,"gap;":10886,"gcy;":1075,"gel;":8923,"geq;":8805,"ges;":10878,"gfr;":120100,"ggg;":8921,"glE;":10898,"gla;":10917,"glj;":10916,"gnE;":8809,"gne;":10888,"hfr;":120101,"icy;":1080,"iff;":8660,"ifr;":120102,"int;":8747,iuml:239,"jcy;":1081,"jfr;":120103,"kcy;":1082,"kfr;":120104,"lEg;":10891,"lap;":10885,"lat;":10923,"lcy;":1083,"leg;":8922,"leq;":8804,"les;":10877,"lfr;":120105,"lgE;":10897,"lnE;":8808,"lne;":10887,"loz;":9674,"lrm;":8206,"lsh;":8624,macr:175,"map;":8614,"mcy;":1084,"mfr;":120106,"mho;":8487,"mid;":8739,"nGg;":8921,"nGt;":8811,"nLl;":8920,"nLt;":8810,"nap;":8777,nbsp:160,"ncy;":1085,"nfr;":120107,"ngE;":8807,"nge;":8817,"ngt;":8815,"nis;":8956,"niv;":8715,"nlE;":8806,"nle;":8816,"nlt;":8814,"not;":172,"npr;":8832,"nsc;":8833,"num;":35,"ocy;":1086,"ofr;":120108,"ogt;":10689,"ohm;":937,"olt;":10688,"ord;":10845,ordf:170,ordm:186,"orv;":10843,ouml:246,"par;":8741,para:182,"pcy;":1087,"pfr;":120109,"phi;":966,"piv;":982,"prE;":10931,"pre;":10927,"psi;":968,"qfr;":120110,quot:34,"rcy;":1088,"reg;":174,"rfr;":120111,"rho;":961,"rlm;":8207,"rsh;":8625,"scE;":10932,"sce;":10928,"scy;":1089,sect:167,"sfr;":120112,"shy;":173,"sim;":8764,"smt;":10922,"sol;":47,"squ;":9633,"sub;":8834,"sum;":8721,sup1:185,sup2:178,sup3:179,"sup;":8835,"tau;":964,"tcy;":1090,"tfr;":120113,"top;":8868,"ucy;":1091,"ufr;":120114,"uml;":168,uuml:252,"vcy;":1074,"vee;":8744,"vfr;":120115,"wfr;":120116,"xfr;":120117,"ycy;":1099,"yen;":165,"yfr;":120118,yuml:255,"zcy;":1079,"zfr;":120119,"zwj;":8205,AMP:38,"DD;":8517,ETH:208,"GT;":62,"Gg;":8921,"Gt;":8811,"Im;":8465,"LT;":60,"Ll;":8920,"Lt;":8810,"Mu;":924,"Nu;":925,"Or;":10836,"Pi;":928,"Pr;":10939,REG:174,"Re;":8476,"Sc;":10940,"Xi;":926,"ac;":8766,"af;":8289,amp:38,"ap;":8776,"dd;":8518,deg:176,"ee;":8519,"eg;":10906,"el;":10905,eth:240,"gE;":8807,"ge;":8805,"gg;":8811,"gl;":8823,"gt;":62,"ic;":8291,"ii;":8520,"in;":8712,"it;":8290,"lE;":8806,"le;":8804,"lg;":8822,"ll;":8810,"lt;":60,"mp;":8723,"mu;":956,"ne;":8800,"ni;":8715,not:172,"nu;":957,"oS;":9416,"or;":8744,"pi;":960,"pm;":177,"pr;":8826,reg:174,"rx;":8478,"sc;":8827,shy:173,uml:168,"wp;":8472,"wr;":8768,"xi;":958,yen:165,GT:62,LT:60,gt:62,lt:60},zi=jf;var Vf=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376];function Wf(i,Ie){if(Ie&&!i.endsWith(";"))return`${i}\\b(?!=)`;return i}function Oc(i){let Re=Object.keys(zi).map((Le)=>Wf(Le,i));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${Re.join("|")})`,"g")}var Xi,Ji;function qf(i){if(i){if(!Ji)Ji=Oc(!0);return Ji}if(!Xi)Xi=Oc(!1);return Xi}var Mc=0;function Gf(i){if(i===10)return 32;if(i<128)return i;if(i<=159)return Vf[i-128];if(i<55296)return i;if(i<=57343)return Mc;if(i<=65535)return i;if(i>=65536&&i<=131071)return i;if(i>=131072&&i<=196607)return i;if(i>=917504&&i<=917631||i>=917760&&i<=917999)return i;return Mc}function Yi(i,Ie){if(i.indexOf("&")===-1)return i;return i.replace(qf(Ie),(Re,Le)=>{let Oe;if(Le[0]!=="#")Oe=zi[Le];else if(Le[1]==="x")Oe=Number.parseInt(Le.substring(2),16);else Oe=Number.parseInt(Le.substring(1),10);if(!Oe)return Re;return String.fromCodePoint(Gf(Oe))})}class T extends Error{constructor(i){super(`sveld's template parser doesn't support ${i} yet.`);this.name="TemplateParseNotImplementedError"}}var Uf=/<\/script\s*>/g,Hf=/<\/script\s*>/y,Kf=/[^\n]/g,zf=new Set(["server","client","worker","test","default"]);function $c(i,Ie,Re){let Le=i.index,Oe=i.readUntil(Uf);if(i.index>=i.source.length)throw Error("sveld: unclosed <script> tag");let $e=i.source.slice(0,Le).replace(Kf," ")+Oe;i.read(Hf);let Me=dr($e,i.isTypeScript,i.root.comments);Me.start=Le;let Fe="default";for(let je of Re){if(zf.has(je.name))throw Error(`sveld: "${je.name}" is a reserved <script> attribute name.`);if(je.name==="module"){if(je.value!==!0)throw Error("sveld: <script module> does not take a value.");Fe="module"}if(je.name==="context"){let qe=je.value;if(qe===!0||!Array.isArray(qe)||qe.length!==1||qe[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(qe[0].data!=="module")throw Error('sveld: only context="module" is valid.');Fe="module"}}return{type:"Script",start:Ie,end:i.index,context:Fe,content:Me,attributes:Re}}function Bc(i,Ie,Re){let Le=i.index,Oe=i.source.indexOf("</style",i.index),$e=Oe===-1?i.source.length:Oe;return i.index=$e,i.eat("</style",!0),i.read(/\s*>/y),{type:"StyleSheet",start:Ie,end:i.index,attributes:Re,children:[],comments:[],content:{start:Le,end:$e,styles:i.source.slice(Le,$e),comment:null}}}var Xf=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Qi(i){return Xf.has(i)||i.charCodeAt(0)===33&&i.toLowerCase()==="!doctype"}var Jf="^[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}]*)?$",Yf=new RegExp(Jf,"u");function Fc(i){return Yf.test(i)}var Qf=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,Gc=/["']/y,Zf=/(\/>|[\s"'=<>`])/y,Zi=/<\/textarea(\s[^>]*)?>/iy,eh=/^![a-zA-Z]+$/,th=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,nh=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,Uc={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},jc={...Uc,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function rh(i){let Ie=i.charCodeAt(0);if(Ie<97||Ie>122)return!1;for(let Re=1;Re<i.length;Re++){let Le=i.charCodeAt(Re);if((Le<97||Le>122)&&(Le<48||Le>57))return!1}return!0}function sh(i){if(rh(i))return!0;if(eh.test(i))return!0;if(th.test(i))return!0;return Fc(i)}function ih(i){let Ie=i.charCodeAt(0);if(Ie>=97&&Ie<=122&&!i.includes("."))return!1;return!0}function oh(i){return`Svelte${i.slice(7).split("-").map((Re)=>Re.charAt(0).toUpperCase()+Re.slice(1)).join("")}`}function ah(i){for(let Ie=i.length-1;Ie>=0;Ie--){let Re=i[Ie].type;if(Re==="SvelteHead")return!0;if(Re==="RegularElement"||Re==="Component")return!1}return!1}function ch(i){for(let Ie=i.length-1;Ie>=0;Ie--){let Re=i[Ie];if(Re.type==="RegularElement"&&Re.attributes?.some((Le)=>Le.type==="Attribute"&&Le.name==="shadowrootmode"))return!0}return!1}function Vc(i){let{source:Ie,index:Re}=i;if(Re>=Ie.length)throw new Vn("Unexpected end of input",Ie.length);let Le=Re;while(Le<Ie.length){let Oe=Ie.charCodeAt(Le);if(Oe===47||Oe===62||Yn(Oe))break;Le++}return i.index=Le,{name:Ie.slice(Re,Le),start:Re,end:Le}}function Hc(i){let{source:Ie,index:Re}=i;if(Re>=Ie.length)throw new Vn("Unexpected end of input",Ie.length);let Le=Re;while(Le<Ie.length){let Oe=Ie.charCodeAt(Le);if(Oe===61||Oe===47||Oe===62||Oe===34||Oe===39||Yn(Oe))break;Le++}return i.index=Le,{name:Ie.slice(Re,Le),start:Re,end:Le}}function lh(i){let Ie=i.index;if(i.eat("//")){let Re=i.readUntilString(`
|
|
16
|
+
`),Le=i.index;i.root.comments.push({type:"Line",value:Re,start:Ie,end:Le});return}if(i.eat("/*")){let Re=i.readUntilString("*/");i.eat("*/");let Le=i.index;i.root.comments.push({type:"Block",value:Re,start:Ie,end:Le})}}function ph(i){if(i==="use")return"UseDirective";if(i==="animate")return"AnimateDirective";if(i==="bind")return"BindDirective";if(i==="class")return"ClassDirective";if(i==="style")return"StyleDirective";if(i==="on")return"OnDirective";if(i==="let")return"LetDirective";if(i==="in"||i==="out"||i==="transition")return"TransitionDirective";return!1}function Kc(i,Ie,Re){let Le={start:i.index,end:-1,type:"Text",raw:"",data:""},Oe=[],$e=(Me)=>{if(Me>Le.start)Le.raw=i.source.slice(Le.start,Me),Le.data=Yi(Le.raw,!0),Le.end=Me,Oe.push(Le)};while(i.index<i.source.length){if(Ie())return $e(i.index),Oe;if(i.eat("{")){if(i.match("#")||i.match("@"))throw new T("blocks/tags inside attribute value sequences");let Me=i.index-1;$e(Me),i.allowWhitespace();let Fe=Ht(i);i.allowWhitespace(),i.eat("}",!0),Oe.push({type:"ExpressionTag",start:Me,end:i.index,expression:Fe}),Le={start:i.index,end:-1,type:"Text",raw:"",data:""}}else{let Me=i.index+1;if(Re!==void 0){let Fe=i.source;while(Me<Fe.length){let je=Fe.charCodeAt(Me);if(je===123||je===Re)break;Me++}}i.index=Me}}throw new T("unterminated attribute value / sequence (loose mode)")}function uh(i){let Ie=i.eat("'")?"'":i.eat('"')?'"':null;if(Ie&&i.eat(Ie))return[{start:i.index-1,end:i.index-1,type:"Text",raw:"",data:""}];let Re=Kc(i,()=>{if(Ie)return i.match(Ie);return!!i.matchRegex(Zf)},Ie===null?void 0:Ie.charCodeAt(0));if(Re.length===0&&!Ie)throw Error("sveld: expected attribute value");if(Ie)i.index+=1;if(Ie||Re.length>1||Re[0].type==="Text")return Re;return Re[0]}function eo(i,Ie,Re,Le){return{type:"Attribute",start:Ie,end:Re,name:i,value:Le}}function dh(i){let Ie=i.index,Re=Hc(i);if(!Re.name)return null;let Le=!0;if(i.eat("=")){i.allowWhitespace();let Oe=i.matchRegex(Qf);if(!Oe)throw Error("sveld: expected attribute value");i.index+=Oe.length;let $e=Oe[0]==='"'||Oe[0]==="'";if($e)Oe=Oe.slice(1,-1);Le=[{start:i.index-Oe.length-($e?1:0),end:$e?i.index-1:i.index,type:"Text",raw:Oe,data:Yi(Oe,!0)}]}if(i.matchRegex(Gc))throw Error("sveld: expected '='");return eo(Re.name,Ie,i.index,Le)}function fh(i){while(!0){let Fe=i.index;if(lh(i),i.index===Fe)break;i.allowWhitespace()}let Ie=i.index;if(i.eat("{")){if(i.allowWhitespace(),i.eat("@attach")){i.requireWhitespace();let qe=Ht(i);return i.allowWhitespace(),i.eat("}",!0),{type:"AttachTag",start:Ie,end:i.index,expression:qe}}if(i.eat("...")){let qe=Ht(i);return i.allowWhitespace(),i.eat("}",!0),{type:"SpreadAttribute",start:Ie,end:i.index,expression:qe}}let Fe=i.readIdentifierName();if(Fe.name==="")throw Error("sveld: empty attribute shorthand");i.allowWhitespace(),i.eat("}",!0);let je={type:"ExpressionTag",start:Fe.start,end:Fe.end,expression:Fe};return eo(Fe.name,Ie,i.index,je)}let Re=Hc(i);if(!Re.name)return null;let Le=i.index;i.allowWhitespace();let Oe=Re.name.indexOf(":"),$e=Oe!==-1&&ph(Re.name.slice(0,Oe)),Me=!0;if(i.eat("="))if(i.allowWhitespace(),i.source[i.index]==="/"&&i.source[i.index+1]===">"){let Fe=i.index;i.index++,Me=[{start:Fe,end:Fe+1,type:"Text",raw:"/",data:"/"}],Le=i.index}else Me=uh(i),Le=i.index;else if(i.matchRegex(Gc))throw Error("sveld: expected '='");if($e){let Fe=Re.name.slice(Oe+1).split("|",1)[0];if(Fe==="")throw Error("sveld: directive missing a name");if($e==="StyleDirective")return{start:Ie,end:Le,type:$e,name:Fe,value:Me};let je=Me===!0?void 0:Array.isArray(Me)?Me[0]:Me,qe=null;if(je){if((Array.isArray(Me)?Me.length>1:!1)||je.type==="Text")throw Error("sveld: directive value must be a single expression");qe=je.expression}let We={start:Ie,end:Le,type:$e,name:Fe,expression:qe};if((We.type==="BindDirective"||We.type==="ClassDirective")&&!We.expression)We.expression={start:Ie+Oe+1,end:Le,type:"Identifier",name:We.name};return We}return eo(Re.name,Ie,Le,Me)}function zc(i){let Ie=i.index++,Re=i.current();if(i.eat("!--")){let ze=i.readUntilString("-->");i.eat("-->",!0),i.append({type:"Comment",start:Ie,end:i.index,data:ze});return}if(i.eat("/")){let{name:ze}=Vc(i);if(i.allowWhitespace(),i.eat(">",!0),Qi(ze))throw Error(`sveld: <${ze}> is a void element and cannot have a closing tag`);while(Re.name!==ze){if(Re.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${ze}>`);Re.end=Ie,i.pop(),Re=i.current()}if(Re.end=i.index,i.pop(),i.lastAutoClosedTag&&i.stack.length<i.lastAutoClosedTag.depth)i.lastAutoClosedTag=void 0;return}let Le=Vc(i),Oe=ih(Le.name)&&nh.test(Le.name);if(!sh(Le.name)&&!Oe)throw Error(`sveld: "${Le.name}" is not a valid element or component name`);if(Le.name in Uc&&Re.type!=="Root")throw Error(`sveld: <${Le.name}> must be a top-level element`);let $e;if(Le.name in jc)$e=jc[Le.name];else if(Le.name.startsWith("svelte:"))$e=oh(Le.name);else if(Oe)$e="Component";else if(Le.name==="title"&&ah(i.stack))$e="TitleElement";else if(Le.name==="slot"&&!ch(i.stack))$e="SlotElement";else $e="RegularElement";let Me={type:$e,start:Ie,end:-1,name:Le.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(i.allowWhitespace(),Re.type==="RegularElement"&&Ea(Re.name,Le.name))Re.end=Ie,i.pop(),i.lastAutoClosedTag={tag:Re.name,reason:Le.name,depth:i.stack.length},Re=i.current();let Fe=i.current(),je=(Le.name==="script"||Le.name==="style")&&Fe.type==="Root",qe=je?dh:fh,We;while(We=qe(i))Me.attributes.push(We),i.allowWhitespace();if(Me.type==="SvelteComponent")Me.expression=qc(Wc(Me));if(Me.type==="SvelteElement"){let ze=Wc(Me);if(ze.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(hh(ze))Me.tag=qc(ze);else{let Xe=ze.value[0];Me.tag=Xe.type==="Text"?{type:"Literal",value:Xe.data,raw:`'${Xe.raw}'`,start:Xe.start,end:Xe.end}:Xe.expression}}if(je){if(i.eat(">",!0),Le.name==="script"){let ze=$c(i,Ie,Me.attributes);if(ze.context==="module"){if(i.root.module)throw Error("sveld: duplicate <script module>");i.root.module=ze}else{if(i.root.instance)throw Error("sveld: duplicate <script>");i.root.instance=ze}}else{if(i.root.css)throw Error("sveld: duplicate <style>");i.root.css=Bc(i,Ie,Me.attributes)}return}i.append(Me);let Ge=i.eat("/")||Qi(Le.name);if(i.eat(">",!0),Ge)Me.end=i.index;else if(Le.name==="textarea")Me.fragment.nodes=Kc(i,()=>(Zi.lastIndex=i.index,Zi.test(i.source))),i.read(Zi),Me.end=i.index;else i.push(Me,Me.fragment)}function Wc(i){let Ie=i.attributes,Re=Ie.findIndex((Le)=>Le.type==="Attribute"&&Le.name==="this");if(Re===-1)throw Error(`sveld: <${i.name}> requires a \`this\` attribute`);return Ie.splice(Re,1)[0]}function qc(i){return Array.isArray(i.value)?i.value[0].expression:i.value.expression}function hh(i){return i.value!==!0&&!Array.isArray(i.value)||Array.isArray(i.value)&&i.value.length===1&&i.value[0].type==="ExpressionTag"}function Xc(i){let Ie={start:i.start,end:i.end,attributes:i.attributes};for(let Re of i.attributes){if(Re.type!=="Attribute")continue;if(Re.name==="runes"){let Le=Jc(Re);if(typeof Le==="boolean")Ie.runes=Le}if(Re.name==="customElement"){let Le=gh(Re);if(Le!==void 0)Ie.customElement=Le}}return Ie}function Jc(i){let{value:Ie}=i;if(Ie===!0)return!0;let Re=Array.isArray(Ie)?Ie[0]:Ie;if(!Re)return!0;if(Array.isArray(Ie)&&Ie.length>1)return null;if(Re.type==="Text")return Re.data;if(Re.expression.type!=="Literal")return null;return Re.expression.value}var mh=new Set(["String","Boolean","Number","Array","Object"]);function to(i){let Ie=[];for(let Re of i.properties){if(!Re||typeof Re!=="object"||Re.type!=="Property"||Re.computed||Re.key?.type!=="Identifier")continue;let{key:Le,value:Oe}=Re;Ie.push([Le.name,Oe])}return Ie}function yh(i){let Ie={};if(!i||typeof i!=="object"||i.type!=="ObjectExpression")return Ie;for(let[Re,Le]of to(i)){if(!Le||typeof Le!=="object"||Le.type!=="Literal")continue;let Oe=Le.value;if(Re==="attribute"&&typeof Oe==="string")Ie.attribute=Oe;else if(Re==="reflect"&&typeof Oe==="boolean")Ie.reflect=Oe;else if(Re==="type"&&typeof Oe==="string"&&mh.has(Oe))Ie.type=Oe}return Ie}function gh(i){let{value:Ie}=i;if(Ie===!0)return;let Re=Array.isArray(Ie)?Ie[0]:Ie;if(!Re)return;if(Re.type==="Text"){let We=Jc(i);return typeof We==="string"?{tag:We}:void 0}let Le=Re.expression;if(Le.type==="Literal"&&Le.value===null)return;if(Le.type!=="ObjectExpression")return;let Oe=to(Le),$e={},Me=Oe.find(([We])=>We==="tag")?.[1];if(Me&&typeof Me==="object"&&Me.type==="Literal"&&typeof Me.value==="string")$e.tag=Me.value;let Fe=Oe.find(([We])=>We==="props")?.[1];if(Fe&&typeof Fe==="object"&&Fe.type==="ObjectExpression"){$e.props={};for(let[We,Ge]of to(Fe))$e.props[We]=yh(Ge)}let je=Oe.find(([We])=>We==="shadow")?.[1];if(je&&typeof je==="object"){let We=je;if(We.type==="Literal"&&(We.value==="open"||We.value==="none"))$e.shadow=We.value;else if(We.type==="ObjectExpression")$e.shadow=je}let qe=Oe.find(([We])=>We==="extend")?.[1];if(qe!==void 0)$e.extend=qe;return $e}var xh=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class no extends Hi{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(i,Ie){super(i);this.isTypeScript=xh.test(i);let Re=tn();this.root={type:"Root",start:0,end:Ie,css:null,js:[],options:null,fragment:Re,comments:[]},this.stack.push(this.root),this.fragments.push(Re)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(i,Ie){this.stack.push(i),this.fragments.push(Ie)}pop(){return this.fragments.pop(),this.stack.pop()}append(i){return this.currentFragment().nodes.push(i),i}}var ro={"{":"}","(":")","[":"]"},bh=new Set(Object.values(ro));function Or(i,Ie,Re=ro){let Le=Re===ro?bh:new Set(Object.values(Re)),Oe=[],$e=Ie;while($e<i.source.length){let Me=i.source[$e++];if(Me==="'"||Me==='"'||Me==="`"){$e=Eh(i,$e,Me);continue}if(Object.hasOwn(Re,Me))Oe.push(Me);else if(Le.has(Me)){let Fe=Oe.pop(),je=Fe?Re[Fe]:void 0;if(Me!==je)throw Error(`sveld: expected "${je}"`);if(Oe.length===0)return $e}}throw Error("sveld: unexpected end of input")}function Eh(i,Ie,Re){let Le=!1,Oe=Ie;while(Oe<i.source.length){let $e=i.source[Oe++];if(Le){Le=!1;continue}if($e===Re)return Oe;if($e==="\\")Le=!0;if(Re==="`"&&$e==="$"&&i.source[Oe]==="{")Oe=Or(i,Oe)}throw Error("sveld: unterminated string constant")}var Qc=/[^\n]/g,Ch=/\?\s*:/g;function Wn(i){let Ie=i.index,Re=i.readIdentifierName();if(Re.name!==""){let ze=Yc(i);return{...Re,typeAnnotation:ze}}let Le=i.source[i.index];if(Le!=="{"&&Le!=="[")throw Error("sveld: expected a binding pattern");let Oe=Or(i,Ie);i.index=Oe;let $e=i.source.slice(Ie,Oe),Me=i.source.slice(0,Ie).replace(Qc," "),Fe=Me.indexOf(" ");Me=Me.slice(0,Fe)+Me.slice(Fe+1);let je=`${Me}(${$e} = 1)`,{node:qe}=fr(je,Ie-1,i.isTypeScript,i.root.comments),We=qe.left,Ge=Yc(i);if(Ge)We.typeAnnotation=Ge,We.end=Ge.end;return We}function Yc(i){let Ie=i.index;if(i.allowWhitespace(),!i.eat(":")){i.index=Ie;return}let Re="_ as ",Le=i.index-Re.length,Oe=i.source.slice(0,Le).replace(Qc," ")+Re+i.source.slice(i.index).replace(Ch,":"),{node:$e}=fr(Oe,Le,i.isTypeScript,i.root.comments),Me=$e;if(Me.type==="AssignmentExpression"){let Fe=Me.right.start;while(Oe[Fe]!=="=")Fe-=1;({node:$e}=fr(Oe.slice(0,Fe),Le,i.isTypeScript,i.root.comments)),Me=$e}if(Me.type==="SequenceExpression"&&Me.expressions)Me=Me.expressions[0];return i.index=Me.end,{type:"TSTypeAnnotation",start:Ie,end:i.index,typeAnnotation:Me.typeAnnotation}}var Zc=/\s*}/y,vh={"<":">"};function el(i){let Ie=i.index-2;while(i.source[Ie]!=="{")Ie-=1;if(i.eat("if")){i.requireWhitespace();let Re={type:"IfBlock",elseif:!1,start:Ie,end:-1,test:Ht(i),consequent:tn(),alternate:null};i.append(Re),i.allowWhitespace(),i.eat("}",!0),i.push(Re,Re.consequent);return}if(i.eat("each")){i.requireWhitespace();let Re=Ht(i);if(i.allowWhitespace(),!i.match("as")){let Fe=Re;if(Fe.type==="SequenceExpression"&&Fe.expressions)Fe=Fe.expressions[0];if(Fe.type==="TSAsExpression"){let je=Fe;Re=je.expression;let qe=je.typeAnnotation.start-2;while(qe>=0&&!(i.source[qe]==="a"&&i.source[qe+1]==="s"))qe-=1;i.index=qe}}let Le=null,Oe,$e;if(i.eat("as"))i.requireWhitespace(),Le=Wn(i);if(i.allowWhitespace(),i.eat(",")){i.allowWhitespace();let Fe=i.readIdentifierName();if(!Fe.name)throw Error("sveld: expected an identifier");Oe=Fe.name,i.allowWhitespace()}if(i.eat("("))i.allowWhitespace(),$e=Ht(i),i.allowWhitespace(),i.eat(")",!0),i.allowWhitespace();i.eat("}",!0);let Me={type:"EachBlock",start:Ie,end:-1,expression:Re,body:tn(),context:Le,index:Oe,key:$e};i.append(Me),i.push(Me,Me.body);return}if(i.eat("await")){i.requireWhitespace();let Re=Ht(i);i.allowWhitespace();let Le={type:"AwaitBlock",start:Ie,end:-1,expression:Re,value:null,error:null,pending:null,then:null,catch:null};if(i.eat("then")){if(!i.matchRegex(Zc))i.requireWhitespace(),Le.value=Wn(i),i.allowWhitespace();Le.then=tn()}else if(i.eat("catch")){if(!i.matchRegex(Zc))i.requireWhitespace(),Le.error=Wn(i),i.allowWhitespace();Le.catch=tn()}else Le.pending=tn();i.eat("}",!0),i.append(Le),i.push(Le,Le.then??Le.catch??Le.pending);return}if(i.eat("key")){i.requireWhitespace();let Re=Ht(i);i.allowWhitespace(),i.eat("}",!0);let Le={type:"KeyBlock",start:Ie,end:-1,expression:Re,fragment:tn()};i.append(Le),i.push(Le,Le.fragment);return}if(i.eat("snippet")){i.requireWhitespace();let Re=i.readIdentifierName();if(Re.name==="")throw Error("sveld: expected a snippet name");i.allowWhitespace();let Le;if(i.isTypeScript&&i.match("<")){let $e=i.index,Me=Or(i,$e,vh);Le=i.source.slice($e+1,Me-1),i.index=Me}if(i.allowWhitespace(),i.eat("(")){let $e=1;while(i.index<i.source.length&&(!i.match(")")||$e!==1)){if(i.match("("))$e++;if(i.match(")"))$e--;i.index+=1}i.eat(")",!0)}i.allowWhitespace(),i.eat("}",!0);let Oe={type:"SnippetBlock",start:Ie,end:-1,expression:Re,typeParams:Le,parameters:[],body:tn()};i.append(Oe),i.push(Oe,Oe.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function tl(i){let Ie=i.index-1,Re=i.current();if(Re.type==="IfBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(i.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(i.allowWhitespace(),i.fragments.pop(),Re.alternate=tn(),i.fragments.push(Re.alternate),i.eat("if")){i.requireWhitespace();let Le=Ht(i);i.allowWhitespace(),i.eat("}",!0);let Oe=Ie-1;while(i.source[Oe]!=="{")Oe-=1;let $e={type:"IfBlock",start:Oe,end:-1,elseif:!0,test:Le,consequent:tn(),alternate:null};i.append($e),i.stack.push($e),i.fragments.pop(),i.fragments.push($e.consequent)}else i.allowWhitespace(),i.eat("}",!0);return}if(Re.type==="EachBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else}");i.allowWhitespace(),i.eat("}",!0),Re.fallback=tn(),i.fragments.pop(),i.fragments.push(Re.fallback);return}if(Re.type==="AwaitBlock"){if(i.eat("then")){if(Re.then)throw Error("sveld: duplicate {:then}");if(!i.eat("}"))i.requireWhitespace(),Re.value=Wn(i),i.allowWhitespace(),i.eat("}",!0);Re.then=tn(),i.fragments.pop(),i.fragments.push(Re.then);return}if(i.eat("catch")){if(Re.catch)throw Error("sveld: duplicate {:catch}");if(!i.eat("}"))i.requireWhitespace(),Re.error=Wn(i),i.allowWhitespace(),i.eat("}",!0);Re.catch=tn(),i.fragments.pop(),i.fragments.push(Re.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function nl(i){let Ie=i.current();switch(Ie.type){case"IfBlock":{i.eat("if",!0),i.allowWhitespace(),i.eat("}",!0);while(Ie.type==="IfBlock"&&Ie.elseif)Ie.end=i.index,i.stack.pop(),Ie=i.current();Ie.end=i.index,i.pop();return}case"EachBlock":i.eat("each",!0);break;case"KeyBlock":i.eat("key",!0);break;case"AwaitBlock":i.eat("await",!0);break;case"SnippetBlock":i.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}i.allowWhitespace(),i.eat("}",!0),Ie.end=i.index,i.pop()}var Sh=/(?:let|const)\b/y,Th=/(?:var|interface|enum)\b/y,kh=/type\b/y;function rl(i){let Ie=i.index;if(i.matchRegex(Th))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!i.matchRegex(Sh)&&!i.matchRegex(kh))return null;let Re=i.root.comments.length,Le=_c(i.source,Ie,i.isTypeScript,i.root.comments);if(Le.type!=="VariableDeclaration"){if(Le.type==="ExpressionStatement")return i.root.comments.length=Re,null;throw Error("sveld: expected a `let`/`const` declaration")}if(Le.kind!=="let"&&Le.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return i.index=Le.end,i.allowWhitespace(),i.eat("}",!0),Le}var wh=/\s*}/y;function sl(i){let Ie=i.index;while(i.source[Ie]!=="{")Ie-=1;if(i.eat("html")){i.requireWhitespace();let Re=Ht(i);i.allowWhitespace(),i.eat("}",!0);let Le={type:"HtmlTag",start:Ie,end:i.index,expression:Re};i.append(Le);return}if(i.eat("debug")){let Re;if(i.read(wh))Re=[];else{let Oe=Ht(i);Re=Oe.type==="SequenceExpression"?Oe.expressions:[Oe];for(let $e of Re)if($e.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");i.allowWhitespace(),i.eat("}",!0)}let Le={type:"DebugTag",start:Ie,end:i.index,identifiers:Re};i.append(Le);return}if(i.eat("const")){i.requireWhitespace();let Re=Wn(i);i.allowWhitespace(),i.eat("=",!0),i.allowWhitespace();let Le=Ht(i),Oe=i.index;i.allowWhitespace(),i.eat("}",!0);let $e={type:"VariableDeclarator",id:Re,init:Le,start:Re.start,end:Oe},Me={type:"ConstTag",start:Ie,end:i.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[$e],start:Ie+2,end:i.index-1}};i.append(Me);return}if(i.eat("render")){i.requireWhitespace();let Re=Ht(i);if(!(Re.type==="CallExpression"||Re.type==="ChainExpression"&&Re.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");i.allowWhitespace(),i.eat("}",!0);let Oe={type:"RenderTag",start:Ie,end:i.index,expression:Re};i.append(Oe);return}throw Error("sveld: expected html/debug/const/render")}function il(i){let Ie=i.index;if(i.index+=1,i.allowWhitespace(),i.eat("#")){el(i);return}if(i.eat(":")){tl(i);return}if(i.eat("@")){sl(i);return}if(i.match("/")&&!i.match("/*")&&!i.match("//")){i.eat("/"),nl(i);return}let Re=rl(i);if(Re){let $e={type:"DeclarationTag",start:Ie,end:i.index,declaration:Re};i.append($e);return}let Le=Ht(i);i.allowWhitespace(),i.eat("}",!0);let Oe={type:"ExpressionTag",start:Ie,end:i.index,expression:Le};i.append(Oe)}function ol(i){let{index:Ie,source:Re}=i,Le=Re.indexOf("<",Ie),Oe=Re.indexOf("{",Ie),$e;if(Le===-1)$e=Oe===-1?Re.length:Oe;else $e=Oe===-1?Le:Math.min(Le,Oe);i.index=$e;let Me=Re.slice(Ie,$e),Fe={type:"Text",start:Ie,end:i.index,raw:Me,data:Me};i.append(Fe)}function A(i){let Ie=i.trimEnd(),Re=new no(Ie,i.length);while(Re.index<Re.source.length)if(Re.match("<"))zc(Re);else if(Re.match("{"))il(Re);else ol(Re);let Le=Re.root.fragment.nodes.findIndex((Oe)=>Oe.type==="SvelteOptions");if(Le!==-1){let[Oe]=Re.root.fragment.nodes.splice(Le,1);Re.root.options=Xc(Oe)}return Re.root}function Mt(i){return typeof i==="object"&&i!==null}function ae(i){return Mt(i)&&i.type==="VariableDeclaration"&&Array.isArray(i.declarations)}function f(i){return Mt(i)&&i.type==="Literal"}function s(i){return Mt(i)&&i.type==="Identifier"&&typeof i.name==="string"}function ce(i){return Mt(i)&&i.type==="MemberExpression"}function Rn(i){return Mt(i)&&i.type==="ObjectExpression"&&Array.isArray(i.properties)}function Ah(i){return Mt(i)&&i.type==="CallExpression"}function p(i,Ie){if(!Ah(i))return!1;return!!i.callee&&Mt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===Ie}function d(i){if(Mt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"expression"in i)return d(i.expression);return i}function ue(i){if(Mt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"typeAnnotation"in i)return i.typeAnnotation;return}function Ph(i){return Mt(i)&&i.type==="NewExpression"}function so(i,Ie){if(!Ph(i))return!1;return!!i.callee&&Mt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===Ie}function qn(i){if(!Mt(i)||typeof i.type!=="string")return null;if(i.type==="Literal"){let Ie=i.value;if(typeof Ie==="string")return Ie;return Ie==null?null:String(Ie)}if(i.type==="TemplateLiteral"){let Ie=i.quasis;if(Ie?.length===1){let Re=Ie[0]?.value?.cooked;return Re==null?null:Re}}return null}var g=Symbol("sveld.parsedComponentTypeScriptMetadata");function En(i){return i[g]}function al(i,Ie){if(Ie.length===0)return;let Re=new Set(i.props.map((Le)=>Le.name));for(let Le of Ie){if(Re.has(Le.name))continue;Re.add(Le.name),i.props.push({name:Le.name,kind:"let",constant:!1,type:Le.type,typeSource:"typescript",...Le.description?{description:Le.description}:{},isFunction:Le.type.includes("=>"),isFunctionDeclaration:!1,isRequired:Le.isRequired,reactive:!1})}}var Nh=/\w/;function _h(i,Ie){let Re=i.trim();if(!Re.startsWith("{")||!Re.endsWith("}"))return;let Le=Re.slice(1,-1),Oe=[],$e=0,Me="";for(let Fe of Le)if(Fe==="{"||Fe==="<"||Fe==="("||Fe==="[")$e++,Me+=Fe;else if(Fe==="}"||Fe===">"||Fe===")"||Fe==="]")$e--,Me+=Fe;else if((Fe===";"||Fe===",")&&$e===0)Oe.push(Me.trim()),Me="";else Me+=Fe;if(Me.trim())Oe.push(Me.trim());for(let Fe of Oe){if(!Fe.startsWith(Ie))continue;let je=Fe.slice(Ie.length);if(je.length>0&&Nh.test(je[0]))continue;let qe=je.trimStart();if(qe.startsWith("?"))qe=qe.slice(1).trimStart();if(qe.startsWith(":"))return qe.slice(1).trim()}return}function j(i,Ie,Re){let Le=Re;if(Le.computed||Le.object?.type!=="Identifier"||Le.property?.type!=="Identifier")return;let Oe=Le.object.name,$e=Le.property.name;if(!Oe||!$e)return;if(i.wholePropsLocals.has(Oe))return Ie.getPropTypeByLocalOrPublic($e);let Me=Ie.getPropTypeByLocalOrPublic(Oe)??Ie.findVariableTypeAndDescription(Oe)?.type;if(!Me)return;return _h(Me,$e)}function Dh(i){let Ie="";for(let Re=0;Re<i.length;Re++){let Le=i[Re];if(Le==="*"&&i[Re+1]==="*"){if(Ie+=".*",Re++,i[Re+1]==="/")Re++;continue}if(Le==="*"){Ie+="[^/]*";continue}if(Le==="?"){Ie+="[^/]";continue}Ie+=".+^$()[]{}|\\".includes(Le)?`\\${Le}`:Le}return Ie}function cl(i,Ie){return new RegExp(`^${Dh(i)}$`).test(Ie)}var F={"prop-unknown-type":"sveld/prop-unknown-type","context-any-type":"sveld/context-any-type","slot-missing-type":"sveld/slot-missing-type","event-no-source":"sveld/event-no-source","example-compile-error":"sveld/example-compile-error","example-syntax-error":"sveld/example-syntax-error","syntax-skipped":"sveld/syntax-skipped","rest-props-unresolved":"sveld/rest-props-unresolved","context-duplicate-key":"sveld/context-duplicate-key","spread-unresolved":"sveld/spread-unresolved","export-unresolved":"sveld/export-unresolved","module-export-conflict":"sveld/module-export-conflict","extend-props-target-missing":"sveld/extend-props-target-missing","extend-props-duplicate":"sveld/extend-props-duplicate","extend-props-override":"sveld/extend-props-override","jsdoc-unknown-tag":"sveld/jsdoc-unknown-tag","typedef-duplicate":"sveld/typedef-duplicate","property-duplicate":"sveld/property-duplicate","generics-conflict":"sveld/generics-conflict","event-description-ambiguous":"sveld/event-description-ambiguous","jsdoc-tag-dropped":"sveld/jsdoc-tag-dropped","internal-typedef-referenced":"sveld/internal-typedef-referenced","types-inline-unresolved":"sveld/types-inline-unresolved"},Ih={"prop-unknown-type":"warning","context-any-type":"warning","slot-missing-type":"warning","event-no-source":"warning","example-compile-error":"error","example-syntax-error":"error","syntax-skipped":"error","rest-props-unresolved":"warning","context-duplicate-key":"warning","spread-unresolved":"warning","export-unresolved":"warning","module-export-conflict":"warning","extend-props-target-missing":"error","extend-props-duplicate":"warning","extend-props-override":"warning","jsdoc-unknown-tag":"warning","typedef-duplicate":"warning","property-duplicate":"warning","generics-conflict":"warning","event-description-ambiguous":"warning","jsdoc-tag-dropped":"warning","internal-typedef-referenced":"error","types-inline-unresolved":"warning"};function Cn(i){return{...i,code:F[i.kind],severity:Ih[i.kind]}}function J(i,Ie){if(Ie)return i;return i.filter((Re)=>Re.kind!=="jsdoc-unknown-tag")}function q(i,Ie){if(!Ie)return[];return i.filter((Re)=>!Re.ignored&&(Ie!=="errors"||Re.severity==="error"))}function Rh(i,Ie){if(Ie.code!==void 0&&Ie.code!==i.code)return!1;if(Ie.name!==void 0&&Ie.name!==i.name)return!1;if(Ie.component!==void 0&&!cl(Ie.component,i.component))return!1;return!0}function ll(i,Ie){if(!Ie||Ie.length===0)return i;return i.map((Re)=>Re.ignored||Ie.some((Le)=>Rh(Re,Le))?{...Re,ignored:!0}:Re)}var Lh={"prop-unknown-type":"Props without inferred types","context-any-type":"Context values typed as `any`","slot-missing-type":"@slot/@snippet tags missing a {Type} annotation","event-no-source":"@event tags with no dispatch or callback","example-compile-error":"@example blocks that failed to compile","example-syntax-error":"@example blocks that failed to parse","syntax-skipped":"Component syntax sveld skipped","rest-props-unresolved":"$$restProps spread only onto components","context-duplicate-key":"Duplicate setContext keys","spread-unresolved":"Unresolved spreads widened to Record<string, any>","export-unresolved":"Unresolved named export specifiers","module-export-conflict":"Module-script exports colliding with generated names","extend-props-target-missing":"@extends/@extendProps targets that couldn't be verified","extend-props-duplicate":"Duplicate @extends/@extendProps tags","extend-props-override":"Own props overriding an @extends target's prop","jsdoc-unknown-tag":"Unknown JSDoc tags","typedef-duplicate":"Duplicate @typedef/@callback names","property-duplicate":"Duplicate @property names","generics-conflict":"Duplicate @generics/@template names","event-description-ambiguous":"Text after an @event read as the next tag's description","jsdoc-tag-dropped":"Passthrough JSDoc tags that couldn't attach","internal-typedef-referenced":"Public types referencing an @internal typedef","types-inline-unresolved":"typesOptions.inline could not safely copy an imported type"},Oh=["prop-unknown-type","context-any-type","slot-missing-type","event-no-source","example-compile-error","example-syntax-error","syntax-skipped","rest-props-unresolved","context-duplicate-key","spread-unresolved","export-unresolved","module-export-conflict","extend-props-target-missing","extend-props-duplicate","extend-props-override","jsdoc-unknown-tag","typedef-duplicate","property-duplicate","generics-conflict","event-description-ambiguous","jsdoc-tag-dropped","internal-typedef-referenced","types-inline-unresolved"];function Es(i){let Ie=new Set,Re=[];for(let Le of i){let Oe=`${Le.component}:${Le.kind}:${Le.name}`;if(Ie.has(Oe))continue;Ie.add(Oe),Re.push(Le)}return Re}function V(i){let Ie=i.filter((Me)=>!Me.ignored),Re=i.length-Ie.length,Le=Re>0?` (${Re} ignored)`:"";if(Ie.length===0)return`sveld: all types resolved${Le}.`;let Oe=[],$e=Ie.length;Oe.push(`sveld: ${$e} unresolved type${$e===1?"":"s"} found${Le}.`);for(let Me of Oh){let Fe=Ie.filter((qe)=>qe.kind===Me);if(Fe.length===0)continue;Oe.push(""),Oe.push(`${Lh[Me]} (${Fe.length}):`);let je=new Map;for(let qe of Fe){let We=je.get(qe.component)??[];We.push(qe),je.set(qe.component,We)}for(let[qe,We]of je){Oe.push(` ${qe}`);for(let Ge of We){let ze=Ge.source?` (${qe}:${Ge.source.start.line}:${Ge.source.start.column})`:"";Oe.push(` - ${Ge.message}${ze} [${Ge.code}]`)}}}return Oe.join(`
|
|
17
|
+
`)}var pe=1;function U(i){return`${JSON.stringify({kind:"diagnostics",schemaVersion:pe,diagnostics:i},null,2)}
|
|
18
|
+
`}function r(i,Ie,Re,Le,Oe){i.diagnosticRecords.push(Cn({component:i.componentFilePath,kind:Ie,name:Re,message:Le,...Oe?{source:Oe}:{},...Mh(i,Ie,Re)?{ignored:!0}:{}}))}function pl(i,Ie){return`${i}:${Ie}`}function m(i,Ie,Re,Le){if(!Le||Le.length===0)return;let Oe=pl(Ie,Re),$e=i.sveldIgnoreDirectives.get(Oe)??new Set;for(let Me of Le)$e.add(Me);i.sveldIgnoreDirectives.set(Oe,$e)}function Mh(i,Ie,Re){let Le=i.sveldIgnoreDirectives.get(pl(Ie,Re));if(!Le)return!1;return Le.has("")||Le.has(F[Ie])}var io=/[\r\n]+/g;function $h(i){if(i.sourceLineStartOffsetsCache)return i.sourceLineStartOffsetsCache;let Ie=[0];if(i.source){let Re=i.source.indexOf(`
|
|
19
|
+
`);while(Re!==-1)Ie.push(Re+1),Re=i.source.indexOf(`
|
|
20
|
+
`,Re+1)}return i.sourceLineStartOffsetsCache=Ie,Ie}function ul(i,Ie){if(!i.source||Ie<0||Ie>i.source.length)return;let Re=$h(i),Le=i.sourceLineHint;if(Le!==void 0)for(let Me=Le;Me<=Le+1&&Me<Re.length;Me++){let Fe=Re[Me],je=Re[Me+1]??Number.POSITIVE_INFINITY;if(Ie>=Fe&&Ie<je)return i.sourceLineHint=Me,{line:Me+1,column:Ie-Fe}}let Oe=0,$e=Re.length-1;while(Oe<=$e){let Me=Oe+$e>>>1,Fe=Re[Me],je=Re[Me+1]??Number.POSITIVE_INFINITY;if(Ie<Fe)$e=Me-1;else if(Ie>=je)Oe=Me+1;else return i.sourceLineHint=Me,{line:Me+1,column:Ie-Fe}}return}function W(i,Ie,Re){if(Ie===void 0||Re===void 0||Re<Ie)return;let Le=ul(i,Ie),Oe=ul(i,Re);if(!Le||!Oe)return;return{start:Le,end:Oe}}function t(i,Ie){if(!Ie||typeof Ie!=="object")return;let Re="start"in Ie&&typeof Ie.start==="number"?Ie.start:void 0,Le="end"in Ie&&typeof Ie.end==="number"?Ie.end:void 0;return W(i,Re,Le)}function un(i,Ie){if(!Ie||Ie.length===0)return;let Re=[...Ie];while(Re.length>1){let je=Re[Re.length-1];if(je.tag!==void 0||!je.raw.trim().endsWith("*/"))break;Re.pop()}let Le=Re[0],Oe=Le.raw.indexOf(`@${Le.tag??""}`),$e=Le.start+Math.max(Oe,0),Me=Re[Re.length-1],Fe=Me.start+Me.raw.length;return W(i,$e,Fe)}function n(i,Ie,Re){return i.source?.slice(Ie,Re)}function Cs(i,Ie){if(!Ie||typeof Ie!=="object")return;let Re="start"in Ie&&typeof Ie.start==="number"?Ie.start:void 0,Le="end"in Ie&&typeof Ie.end==="number"?Ie.end:void 0;if(Re===void 0||Le===void 0)return;return n(i,Re,Le)?.replace(io," ")}function u(i){return i===void 0||i===""?void 0:i}function R(i,Ie,Re,Le){if(u(Re)===void 0)return;if(i.trackPropLocalName(Re),Ie.props.has(Re)){let Oe=Ie.props.get(Re);Ie.props.set(Re,{...Oe,...Le})}else Ie.props.set(Re,Le)}function L(i,Ie,Re,Le){if(Ie.pendingCallDefault)i.pendingCallDefaultCandidates.push({propName:Re,location:Le,...Ie.pendingCallDefault});if(Ie.pendingConstDefault)i.pendingConstDefaultCandidates.push({propName:Re,location:Le,...Ie.pendingConstDefault})}function h(i,Ie,Re,Le=0){let Oe,$e,Me=!1;if(!Re||typeof Re!=="object"||!("type"in Re))return{value:Oe,type:$e,isFunction:Me};let Fe=fl(i,Ie,Re);if(Re.type==="ObjectExpression"||Re.type==="BinaryExpression"||Re.type==="ArrayExpression"||Re.type==="ArrowFunctionExpression"||Re.type==="FunctionExpression"){let je=Re;if("start"in je&&"end"in je&&typeof je.start==="number"&&typeof je.end==="number")Oe=n(Ie,je.start,je.end)?.replace(io," ");if($e=Oe,Me=Re.type==="ArrowFunctionExpression"||Re.type==="FunctionExpression",Re.type==="BinaryExpression"){let qe=Re;if(qe.left&&typeof qe.left==="object"&&"type"in qe.left&&qe.left.type==="Literal"&&"value"in qe.left&&typeof qe.left.value==="string")$e="string"}if(Re.type==="ArrowFunctionExpression"||Re.type==="FunctionExpression")$e=yl(Re),Oe=dl(Ie,Re)}else if(Re.type==="UnaryExpression"){let je=Re;if("start"in je&&"end"in je&&typeof je.start==="number"&&typeof je.end==="number")Oe=n(Ie,je.start,je.end);if(je.argument){if(typeof je.argument==="object"&&"type"in je.argument&&je.argument.type==="UnaryExpression")$e=h(i,Ie,je.argument).type;else if(typeof je.argument==="object"&&"value"in je.argument)$e=typeof je.argument.value}}else if(Re.type==="NewExpression"){let je=Re;if("start"in je&&"end"in je&&typeof je.start==="number"&&typeof je.end==="number")Oe=n(Ie,je.start,je.end);if(je.callee&&typeof je.callee==="object"&&"type"in je.callee&&je.callee.type==="Identifier"){let qe=je.callee.name;if(qe==="Date")$e="Date";else if(qe==="Map")$e="Map<any, any>";else if(qe==="Set")$e="Set<any>";else if(qe==="WeakMap")$e="WeakMap<object, any>";else if(qe==="WeakSet")$e="WeakSet<object>";else if(qe==="Array")$e="any[]";else if(qe==="RegExp"||qe==="Regexp")$e="RegExp";else if(qe==="Error")$e="Error";else $e=qe}}else if(Re.type==="CallExpression"){let je=Re;if("start"in je&&"end"in je&&typeof je.start==="number"&&typeof je.end==="number")Oe=n(Ie,je.start,je.end);let qe=je.callee,We=qe&&typeof qe==="object"&&"type"in qe&&qe.type==="Identifier"?qe.name:void 0;if((We==="$derived"||We==="$state")&&je.arguments.length===1&&Le<5)return{...h(i,Ie,je.arguments[0],Le+1),value:Oe,defaultValue:Fe};if(We){let Ge=Fh(i,Ie,We);if(Ge)return{value:Oe,type:void 0,isFunction:!1,defaultValue:Fe,resolvedType:Ge};if(Ie.funcDecls.has(We)||jh(Ie,We))return{value:Oe,type:void 0,isFunction:!1,defaultValue:Fe,pendingCallDefault:{calleeName:We}};let ze=Ie.valueImportBindingsByLocalName.get(We);if(ze)return{value:Oe,type:void 0,isFunction:!1,defaultValue:Fe,pendingCallDefault:{calleeName:We,importSource:ze.source,importedName:ze.importedName}}}return{value:Oe,type:void 0,isFunction:!1,defaultValue:Fe,pendingCallDefault:{calleeName:We??Bh(Ie,qe)}}}else if(Re.type==="Identifier"){let je=Re;if(Le<5){let We=hl(Ie,je.name);if(We){let Ge=h(i,Ie,We,Le+1),ze=i.resolveLocalVarJSDoc(je.name);return{...Ge,resolvedType:ze?.type??Ge.resolvedType,resolvedDescription:ze?.description??Ge.resolvedDescription,resolvedParams:ze?.params??Ge.resolvedParams,resolvedReturnType:ze?.returnType??Ge.resolvedReturnType}}if(Ie.funcDecls.has(je.name)){let Ge=i.resolveLocalVarJSDoc(je.name),ze=Ie.funcDecls.get(je.name);return{value:ze?dl(Ie,ze):void 0,type:void 0,isFunction:!0,defaultValue:ze?fl(i,Ie,ze):void 0,resolvedType:Ge?.type??Gh(Ge,ze),resolvedDescription:Ge?.description,resolvedParams:Ge?.params,resolvedReturnType:Ge?.returnType}}}if("start"in je&&"end"in je&&typeof je.start==="number"&&typeof je.end==="number")Oe=n(Ie,je.start,je.end);let qe=Ie.valueImportBindingsByLocalName.get(je.name);if(qe)return{value:Oe,type:$e,isFunction:Me,defaultValue:Fe,pendingConstDefault:{importSource:qe.source,importedName:qe.importedName}}}else if(Re.type==="MemberExpression"){let je=Re;if("start"in je&&"end"in je&&typeof je.start==="number"&&typeof je.end==="number")Oe=n(Ie,je.start,je.end);if(i.isNumericConstant(Re))$e="number"}else if(Re.type==="TemplateLiteral"){let je=Re;if("start"in je&&"end"in je&&typeof je.start==="number"&&typeof je.end==="number")Oe=n(Ie,je.start,je.end);$e="string"}else if("raw"in Re&&typeof Re.raw==="string"){if(Oe=Re.raw,"value"in Re)$e=Re.value==null?void 0:typeof Re.value}return{value:Oe,type:$e,isFunction:Me,defaultValue:Fe}}function hl(i,Ie){for(let Re of i.vars)for(let Le of Re.declarations)if(Le.id&&typeof Le.id==="object"&&"type"in Le.id&&Le.id.type==="Identifier"&&"name"in Le.id&&Le.id.name===Ie&&Le.init)return Le.init;return}function Mr(i,Ie){for(let Re of i.vars){if(Re.kind!=="const")continue;for(let Le of Re.declarations)if(Le.id&&typeof Le.id==="object"&&"type"in Le.id&&Le.id.type==="Identifier"&&"name"in Le.id&&Le.id.name===Ie&&Le.init)return Le.init}return}function Bh(i,Ie){if(Ie&&typeof Ie==="object"&&"start"in Ie&&"end"in Ie&&typeof Ie.start==="number"&&typeof Ie.end==="number")return n(i,Ie.start,Ie.end)??"call";return"call"}function Fh(i,Ie,Re){let Le=i.resolveLocalVarJSDoc(Re);if(Le?.returnType)return Le.returnType;let Oe=Ie.funcDecls.get(Re)??ml(Ie,Re);if(!Oe)return;let $e=qh(Ie,Oe);if($e)return $e;let Me=Vh(Ie,Re);if(Me)return Me;let Fe=gl(Oe);return Fe==="any"?void 0:Fe}function jh(i,Ie){return ml(i,Ie)!==void 0}function ml(i,Ie){let Re=hl(i,Ie);if(!Re||typeof Re!=="object"||!("type"in Re))return;if(Re.type==="ArrowFunctionExpression"||Re.type==="FunctionExpression")return Re;return}function Vh(i,Ie){for(let Re of i.vars)for(let Le of Re.declarations){let Oe=Le.id;if(!Oe||typeof Oe!=="object"||!("type"in Oe)||Oe.type!=="Identifier"||!("name"in Oe)||Oe.name!==Ie)continue;let $e=Oe.typeAnnotation;if($e?.type!=="TSTypeAnnotation")return;let Me=$e.typeAnnotation;if(!Me||typeof Me.start!=="number"||typeof Me.end!=="number")return;return Wh(n(i,Me.start,Me.end))}return}function Wh(i){if(!i)return;let Ie=i.lastIndexOf("=>");if(Ie===-1)return;return i.slice(Ie+2).trim()||void 0}function qh(i,Ie){let Re=Ie.returnType;if(Re?.type!=="TSTypeAnnotation")return;let Le=Re.typeAnnotation;if(!Le||typeof Le.start!=="number"||typeof Le.end!=="number")return;return n(i,Le.start,Le.end)}function Gh(i,Ie){let Re=i?.returnType??"any",Le=i?.params;if(Le&&Le.length>0)return`(${Le.map(($e)=>`${$e.name}${$e.optional?"?":""}: ${$e.type}`).join(", ")}) => ${Re}`;if(i?.returnType)return`() => ${Re}`;if(Ie)return yl(Ie);return"(...args: any[]) => any"}function yl(i){return`(${Uh(i)}) => ${gl(i)}`}function Uh(i){let Ie=i.params;if(!Array.isArray(Ie)||Ie.length===0)return"...args: any[]";let Re=[];for(let Le of Ie)if(Le&&typeof Le==="object"&&"type"in Le&&Le.type==="Identifier"&&"name"in Le&&typeof Le.name==="string")Re.push(`${Le.name}: any`);else return"...args: any[]";return Re.join(", ")}function gl(i){if(i.async||i.generator)return"any";let Ie=i.body,Re;if(Ie&&typeof Ie==="object"&&"type"in Ie&&Ie.type==="BlockStatement"){if(Re=Hh(Ie),Re.length===0)return"any"}else Re=[Ie];let Le=null;for(let Oe of Re){let $e=Kh(Oe);if(!$e)return"any";if(Le===null)Le=$e;else if(Le!==$e)return"any"}return Le??"any"}function Hh(i){let Ie=[];return oo(i,Ie),Ie}function oo(i,Ie){if(!i||typeof i!=="object")return;let Re=i;if(typeof Re.type!=="string")return;if(Re.type==="FunctionDeclaration"||Re.type==="FunctionExpression"||Re.type==="ArrowFunctionExpression")return;if(Re.type==="ReturnStatement")Ie.push(Re.argument??null);for(let Le in Re){if(Le==="leadingComments")continue;let Oe=Re[Le];if(!Oe||typeof Oe!=="object")continue;if(Array.isArray(Oe))for(let $e=0;$e<Oe.length;$e++)oo(Oe[$e],Ie);else oo(Oe,Ie)}}function Kh(i){if(!i||typeof i!=="object"||!("type"in i))return null;switch(i.type){case"Literal":{let Ie=i.value;if(typeof Ie==="string")return"string";if(typeof Ie==="number")return"number";if(typeof Ie==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let Ie=i.callee;if(Ie&&typeof Ie==="object"&&"type"in Ie&&Ie.type==="Identifier"){let Re=Ie.name;if(Re==="String")return"string";if(Re==="Number")return"number";if(Re==="Boolean")return"boolean"}return null}default:return null}}function le(i){if(p(i,"$bindable"))return{init:i.arguments[0],bindable:!0};return{init:i,bindable:!1}}function zh(i,Ie){let Re=Ie.params;if(!Array.isArray(Re)||Re.length===0)return"";let Le=Re[0],Oe=Re[Re.length-1];if(typeof Le.start!=="number"||typeof Oe.end!=="number")return"";return n(i,Le.start,Oe.end)??""}function dl(i,Ie){if(Ie.generator)return;let Re=Ie.body;if(!Re||typeof Re!=="object"||!("type"in Re))return;let Le=zh(i,Ie),Oe=Ie.async?"async ":"",$e=(Fe,je)=>Fe&&typeof Fe==="object"&&("type"in Fe)&&Fe.type==="ObjectExpression"?`(${je})`:je;if(Re.type!=="BlockStatement"){let Fe=Cs(i,Re);return Fe===void 0?void 0:`${Oe}(${Le}) => ${$e(Re,Fe)}`}let Me=Re.body;if(Me.length===0)return`${Oe}(${Le}) => {}`;if(Me.length===1){let Fe=Me[0];if(Fe&&typeof Fe==="object"&&"type"in Fe&&Fe.type==="ReturnStatement"){let je=Fe.argument;if(je){let qe=Cs(i,je);if(qe!==void 0)return`${Oe}(${Le}) => ${$e(je,qe)}`}}}return}function fl(i,Ie,Re){let Le=Cs(Ie,Re);if(!Le||!Re||typeof Re!=="object"||!("type"in Re))return;let Oe="expression";if(Re.type==="Literal"||Re.type==="UnaryExpression")Oe="literal";else if(Re.type==="TemplateLiteral")Oe=Re.expressions.length===0?"literal":"expression";else if(Re.type==="ArrayExpression")Oe="array";else if(Re.type==="ObjectExpression")Oe="object";else if(Re.type==="ArrowFunctionExpression"||Re.type==="FunctionExpression"||Re.type==="FunctionDeclaration")Oe="function";let $e={raw:Le,kind:Oe};if(Oe==="literal"||Oe==="array"||Oe==="object"){let Me=ao(i,Re);if(Me.ok)$e.value=Me.value}return $e}function ao(i,Ie){if(!Ie||typeof Ie!=="object"||!("type"in Ie))return{ok:!1};if(Ie.type==="Literal"){let Re=Ie.value;return typeof Re==="bigint"?{ok:!1}:{ok:!0,value:Re}}if(Ie.type==="UnaryExpression"){let Re=Ie,Le=Re.argument;if(!Le||typeof Le!=="object"||!("type"in Le)||Le.type!=="Literal")return{ok:!1};let Oe=Le.value;if(typeof Oe==="number"){if(Re.operator==="-")return{ok:!0,value:-Oe};if(Re.operator==="+")return{ok:!0,value:Oe}}if(typeof Oe==="boolean"&&Re.operator==="!")return{ok:!0,value:!Oe};return{ok:!1}}if(Ie.type==="TemplateLiteral"){let Re=Ie;if(Re.expressions.length>0||Re.quasis.length!==1)return{ok:!1};return{ok:!0,value:Re.quasis[0].value.cooked??Re.quasis[0].value.raw}}if(Ie.type==="ArrayExpression"){let Re=Ie,Le=[];for(let Oe of Re.elements){if(!Oe)return{ok:!1};let $e=ao(i,Oe);if(!$e.ok)return{ok:!1};Le.push($e.value)}return{ok:!0,value:Le}}if(Ie.type==="ObjectExpression"){let Re=Ie,Le={};for(let Oe of Re.properties){if(Oe.type!=="Property"||Oe.computed)return{ok:!1};let $e=i.getPropertyName(Oe.key);if(!$e)return{ok:!1};let Me=ao(i,Oe.value);if(!Me.ok)return{ok:!1};Le[$e]=Me.value}return{ok:!0,value:Le}}return{ok:!1}}function Xh(i){let Ie=[],Re=0,Le=0;for(let Oe=0;Oe<i.length;Oe++){let $e=i[Oe];if($e==="<"||$e==="("||$e==="["||$e==="{")Re++;else if($e===">"||$e===")"||$e==="]"||$e==="}")Re=Math.max(Re-1,0);else if(Re===0&&($e===";"||$e===","))Ie.push(i.slice(Le,Oe)),Le=Oe+1}return Ie.push(i.slice(Le)),Ie}function Jh(i){let Ie=0;for(let Re=0;Re<i.length;Re++){let Le=i[Re];if(Le==="<"||Le==="("||Le==="["||Le==="{")Ie++;else if(Le===">"||Le===")"||Le==="]"||Le==="}")Ie=Math.max(Ie-1,0);else if(Ie===0&&Le===":")return Re}return-1}var Yh=/^\{([\s\S]*)\}$/,Qh=/^[A-Za-z_$][\w$]*$/;function vs(i){let Ie=i.trim(),Re=Yh.exec(Ie);if(!Re)return null;let Le=Re[1].trim();if(Le==="")return[];let Oe=[];for(let $e of Xh(Le)){let Me=$e.trim();if(!Me)continue;let Fe=Jh(Me);if(Fe===-1)return null;let je=Me.slice(0,Fe).trim(),qe=Me.slice(Fe+1).trim();if(!qe)return null;let We=!1;if(je.endsWith("?"))We=!0,je=je.slice(0,-1).trim();if(!Qh.test(je))return null;Oe.push({name:je,type:qe,optional:We})}return Oe}function Zh(i,Ie,Re,Le){if(!s(Re))return null;let Oe=Mr(i,Re.name);if(Rn(Oe))return El(i,Ie,Oe,Le).properties;let $e=Ie.findVariableTypeAndDescription(Re.name);if(!$e)return null;let Me=vs($e.type);if(!Me)return null;return Me.map((Fe)=>({name:Fe.name,type:Fe.type,optional:Fe.optional}))}function El(i,Ie,Re,Le){let Oe=[],$e=!1;for(let Me of Re.properties){if(Me.type==="SpreadElement"){let Ge=Zh(i,Ie,Me.argument,Le);if(Ge)Oe.push(...Ge);else $e=!0,r(i,"spread-unresolved",Le,`Context "${Le}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,Me));continue}if(Me.type!=="Property")continue;let Fe=Ie.getPropertyName(Me.key);if(!Fe)continue;let je="any",qe,We;if(s(Me.value)){let Ge=Me.value.name,ze=Ie.findVariableTypeAndDescription(Ge);if(ze)je=ze.type,qe=ze.description,We=ze.internal;else r(i,"context-any-type",Fe,`Context "${Le}" property "${Fe}" has no type annotation; defaulted to "any".`,t(i,Me))}else if(Me.value&&typeof Me.value==="object"&&"type"in Me.value&&(Me.value.type==="ArrowFunctionExpression"||Me.value.type==="FunctionExpression"))je=`(${Me.value.params?.map((Xe)=>{if(s(Xe))return`${Xe.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(f(Me.value))je=Me.value.value==null?"null":typeof Me.value.value;Oe.push({name:Fe,type:je,description:qe,optional:!1,...We?{internal:!0}:{}})}return{properties:Oe,hasUnresolvedSpread:$e}}var em=/[-_.:/\s]+/;function $r(i){return`${i.split(em).map((Le)=>Le.charAt(0).toUpperCase()+Le.slice(1)).join("")}Context`}function xl(i,Ie,Re,Le){if(!Re||typeof Re!=="object"||!("type"in Re))return null;if(Re.type==="ObjectExpression"){if(!Rn(Re))return null;let{properties:Oe,hasUnresolvedSpread:$e}=El(i,Ie,Re,Le);return{key:Le,typeName:$r(Le),properties:Oe,description:void 0,...$e?{hasUnresolvedSpread:$e}:{}}}else if(s(Re)){let Oe=Re.name,$e=Ie.findVariableTypeAndDescription(Oe);if($e)return{key:Le,typeName:$r(Le),properties:[{name:Oe,type:$e.type,description:$e.description,optional:!1}],description:void 0,...$e.internal?{internal:!0}:{}};return r(i,"context-any-type",Oe,`Context "${Le}" variable "${Oe}" has no type annotation; defaulted to "any".`,t(i,Re)),{key:Le,typeName:$r(Le),properties:[{name:Oe,type:"any",description:void 0,optional:!1}]}}return null}function bl(i){let Ie=i.callee;if(!Ie||typeof Ie!=="object"||!("type"in Ie))return null;let Re=Ie.type==="Identifier"&&Ie.name==="Symbol",Le=Ie.type==="MemberExpression"&&!Ie.computed&&Ie.object.type==="Identifier"&&Ie.object.name==="Symbol"&&Ie.property.type==="Identifier"&&Ie.property.name==="for";if(!Re&&!Le)return null;let Oe=i.arguments[0];if(!Oe||typeof Oe!=="object"||!("type"in Oe))return"";if(Oe.type==="Literal"&&typeof Oe.value==="string")return Oe.value;if(Oe.type==="TemplateLiteral"&&Oe.quasis?.length===1)return Oe.quasis[0].value.cooked??"";return""}function Cl(i,Ie,Re=0){if(!Ie||typeof Ie!=="object"||!("type"in Ie))return{kind:"unresolved"};let Le=Ie;if(Le.type==="Literal"||Le.type==="TemplateLiteral"){let Oe=qn(Le);return Oe==null?{kind:"unresolved"}:{kind:"resolved",key:Oe}}if(Le.type==="CallExpression"||Le.type==="NewExpression"){let Oe=bl(Le);return Oe==null?{kind:"unresolved"}:{kind:"resolved",key:Oe}}if(Le.type==="Identifier"){if(Re>=5)return{kind:"unresolved"};let Oe=Mr(i,Le.name);if(Oe&&typeof Oe==="object"&&"type"in Oe){let Me=Oe;if((Me.type==="CallExpression"||Me.type==="NewExpression")&&bl(Me)==="")return{kind:"resolved",key:Le.name};return Cl(i,Me,Re+1)}let $e=i.valueImportBindingsByLocalName.get(Le.name);if($e)return{kind:"pending",importSource:$e.source,importedName:$e.importedName};return{kind:"unresolved"}}return{kind:"unresolved"}}function fe(i,Ie,Re,Le){if(!Re||typeof Re!=="object"||!("type"in Re)||Re.type!=="CallExpression")return;let Oe=Re,$e=Oe.arguments[0];if(!$e)return;let Me=Cl(i,$e);if(Me.kind==="unresolved"||Me.kind==="resolved"&&!Me.key){let Ge=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Could not resolve setContext key${Ge}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);return}let Fe=Oe.arguments[1];if(!Fe)return;let je=t(i,Re);if(Me.kind==="pending"){let Ge=xl(i,Ie,Fe,"");if(Ge)i.pendingContextKeyCandidates.push({importSource:Me.importSource,importedName:Me.importedName,properties:Ge.properties,description:Ge.description,source:je});return}let qe=Me.key,We=xl(i,Ie,Fe,qe);if(!We)return;if(i.contexts.has(qe)){r(i,"context-duplicate-key",qe,`setContext("${qe}", ...) was called more than once; only the first call's shape is used.`,je);return}i.contexts.set(qe,{...We,source:je})}var tm=/\n/g;function de(i,Ie){if(!Ie||typeof Ie!=="object"||!("type"in Ie))return;if(Rn(Ie))return Sl(i,Ie);if(Ie.type==="ArrayExpression")return Tl(i,Ie);return}function vl(i,Ie){if(!Ie||typeof Ie!=="object"||!("type"in Ie))return"any";if(s(Ie))return i.findVariableTypeAndDescription(Ie.name)?.type??"any";if(f(Ie)){let Re=Ie.value;return Re===null?"null":typeof Re}if(Rn(Ie))return Sl(i,Ie);if(Ie.type==="ArrayExpression")return Tl(i,Ie);return"any"}function Sl(i,Ie){let Re=[];for(let Le of Ie.properties){if(Le.type!=="Property"||Le.computed)continue;let Oe=i.getPropertyName(Le.key);if(!Oe)continue;Re.push({name:Oe,type:vl(i,Le.value)})}return Ss(Re)}function Tl(i,Ie){let Re=new Set(Ie.elements.filter((Le)=>Le!=null).map((Le)=>vl(i,Le)));if(Re.size===0)return"any[]";if(Re.size===1)return`${[...Re][0]}[]`;return`(${[...Re].join(" | ")})[]`}function Q(i){return typeof i==="string"?JSON.stringify(i):String(i)}function y(i,{name:Ie,detail:Re,has_argument:Le,description:Oe,deprecated:$e,tags:Me,internal:Fe,source:je}){if(Ie===void 0)return;let qe=!Le&&!Re?"null":u(Re),We=Oe,Ge=i.events.get(Ie);if(Ge?.type==="forwarded")i.events.set(Ie,{type:"dispatched",name:Ie,detail:qe,description:We||Ge.description,deprecated:$e??Ge.deprecated,tags:Me??Ge.tags,...Fe||Ge.internal?{internal:!0}:{},source:je||Ge.source});else if(Ge){let ze=Ge.tags??Me;i.events.set(Ie,{...Ge,detail:Ge.detail===void 0?qe:Ge.detail,description:Ge.description||We,deprecated:Ge.deprecated??$e,tags:ze,...Ge.internal||Fe?{internal:!0}:{},source:je||Ge.source})}else i.events.set(Ie,{type:"dispatched",name:Ie,detail:qe,description:We,deprecated:$e,tags:Me,...Fe?{internal:!0}:{},source:je})}function me(i,Ie){let Re=Ie.arguments[0],Le=so(Re,"CustomEvent");if(!Le&&!so(Re,"Event"))return;let Oe=Re.arguments[0],$e=f(Oe)?Oe.value:void 0;if($e==null)return;let Me=Le?Re.arguments[1]:void 0,Fe=!1,je;if(Rn(Me)){let qe=Me.properties.find((We)=>We.type==="Property"&&s(We.key)&&We.key.name==="detail");if(qe?.type==="Property")Fe=!0,je=f(qe.value)?qe.value.value:void 0}return y(i,{name:String($e),detail:je==null?"":Q(je),has_argument:Fe,source:t(i,Ie)}),String($e)}function Ss(i,Ie,Re=!1){if(i.length===0)return"null";let Le=i.map(({name:Oe,type:$e,description:Me,optional:Fe,default:je})=>{let qe=Fe?"?":"",We=Me||"";if(je&&We)We=`${We} @default ${je}`;else if(je)We=`@default ${je}`;if(We){if(Re)return`${We.includes(`
|
|
21
|
+
`)?`/**
|
|
22
|
+
* ${We.split(`
|
|
23
|
+
`).join(`
|
|
24
|
+
* `)}
|
|
25
|
+
*/`:`/** ${We} */`}
|
|
26
|
+
${Oe}${qe}: ${$e};`;return`/** ${We.replace(tm," ")} */ ${Oe}${qe}: ${$e};`}return`${Oe}${qe}: ${$e};`}).join(Re?`
|
|
27
|
+
`:" ");return Re?`{
|
|
28
|
+
${Le}
|
|
29
|
+
}`:`{ ${Le} }`}var nm=/[A-Za-z_$][\w$]*/g;function rm(i,Ie){if(!Ie)return!1;let Re=new Set(Ie[0].split(",").map((Le)=>Le.trim()));for(let[Le]of i.matchAll(nm))if(Re.has(Le))return!0;return!1}function Y(i,Ie){if(Ie===void 0)return;return i.runesPropsDeclarationMetadataByDeclaratorStart.get(Ie)}function he(i,Ie,Re){return Y(i,Ie)?.props.get(Re)}function ye(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"right"in i&&i.right&&typeof i.right==="object"&&"name"in i.right&&typeof i.right.name==="string")return i.right.name;return}function kl(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"left"in i&&i.left&&typeof i.left==="object")return kl(i.left);return}function x(i,Ie){let Re=Ie?.start,Le=Ie?.end;if(Re===void 0||Le===void 0)return;return n(i,Re+1,Le)?.trim()}function ge(i,Ie){let Re=Ie?.start,Le=Ie?.end;if(Re===void 0||Le===void 0)return;return n(i,Re,Le)?.trim()}function c(i,Ie,Re,Le,Oe=new Set){if(!Ie?.type)return;switch(Ie.type){case"TSInterfaceDeclaration":c(i,{type:"TSTypeLiteral",members:Ie.body?.body},Re,Le,Oe);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":c(i,Ie.typeAnnotation,Re,Le,Oe);return;case"TSIntersectionType":case"TSUnionType":for(let $e of Ie.types??[])c(i,$e,Re,Le,Oe);return;case"TSTypeLiteral":for(let $e of Ie.members??[]){if($e?.type!=="TSPropertySignature")continue;c(i,$e.typeAnnotation?.typeAnnotation,Re,Le,Oe)}return;case"TSTypeReference":{let $e=kl(Ie.typeName);if($e){if(i.typeImportBindingsByLocalName.has($e)||i.valueImportBindingsByLocalName.has($e))Re.add($e);let Me=i.localTypeDeclarationsByName.get($e);if(Me&&!Oe.has($e))Le.add($e),Oe.add($e),c(i,Me.node,Re,Le,Oe),Oe.delete($e)}if("typeParameters"in Ie&&Ie.typeParameters&&typeof Ie.typeParameters==="object"){let Me=Ie.typeParameters;for(let Fe of Me.params??[])c(i,Fe,Re,Le,Oe)}return}case"TSArrayType":case"TSRestType":case"TSOptionalType":case"TSIndexedAccessType":case"TSTypeOperator":case"TSExpressionWithTypeArguments":case"TSTupleType":case"TSConditionalType":case"TSInferType":case"TSMappedType":case"TSFunctionType":case"TSConstructorType":case"TSTypeQuery":case"TSImportType":case"TSLiteralType":case"TSTypePredicate":case"TSNamedTupleMember":break;default:break}for(let $e in Ie){let Me=Ie[$e];if(!Me||typeof Me!=="object")continue;if(Array.isArray(Me)){for(let Fe of Me){if(!Fe||typeof Fe!=="object"||!("type"in Fe))continue;c(i,Fe,Re,Le,Oe)}continue}if("type"in Me)c(i,Me,Re,Le,Oe)}}function sm(i,Ie){let Re=new Map;for(let Le of Array.from(Ie).sort()){let Oe=i.typeImportBindingsByLocalName.get(Le),$e=Oe?void 0:i.valueImportBindingsByLocalName.get(Le),Me=Oe??($e?{importedName:$e.importedName,localName:$e.localName,source:$e.source,specifierType:"named"}:void 0);if(!Me)continue;let Fe=Re.get(Me.source)??{default:[],named:[],namespace:[]};if(Me.specifierType==="default")Fe.default.push(Me.localName);else if(Me.specifierType==="namespace")Fe.namespace.push(Me.localName);else Fe.named.push({imported:Me.importedName,local:Me.localName});Re.set(Me.source,Fe)}return Array.from(Re.entries()).sort(([Le],[Oe])=>Le.localeCompare(Oe)).map(([Le,Oe])=>{if(Oe.namespace.length>0)return Oe.namespace.map((je)=>`import type * as ${je} from "${Le}";`).join(`
|
|
30
|
+
`);let $e=Oe.named.map(({imported:je,local:qe})=>{if(!je||je===qe)return qe;return`${je} as ${qe}`}),Me=Oe.default[0],Fe=$e.length>0?`{ ${$e.join(", ")} }`:"";if(Me&&Fe)return`import type ${Me}, ${Fe} from "${Le}";`;if(Me)return`import type ${Me} from "${Le}";`;return`import type ${Fe} from "${Le}";`})}function P(i,Ie){if(Ie)i.additionalTypeDependencyNodes.push(Ie)}function im(i){if(!i.const)return;let Ie=i.id?.name;if(!Ie)return;let Re=[];for(let Le of i.members??[]){let Oe=Le.initializer;if(Oe?.type!=="Literal")return;let $e=Oe.value;if(typeof $e==="string")Re.push(JSON.stringify($e));else if(typeof $e==="number")Re.push(String($e));else return}if(Re.length===0)return;return`type ${Ie} = ${Re.join(" | ")};`}function xe(i,Ie){let Re=im(Ie);if(Re)return Re;if(Ie.start===void 0||Ie.end===void 0)return;let Le=n(i,Ie.start,Ie.end)?.trim();return Le?`declare ${Le}`:void 0}function Z(i,Ie){let Re=!1,Le=[];for(let $e of Ie.params??[]){if($e.type==="RestElement"){let Ge=$e.argument?.name??"rest",ze=x(i,$e.typeAnnotation);if(ze)Re=!0;P(i,$e.typeAnnotation?.typeAnnotation),Le.push(`...${Ge}: ${ze??"any[]"}`);continue}let Me=$e.type==="AssignmentPattern",Fe=Me?$e.left:$e,je=Fe?.name??"arg",qe=x(i,Fe?.typeAnnotation);if(qe)Re=!0;P(i,Fe?.typeAnnotation?.typeAnnotation);let We=Me||$e.optional===!0;Le.push(`${je}${We?"?":""}: ${qe??"any"}`)}let Oe=x(i,Ie.returnType);if(Oe)Re=!0;return P(i,Ie.returnType?.typeAnnotation),{signature:`(${Le.join(", ")}) => ${Oe??"any"}`,hasAnnotations:Re}}function Te(i){let Ie=i.pendingCallDefaultCandidates.length>0?i.pendingCallDefaultCandidates.slice():void 0,Re=i.pendingConstDefaultCandidates.length>0?i.pendingConstDefaultCandidates.slice():void 0,Le=i.pendingContextKeyCandidates.length>0?i.pendingContextKeyCandidates.slice():void 0,Oe={...Ie?{pendingCallDefaultCandidates:Ie}:{},...Re?{pendingConstDefaultCandidates:Re}:{},...Le?{pendingContextKeyCandidates:Le}:{}},$e=Ie!==void 0||Re!==void 0||Le!==void 0,Me=new Set,Fe=new Set;for(let Ge of i.additionalTypeDependencyNodes)c(i,Ge,Me,Fe);let je=i.typedRunesPropsDeclarations.length===1?i.typedRunesPropsDeclarations[0]:void 0,qe=je?.canonicalType;if(je&&qe){for(let Ge of je.referencedImportedTypes)Me.add(Ge);for(let Ge of je.referencedLocalTypes)Fe.add(Ge)}if(!qe&&Me.size===0&&Fe.size===0)return $e?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],...Oe}:void 0;let We=Array.from(Fe).map((Ge)=>i.localTypeDeclarationsByName.get(Ge)).filter((Ge)=>Ge!==void 0).sort((Ge,ze)=>Ge.start-ze.start).map((Ge)=>Ge.code);return{...qe?{canonicalPropsType:qe}:{},canonicalPropNames:je&&qe?Array.from(je.props.keys()).sort():[],localTypeDeclarations:We,typeImportStatements:sm(i,Me),referencesComponentGenerics:qe?rm(qe,i.generics):!1,...Oe}}var om=/^[A-Za-z_$][\w$]*/,am=/[A-Za-z_$][\w$]*/g,wl=/^(?:const|in|out)\s+/;function kn(i){let Ie=[],Re=0,Le=0;for(let Oe=0;Oe<i.length;Oe++){let $e=i[Oe];if($e==="<"||$e==="("||$e==="["||$e==="{")Re++;else if($e===">"||$e===")"||$e==="]"||$e==="}")Re=Math.max(Re-1,0);else if($e===","&&Re===0)Ie.push(i.slice(Le,Oe)),Le=Oe+1}return Ie.push(i.slice(Le)),Ie}function Ee(i){let Ie=kn(i).map((Le)=>Le.trim()).filter((Le)=>Le.length>0);if(Ie.length===0)return null;return[Ie.map((Le)=>{let Oe=Le;while(wl.test(Oe))Oe=Oe.replace(wl,"");return Oe.match(om)?.[0]??Le}).join(", "),Ie.join(", ")]}function be(i,Ie,Re){let Le=i.scriptGenericsAttribute?.value;if(!Le)return;for(let[Oe]of Le.matchAll(am)){if(i.typeImportBindingsByLocalName.has(Oe))Ie.add(Oe);if(Re.has(Oe))continue;let $e=i.localTypeDeclarationsByName.get(Oe);if(!$e)continue;Re.add(Oe),c(i,$e.node,Ie,Re)}}var cm=null;function lm(i,Ie,Re){let Le={value:void 0,replace:!1};if(!Re||typeof Re!=="object"||!("type"in Re))return Le;if(Re.type==="Identifier")Le.value=Re.name,Le.replace=!0;else if(Re.type==="Literal")Le.value=String(Re.value);else if(Re.type==="MemberExpression")Le.value=j(i,Ie,Re);else if((Re.type==="ObjectExpression"||Re.type==="TemplateLiteral")&&"start"in Re&&"end"in Re&&typeof Re.start==="number"&&typeof Re.end==="number")Le.value=n(i,Re.start,Re.end);return Le}function pm(i,Ie,Re){if(!s(Re))return null;let Le=Mr(i,Re.name);if(Rn(Le))return K(i,Ie,Le).slot_props;let Oe=Ie.findVariableTypeAndDescription(Re.name);if(!Oe)return null;let $e=vs(Oe.type);if(!$e)return null;let Me={};for(let Fe of $e)Me[Fe.name]={value:Fe.type,replace:!1};return Me}function K(i,Ie,Re){let Le={},Oe=!1;for(let $e of Re.properties){if($e.type==="SpreadElement"){let Fe=pm(i,Ie,$e.argument);if(Fe)Object.assign(Le,Fe);else Oe=!0,r(i,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,$e));continue}if($e.type!=="Property"||$e.computed)continue;let Me=Ie.getPropertyName($e.key);if(!Me)continue;Le[Me]=lm(i,Ie,$e.value)}return{slot_props:Le,hasUnresolvedSpread:Oe}}function um(i,Ie){if(!Ie||typeof Ie!=="object"||!("type"in Ie))return null;if(Ie.type==="Identifier"){let $e=Ie,Me=i.propLocalToPublicName.get($e.name);if(!Me)return null;return{publicName:Me,trackingName:$e.name}}if(Ie.type!=="MemberExpression")return null;let Re=Ie,Le=Re.object&&typeof Re.object==="object"&&"type"in Re.object&&Re.object.type==="Identifier"?Re.object.name:void 0;if(!Le||!i.wholePropsLocals.has(Le))return null;let Oe;if(!Re.computed&&Re.property&&typeof Re.property==="object"&&"type"in Re.property){if(Re.property.type==="Identifier")Oe=Re.property.name;else if(Re.property.type==="Literal"&&Re.property.value!=null)Oe=String(Re.property.value)}else if(Re.computed&&Re.property&&typeof Re.property==="object"&&"type"in Re.property&&Re.property.type==="Literal"&&"value"in Re.property&&Re.property.value!=null)Oe=String(Re.property.value);if(!Oe)return null;return{publicName:Oe,trackingName:Oe}}function Se(i,Ie){let Re=Ie;if(Re&&typeof Re==="object"&&"type"in Re&&Re.type==="ChainExpression")Re=Re.expression;if(!Re||typeof Re!=="object"||!("type"in Re)||Re.type!=="CallExpression")return null;let Le=Re;if(!Le.callee||typeof Le.callee!=="object"||!("type"in Le.callee))return null;let Oe=um(i,Le.callee);if(!Oe)return null;return{...Oe,arguments:Le.arguments}}function O(i,{slot_name:Ie,slot_props:Re,slot_props_unresolved_spread:Le,slot_fallback:Oe,slot_description:$e,slot_deprecated:Me,slot_tags:Fe,slot_internal:je,source:qe}){let We=Ie===void 0||Ie==="",Ge=We?cm:Ie??"",ze=u(Oe),Xe=Re===void 0||Re===""?void 0:Re,Qe=$e?.trim()||void 0;if(i.slots.has(Ge)){let Ze=i.slots.get(Ge);if(Ze)i.slots.set(Ge,{...Ze,default:Ze.default??We,fallback:ze,slot_props:Ze.slot_props===void 0?Xe:Ze.slot_props,slot_props_unresolved_spread:Ze.slot_props_unresolved_spread||Le,description:Ze.description||Qe,deprecated:Ze.deprecated??Me,tags:Ze.tags||Fe,...Ze.internal||je?{internal:!0}:{},source:qe||Ze.source})}else i.slots.set(Ge,{name:Ge,default:We,fallback:ze,slot_props:Xe,slot_props_unresolved_spread:Le,description:Qe,deprecated:Me,tags:Fe,...je?{internal:!0}:{},source:qe})}function H(i,Ie){let Re=Ie.source?.value;if(typeof Re!=="string"||Ie.importKind==="type")return;for(let Le of Ie.specifiers??[]){if(Le.type!=="ImportSpecifier"||Le.importKind==="type")continue;let Oe=Le.local?.name;if(!Oe)continue;let $e=Le.imported?.name??(typeof Le.imported?.value==="string"?Le.imported.value:Oe);i.valueImportBindingsByLocalName.set(Oe,{localName:Oe,importedName:$e,source:Re})}}function Ts(i){let Ie=i,Re=Ie.type==="Program"?Ie.body:Ie.content?.body??Ie.body;return Array.isArray(Re)?Re:void 0}function ke(i){let Ie=new Map,Re=i?Ts(i):void 0;if(!Re)return Ie;for(let Le of Re){let Oe=Le;if(Oe.type!=="ImportDeclaration"||Oe.importKind==="type")continue;let $e=Oe.source?.value;if(typeof $e!=="string")continue;for(let Me of Oe.specifiers??[]){let Fe=Me.local?.name;if(!Fe||Me.importKind==="type")continue;let je;if(Me.type==="ImportDefaultSpecifier")je="default";else if(Me.type==="ImportNamespaceSpecifier")je="*";else je=Me.imported?.name??String(Me.imported?.value??Fe);Ie.set(Fe,{from:$e,imported:je})}}return Ie}function ee(i,Ie){if(!Ie)return;let Re=Ts(Ie);if(!Re)return;for(let Le of Re){let Oe=Le;if(Oe.type==="ImportDeclaration"){H(i,Oe);continue}let $e=Oe.type==="ExportNamedDeclaration"&&Oe.declaration?Oe.declaration:Oe;if($e.type==="FunctionDeclaration"){let Me=$e;if(Me.id?.name)i.funcDecls.set(Me.id.name,Me)}}}var co=/^\s+/,Pl=/\s/,dm=/^@[^\s/]+(?=\s|$)/,fm=/^@(\S+)\s*/;function Al(i){let Ie=0;while(Ie<i.length){let Re=i.charCodeAt(Ie);if(Re!==32&&Re!==9&&Re!==13&&Re!==10&&!Pl.test(i[Ie]))break;Ie++}return Ie}function hm(i,Ie){let Re=i.slice(Al(i)),Le=!1;if(Ie)Re=Re.slice(3),Le=!0;else if(Re.startsWith("*")&&!Re.startsWith("*/"))Re=Re.slice(1),Le=!0;let Oe=Re.slice(0,Al(Re));Re=Re.slice(Oe.length);let $e=Re.trimEnd(),Me=$e.endsWith("*/")?$e.slice(0,-2):Re;return{indent:Le?Oe.slice(1):Oe,separator:Oe,content:Me}}function mm(i,Ie,Re){let Le=Re>Ie&&i.charCodeAt(Re-1)===13?Re-1:Re;return i.slice(Ie,Le)}function ym(i){let Ie=[],Re=0;while(!0){let Le=i.indexOf("/**",Re);if(Le===-1)break;let Oe=i.lastIndexOf(`
|
|
31
|
+
`,Le-1)+1;if(i.charCodeAt(Le+3)===42||i.slice(Oe,Le).trim()!==""){Re=Le+1;continue}let $e=[],Me=Oe,Fe=!1,je=0;while(Me<=i.length){let qe=i.indexOf(`
|
|
32
|
+
`,Me),We=qe===-1?i.length:qe,Ge=mm(i,Me,We),{indent:ze,separator:Xe,content:Qe}=hm(Ge,$e.length===0);$e.push({raw:Ge,start:Me,number:$e.length,indent:ze,separator:Xe,content:Qe});let Ze=Ge.trimEnd();if(Ze.endsWith("*/")){Fe=!0,je=Me+Ze.length,Re=We;break}if(qe===-1)break;Me=qe+1}if(!Fe)break;Ie.push({start:Le,end:je,lines:$e})}return Ie}function gm(i){let Ie=i;if(Ie.length>0&&Ie[0].content==="")Ie=Ie.slice(1);if(Ie.length>0&&Ie[Ie.length-1].content==="")Ie=Ie.slice(0,-1);return Ie}function xm(i){let Ie=[[]],Re=!1;for(let Le of i){if(dm.test(Le.content)&&!Re)Ie.push([Le]);else Ie[Ie.length-1].push(Le);if(bm(Le.content,"```")%2===1)Re=!Re}return Ie}function bm(i,Ie){let Re=0,Le=i.indexOf(Ie);while(Le!==-1)Re++,Le=i.indexOf(Ie,Le+Ie.length);return Re}function Nl(i){return i.map((Ie)=>Ie.indent+Ie.content).join(`
|
|
33
|
+
`)}function Em(i,Ie){let Re=Ie;while(Re<i.length-1&&i[Re].content.trim()==="")Re++;if(i[Re].content[0]!=="{")return null;let Le=0,Oe=[],$e=Re;for(;$e<i.length;$e++){let je=i[$e].content,qe=0;for(let We of je){if(We==="{")Le++;else if(We==="}")Le--;if(qe++,Le===0)break}if(Oe.push(qe),Le===0)break}if(Le!==0)return null;let Me=$e;return{type:Oe.map((je,qe)=>{let We=Re+qe,Ge=i[We].content.slice(0,je);return i[We].content=i[We].content.slice(je).replace(co,""),qe===0?Ge:i[We].indent+Ge}).join(`
|
|
34
|
+
`).slice(1,-1),endIndex:Me}}function Cm(i){let Ie=i.content.match(co)?.[0]??"",Re=i.content.slice(Ie.length),Le=0,Oe=0;for(let qe of Re){if(Le===0&&Pl.test(qe))break;if(qe==="[")Le++;if(qe==="]")Le--;Oe++}let $e=Le===0?Re.slice(0,Oe):"";if(!$e)return null;let Me=$e,Fe=!1,je;if($e.startsWith("[")&&$e.endsWith("]")){Fe=!0;let We=$e.slice(1,-1).split("=");if(Me=We[0].trim(),We.length>1)je=We.slice(1).join("=").trim();if(!Me)return null}if(Me.length>1&&(Me[0]==='"'||Me[0]==="'")&&Me[Me.length-1]===Me[0])Me=Me.slice(1,-1);return i.content=Re.slice(Oe).replace(co,""),{name:Me,optional:Fe,default:je}}function vm(i){let Ie=i[0],Re=Ie.content.match(fm),Le=Re?Re[1]:"",Oe=Re?Ie.content.slice(Re[0].length):Ie.content,$e=Oe.trimEnd(),Me=i.slice(1).map((Xe)=>Xe.separator+Xe.content),Fe=($e?[$e,...Me]:Me).join(`
|
|
35
|
+
`);Ie.content=Oe,Ie.tag=Le;let je=Em(i,0),qe=je?.type??"",We=0;if(je){We=je.endIndex;while(We<i.length-1&&i[We].content.trim()==="")We++}let Ge=Cm(i[We]),ze=Nl(i.slice(je?je.endIndex:0));return{tag:Le,name:Ge?.name??"",type:qe,optional:Ge?.optional??!1,default:Ge?.default,description:ze,raw:Fe,lines:i}}function Sm(i,Ie,Re){let Le=gm(i);Le.forEach((Me,Fe)=>{Me.number=Fe});let Oe=xm(Le),$e=Oe.slice(1).map(vm);return{description:Nl(Oe[0]),tags:$e,start:Ie,end:Re,lines:Le}}function Br(i){return ym(i).map(({start:Ie,end:Re,lines:Le})=>Sm(Le,Ie,Re))}var Tm=/\s*=\s*/;function _l(i){let Ie=i.indexOf("<");if(Ie===-1||!i.endsWith(">"))return i;let Re=i.slice(0,Ie),Le=i.slice(Ie+1,-1),Oe=kn(Le).map(($e)=>$e.trim().replace(Tm," = ")).join(", ");return`${Re}<${Oe}>`}var te=/^\s*$/,km=/;$/,wm=/^-\s*/;function Am(i){return i.split(`
|
|
36
|
+
`).map((Ie)=>Ie.trim()).join(`
|
|
37
|
+
`)}function hr(i){if(i===void 0)return;let Ie=i.replace(wm,"").trim();return Ie===""?"":Ie}var Dl=new Set(["restProps","slot","snippet","event","typedef","callback"]),lo=new Set(["property","type"]);function ks(i){if(!i||i.length===0)return;return i[0].content}var Il=new Set(["since","example","see"]),Pm=new Set(["bindable","default","required"]);function Nm(i){let Ie=i.trim();return Ie===""?!0:Ie}function Rl(i,Ie){return Nm(`${i??""}${Ie?` ${Ie}`:""}`)}function _m(i){let Ie=i.trim().replace(km,"").trimEnd();if(!Ie.startsWith("{")||!Ie.endsWith("}"))return!1;let Re=0,Le=null;for(let Oe=0;Oe<Ie.length;Oe++){let $e=Ie[Oe];if(Le!==null){if($e==="\\"){Oe++;continue}if($e===Le)Le=null;continue}if($e==='"'||$e==="'"||$e==="`"){Le=$e;continue}if($e==="{"||$e==="["||$e==="(")Re++;else if($e==="}"||$e==="]"||$e===")"){if(Re--,Re===0&&Oe<Ie.length-1)return!1}}return Re===0}function po(i){let Ie=i;if(!Ie.startsWith("/*"))Ie=`/*${Ie}`;if(!Ie.endsWith("*/"))Ie+="*/";return Ie}function Dm(i){if(i==="*")return"any";return i.trim()}function Ll(i){let Ie=Br(po(i)),{returns:Re}=M(Ie);return Re?Dm(Re.type):void 0}function Ol(i){let Ie=Br(po(i)),{deprecated:Re,passthrough:Le,internal:Oe}=M(Ie),$e=Le.length>0?Le.map((Me)=>({name:Me.tag,body:Me.raw})):void 0;return{deprecated:Re,tags:$e,internal:Oe}}var Im=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function re(i,Ie){let Re=i.parsedJsDocByText.get(Ie);if(Re===void 0)Re=Br(Ie),i.parsedJsDocByText.set(Ie,Re);return Re}function M(i){let Ie=i[0]?.tags??[],Re,Le=[],Oe,$e,Me,Fe=!1,je=[],qe=[],We=[];for(let Ge of Ie)if(Ge.tag==="type")Re=Ge;else if(Ge.tag==="param")Le.push(Ge);else if(Ge.tag==="returns"||Ge.tag==="return")Oe=Ge;else if(Ge.tag==="deprecated")Me??=Rl(Ge.name,Ge.description);else if(Ge.tag==="ignore"||Ge.tag==="internal")Fe=!0;else if(Ge.tag==="sveld-ignore")We.push(Ge.name);else if(Il.has(Ge.tag))qe.push(Ge);else if(Ge.tag==="bindable"){if(Ge.type)continue;let ze=`${Ge.name}${Ge.description?` ${Ge.description}`:""}`.trim();if(ze==="readonly"||ze==="writable")$e??=ze}else if(!Im.has(Ge.tag))je.push(Ge);return{type:Re,param:Le,returns:Oe,binding:$e,deprecated:Me,internal:Fe,additional:je,passthrough:qe,ignore:We,description:i[0]?.description}}function Rm(i,Ie){if(typeof Ie.start!=="number"||typeof Ie.end!=="number")return;let Re=i.jsDocBlocksByStart.get(Ie.start);if(Re===void 0||Re.end!==Ie.end)return;return[Re]}function Lm(i){if(!i||i.length===0)return;let Ie=i[i.length-1];return Ie&&typeof Ie==="object"&&"value"in Ie?Ie:void 0}function Ml(i,Ie,Re){if(!Ie||Ie.length===0||Re===void 0||!i.source)return;for(let Le=Ie.length-1;Le>=0;Le--){let Oe=Ie[Le];if(!Oe||typeof Oe!=="object"||!("value"in Oe)||!("end"in Oe))continue;if(typeof Oe.end!=="number"||!("start"in Oe)||typeof Oe.start!=="number")continue;let $e=i.source.slice(Oe.end,Re);if(te.test($e))return Oe}return}function Om(i){let Ie=new Set,Re=(Oe)=>{let{leadingComments:$e,start:Me}=Oe,Fe=Ml(i,$e,Me);if(Fe)Ie.add(Fe.start)};for(let Oe of i.funcDecls.values())Re(Oe);let Le=[{root:i.parsed?.module,isModule:!0},{root:i.parsed?.instance,isModule:!1}];for(let{root:Oe,isModule:$e}of Le)for(let Me of(Oe&&Ts(Oe))??[]){let Fe=Me,je=Fe.type==="ExportNamedDeclaration",qe=je?Fe.declaration:Fe;if(qe?.type==="FunctionDeclaration"){if(je)Re(Fe)}else if(qe?.type==="VariableDeclaration"&&($e||!je)&&qe.declarations?.length===1&&Mm.has(qe.declarations[0].init?.type??""))Re(Fe)}return Ie}var Mm=new Set(["ArrowFunctionExpression","FunctionExpression"]);function l(i,Ie,Re){if(!Re?.leadingComments)return;let Le=Ml(i,Re.leadingComments,Re.start);if(!Le)return;return $m(i,Ie,[Le])}function we(i,Ie,Re){if(!Re?.leadingComments)return;return l(i,Ie,Re)}function $l(i,Ie,Re){let Le=i;if(Ie)Le=`${i} extends ${Ie}`;if(Re)Le+=` = ${Re}`;return Le}function $m(i,Ie,Re){if(!Re)return;let Le=Lm(Re);if(!Le)return;let Oe=Rm(i,Le)??re(i,po(Le.value)),{type:$e,param:Me,returns:Fe,binding:je,deprecated:qe,internal:We,additional:Ge,passthrough:ze,ignore:Xe,description:Qe}=M(Oe),Ze,nt,at,pt;if($e)Ze=Ie.aliasType($e.type);if(Me.length>0)nt=Me.filter((Et)=>!Et.name.includes(".")).map((Et)=>({name:Et.name,type:Ie.aliasType(Et.type),description:hr(Am(Et.description)),optional:Et.optional||!1}));if(Fe)at=Ie.aliasType(Fe.type);let tt,lt=Ge;if(typeof Le.start==="number"&&i.functionDocCommentStarts.has(Le.start)){let Et=Ge.filter((vt)=>vt.tag==="template"&&vt.name);if(Et.length>0)tt=Et.map((vt)=>$l(vt.name,Ie.aliasType(vt.type),vt.default)).join(", "),lt=Ge.filter((vt)=>vt.tag!=="template")}let ct=u(Qe?.trim());if(ct||lt.length>0){let Et=[];if(ct)Et.push(ct);for(let vt of lt){let Be=`@${vt.tag}${vt.name?` ${vt.name}`:""}${vt.description?` ${vt.description}`:""}`;Et.push(Be)}pt=Et.join(`
|
|
38
|
+
`)}let Nt=ze.length>0?ze.map((Et)=>({name:Et.tag,body:Et.raw})):void 0;return{type:Ze,params:nt,returnType:at,description:pt,binding:je,deprecated:qe,tags:Nt,sveldIgnore:Xe.length>0?Xe:void 0,internal:We,typeParameters:tt}}function Ce(i,Ie,Re=i.source){if(!Re)return;let Le=!1,Oe=!1,$e=!1,Me=new Set,Fe=()=>{if(Le&&Oe&&!$e){$e=!0;let Qe=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${Qe}; their declarations are combined in the order encountered.`)}},je=(Qe,Ze)=>{if(Me.has(Qe))r(i,"generics-conflict",Qe,`Duplicate generic name "${Qe}".`,Ze);else Me.add(Qe)},qe=(Qe,Ze)=>{if(i.generics){let at=kn(i.generics[0]).map((pt)=>pt.trim()).indexOf(Qe.trim());if(at!==-1){let pt=kn(i.generics[1]).map((tt)=>tt.trim());pt[at]=Ze,i.generics=[i.generics[0],pt.join(", ")];return}}Ie.accumulateGeneric(Qe,Ze)},We=(Qe,Ze)=>{if(i.typedefs.has(Qe))r(i,"typedef-duplicate",Qe,`Duplicate typedef/callback name "${Qe}"; the later declaration overwrites the earlier one.`,Ze)},Ge=(Qe,Ze,nt,at)=>{let pt=Qe.findIndex((tt)=>tt.name===Ze.name);if(pt===-1)Qe.push(Ze);else{let tt=nt?` of "${nt}"`:"";r(i,"property-duplicate",Ze.name,`Duplicate property "${Ze.name}"${tt}; the later declaration overwrites the earlier one.`,at),Qe[pt]=Ze}},ze=Re.includes("@template")?Om(i):new Set;i.functionDocCommentStarts=ze;let Xe=Br(Re);for(let Qe of Xe)i.jsDocBlocksByStart.set(Qe.start,Qe);for(let{tags:Qe,description:Ze,lines:nt,start:at}of Xe){let pt=ze.has(at),tt,lt,ct,Nt,Et=!1,vt,Be,Ve=[],Ue=[],Ke=[],Je,Ye,rt,it,st=[],et=!1,ot=[],ut,mt,gt,Ct=[],$t=!1,Wt=[],Kt,qt,Sn=!1,Bt=!0,zt=[],mi,Hn=!1,Tr=new Map,ma=new Set,kr=new Set;for(let yt of Qe)if(yt.lines.length>0)ma.add(yt.lines[0].number);let yi=new Set,gi=!1;for(let yt of nt){if(!yt.tag&&yt.content&&yt.content.trim()!=="}")Tr.set(yt.number,yt.content);if(yt.tag!==void 0)gi=!0;else if(gi&&yt.indent&&yt.content.trim())yi.add(yt.number);else gi=!1}let qu=(yt)=>{if(!yt||yt.length===0)return;let Dt=yt[0].number,Gt=[],bt=[],Yt=!1;for(let _t=Dt-1;_t>=0;_t--){if(ma.has(_t)||yi.has(_t))break;let Ft=Tr.get(_t);if(Ft)Gt.unshift(Ft),bt.unshift(_t),Yt=!0;else if(Yt){let Qt=nt[_t];if(!(!Qt||!Qt.tag&&(!Qt.content||Qt.content.trim()==="")))break}}if(Gt.length===0)return;for(let _t of bt)kr.add(_t);return Gt.join(`
|
|
39
|
+
`).trim()},sr=(yt,Dt)=>{let Gt=hr(ks(yt)),bt=Dt!==void 0&&Dl.has(Dt.tag)&&!hr(ks(Dt.lines)),Yt=tt!==void 0&&(Dt===void 0||!lo.has(Dt.tag)),_t=[];for(let Ft=1;Ft<yt.length;Ft++){let Qt=yt[Ft];if((bt||Yt)&&!yi.has(Qt.number))continue;let It=Tr.get(Qt.number)?.trim();if(!It||kr.has(Qt.number))continue;_t.push(It),kr.add(Qt.number)}if(_t.length===0)return Gt;return[Gt,..._t].filter(Boolean).join(`
|
|
40
|
+
`)},Gu=(yt,Dt,Gt,bt)=>{if(tt===void 0||ct)return;if(bt?.tag!=="event"&&!lo.has(bt?.tag??""))return;if(hr(ks(Gt)))return;let Yt=Dt?`@${yt} "${Dt}"`:`@${yt}`;r(i,"event-description-ambiguous",tt,`Text after @event "${tt}" was used as the description of ${Yt}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,un(i,Gt))},ya=()=>{if(tt!==void 0){let yt=lt&<!=="object"&<!=="Object"?lt:void 0,Dt;if(yt)Dt=yt;else if(Ke.length>0)Dt=Ss(Ke,tt,!0);else Dt=lt||"";if(Be!==void 0){let Gt;for(let _t of Qe){let Ft=_t.lines[0]?.number;if(typeof Ft!=="number")continue;if(Ft<=Be)continue;if(lo.has(_t.tag))continue;Gt=Ft;break}let bt=[],Yt=Array.from(Tr.keys()).sort((_t,Ft)=>_t-Ft);for(let _t of Yt){if(_t<=Be)continue;if(Gt!==void 0&&_t>=Gt)continue;if(kr.has(_t))continue;let Qt=Tr.get(_t)?.trim();if(Qt)bt.push(Qt),kr.add(_t)}if(bt.length>0){let _t=bt.join(`
|
|
41
|
+
`);ct=ct?`${ct}
|
|
42
|
+
${_t}`:_t}}y(i,{name:tt,detail:Dt,has_argument:!1,description:ct,deprecated:Nt,tags:Ve.length>0?Ve:void 0,internal:Et||void 0,source:vt}),i.eventDescriptions.set(tt,ct),i.jsDocEventNames.add(tt),i.jsDocEventSources.set(tt,vt),m(i,"event-no-source",tt,Ue),Ke.length=0,tt=void 0,lt=void 0,ct=void 0,Nt=void 0,Et=!1,vt=void 0,Be=void 0,Ve=[],Ue=[]}},ga=()=>{if(Je!==void 0){let yt,Dt;if(ot.length>0)yt=Ss(ot,void 0,!0),Dt=`type ${Je} = ${yt};`;else if(Ye)yt=Ye,Dt=_m(yt)?`interface ${Je} ${yt}`:`type ${Je} = ${yt};`;else yt="{}",Dt=`type ${Je} = ${yt};`;We(Je,it),i.typedefs.set(Je,{type:yt,name:Je,description:u(rt),ts:Dt,tags:st.length>0?st:void 0,...et?{internal:!0}:{},source:it}),ot.length=0,Je=void 0,Ye=void 0,rt=void 0,it=void 0,st=[],et=!1}},xa=()=>{if(ut!==void 0){let Gt=`(${Wt.map(({name:Yt,type:_t,optional:Ft})=>`${Yt}${Ft?"?":""}: ${_t}`).join(", ")}) => ${Kt||"void"}`,bt=`type ${ut} = ${Gt};`;We(ut,gt),i.typedefs.set(ut,{type:Gt,name:ut,description:u(mt),ts:bt,tags:Ct.length>0?Ct:void 0,...$t?{internal:!0}:{},source:gt}),Wt.length=0,Kt=void 0,ut=void 0,mt=void 0,gt=void 0,Ct=[],$t=!1}},Uu=Qe.some((yt)=>yt.tag==="slot"||yt.tag==="snippet"),Hu=Qe.some((yt)=>yt.tag==="extends"||yt.tag==="extendProps"),Ku=Qe.some((yt)=>yt.tag==="slot"||yt.tag==="snippet"||yt.tag==="event"||yt.tag==="typedef"||yt.tag==="callback");for(let yt=0;yt<Qe.length;yt++){let{tag:Dt,type:Gt,name:bt,description:Yt,optional:_t,default:Ft,raw:Qt,lines:It}=Qe[yt],ir=Qe[yt+1],ln=Ie.aliasType(Gt),or=Dl.has(Dt)?qu(It):void 0;if(or)Gu(Dt,bt,It,Qe[yt-1]);switch(Dt){case"extends":case"extendProps":if(i.extends!==void 0)r(i,"extend-props-duplicate",bt,`A second @extends/@extendProps tag ("${bt}") overwrote the first ("${i.extends.interface}"); only one is used.`,un(i,It));if(i.extends={interface:bt,import:ln},Bt)Bt=!1;break;case"restProps":{let Rt=bt?Yt?`${bt} ${Yt}`:bt:Yt,Bn=hr(Rt)||or;if(!Bn&&Bt&&!Sn&&Ze)Bn=Ze,Sn=!0;if(i.rest_props={type:"Element",name:ln,description:Bn||void 0},Bt)Bt=!1;break}case"slot":case"snippet":{let rn=sr(It,ir);if(!rn&&Bt&&!Sn&&Ze)rn=Ze,Sn=!0;if(!rn&&zt.length===0)rn=or;if(Bt)Bt=!1;let Bn=ln;if(!Bn)Bn="Record<string, never>",r(i,"slot-missing-type",bt||"default",`@${Dt}${bt?` "${bt}"`:""} is missing a required {Type} annotation; falling back to "${Bn}".`,un(i,It));O(i,{slot_name:bt,slot_props:Bn,slot_description:rn||void 0,slot_deprecated:mi,slot_tags:zt.length>0?[...zt]:void 0,slot_internal:Hn||void 0,source:un(i,It)}),zt.length=0,mi=void 0,Hn=!1;{let zu=bt===void 0||bt===""?null:bt;qt=(Xu)=>{let xi=i.slots.get(zu);if(xi)xi.tags=[...xi.tags??[],Xu]}}break}case"csspart":{let Rt=sr(It,ir);i.cssParts.push({name:bt,...Rt?{description:Rt}:{}});break}case"cssprop":case"cssproperty":{let Rt=sr(It,ir);i.cssProperties.push({name:bt,...ln?{type:ln}:{},...Ft===void 0?{}:{default:Ft},...Rt?{description:Rt}:{}});break}case"event":{if(ya(),tt=bt,lt=ln,Be=It.length>0?It[0].number:void 0,ct=hr(ks(It))||or,!ct&&Bt&&!Sn&&Ze)ct=Ze,Sn=!0;if(vt=un(i,It),zt.length>0)Ve.push(...zt),zt.length=0;if(qt=(rn)=>Ve.push(rn),Bt)Bt=!1;break}case"type":if(tt!==void 0)lt=ln;break;case"param":if(ut!==void 0)Wt.push({name:bt,type:ln,optional:_t||!1});break;case"returns":case"return":if(ut!==void 0)Kt=ln;break;case"property":{let Rt={name:bt,type:ln,description:sr(It,ir),optional:_t||!1,default:Ft};if(tt!==void 0)Ge(Ke,Rt,tt,un(i,It));else if(Je!==void 0)Ge(ot,Rt,Je,un(i,It));break}case"typedef":{if(ga(),Je=_l(bt),Ye=ln,it=un(i,It),rt=sr(It,ir)||or,!rt&&Bt&&!Sn&&Ze)rt=Ze,Sn=!0;if(zt.length>0)st.push(...zt),zt.length=0;if(et=Hn,Hn=!1,qt=(rn)=>st.push(rn),Bt)Bt=!1;break}case"callback":{if(xa(),ut=_l(bt),gt=un(i,It),mt=sr(It,ir)||or,!mt&&Bt&&!Sn&&Ze)mt=Ze,Sn=!0;if(zt.length>0)Ct.push(...zt),zt.length=0;if($t=Hn,Hn=!1,qt=(rn)=>Ct.push(rn),Bt)Bt=!1;break}case"generics":{let Rt=ln||bt;for(let rn of kn(bt))je(rn.trim(),un(i,It));if(Le=!0,Fe(),qe(bt,Rt),Bt)Bt=!1;break}case"template":{let Rt=$l(bt,ln,Ft);if(Uu&&!Hu){i.deferredSlotBlockGenerics.push({name:bt,constraint:Rt});break}if(pt)break;if(je(bt,un(i,It)),Oe=!0,Fe(),qe(bt,Rt),Bt)Bt=!1;break}case"deprecated":{let Rt=Rl(bt,Yt);if(tt===void 0)mi??=Rt;else Nt??=Rt;break}case"ignore":case"internal":{if(tt===void 0)Hn=!0;else Et=!0;break}case"sveld-ignore":if(tt!==void 0)Ue.push(bt);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let Rt={name:Dt,body:Qt};if(!Il.has(Dt)&&!Pm.has(Dt))r(i,"jsdoc-unknown-tag",Dt,`Unknown JSDoc tag "@${Dt}"; passed through unchanged. If this is a typo, fix the tag name.`,un(i,It));if(qt)qt(Rt);else zt.push(Rt)}break}}if(ya(),ga(),xa(),Ku&&zt.length>0){for(let yt of zt)r(i,"jsdoc-tag-dropped",yt.name,`@${yt.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);zt.length=0}}}function ne(i){return i==="TSTypeAnnotation"||i==="TSTypeAliasDeclaration"||i==="TSInterfaceDeclaration"||i==="TSTypeParameterDeclaration"||i==="TSTypeParameterInstantiation"}function v(i,Ie,Re,Le){uo(i,null,null,Ie,Re,Le?.skipTypeOnlySubtrees===!0)}function uo(i,Ie,Re,Le,Oe,$e){Le(i,Ie,Re);let Me=i.type;if((Me==="Identifier"||Me==="Literal"||Me==="Text")&&i.typeAnnotation===void 0){if(Oe)Oe(i);return}if($e&&Me.charCodeAt(0)===84&&ne(Me)){if(Oe)Oe(i);return}for(let Fe in i){if(Fe==="leadingComments")continue;let je=i[Fe];if(!je||typeof je!=="object")continue;if(Array.isArray(je))for(let qe=0;qe<je.length;qe++){let We=je[qe];if(We&&typeof We==="object"&&typeof We.type==="string")uo(We,i,Fe,Le,Oe,$e)}else if(typeof je.type==="string")uo(je,i,Fe,Le,Oe,$e)}if(Oe)Oe(i)}import Bl,{sep as fo}from"node:path";var wn=/\.svelte$/,Fl=/\.(?:svelte|[mc]?ts|[mc]?js)$/;function ws(i){if(!i.endsWith(".svelte"))return!1;let Ie=i.length-7;if(Ie===0)return!1;let Re=i.charCodeAt(Ie-1);return Re!==47&&(fo==="/"||Re!==92)}function e(i){return fo==="/"?i:i.split(fo).join("/")}function As(i,Ie){return e(Bl.join(Ie,Bl.normalize(i)))}function Qn(i){return`${JSON.stringify(i,null,2)}
|
|
43
|
+
`}var jl="sveld",Ps="0.37.5";var Vl={name:jl,version:Ps,license:"Apache-2.0",description:"Generate TypeScript definitions and component documentation for your Svelte components.",type:"module",main:"./lib/index.js",types:"./lib/index.d.ts",exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./browser":{types:"./lib/browser.d.ts",import:"./lib/browser.js",default:"./lib/browser.js"},"./schema/component-api.schema.json":"./schema/component-api.schema.json"},scripts:{test:"bun test --parallel","test:fixtures-types":"tsc --project tsconfig.fixtures.json","test:e2e":"bun tests/test-e2e.ts",format:"biome format --write .",lint:"biome check --error-on-warnings .","lint:fix":"biome check --write --unsafe .","lint:fix:changed":"biome check --write --unsafe --changed --no-errors-on-unmatched",build:"bun scripts/build.ts",bench:"bun scripts/bench.ts","bench:cache":"bun scripts/bench.ts --cache","bench:ostia":"ostia bench scripts/bench-ostia.ts",fuzz:"bun scripts/fuzz-parser.ts",typecheck:"tsc --noEmit"},devDependencies:{"@biomejs/biome":"2.5.14","@sveltejs/acorn-typescript":"1.0.13","@types/bun":"^1.4.2","@types/jest":"^30.0.0","@typescript/typescript6":"^6.0.2",acorn:"^8.18.0",ajv:"^8.20.0",culls:"^0.2.0","custom-elements-manifest":"^2.1.0",ostia:"0.2.5",svelte:"^5.57.0",typescript:"^7.0.2"},bin:{sveld:"cli.js"},files:["lib","cli.js","schema"],repository:{type:"git",url:"git+https://github.com/carbon-design-system/sveld.git"},homepage:"https://github.com/carbon-design-system/sveld",bugs:"https://github.com/carbon-design-system/sveld/issues",keywords:["svelte","svelte component","documentation","docgen","typescript","definitions","JSDocs","vite","vite-plugin"],maintainers:["Eric Liu (https://github.com/metonym)"]};var Fr="5.57.0";var Ns=1,Wl=new WeakMap;function Gn(i){return i.some((Ie)=>Ie.internal)?i.filter((Ie)=>!Ie.internal):i}function Fm(i){return{...i,props:Gn(i.props),moduleExports:Gn(i.moduleExports),slots:Gn(i.slots),events:Gn(i.events),typedefs:Gn(i.typedefs),...i.contexts?{contexts:Gn(i.contexts).map((Ie)=>({...Ie,properties:Gn(Ie.properties)}))}:{}}}function o(i,Ie={}){let Re=Wl.get(i),Le=Re?.get(Ie.entryExports);if(Le)return Le;let Oe=Array.from(i,([,Fe])=>{let{diagnostics:je,...qe}=Fe;return Fm(qe)}).sort((Fe,je)=>Fe.moduleName.localeCompare(je.moduleName)),$e={schemaVersion:Ns,generator:{name:jl,version:Ps,svelteVersion:Fr},total:Oe.length,components:Oe},Me=Ie.entryExports?Gn(Ie.entryExports):void 0;if(Me&&Me.length>0)$e.totalExports=Me.length,$e.exports=Me;if(!Re)Re=new Map,Wl.set(i,Re);return Re.set(Ie.entryExports,$e),$e}import{readFile as jm}from"node:fs/promises";import Vm from"node:path";var Wm=/[:=]/,_s={none:0,patch:1,minor:2,major:3};function qm(i,Ie){return _s[Ie]>_s[i]?Ie:i}function Gm(i){return i.reduce((Ie,Re)=>qm(Ie,Re.bump),"none")}function Is(i,Ie){return _s[i]>=_s[Ie]}function zl(i,Ie){let Re=[],Le=0,Oe="",$e=null;for(let Me=0;Me<i.length;Me++){let Fe=i[Me];if($e){if(Oe+=Fe,Fe==="\\")Me++,Oe+=i[Me]??"";else if(Fe===$e)$e=null;continue}if(Fe==='"'||Fe==="'"||Fe==="`"){$e=Fe,Oe+=Fe;continue}if(Fe==="<"||Fe==="("||Fe==="{"||Fe==="[")Le++;if(Fe===">"||Fe===")"||Fe==="}"||Fe==="]")Le--;if(Fe===Ie&&Le===0){Re.push(Oe.trim()),Oe="";continue}Oe+=Fe}return Re.push(Oe.trim()),Re}function ql(i){return new Set(zl(i,"|").filter((Ie)=>Ie.length>0))}function Um(i){let Ie=0,Re=null;for(let Le=0;Le<i.length;Le++){let Oe=i[Le];if(Re){if(Oe==="\\")Le++;else if(Oe===Re)Re=null;continue}if(Oe==='"'||Oe==="'"||Oe==="`"){Re=Oe;continue}if(Oe==="<"||Oe==="("||Oe==="{"||Oe==="[")Ie++;if(Oe===">"||Oe===")"||Oe==="}"||Oe==="]")Ie--;if(Ie===0&&Oe==="="&&i[Le+1]===">")return Le}return-1}function Gl(i){let Ie=Um(i);if(Ie===-1)return;let Re=i.slice(0,Ie).trim(),Le=i.slice(Ie+2).trim();if(!Re.startsWith("(")||!Re.endsWith(")"))return;let Oe=Re.slice(1,-1).trim();return{params:Oe.length===0?[]:zl(Oe,","),returnType:Le}}function Hm(i){return(i.split(Wm,1)[0]??"").trimEnd().endsWith("?")}function Km(i,Ie){if(i.returnType!==Ie.returnType)return"major";if(Ie.params.length<i.params.length)return"major";for(let Le=0;Le<i.params.length;Le++)if(i.params[Le]!==Ie.params[Le])return"major";if(Ie.params.length===i.params.length)return"none";return Ie.params.slice(i.params.length).every(Hm)?"minor":"major"}function mo(i,Ie){if(i===Ie)return"none";if(i===void 0||Ie===void 0)return"major";let Re=Gl(i),Le=Gl(Ie);if(Re&&Le)return Km(Re,Le);let Oe=ql(i),$e=ql(Ie),Me=[...$e].some((je)=>!Oe.has(je)),Fe=[...Oe].some((je)=>!$e.has(je));if(!Me&&!Fe)return"none";if(Me&&!Fe)return"minor";if(Fe&&!Me)return"major";return"major"}function Ul(i){return i.bindable===!0||i.binding==="writable"}function Hl(i,Ie,Re,Le){let Oe=Ie==="prop"?"prop":"export",$e=[],Me=new Map(Re.map((je)=>[je.name,je])),Fe=new Map(Le.map((je)=>[je.name,je]));for(let[je,qe]of Fe){if(Me.has(je))continue;$e.push({component:i,kind:Ie,name:je,bump:qe.isRequired?"major":"minor",message:`${Oe} "${je}" added${qe.isRequired?" (required)":""}`})}for(let[je]of Me){if(Fe.has(je))continue;$e.push({component:i,kind:Ie,name:je,bump:"major",message:`${Oe} "${je}" removed`})}for(let[je,qe]of Me){let We=Fe.get(je);if(!We)continue;if(qe.isRequired!==We.isRequired)$e.push({component:i,kind:Ie,name:je,bump:We.isRequired?"major":"minor",message:`${Oe} "${je}" became ${We.isRequired?"required":"optional"}`});let Ge=mo(qe.type,We.type);if(Ge!=="none")$e.push({component:i,kind:Ie,name:je,bump:Ge,message:`${Oe} "${je}" type changed from \`${qe.type??"unknown"}\` to \`${We.type??"unknown"}\``});let ze=Ul(qe),Xe=Ul(We);if(ze!==Xe)$e.push({component:i,kind:Ie,name:je,bump:Xe?"minor":"major",message:`${Oe} "${je}" ${Xe?"gained a writable binding":"lost its writable binding"}`});if(qe.value!==We.value&&Ge==="none")$e.push({component:i,kind:Ie,name:je,bump:"patch",message:`${Oe} "${je}" default changed from \`${qe.value??"none"}\` to \`${We.value??"none"}\``});let Qe=qe.deprecated!==void 0,Ze=We.deprecated!==void 0;if(Qe!==Ze)$e.push({component:i,kind:Ie,name:je,bump:Ze?"minor":"patch",message:`${Oe} "${je}" ${Ze?"marked as deprecated":"no longer deprecated"}`});if(qe.constant!==We.constant)$e.push({component:i,kind:Ie,name:je,bump:"minor",message:`${Oe} "${je}" ${We.constant?"became constant":"became mutable"}`});if(qe.reactive!==We.reactive)$e.push({component:i,kind:Ie,name:je,bump:"minor",message:`${Oe} "${je}" ${We.reactive?"became reactive":"stopped being reactive"}`})}return $e}function zm(i,Ie,Re){let Le=[],Oe=new Map(Ie.map((Me)=>[Me.name,Me])),$e=new Map(Re.map((Me)=>[Me.name,Me]));for(let[Me]of $e){if(Oe.has(Me))continue;Le.push({component:i,kind:"event",name:Me,bump:"minor",message:`event "${Me}" added`})}for(let[Me]of Oe){if($e.has(Me))continue;Le.push({component:i,kind:"event",name:Me,bump:"major",message:`event "${Me}" removed`})}for(let[Me,Fe]of Oe){let je=$e.get(Me);if(!je)continue;if(Fe.type!==je.type){Le.push({component:i,kind:"event",name:Me,bump:"major",message:`event "${Me}" changed from ${Fe.type} to ${je.type}`});continue}let qe=Fe.type==="dispatched"?Fe.detail:void 0,We=je.type==="dispatched"?je.detail:void 0,Ge=mo(qe,We);if(Ge!=="none")Le.push({component:i,kind:"event",name:Me,bump:Ge,message:`event "${Me}" detail changed from \`${qe??"unknown"}\` to \`${We??"unknown"}\``})}return Le}function Kl(i){return i.name??"default"}function Xm(i,Ie,Re){let Le=[],Oe=new Map(Ie.map((Me)=>[Kl(Me),Me])),$e=new Map(Re.map((Me)=>[Kl(Me),Me]));for(let[Me]of $e){if(Oe.has(Me))continue;Le.push({component:i,kind:"slot",name:Me,bump:"minor",message:`slot "${Me}" added`})}for(let[Me]of Oe){if($e.has(Me))continue;Le.push({component:i,kind:"slot",name:Me,bump:"major",message:`slot "${Me}" removed`})}for(let[Me,Fe]of Oe){let je=$e.get(Me);if(!je)continue;let qe=mo(Fe.slot_props,je.slot_props);if(qe!=="none")Le.push({component:i,kind:"slot",name:Me,bump:qe,message:`slot "${Me}" props changed from \`${Fe.slot_props??"none"}\` to \`${je.slot_props??"none"}\``})}return Le}var Jm=new Set(["description","source","componentCommentSource","tags"]);function Ds(i){if(Array.isArray(i))return i.map(Ds);if(i!==null&&typeof i==="object"){let Ie={};for(let[Re,Le]of Object.entries(i)){if(Jm.has(Re))continue;Ie[Re]=Ds(Le)}return Ie}return i}var Ym=["generics","rest_props","extends","contexts","typedefs"];function Qm(i,Ie,Re){let Le=[];for(let Oe of Ym){let $e=JSON.stringify(Ds(Ie[Oe])),Me=JSON.stringify(Ds(Re[Oe]));if($e!==Me)Le.push({component:i,kind:"shape",name:Oe,bump:"major",message:`"${Oe}" changed (breaking)`})}return Le}function Zm(i,Ie){let Re=Ie.moduleName;return[...Hl(Re,"prop",i.props,Ie.props),...Hl(Re,"moduleExport",i.moduleExports,Ie.moduleExports),...zm(Re,i.events,Ie.events),...Xm(Re,i.slots,Ie.slots),...Qm(Re,i,Ie)]}function Pe(i,Ie){let Re=[],Le=new Map(i.components.map(($e)=>[$e.moduleName,$e])),Oe=new Map(Ie.components.map(($e)=>[$e.moduleName,$e]));for(let[$e]of Oe){if(Le.has($e))continue;Re.push({component:$e,kind:"component",bump:"minor",message:`component "${$e}" added`})}for(let[$e]of Le){if(Oe.has($e))continue;Re.push({component:$e,kind:"component",bump:"major",message:`component "${$e}" removed`})}for(let[$e,Me]of Le){let Fe=Oe.get($e);if(!Fe)continue;Re.push(...Zm(Me,Fe))}return Re}async function ey(i){let Ie;try{Ie=await jm(Vm.resolve(i),"utf-8")}catch(Re){if(Re.code==="ENOENT")return null;throw Re}try{return JSON.parse(Ie)}catch{throw Error(`sveld: could not parse "${i}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function G(i){if(typeof i.check==="string")return i.check;return i.jsonOptions?.outFile??"COMPONENT_API.json"}async function B(i,Ie,Re={}){let Le=await ey(Ie);if(Le===null)return{snapshotExists:!1,snapshotFile:Ie,changes:[],bump:"none"};if(Le.schemaVersion!==Ns)return{snapshotExists:!0,snapshotFile:Ie,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${Le.schemaVersion} differs from ${Ns}; regenerate the snapshot`}],bump:"none"};let Oe=o(i,{entryExports:Re.entryExports}),$e=Pe(Le,Oe);return{snapshotExists:!0,snapshotFile:Ie,changes:$e,bump:Gm($e)}}var ty={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function se(i){if(!i.snapshotExists)return`sveld --check: no snapshot found at "${i.snapshotFile}". Run \`sveld --json\` and commit the output first.`;if(i.changes.length===0)return`sveld --check: no API changes detected against "${i.snapshotFile}".`;let Ie=[],Re=i.changes.length;Ie.push(`sveld --check: ${Re} API change${Re===1?"":"s"} detected against "${i.snapshotFile}".`),Ie.push(`Suggested semver bump: ${i.bump}.`);let Le=new Map;for(let Oe of i.changes){let $e=Le.get(Oe.component)??[];$e.push(Oe),Le.set(Oe.component,$e)}for(let[Oe,$e]of Le){Ie.push(""),Ie.push(` ${Oe}`);for(let Me of $e){let Fe=Me.kind==="schema"?"schema":ty[Me.bump];Ie.push(` [${Fe}] ${Me.message}`)}}return Ie.join(`
|
|
44
|
+
`)}var ve=1;function ie(i){let Ie={kind:"check-report",schemaVersion:ve,...i};return Qn(Ie)}import{existsSync as ry}from"node:fs";import{join as sy}from"node:path";import{pathToFileURL as iy}from"node:url";function ny(i,Ie){let Re=i.length+1,Le=Ie.length+1,Oe=Array.from({length:Re},()=>Array(Le).fill(0));for(let $e=0;$e<Re;$e++)Oe[$e][0]=$e;for(let $e=0;$e<Le;$e++)Oe[0][$e]=$e;for(let $e=1;$e<Re;$e++)for(let Me=1;Me<Le;Me++){let Fe=i[$e-1]===Ie[Me-1]?0:1;Oe[$e][Me]=Math.min(Oe[$e-1][Me]+1,Oe[$e][Me-1]+1,Oe[$e-1][Me-1]+Fe)}return Oe[Re-1][Le-1]}function Rs(i,Ie){let Re,Le=Number.POSITIVE_INFINITY;for(let Oe of Ie){let $e=ny(i,Oe);if($e<Le)Re=Oe,Le=$e}if(Re===void 0||Le>3)return;return Re}var oy=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function _e(i){return i}function ay(i=process.cwd()){for(let Ie of oy){let Re=sy(i,Ie);if(ry(Re))return Re}return null}async function yo(i){let Ie;try{Ie=await import(`${iy(i).href}?t=${Date.now()}`)}catch(Le){let Oe=Le instanceof Error?Le.message:String(Le);throw Error(`sveld: failed to load config file "${i}".
|
|
45
|
+
${Oe}`)}let Re=Ie.default;if(!Mt(Re)||Array.isArray(Re))throw Error(`sveld: config file "${i}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return Re}async function _(i=process.cwd()){let Ie=ay(i);if(Ie===null)return{};return yo(Ie)}function E(...i){let Ie={};for(let Re of i){if(!Re)continue;for(let[Le,Oe]of Object.entries(Re)){let $e=Ie[Le];Ie[Le]=Mt($e)&&!Array.isArray($e)&&Mt(Oe)&&!Array.isArray(Oe)?{...$e,...Oe}:Oe}}return Ie}var cy={ci:{strict:!0,reportDiagnostics:!0,check:!0,checkExamples:!0},local:{reportDiagnostics:!0}};function z(i){let{strict:Ie,...Re}=i;if(Ie!=="ci"&&Ie!=="local")return i;return{...cy[Ie],...Re}}var Xl=["entry","glob","quiet","documentExports","types","typesOptions","json","jsonOptions","markdown","markdownOptions","customElements","customElementsOptions","llms","llmsOptions","additionalWriters","failFast","watch","config","resolveTypes","cache","checkExamples","reportDiagnostics","strict","check","checkLevel","stdout","format","dryRun","diagnostics"],ly={typesOptions:["outDir","preamble","format","exportTypes","typeNames","comments","propsDeclaration","transform","indexTypes","inline","exports","dryRun","cache","resolvedPathByFilePath"],jsonOptions:["input","outFile","outDir","entryExports","dryRun","source"],markdownOptions:["write","outFile","outDir","entryExports","onAppend","dryRun"],customElementsOptions:["outFile","dryRun"],llmsOptions:["outDir","linkBase","title","summary","entryExports","dryRun"],diagnostics:["ignore"]};function Jl(i,Ie,Re){let Le=i===null?Ie:`${i}.${Ie}`,Oe=Rs(Ie,Re),$e=Oe===void 0?void 0:i===null?Oe:`${i}.${Oe}`;console.warn(`sveld: unknown option "${Le}".${$e?` Did you mean "${$e}"?`:""}`)}function N(i){for(let Ie of Object.keys(i))if(!Xl.includes(Ie))Jl(null,Ie,Xl);for(let[Ie,Re]of Object.entries(ly)){let Le=i[Ie];if(!Mt(Le))continue;for(let Oe of Object.keys(Le))if(!Re.includes(Oe))Jl(Ie,Oe,Re)}}var Ls=new Map;function k(i,Ie){if(!Ie?.replace&&Ls.has(i.name))throw Error(`sveld: a writer named "${i.name}" is already registered. Pass { replace: true } to overwrite it.`);Ls.set(i.name,i)}function X(i){return Ls.get(i)}function Ne(){return Array.from(Ls.values())}import{dirname as _u,isAbsolute as rb,resolve as sb}from"node:path";import{existsSync as Zp,lstatSync as nu,readFileSync as Dx,realpathSync as Ix,statSync as ru}from"node:fs";import{readFile as Rx}from"node:fs/promises";import{basename as Lx,dirname as su,extname as Ox,isAbsolute as Mx,join as eu,parse as $x,relative as Uo,resolve as Cr}from"node:path";function jr(i){return i}function Ln(i){if(i==="")return i;return i.startsWith(".")?i:`./${i}`}import{dirname as Ql,resolve as Zl}from"node:path";var py=/^(['"])(.*)\1$/,ep=/^[./]/,uy=/import\(\s*(['"])((?:(?!\1).)+)\1\s*\)/g;function dy(i,Ie){let Re=i.extends?.import;if(Re===void 0)return null;let Le=Re.replace(py,"$2");if(!ep.test(Le))return null;return Zl(Ql(Ie),Le)}function Yl(i,Ie){let Re=[];for(let Le of i.matchAll(uy)){let Oe=Le[2];if(!ep.test(Oe))continue;Re.push(Zl(Ql(Ie),Oe))}return Re}function fy(i,Ie){let Re=[],Le=dy(i,Ie);if(Le!==null)Re.push(Le);for(let Oe of i.typedefs??[])Re.push(...Yl(Oe.type,Ie));for(let Oe of i.props)if(Oe.type)Re.push(...Yl(Oe.type,Ie));return Re}function Vr(i,Ie){let Re=new Map;for(let Le of i.values()){let Oe=Ie(Le.filePath);for(let $e of fy(Le,Oe)){let Me=Re.get($e);if(Me===void 0)Me=new Set,Re.set($e,Me);Me.add(Oe)}}return Re}function Os(i,Ie){let Re=new Set,Le=[];for(let Oe of i)if(!Re.has(Oe))Re.add(Oe),Le.push(Oe);while(Le.length>0){let Oe=Le.shift(),$e=Ie.get(Oe);if($e===void 0)continue;for(let Me of $e)if(!Re.has(Me))Re.add(Me),Le.push(Me)}return Re}var hy=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,my=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),yy=new Set(["svelte","html"]);function gy(i){let Ie=i.trim();if(Ie==="")return null;let Re=Ie.match(hy);if(Re){let Le=Re[1].toLowerCase(),Oe=Re[2].trim();if(Oe==="")return null;if(my.has(Le))return{kind:"compile",code:Oe};if(yy.has(Le))return{kind:"syntax",code:Oe};return null}if(Ie.startsWith("<"))return null;return{kind:"compile",code:Ie}}function tp(i){if(!i.isFunction)return"any";return`(${(i.params??[]).map((Re)=>`${Re.name}${Re.optional?"?":""}: any`).join(", ")}) => any`}function Ms(i,Ie,Re,Le,Oe){let $e=(i??[]).filter((Fe)=>Fe.name==="example"),Me=[];return $e.forEach((Fe,je)=>{let qe=gy(Fe.body);if(qe===null)return;let We=$e.length>1;Me.push({id:We?`${Ie}#${je}`:Ie,name:We?`${Re} (example ${je+1})`:Re,type:Le,code:qe.code,kind:qe.kind,...Oe?{source:Oe}:{}})}),Me}function np(i){return i.name??"default"}function rp(i){let Ie=[];for(let Re of i.props)Ie.push(...Ms(Re.tags,`prop:${Re.name}`,Re.name,tp(Re),Re.source));for(let Re of i.moduleExports)Ie.push(...Ms(Re.tags,`export:${Re.name}`,Re.name,tp(Re),Re.source));for(let Re of i.slots)Ie.push(...Ms(Re.tags,`slot:${np(Re)}`,np(Re),"any",Re.source));for(let Re of i.events)Ie.push(...Ms(Re.tags,`event:${Re.name}`,Re.name,"any",Re.source));return Ie}import{existsSync as xy,readdirSync as by}from"node:fs";import{join as Ey}from"node:path";var go=new Map;function $s(){go.clear()}function Bs(i){let Ie=go.get(i);if(Ie!==void 0)return Ie;try{let Re=by(i,{withFileTypes:!0}),Le=new Set;for(let Oe of Re)Le.add(Oe.name);Ie={entries:Re,names:Le}}catch{Ie=null}return go.set(i,Ie),Ie}function Fs(i,Ie){let Re=Bs(i);if(Re===null)return;if(Re.byName===void 0){Re.byName=new Map;for(let Le of Re.entries)Re.byName.set(Le.name,Le)}return Re.byName.get(Ie)}function sp(i){return i.normalize("NFC").toLowerCase()}function An(i,Ie){let Re=Bs(i);if(Re===null)return!1;if(Re.names.has(Ie))return!0;if(Re.folded===void 0){Re.folded=new Map;for(let Oe of Re.names)Re.folded.set(sp(Oe),Oe)}let Le=Re.folded.get(sp(Ie));return Le!==void 0&&Le!==Ie&&xy(Ey(i,Ie))}import{lstatSync as Dg,readFileSync as Ig}from"node:fs";import{basename as Rg,dirname as Io,join as Ip,resolve as Lg}from"node:path";import{existsSync as Ws,readFileSync as Cy}from"node:fs";import{dirname as xo,isAbsolute as vy,join as Sy,relative as Ty,resolve as qs}from"node:path";function js(i){if(!Mt(i))return{};let Ie={};if(typeof i.svelte==="string")Ie.svelte=i.svelte;if(typeof i.name==="string")Ie.name=i.name;if(typeof i.description==="string")Ie.description=i.description;return Ie}function ip(i){if(!Mt(i))return{};let Ie={};if(typeof i.extends==="string")Ie.extends=i.extends;if(Mt(i.compilerOptions)){let Re={};if(typeof i.compilerOptions.baseUrl==="string")Re.baseUrl=i.compilerOptions.baseUrl;if(Mt(i.compilerOptions.paths)){let Le={};for(let[Oe,$e]of Object.entries(i.compilerOptions.paths))if(Array.isArray($e)&&$e.every((Me)=>typeof Me==="string"))Le[Oe]=$e;if(Object.keys(Le).length>0)Re.paths=Le}if(Object.keys(Re).length>0)Ie.compilerOptions=Re}return Ie}var Vs=new Map,op=new Map,ky=/\/\*[\s\S]*?\*\/|\/\/.*/g,wy=/[.+?^${}()|[\]\\]/g,Ay=[".svelte",".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".d.ts"];class mr extends Error{specifier;fromFile;searched;constructor(i,Ie,Re){super(`cannot resolve "${i}" from ${Ie||"."} (${Re})`);this.name="UnresolvedModuleError",this.specifier=i,this.fromFile=Ie,this.searched=Re}}function Py(i){if(Ws(i))return!0;return Ay.some((Ie)=>Ws(i+Ie))}function ap(i){let Ie=i.indexOf("*");return Ie===-1?i.length:Ie}function Ny(i){let Ie=i,Re=qs(Ie,"/");while(Ie!==Re){for(let Le of["tsconfig.json","jsconfig.json"]){let Oe=Sy(Ie,Le);if(Ws(Oe))return Oe}Ie=xo(Ie)}return null}function cp(i){if(Vs.has(i))return Vs.get(i)??null;try{let Ie=Cy(i,"utf-8"),Re;try{Re=JSON.parse(Ie)}catch{let Oe=Ie.replace(ky,"");Re=JSON.parse(Oe)}let Le=ip(Re);if(Le.extends){let Oe=vy(Le.extends)?Le.extends:qs(xo(i),Le.extends),$e=Oe.endsWith(".json")?Oe:`${Oe}.json`;if(Ws($e)){let Me=cp($e);if(Me)Le.compilerOptions={...Me.compilerOptions,...Le.compilerOptions,paths:{...Me.compilerOptions?.paths,...Le.compilerOptions?.paths}}}}return Vs.set(i,Le),Le}catch{return Vs.set(i,null),null}}function _y(i){let Ie=op.get(i);if(!Ie){let Re=i.split("*").map((Le)=>Le.replace(wy,"\\$&")).join("(.*)");Ie=new RegExp(`^${Re}$`),op.set(i,Ie)}return Ie}function yr(i,Ie){if(i.startsWith(".")||i.startsWith("/"))return{resolved:i,unresolved:!1,searched:""};let Re=Ny(Ie);if(!Re)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let Le=cp(Re);if(!Le?.compilerOptions?.paths)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:Oe=".",paths:$e}=Le.compilerOptions,Me=xo(Re),Fe=qs(Me,Oe),je=Object.entries($e).sort(([qe],[We])=>ap(We)-ap(qe));for(let[qe,We]of je){let Ge=i.match(_y(qe));if(!Ge)continue;let ze;for(let Xe of We){let Qe=Xe;for(let nt=1;nt<Ge.length;nt++)Qe=Qe.replace("*",Ge[nt]);let Ze=qs(Fe,Qe);if(ze===void 0)ze=Ze;if(Py(Ze))return{resolved:Ze,unresolved:!1,searched:Re}}return{resolved:ze??i,unresolved:!1,searched:Re}}return{resolved:i,unresolved:!0,searched:`tsconfig paths (${Re})`}}function bo(i,Ie){return yr(i,Ie).resolved}function Gs(i,Ie){if(i.startsWith(".")||i.startsWith("/"))return i;let Re=bo(i,Ie);if(Re===i)return i;let Le=Ty(Ie,Re);return Le=e(Le),Le.startsWith(".")?Le:`./${Le}`}var Dy=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var up=/\s/,Iy=/\s{2}|[^\S ]/,Ry=/["'`{}/]/g,Ly=/["'`{};/]/g;function Oy(i){return Dy.test(i.slice(-200))}var lp=[""];function My(i){let Ie=lp[i];if(Ie===void 0)Ie=" ".repeat(i),lp[i]=Ie;return Ie}function $y(i,Ie){let Re="";for(let Le=i.length-1;Le>=0&&Re.length<Ie;Le--)Re=i[Le]+Re;return Re.length>Ie?Re.slice(-Ie):Re}function By(i){if(i.length===0)return!1;let Ie=i[i.length-1];return Ie.charCodeAt(Ie.length-1)===10}function Fy(i){while(i.length>0){let Ie=i[i.length-1],Re=Ie.length;while(Re>0){let Le=Ie.charCodeAt(Re-1);if(Le!==32&&Le!==9)break;Re--}if(Re===Ie.length)return;if(Re===0){i.pop();continue}i[i.length-1]=Ie.slice(0,Re);return}}function jy(i){while(i.length>0){let Ie=i[i.length-1];if(!up.test(Ie[Ie.length-1]))return;let Re=Ie.trimEnd();if(Re.length===Ie.length)return;if(Re.length===0){i.pop();continue}i[i.length-1]=Re;return}}function Vy(i){if(i.includes("{"))return!1;let Ie=0,Re=0;for(let Le=0;Le<i.length;Le++){let Oe=i.charCodeAt(Le);if(Ie!==0){if(Oe===Ie&&i.charCodeAt(Le-1)!==92)Ie=0;continue}if(Oe===34||Oe===39||Oe===96){Ie=Oe;continue}if(Oe===59&&++Re>=2)return!0}return!1}function Wy(i){if(!Iy.test(i))return i.trimEnd();let Ie="",Re=null,Le=!1;for(let Oe=0;Oe<i.length;Oe++){let $e=i[Oe],Me=i[Oe-1];if(Re){if(Ie+=$e,Re==="double"&&$e==='"'&&Me!=="\\"||Re==="single"&&$e==="'"&&Me!=="\\"||Re==="template"&&$e==="`"&&Me!=="\\")Re=null;Le=!1;continue}if($e==='"'||$e==="'"||$e==="`"){Re=$e==='"'?"double":$e==="'"?"single":"template",Ie+=$e,Le=!1;continue}if(up.test($e)){if(!Le&&Ie.length>0)Ie+=" ",Le=!0;continue}Ie+=$e,Le=!1}return Ie.trimEnd()}function dp(i,Ie){let Re=i[Ie],Le=i.indexOf(Re,Ie+1);while(Le!==-1&&i.charCodeAt(Le-1)===92)Le=i.indexOf(Re,Le+1);return Le}function fp(i,Ie){let Re=i.indexOf("*/",Ie+1);return Re===-1?-1:Re+1}function qy(i){let Ie=new Map,Re=[],Le=Ry,Oe=0;while(Oe<i.length){if(Le.lastIndex=Oe,!Le.test(i))break;Oe=Le.lastIndex-1;let $e=i.charCodeAt(Oe);if($e===47){if(i.charCodeAt(Oe+1)===42){let Me=fp(i,Oe);if(Me===-1)break;Oe=Me}}else if($e===34||$e===39||$e===96){let Me=dp(i,Oe);if(Me===-1)break;Oe=Me}else if($e===123)Re.push(Oe);else if($e===125&&Re.length>0)Ie.set(Re.pop(),Oe);Oe++}return Ie}function Gy(i,Ie,Re){for(let Le=Ie;Le<Re;Le++)if(!Eo(i.charCodeAt(Le)))return!1;return!0}function Eo(i){if(i<=32)return i===32||i>=9&&i<=13;if(i<160)return!1;return i===160||i===5760||i>=8192&&i<=8202||i===8232||i===8233||i===8239||i===8287||i===12288||i===65279}function hp(i,Ie,Re,Le){let Oe=[],$e=Ly,Me=Ie,Fe=Ie;while(Fe<Re){if($e.lastIndex=Fe,!$e.test(i))break;if(Fe=$e.lastIndex-1,Fe>=Re)break;let je=i.charCodeAt(Fe);if(je===47){if(i.charCodeAt(Fe+1)===42){let qe=fp(i,Fe);if(qe===-1)break;Fe=qe}Fe++;continue}if(je===34||je===39||je===96){let qe=dp(i,Fe);if(qe===-1)break;Fe=qe+1;continue}if(je===123){let qe=Le.get(Fe);if(qe===void 0||qe>=Re){Fe++;continue}if(Me<Fe)Oe.push(i.slice(Me,Fe));let We=Fe+1;if(Gy(i,We,qe)){Oe.push("{}"),Fe=qe+1,Me=Fe;continue}let Ge=i.slice(We,qe),ze=i.charCodeAt(We)===10;if(!ze&&!Ge.includes("/*")&&!Vy(Ge)&&!Oy($y(Oe,200))){let Xe=hp(i,We,qe,Le),Qe=Xe.trim();if(!Qe.includes(`
|
|
46
|
+
`)){let Ze=Qe.endsWith(";")?Qe.slice(0,-1):Qe,nt=`{ ${Wy(Ze)} }`;if(nt.length<=120){Oe.push(nt),Fe=qe+1,Me=Fe;continue}}if(Oe.push("{"),Xe.charCodeAt(0)!==59)Oe.push(`
|
|
47
|
+
`);if(Xe.length>0)Oe.push(Xe);Fe=qe,Me=qe;continue}if(Oe.push("{"),!ze)Oe.push(`
|
|
48
|
+
`);Fe=We,Me=We;continue}if(je===125){if(Me<Fe)Oe.push(i.slice(Me,Fe));if(Fy(Oe),!By(Oe))Oe.push(`
|
|
49
|
+
`);Oe.push("}"),Fe++,Me=Fe;continue}if(Me<Fe)Oe.push(i.slice(Me,Fe));if(jy(Oe),Oe.push(";"),i.charCodeAt(Fe+1)!==10)Oe.push(`
|
|
50
|
+
`);Fe++,Me=Fe}if(Me<Re)Oe.push(i.slice(Me,Re));return Oe.join("")}function Uy(i){return hp(i,0,i.length,qy(i))}function Hy(i){if(!i.includes(" "))return i;let Ie="",Re=0;for(let Le=0;Le<i.length;Le++){let Oe=i.charCodeAt(Le);if(Re!==0){if(Ie+=i[Le],Oe===Re&&i.charCodeAt(Le-1)!==92)Re=0;continue}if(Oe===34||Oe===39||Oe===96){Re=Oe,Ie+=i[Le];continue}if(Oe===32&&Ie.charCodeAt(Ie.length-1)===32)continue;Ie+=i[Le]}return Ie}function Ky(i){return i===125||i===93||i===41||i===62}function zy(i,Ie,Re){return Re-Ie>=3&&i.charCodeAt(Ie)===47&&i.charCodeAt(Ie+1)===42&&i.charCodeAt(Ie+2)===42}function pp(i,Ie,Re){let Le=i.indexOf("*/",Ie);return Le!==-1&&Le+2<=Re}function Xy(i){let Ie=[],Re=[],Le=i.length,Oe=0,$e=!1,Me=0,Fe=0;while(Fe<=Le){let We=i.indexOf(`
|
|
51
|
+
`,Fe);if(We===-1)We=Le;let Ge=We+1,ze=Fe,Xe=We;while(ze<Xe&&Eo(i.charCodeAt(ze)))ze++;while(Xe>ze&&Eo(i.charCodeAt(Xe-1)))Xe--;if(ze===Xe){let tt=Re.length>0?Re[Re.length-1]:void 0;if(tt!==void 0&&tt!==""){let lt=tt.charCodeAt(tt.length-1);if(lt!==123&<!==40&<!==91)Ie.push(0),Re.push("")}Fe=Ge;continue}if($e){if(Ie.push(Me),Re.push(` ${i.slice(ze,Xe)}`),pp(i,ze,Xe))$e=!1;Fe=Ge;continue}let Qe=zy(i,ze,Xe),Ze=Qe&&pp(i,ze,Xe);if(Qe&&!Ze){Ie.push(Oe),Re.push(i.slice(ze,Xe)),$e=!0,Me=Oe,Fe=Ge;continue}let nt=Ky(i.charCodeAt(ze)),at=Math.max(0,Oe-(nt?1:0));if(nt&&at===0&&Re.length>0&&Re[Re.length-1]==="")Ie.pop(),Re.pop();if(Ie.push(at),Re.push(Hy(i.slice(ze,Xe))),Fe=Ge,Ze)continue;let pt=0;for(let tt=ze;tt<Xe;tt++){let lt=i.charCodeAt(tt);if(pt!==0){if(lt===pt&&i.charCodeAt(tt-1)!==92)pt=0;continue}if(lt===34||lt===39||lt===96)pt=lt;else if(lt===123||lt===40||lt===91||lt===60)Oe++;else if(lt===125||lt===41||lt===93)Oe=Math.max(0,Oe-1);else if(lt===62&&i.charCodeAt(tt-1)!==61)Oe=Math.max(0,Oe-1)}}let je=Re.length;while(je>0&&Re[je-1]==="")je--;let qe=[];for(let We=0;We<je;We++){if(We>0)qe.push(`
|
|
52
|
+
`);let Ge=Ie[We];if(Ge>0)qe.push(My(Ge));qe.push(Re[We])}return qe.join("")}function mp(i){return`${Xy(Uy(i))}
|
|
53
|
+
`}var On="any",an="",Jy="Record<string, any>",vo="Record<string, never>",So=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Yy=/CustomEvent/,Qy=/^[A-Z]/,Zy=/\n/,Ep=/=>/,eg=/(?:^|\n)@default\b/,To=/\n/g,tg=/\s+/g,gr=/(^|[^.\w])Snippet(?:\s*<|\b)/,ng=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,rg=/[.*+?^${}()|[\]\\]/g,sg=/^const\s+/,ig=/\{name\}/g;function ko(i){return i.replace(sg,"")}function og(i){if(!i)return;return i.replace(To,`
|
|
54
|
+
* `)}function Us(i){if(!i)return"";return`/** ${i} */`}function Hs(i){if(!i)return"";return`/**
|
|
55
|
+
* ${i.replace(To,`
|
|
56
|
+
* `)}
|
|
57
|
+
*/`}function Cp(i){if(i===void 0)return;return i===!0?"@deprecated":`@deprecated ${i}`}function ag(i){let Ie=Cp(i);if(Ie===void 0)return;return`* ${Ie.replace(To,`
|
|
58
|
+
* `)}
|
|
59
|
+
`}function cg(i,Ie){if(!Ie)return[`@${i}`];if(!Ie.includes(`
|
|
60
|
+
`))return[`@${i} ${Ie}`];return[`@${i}`,...Ie.split(`
|
|
61
|
+
`)]}function wo(i){let Ie=[];for(let{name:Re,body:Le}of i??[])Ie.push(...cg(Re,Le));return Ie}function Wr(i,Ie,Re){let Le=Cp(Re),Oe=wo(Ie),$e=Oe.length>0;if(!i&&!$e&&!Le)return"";if(!$e&&!Le)return i?.includes(`
|
|
62
|
+
`)?Hs(i):Us(i);let Me=[];if(i)Me.push(...i.split(`
|
|
63
|
+
`));if(Me.push(...Oe),Le)Me.push(...Le.split(`
|
|
64
|
+
`));return`/**
|
|
65
|
+
* ${Me.join(`
|
|
66
|
+
* `)}
|
|
67
|
+
*/`}function lg(i){let Ie=wo(i);if(Ie.length===0)return"";return Ie.map((Re)=>`* ${Re}
|
|
68
|
+
`).join("")}function Ks(i){if(i===void 0)return On;return`${i}
|
|
69
|
+
`}function br(i,Ie={export:!0},Re="all"){if(i.typedefs.length===0)return an;let Le=Ie.export?"export ":"";return i.typedefs.map((Oe)=>{let $e=an;if(Re!=="none"){let Me=Re==="all"?wo(Oe.tags):[];if(Me.length===0)$e=Oe.description?`${Hs(Oe.description)}
|
|
70
|
+
`:"";else $e=`/**
|
|
71
|
+
* ${(Oe.description?[...Oe.description.split(`
|
|
72
|
+
`),...Me]:Me).join(`
|
|
73
|
+
* `)}
|
|
74
|
+
*/
|
|
75
|
+
`}return`${$e}${Le}${Oe.ts}`}).join(`
|
|
76
|
+
|
|
77
|
+
`)}var yp=new Map;function vp(i,Ie){let Re=yp.get(Ie);if(Re===void 0){let Le=Ie.replace(rg,"\\$&");Re=new RegExp(`\\b${Le}\\b`),yp.set(Ie,Re)}return Re.test(i)}var gp,xp=[];function Ao(i){if(i!==gp)gp=i,xp=kn(i);return xp}function pg(i){if(i===null)return[];return i[0].split(",").map((Ie,Re)=>({name:Ie.trim(),constraint:(Ao(i[1]??"")[Re]??Ie).trim()}))}function ug(i,Ie){let Re=pg(i).filter(({name:Le})=>vp(Ie,Le));if(Re.length===0)return{declSuffix:an,refSuffix:an};return{declSuffix:`<${Re.map(({constraint:Le})=>ko(Le)).join(", ")}>`,refSuffix:`<${Re.map(({name:Le})=>Le).join(", ")}>`}}function Sp(i,Ie={export:!0},Re="all"){if(!i.contexts||i.contexts.length===0)return an;let Le=Ie.export?"export ":"",Oe=i.generics===null?[]:i.generics[0].split(",").map(($e,Me)=>({name:$e.trim(),constraint:(Ao(i.generics?.[1]??"")[Me]??$e).trim()}));return i.contexts.map(($e)=>{let Me=$e.properties.map((Ge)=>{let ze=Re!=="none"&&Ge.description?`${Us(Ge.description)}
|
|
78
|
+
`:"",Xe=Ge.optional?"?":"";return`${ze}${Ge.name}${Xe}: ${Ge.type};`}).join(`
|
|
79
|
+
`),Fe=Re!=="none"&&$e.description?`${Hs($e.description)}
|
|
80
|
+
`:"",je=Oe.filter(({name:Ge})=>$e.properties.some((ze)=>vp(ze.type,Ge))).map(({constraint:Ge})=>Ge),qe=je.length>0?`<${je.map(ko).join(", ")}>`:"";if($e.properties.length===0)return $e.hasUnresolvedSpread?`${Fe}${Le}type ${$e.typeName} = Record<string, any>;`:`${Fe}${Le}type ${$e.typeName} = Record<string, never>;`;let We=$e.hasUnresolvedSpread?" & Record<string, any>":"";return`${Fe}${Le}type ${$e.typeName}${qe} = {
|
|
81
|
+
${Me}
|
|
82
|
+
}${We};`}).join(`
|
|
83
|
+
|
|
84
|
+
`)}function xr(i){return So.test(i)?i:JSON.stringify(i)}function Tp(i,Ie){if(!i)return;return`* ${Ie||i}
|
|
85
|
+
`}function zs(i,Ie,Re,Le="all"){if(Le==="none")return an;return[Tp(og(i)),ag(Ie),Le==="all"?lg(Re):void 0].filter(Boolean).join("")}function qr(i){return i.length>0?`/**
|
|
86
|
+
${i}*/`:an}function dg(i,Ie={export:!0},Re="all"){let Le=Ie.export?"export ":"",Oe=i.props.filter((tt)=>!tt.isFunctionDeclaration&&tt.kind!=="const"),$e=new Set([...Oe.map((tt)=>tt.name),...Array.from(i.canonicalPropNames??[])]),Me=Oe.map((tt)=>{let lt=typeof tt.value==="string"?tt.value.replace(tg," "):tt.value,Nt=eg.test(tt.description??"")||tt.value===void 0,Et=[zs(tt.description,tt.deprecated,tt.tags,Re),Re==="all"?Tp(tt.constant,"@constant"):null,Re==="all"&&!Nt?`* @default ${lt}
|
|
87
|
+
`:null].filter(Boolean).join(""),vt=tt.constant&&!tt.isFunction?tt.value:tt.type||On;return`
|
|
88
|
+
${qr(Et)}
|
|
89
|
+
${xr(tt.name)}${tt.isRequired?"":"?"}: ${vt};`}),Fe=i.canonicalPropsType?Me.filter((tt,lt)=>{let ct=Oe[lt];return ct?!(i.canonicalPropNames?.has(ct.name)??!1):!0}):Me,je=(i.slots||[]).filter((tt)=>!tt.default&&tt.name!=null&&!$e.has(tt.name)).map((tt)=>{let lt=tt.name,ct=xr(lt),Nt=Wr(tt.description,tt.tags,tt.deprecated),Et=Nt?`${Nt}
|
|
90
|
+
`:"",Be=tt.slot_props&&tt.slot_props!=="Record<string, never>"?`(this: void, ...args: [${tt.slot_props}]) => void`:"(this: void) => void";return`
|
|
91
|
+
${Et}${ct}?: ${Be};`}),qe=(i.slots||[]).find((tt)=>tt.default||tt.name===null),We=qe&&!$e.has("children")?(()=>{let tt=Wr(qe.description,qe.tags,qe.deprecated),lt=tt?`${tt}
|
|
92
|
+
`:"",Nt=qe.slot_props&&qe.slot_props!=="Record<string, never>"?`(this: void, ...args: [${qe.slot_props}]) => void`:"(this: void) => void";return`
|
|
93
|
+
${lt}children?: ${Nt};`})():"",Ge=i.events?xg({events:i.events},$e):[],ze=[...je,We,...Ge].filter(Boolean),Xe=[...Fe,...ze].join(`
|
|
94
|
+
`),Qe=Mn(i.moduleName,Ie.typeNames),Ze=an,nt=i.generics?`<${Ao(i.generics[1]).map((tt)=>ko(tt.trim())).join(", ")}>`:"",at=i.generics?`<${i.generics[0]}>`:"",pt=i.canonicalPropsType?`
|
|
95
|
+
type $Props${nt} = ${i.canonicalPropsType}${Xe.trim()===""?"":` & {${Xe}
|
|
96
|
+
}`};
|
|
97
|
+
`:`
|
|
98
|
+
type $Props${nt} = {
|
|
99
|
+
${Xe}
|
|
100
|
+
};
|
|
101
|
+
`;if(i.rest_props?.type==="Element"){let tt;if(i.rest_props.name==="svelte:element")if(i.rest_props.thisValue)tt=`SvelteHTMLElements["${i.rest_props.thisValue}"]`;else tt="HTMLAttributes<HTMLElement>";else tt=i.rest_props.name.split("|").map((Nt)=>`SvelteHTMLElements["${Nt.trim()}"]`).join(" & ");let lt="[key: `data-${string}`]: unknown;",ct=i.rest_props.description?i.rest_props.description.includes(`
|
|
102
|
+
`)?`${Hs(i.rest_props.description)}
|
|
103
|
+
`:`${Us(i.rest_props.description)}
|
|
104
|
+
`:"";if(i.extends===void 0)Ze=`
|
|
105
|
+
${ct}${tt?`type $RestProps = ${tt};
|
|
106
|
+
`:""}
|
|
107
|
+
${i.canonicalPropsType?`type $Props${nt} = (${i.canonicalPropsType}) & {${Xe}
|
|
108
|
+
|
|
109
|
+
${lt}
|
|
110
|
+
};`:`type $Props${nt} = {
|
|
111
|
+
${Xe}
|
|
112
|
+
|
|
113
|
+
${lt}
|
|
114
|
+
};`}
|
|
115
|
+
|
|
116
|
+
${Le}type ${Qe}${nt} = Omit<$RestProps, keyof $Props${at}> & $Props${at};
|
|
117
|
+
`;else Ze=`
|
|
118
|
+
${ct}${tt?`type $RestProps = ${tt};
|
|
119
|
+
`:""}
|
|
120
|
+
${i.canonicalPropsType?`type $Props${nt} = (${i.canonicalPropsType}) & {${Xe}
|
|
121
|
+
|
|
122
|
+
${lt}
|
|
123
|
+
};`:`type $Props${nt} = {
|
|
124
|
+
${Xe}
|
|
125
|
+
|
|
126
|
+
${lt}
|
|
127
|
+
};`}
|
|
128
|
+
|
|
129
|
+
${Le}type ${Qe}${nt} = Omit<$RestProps, keyof ($Props${at} & ${i.extends.interface})> & Omit<${i.extends.interface}, keyof $Props${at}> & $Props${at};
|
|
130
|
+
`}else if(Xe.trim()===""&&i.extends===void 0&&!i.canonicalPropsType)Ze=`
|
|
131
|
+
${Le}type ${Qe}${nt} = ${vo};
|
|
132
|
+
`;else if(i.canonicalPropsType)Ze=`
|
|
133
|
+
${pt}
|
|
134
|
+
${Le}type ${Qe}${nt} = ${i.extends===void 0?"":`Omit<${i.extends.interface}, keyof $Props${at}> & `}$Props${at};
|
|
135
|
+
`;else if(i.extends===void 0)Ze=Ie.propsDeclaration==="interface"&&Xe.trim()!==""?`
|
|
136
|
+
${Le}interface ${Qe}${nt} {
|
|
137
|
+
${Xe}
|
|
138
|
+
}
|
|
139
|
+
`:`
|
|
140
|
+
${Le}type ${Qe}${nt} = {
|
|
141
|
+
${Xe}
|
|
142
|
+
};
|
|
143
|
+
`;else Ze=`
|
|
144
|
+
type $Props${nt} = {
|
|
145
|
+
${Xe}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
${Le}type ${Qe}${nt} = Omit<${i.extends.interface}, keyof $Props${at}> & $Props${at};
|
|
149
|
+
`;return{props_name:Qe,prop_def:Ze}}function fg(i){if(i.slots.length===0)return vo;let Ie=i.slots.map(({name:Re,slot_props:Le,...Oe})=>{let $e=Oe.default||Re===null?"default":xr(Re??""),Me=Wr(Oe.description,Oe.tags,Oe.deprecated);return`${Me?`${Me}
|
|
150
|
+
`:""}${$e}: ${Ks(Le)};`}).join(`
|
|
151
|
+
`);return i.slots.length===1?`{${Ie}}`:`{
|
|
152
|
+
${Ie}
|
|
153
|
+
}`}var hg=()=>"WindowEventMap",mg=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","contextmenu","wheel","keydown","keyup","keypress","submit","change","input","focus","blur","focusin","focusout","reset","select","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","pointerdown","pointerup","pointermove","pointerover","pointerout","pointerenter","pointerleave","pointercancel","gotpointercapture","lostpointercapture","play","pause","ended","volumechange","timeupdate","loadeddata","loadedmetadata","canplay","canplaythrough","seeking","seeked","playing","waiting","stalled","suspend","abort","error","emptied","ratechange","durationchange","loadstart","progress","loadend","animationstart","animationend","animationiteration","animationcancel","transitionstart","transitionend","transitionrun","transitioncancel","scroll","resize","load","unload","beforeunload","cut","copy","paste","compositionstart","compositionupdate","compositionend"]);function Co(i=On){if(Yy.test(i))return i;return`CustomEvent<${i}>`}function yg(i){return mg.has(i)}function kp(i){switch(i.type){case"dispatched":return Co(i.detail);case"forwarded":{let Ie=i.element,Le=!(Ie&&Qy.test(Ie))||yg(i.name),Oe=i.detail!==void 0&&i.detail!=="undefined"&&!(i.detail==="null"&&Le),$e=i.detail==="null"&&!Le;if(Oe||$e)return Co(i.detail);else if(Le)return`${hg()}["${i.name}"]`;else return Co()}default:return i}}function gg(i){if(i.events.length===0)return Jy;let Ie=i.events.map((Re)=>{let Le="",Oe=Wr(Re.description,Re.tags,Re.deprecated);if(Oe)Le=`${Oe}
|
|
154
|
+
`;return`${Le}${xr(Re.name)}: ${kp(Re)};
|
|
155
|
+
`}).join("");return i.events.length===1?`{${Ie}}`:`{
|
|
156
|
+
${Ie}}`}function xg(i,Ie){return i.events.map((Re)=>{let Le=`on${Re.name}`;if(Ie.has(Le))return;let Oe="",$e=Wr(Re.description,Re.tags,Re.deprecated);if($e)Oe=`${$e}
|
|
157
|
+
`;return`
|
|
158
|
+
${Oe}${xr(Le)}?: (event: ${kp(Re)}) => void;`}).filter((Re)=>Re!==void 0)}function bg(i){let Ie=i.type==="() => any";if(i.type&&Ep.test(i.type)&&!Ie)return i.type;else if(i.params&&i.params.length>0){let Le=i.params.map(($e)=>{let Me=$e.optional?"?":"";return`${$e.name}${Me}: ${$e.type}`}).join(", "),Oe=i.returnType||On;return`(${Le}) => ${Oe}`}else if(i.returnType)return`() => ${i.returnType}`;else return i.type||On}function wp(i,Ie="all"){return i.props.filter((Re)=>Re.isFunctionDeclaration||Re.kind==="const").map((Re)=>{let Le=zs(Re.description,Re.deprecated,Re.tags,Ie),Oe=bg(Re);return`
|
|
159
|
+
${qr(Le)}
|
|
160
|
+
${xr(Re.name)}: ${Oe};`}).join(`
|
|
161
|
+
`)}function Eg(i,Ie={export:!0},Re="all"){let Le=Ie.export?"export ":"",Oe=Zn(i.moduleName,Ie.typeNames),$e=wp({props:i.props},Re);if($e.trim()==="")return{exports_name:Oe,exports_ref:Oe,exports_def:`${Le}type ${Oe} = ${vo};`};let{declSuffix:Me,refSuffix:Fe}=ug(i.generics,$e);return{exports_name:Oe,exports_ref:`${Oe}${Fe}`,exports_def:`${Le}type ${Oe}${Me} = {${$e}
|
|
162
|
+
};`}}function Cg(i){let Ie=i.props.filter((Re)=>Re.bindable===!0||Re.binding==="writable").map((Re)=>JSON.stringify(Re.name));return Ie.length===0?an:Ie.join(" | ")}function vg(i){let Ie=i.moduleName==="default"?"$$Component":i.moduleName,Re=i.bindings===an?'""':i.bindings;return`declare const ${Ie}: Component<
|
|
163
|
+
${i.propsRef},
|
|
164
|
+
${i.exportsRef},
|
|
165
|
+
${Re}
|
|
166
|
+
>;
|
|
167
|
+
export default ${Ie};`}function Sg(i){let Ie=i.moduleName==="default"?"$$Component":i.moduleName,Re=`${Ie}Component`,Le=i.bindings===an?'""':i.bindings;return`interface ${Re} {
|
|
168
|
+
new ${i.generic}(
|
|
169
|
+
options: ComponentConstructorOptions<${i.propsRef}>
|
|
170
|
+
): SvelteComponent<${i.propsRef}> & ${i.exportsRef};
|
|
171
|
+
${i.generic}(
|
|
172
|
+
this: void,
|
|
173
|
+
internals: ComponentInternals,
|
|
174
|
+
props: ${i.propsRef}
|
|
175
|
+
): {
|
|
176
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
177
|
+
$set?(props: Partial<${i.propsRef}>): void;
|
|
178
|
+
} & ${i.exportsRef};
|
|
179
|
+
element?: typeof HTMLElement;
|
|
180
|
+
z_$$bindings?: ${Le};
|
|
181
|
+
}
|
|
182
|
+
declare const ${Ie}: ${Re};
|
|
183
|
+
export default ${Ie};`}function Tg(i){if(i.extends===void 0)return"";return`import type { ${i.extends.interface} } from ${i.extends.import};`}function kg(i,Ie="all"){if(Ie==="none"||!i.componentComment)return"";if(!Zy.test(i.componentComment))return Us(i.componentComment.trim());return`/*${i.componentComment.split(`
|
|
184
|
+
`).map((Re)=>`* ${Re}`).join(`
|
|
185
|
+
`)}
|
|
186
|
+
*/`}function bp(i){return So.test(i)?i:JSON.stringify(i)}function wg(i,Ie){let Re=[],Le=new Map;for(let Oe of i.moduleExports){if(Oe.kind!=="re-export"||!Oe.reExport)continue;let{from:$e,imported:Me}=Oe.reExport,Fe=zs(Oe.description,Oe.deprecated,Oe.tags,Ie),je=bp(Oe.name);if(Me==="*"){let Ge=Oe.name==="*"?"*":`* as ${je}`;Re.push(`${qr(Fe)}
|
|
187
|
+
export ${Ge} from ${JSON.stringify($e)};`);continue}let qe=`${$e}\x00${Fe}`,We=Le.get(qe);if(!We)We={comments:Fe,from:$e,specifiers:[]},Le.set(qe,We),Re.push(qe);We.specifiers.push(Me===Oe.name?je:`${bp(Me)} as ${je}`)}return Re.map((Oe)=>{let $e=Le.get(Oe);if(!$e)return Oe;return`${qr($e.comments)}
|
|
188
|
+
export { ${$e.specifiers.join(", ")} } from ${JSON.stringify($e.from)};`}).join(`
|
|
189
|
+
|
|
190
|
+
`)}function Ag(i,Ie="all"){let Re=wg(i,Ie),Le=i.moduleExports.filter((Oe)=>Oe.kind!=="re-export").map((Oe)=>{let $e=zs(Oe.description,Oe.deprecated,Oe.tags,Ie),Me,Fe=Oe.type&&Ep.test(Oe.type),je=Oe.type==="() => any",qe=Oe.typeParameters?`<${Oe.typeParameters}>`:"";if(Oe.kind==="const"&&!Fe)Me=`export declare const ${Oe.name}: ${Oe.type||On};
|
|
191
|
+
`;else if(Oe.params&&Oe.params.length>0){let Ge=Oe.params.map((Xe)=>{let Qe=Xe.optional?"?":"";return`${Xe.name}${Qe}: ${Xe.type}`}).join(", "),ze=Oe.returnType||On;Me=`export declare function ${Oe.name}${qe}(${Ge}): ${ze};`}else if(Oe.returnType)Me=`export declare function ${Oe.name}${qe}(): ${Oe.returnType};`;else if(Fe&&Oe.type&&!je){let[We,Ge,...ze]=Oe.type.split("=>"),Xe=ze.map((Qe)=>` => ${Qe.trim()}`).join("");Me=`export declare function ${Oe.name}${We.trimEnd()}: ${Ge.trim()}${Xe};`}else if(Fe&&Oe.type){let[We,Ge,...ze]=Oe.type.split("=>"),Xe=ze.map((Qe)=>` => ${Qe.trim()}`).join("");Me=`export declare function ${Oe.name}${We.trimEnd()}: ${Ge.trim()}${Xe};`}else if(Oe.kind==="const")Me=`export declare const ${Oe.name}: ${Oe.type||On};
|
|
192
|
+
`;else Me=`export type ${Oe.name} = ${Oe.type||On};`;return`
|
|
193
|
+
${qr($e)}
|
|
194
|
+
${Me}`}).join(`
|
|
195
|
+
`);return[Re,Le].filter(Boolean).join(`
|
|
196
|
+
|
|
197
|
+
`)}var Pg=120;function Ng(i){let Re=`export default class ${i.moduleName==="default"?"":i.moduleName}${i.generic} extends SvelteComponentTyped<`,Le=[i.genericProps,i.events,i.slots];if(i.accessors.trim()===""&&Le.every((Oe)=>!Oe.includes(`
|
|
198
|
+
`))){let Oe=`${Re}${Le.join(", ")}> {}`;if(Oe.length<=Pg)return Oe}return`${Re}
|
|
199
|
+
${i.genericProps},
|
|
200
|
+
${i.events},
|
|
201
|
+
${i.slots}
|
|
202
|
+
> {
|
|
203
|
+
${i.accessors}
|
|
204
|
+
}`}function Ap(i,Ie,Re){let Le=Re.replace(ig,Ie);if(!Re.includes("{name}")||!So.test(Le))throw Error(`sveld: typesOptions.typeNames.${i} must contain "{name}" and produce a valid identifier; got "${Re}".`);return Le}function Mn(i,Ie){return Ap("props",i,Ie?.props??"{name}Props")}function Zn(i,Ie){return Ap("exports",i,Ie?.exports??"{name}Exports")}function Xs(i,Ie,Re){if(i===void 0||i===!0)return{...Ie};if(i===!1)return{props:!1,exports:!1,typedefs:!1,contexts:!1};return{props:i.props??Re,exports:i.exports??Re,typedefs:i.typedefs??Re,contexts:i.contexts??Re}}var Po={props:!0,exports:!0,typedefs:!0,contexts:!0};function No(i){let Ie=Xs(i?.exportTypes,Po,!0);if(i?.forceExportProps===!0)Ie.props=!0;return Ie}function _o(i){return{format:i.format,exportTypes:i.exportTypes,forceExportProps:i.forceExportProps,typeNames:i.typeNames,comments:i.comments,propsDeclaration:i.propsDeclaration,inline:i.inline}}var _g={format:"class",exportTypes:!0,forceExportProps:!1,typeNames:null,comments:"all",propsDeclaration:"type",inline:!1};function Pp(i){let Ie=_o(i??{}),Re={};for(let[Le,Oe]of Object.entries(Ie))Re[Le]=Oe??_g[Le];return JSON.stringify(Re)}function Do(i,Ie){let Re=En(i),{moduleName:Le,typedefs:Oe,generics:$e,props:Me,moduleExports:Fe,slots:je,events:qe,rest_props:We,extends:Ge,componentComment:ze,contexts:Xe,syntaxMode:Qe}=i,Ze=Ie?.format==="component",nt=$e!==null,at=No(Ie),pt=Ie?.comments??"all",{props_name:tt,prop_def:lt}=dg({moduleName:Le,props:Me,rest_props:We,extends:Ge,generics:$e,slots:je,canonicalPropNames:new Set(Re?.canonicalPropNames??[]),canonicalPropsType:Re?.canonicalPropsType,events:Ze&&Qe==="legacy"?qe:void 0},{export:at.props,typeNames:Ie?.typeNames,propsDeclaration:Ie?.propsDeclaration},pt),ct=$e?`<${$e[1]}>`:"",Nt=$e?`${tt}<${$e[0]}>`:tt,Et=Ag({moduleExports:Fe},pt),vt=br({typedefs:Oe},{export:at.typedefs},pt),Be=Sp({contexts:Xe,generics:$e},{export:at.contexts},pt),Ve=new Set(Ie?.inlined?.droppedImportStatements??[]),Ue=(Re?.typeImportStatements??[]).filter((Ct)=>!Ve.has(Ct)).join(`
|
|
205
|
+
`),Ke=[...Ie?.inlined?.declarations??[],...Re?.localTypeDeclarations??[]].join(`
|
|
206
|
+
|
|
207
|
+
`),{exports_ref:Je,exports_def:Ye}=Ze?Eg({props:Me,moduleName:Le,generics:$e},{export:at.exports,typeNames:Ie?.typeNames},pt):{exports_ref:an,exports_def:an},rt=Ze?Cg({props:Me}):an,it=!ng.test(Ue)&&(gr.test(lt)||gr.test(Et)||gr.test(vt)||gr.test(Be)||gr.test(Ke)||gr.test(Ye)),st=We?.type==="Element"&&(We.name!=="svelte:element"||We.name==="svelte:element"&&We.thisValue),et=We?.type==="Element"&&We.name==="svelte:element"&&!We.thisValue,ut=[Ze?nt?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${it?", Snippet":""} } from "svelte";`:`import type { Component${it?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${it?", type Snippet":""} } from "svelte";`,st?'import type { SvelteHTMLElements } from "svelte/elements";':"",et?'import type { HTMLAttributes } from "svelte/elements";':"",Ue,Tg({extends:Ge})].filter(Boolean).join(`
|
|
208
|
+
`),mt=Ze?nt?Sg({moduleName:Le,generic:ct,propsRef:Nt,exportsRef:Je,bindings:rt}):vg({moduleName:Le,propsRef:Nt,exportsRef:Je,bindings:rt}):Ng({moduleName:Le,generic:ct,genericProps:Nt,events:gg({events:qe}),slots:fg({slots:je}),accessors:wp({props:Me},pt)}),gt=[Et,vt,Ke,Be,lt,Ye,[kg({componentComment:ze},pt),mt].filter(Boolean).join(`
|
|
209
|
+
`)].map((Ct)=>Ct.trim()).filter(Boolean).join(`
|
|
210
|
+
|
|
211
|
+
`);return mp([ut,gt].filter(Boolean).join(`
|
|
212
|
+
|
|
213
|
+
`))}var Og=[".ts",".d.ts",".mts",".cts"],Mg=["index.ts","index.d.ts"],$g=10,Bg=/^\s*(?:export\s+)?(?:declare\s+)?(?:type|interface)\s+([A-Za-z_$][\w$]*)/,Fg=new Set(["svelte","svelte/elements"]);function Ro(i){return Fg.has(i)}function Ur(i,Ie){let Re=Io(Ie),Le;if(i.startsWith(".")||i.startsWith("/"))Le=Lg(Re,i);else{let Me=yr(i,Re);if(Me.unresolved)return{kind:"bare"};Le=Me.resolved}let Oe=Io(Le),$e=Rg(Le);if(An(Oe,$e)){let Me=Fs(Oe,$e);if(Me?Me.isFile():Dg(Le,{throwIfNoEntry:!1})?.isFile())return Le.endsWith(".svelte")?{kind:"svelte"}:{kind:"resolved",path:Le}}if(An(Oe,`${$e}.svelte`))return{kind:"svelte"};for(let Me of Og)if(An(Oe,`${$e}${Me}`))return{kind:"resolved",path:`${Le}${Me}`};for(let Me of Mg)if(An(Le,Me))return{kind:"resolved",path:Ip(Le,Me)};return{kind:"missing"}}function At(i){return Mt(i)&&typeof i.type==="string"?i:void 0}function er(i){if(!Array.isArray(i))return[];let Ie=[];for(let Re of i){let Le=At(Re);if(Le)Ie.push(Le)}return Ie}function Vt(i){if(!i)return;if(s(i))return i.name;return qn(i)??void 0}function Hr(i){return qn(i)??void 0}function Lo(i,Ie){let Re=i.files.get(Ie);if(Re!==void 0)return Re;let Le;try{let Oe=Ig(Ie,"utf-8"),$e=dr(Oe,!0,[]);Le={source:Oe,program:$e}}catch{Le=null}return i.files.set(Ie,Le),Le}function jg(i){let Ie=i;while(Ie?.type==="TSQualifiedName")Ie=At(Ie.left);return Ie?Vt(Ie):void 0}function Vg(i){let Ie=new Set,Re=[],Le=(Oe)=>{if(Oe.type!=="TSTypeReference")return;let $e=jg(At(Oe.typeName));if($e&&!Ie.has($e))Ie.add($e),Re.push($e)};for(let Oe in i){if(Oe==="id"||Oe==="typeParameters")continue;let $e=i[Oe];if(Array.isArray($e))for(let Me of $e){let Fe=At(Me);if(Fe)v(Fe,Le)}else{let Me=At($e);if(Me)v(Me,Le)}}return Re}function Wg(i){let Ie=new Set,Re=At(i.typeParameters);for(let Le of er(Re?.params)){let Oe=Vt(At(Le.name));if(Oe)Ie.add(Oe)}return Ie}function Oo(i,Ie){for(let Re of i.body){let Le=Re.type==="ExportNamedDeclaration"?At(Re.declaration)??Re:Re;switch(Le.type){case"TSTypeAliasDeclaration":if(Vt(At(Le.id))===Ie)return{kind:"type",node:Le};break;case"TSInterfaceDeclaration":if(Vt(At(Le.id))===Ie)return{kind:"interface",node:Le};break;case"TSEnumDeclaration":if(Vt(At(Le.id))===Ie)return{kind:"unsupported",reason:"enum"};break;case"ClassDeclaration":if(Vt(At(Le.id))===Ie)return{kind:"unsupported",reason:"class"};break;case"FunctionDeclaration":if(Vt(At(Le.id))===Ie)return{kind:"unsupported",reason:"function"};break;case"TSModuleDeclaration":if(Vt(At(Le.id))===Ie)return{kind:"unsupported",reason:"namespace"};break;case"VariableDeclaration":for(let Oe of er(Le.declarations))if(Vt(At(Oe.id))===Ie)return{kind:"unsupported",reason:"const"};break;default:break}}return}function qg(i,Ie){for(let Re of i.body){if(Re.type!=="ImportDeclaration")continue;let Le=Hr(At(Re.source));if(Le===void 0)continue;for(let Oe of er(Re.specifiers)){let $e=At(Oe.local),Me=Vt($e);if(Me!==Ie)continue;if(Oe.type==="ImportNamespaceSpecifier")return{kind:"namespace"};let Fe=typeof $e?.start==="number"?$e.start:void 0;if(Oe.type==="ImportDefaultSpecifier")return{kind:"named",source:Le,importedName:"default",localNameStart:Fe};if(Oe.type==="ImportSpecifier")return{kind:"named",source:Le,importedName:Vt(At(Oe.imported))??Me,localNameStart:Fe}}}return}function Mo(i,Ie){return`${i}\x00${Ie}`}function Gg(i,Ie){let Re=new Set,Le=[];for(let Oe of i){let $e;try{$e=dr(Oe,!0,[])}catch{continue}for(let Me of $e.body){if(Me.type!=="ImportDeclaration")continue;let Fe=Hr(At(Me.source));if(Fe===void 0||Ro(Fe))continue;if(Ur(Fe,Ie).kind!=="bare")continue;for(let je of er(Me.specifiers)){if(je.type==="ImportNamespaceSpecifier")continue;let qe=je.type==="ImportDefaultSpecifier"?"default":Vt(At(je.imported))??void 0;if(!qe)continue;let We=Mo(Fe,qe);if(Re.has(We))continue;Re.add(We),Le.push({source:Fe,importedName:qe})}}}return Le}function $o(i,Ie){return e(Ip(Io(i),`__sveld_inline_all_${Ie}.ts`))}function Rp(i,Ie,Re){let Le=Gg(Re,i);if(Le.length===0)return null;let Oe=Le.map(({source:je,importedName:qe},We)=>`import type { ${qe} as __sveld_bare_${We} } from ${JSON.stringify(je)};`),$e=new Map,Me=`${Oe.join(`
|
|
214
|
+
`)}
|
|
215
|
+
`;return Le.forEach(({source:je,importedName:qe},We)=>{Me+=`type __sveld_ref_${We} = `,$e.set(Mo(je,qe),Me.length),Me+=`__sveld_bare_${We};
|
|
216
|
+
`}),{virtualFile:$o(i,Ie),content:Me,positions:$e}}function Ys(i,Ie){let Re=new Map;for(let Le of i.values()){let Oe=En(Le)?.typeImportStatements??[];if(Oe.length===0)continue;let $e=Rp(Ie(Le.filePath),Le.moduleName,Oe);if($e)Re.set($e.virtualFile,$e.content)}return Re}function Np(i){switch(i.type){case"TSTypeAliasDeclaration":return{kind:"type"};case"TSInterfaceDeclaration":return{kind:"interface"};case"TSEnumDeclaration":return{reason:"enum"};case"ClassDeclaration":return{reason:"class"};case"FunctionDeclaration":return{reason:"function"};case"TSModuleDeclaration":return{reason:"namespace"};default:return{reason:i.type}}}function Js(i,Ie,Re,Le,Oe){let $e=`${Ie}#${Re}`;if(Oe>$g||Le.has($e))return{kind:"not-found"};Le.add($e);let Me=Lo(i,Ie);if(!Me)return{kind:"not-found"};i.dependencies.add(Ie);for(let Fe of Me.program.body){if(Fe.type==="ExportNamedDeclaration"){let je=At(Fe.declaration);if(!je)continue;if(je.type==="VariableDeclaration"){for(let We of er(je.declarations))if(Vt(At(We.id))===Re)return{kind:"unsupported",reason:"const"};continue}if(Vt(At(je.id))!==Re)continue;let qe=Np(je);return"reason"in qe?{kind:"unsupported",reason:qe.reason}:{kind:"found",node:je,filePath:Ie,source:Me.source}}if(Fe.type==="ExportDefaultDeclaration"&&Re==="default"){let je=At(Fe.declaration);if(!je)return{kind:"not-found"};let qe=Np(je);return"reason"in qe?{kind:"unsupported",reason:qe.reason}:{kind:"found",node:je,filePath:Ie,source:Me.source}}}for(let Fe of Me.program.body){if(Fe.type!=="ExportNamedDeclaration"||Fe.declaration)continue;for(let je of er(Fe.specifiers)){if(Vt(At(je.exported))!==Re)continue;let qe=Vt(At(je.local));if(!qe)return{kind:"not-found"};if(!Fe.source){let ze=Oo(Me.program,qe);if(!ze)return{kind:"not-found"};if(ze.kind==="unsupported")return ze;return{kind:"found",node:ze.node,filePath:Ie,source:Me.source}}let We=Hr(At(Fe.source));if(We===void 0)return{kind:"not-found"};let Ge=Ur(We,Ie);if(Ge.kind!=="resolved")return{kind:"not-found"};return Js(i,Ge.path,qe,Le,Oe+1)}}for(let Fe of Me.program.body){if(Fe.type!=="ExportAllDeclaration"||At(Fe.exported))continue;let je=Hr(At(Fe.source));if(je===void 0)continue;let qe=Ur(je,Ie);if(qe.kind!=="resolved")continue;let We=Js(i,qe.path,Re,Le,Oe+1);if(We.kind!=="not-found")return We}return{kind:"not-found"}}function _p(i,Ie,Re){if(Re===Ie)return{ok:!0};let Le=`alias#${Re}`;if(i.textByKey.has(Le))return{ok:!0};let Oe=i.nameOwner.get(Re);if(Oe!==void 0&&Oe!==Le)return{ok:!1,reason:`"${Re}" was already inlined from a different source`};if(i.reservedNames.has(Re))return{ok:!1,reason:`"${Re}" collides with an existing declaration in the component`};return i.nameOwner.set(Re,Le),i.tx.keys.push(Le),i.textByKey.set(Le,`type ${Re} = ${Ie};`),i.order.push(Le),{ok:!0}}async function Lp(i,Ie,Re){let Le=await i.bareSession.resolveAt(Ie,Re);if(Le.kind==="default-lib")return{status:"left-alone"};if(Le.kind==="unresolved")return{status:"unresolved"};let Oe=Lo(i,Le.filePath);if(!Oe)return{status:"unlocatable",filePath:Le.filePath,declaredName:Le.declaredName};let $e=Oo(Oe.program,Le.declaredName);if(!$e)return{status:"unlocatable",filePath:Le.filePath,declaredName:Le.declaredName};if($e.kind==="unsupported")return{status:"unsupported",reason:$e.reason};return{status:"found",node:$e.node,filePath:Le.filePath,source:Oe.source}}async function Gr(i,Ie,Re,Le,Oe){let $e=Vt(At(Ie.id)),{start:Me,end:Fe}=Ie;if(!$e||typeof Me!=="number"||typeof Fe!=="number")return{ok:!1,reason:"has no name or source position"};let je=`${Re}#${$e}`;if(i.pending.has(je)||i.textByKey.has(je))return _p(i,$e,Oe);let qe=i.nameOwner.get($e);if(qe!==void 0&&qe!==je)return{ok:!1,reason:`"${$e}" was already inlined from a different source`};if(i.reservedNames.has($e))return{ok:!1,reason:`"${$e}" collides with an existing declaration in the component`};i.pending.add(je),i.nameOwner.set($e,je),i.tx.keys.push(je),i.dependencies.add(Re);let We=Wg(Ie),Ge=Lo(i,Re);for(let ze of Vg(Ie)){if(We.has(ze)||ze===$e)continue;if(!Ge)continue;let Xe=Oo(Ge.program,ze);if(Xe){if(Xe.kind==="unsupported")return i.pending.delete(je),{ok:!1,reason:`references "${ze}", a ${Xe.reason} that cannot be inlined`};let pt=await Gr(i,Xe.node,Re,Le,ze);if(!pt.ok)return i.pending.delete(je),pt;continue}let Qe=qg(Ge.program,ze);if(!Qe||Qe.kind==="namespace")continue;let Ze=Ur(Qe.source,Re);if(Ze.kind==="resolved"){let pt=Js(i,Ze.path,Qe.importedName,new Set,0);if(pt.kind==="not-found")return i.pending.delete(je),{ok:!1,reason:`references "${ze}", which is not exported from "${Qe.source}"`};if(pt.kind==="unsupported")return i.pending.delete(je),{ok:!1,reason:`references "${ze}", a ${pt.reason} that cannot be inlined`};let tt=await Gr(i,pt.node,pt.filePath,pt.source,ze);if(!tt.ok)return i.pending.delete(je),tt;continue}if(Ze.kind!=="bare"||Ro(Qe.source)||!i.bareSession||Qe.localNameStart===void 0)continue;let nt=await Lp(i,Re,Qe.localNameStart);if(nt.status==="left-alone")continue;if(nt.status!=="found"){i.pending.delete(je);let pt=nt.status==="unresolved"?`which could not be resolved from "${Qe.source}"`:nt.status==="unlocatable"?`which resolves to "${nt.declaredName}" in "${nt.filePath}", where sveld could not locate that declaration`:`a ${nt.reason} that cannot be inlined`;return{ok:!1,reason:`references "${ze}", ${pt}`}}let at=await Gr(i,nt.node,nt.filePath,nt.source,ze);if(!at.ok)return i.pending.delete(je),at}return i.pending.delete(je),i.textByKey.set(je,Le.slice(Me,Fe).trim()),i.order.push(je),_p(i,$e,Oe)}async function Ug(i,Ie,Re,Le){let Oe=Js(i,Ie,Re,new Set,0);if(Oe.kind==="not-found")return{ok:!1,reason:`"${Re}" is not exported from "${Ie}"`};if(Oe.kind==="unsupported")return{ok:!1,reason:`"${Re}" is a ${Oe.reason}, which cannot be inlined`};return Gr(i,Oe.node,Oe.filePath,Oe.source,Le)}async function Hg(i,Ie,Re,Le){let Oe=i.barePlan?.positions.get(Mo(Ie,Re));if(!i.bareSession||!i.barePlan||Oe===void 0)return{ok:!1,reason:`"${Re}" is a package import that sveld could not verify`};let $e=await Lp(i,i.barePlan.virtualFile,Oe);switch($e.status){case"left-alone":return{ok:!1,reason:`"${Re}" resolves to a built-in TypeScript type, which cannot be inlined`};case"unresolved":return{ok:!1,reason:`"${Re}" could not be resolved from "${Ie}"`};case"unlocatable":return{ok:!1,reason:`"${Re}" resolves to "${$e.declaredName}" in "${$e.filePath}", where sveld could not locate that declaration`};case"unsupported":return{ok:!1,reason:`"${Re}" is a ${$e.reason}, which cannot be inlined`};case"found":return Gr(i,$e.node,$e.filePath,$e.source,Le);default:return $e}}function Dp(i){i.order.length=i.tx.orderStart;let Ie=new Set(i.tx.keys);for(let Re of Ie)i.textByKey.delete(Re);for(let[Re,Le]of i.nameOwner)if(Ie.has(Le))i.nameOwner.delete(Re)}async function Kg(i,Ie,Re){let Le;try{Le=dr(Ie,!0,[])}catch{return{status:"kept"}}let Oe=Le.body.filter((We)=>We.type==="ImportDeclaration");if(Oe.length===0)return{status:"kept"};let $e=Oe.flatMap((We)=>er(We.specifiers).map((Ge)=>({decl:We,spec:Ge})));if($e.some(({spec:We})=>We.type==="ImportNamespaceSpecifier"))return{status:"kept"};let Me=Hr(At(Oe[0]?.source));if(Me===void 0)return{status:"kept"};let Fe=Ur(Me,Re);if(Fe.kind==="svelte")return{status:"kept"};let je=[];for(let{spec:We}of $e){let Ge=Vt(At(We.local));if(!Ge)continue;let ze=We.type==="ImportDefaultSpecifier"?"default":Vt(At(We.imported))??Ge;je.push({importedName:ze,localName:Ge})}if(Fe.kind==="missing")return{status:"refused",failures:je.map(({localName:We})=>({name:We,reason:`"${Me}" was not found on disk`}))};if(Fe.kind==="bare"){if(Ro(Me)||!i.bareSession)return{status:"kept"};i.tx={orderStart:i.order.length,keys:[]};let We=[];for(let{importedName:Ge,localName:ze}of je){let Xe=await Hg(i,Me,Ge,ze);if(!Xe.ok)We.push({name:ze,reason:Xe.reason})}if(We.length>0)return Dp(i),{status:"refused",failures:We};return{status:"inlined"}}i.tx={orderStart:i.order.length,keys:[]};let qe=[];for(let{importedName:We,localName:Ge}of je){let ze=await Ug(i,Fe.path,We,Ge);if(!ze.ok)qe.push({name:Ge,reason:ze.reason})}if(qe.length>0)return Dp(i),{status:"refused",failures:qe};return{status:"inlined"}}function zg(i,Ie){let Re=new Set;for(let Oe of i.typedefs)Re.add(Oe.name);for(let Oe of i.contexts??[])Re.add(Oe.typeName);let Le=En(i);for(let Oe of Le?.localTypeDeclarations??[]){let $e=Bg.exec(Oe);if($e)Re.add($e[1])}return Re.add(Mn(i.moduleName,Ie)),Re.add(Zn(i.moduleName,Ie)),Re}async function Qs(i,Ie,Re,Le){let Oe=new Map;return await Promise.all(Array.from(i.values()).map(async($e)=>{let Fe=En($e)?.typeImportStatements??[];if(Fe.length===0)return;let je=Ie($e.filePath),qe=Le?Rp(je,$e.moduleName,Fe):null,We={files:new Map,reservedNames:zg($e,Re),nameOwner:new Map,textByKey:new Map,order:[],pending:new Set,dependencies:new Set,tx:{orderStart:0,keys:[]},bareSession:Le,barePlan:qe},Ge=[],ze=($e.diagnostics??[]).filter((Xe)=>Xe.kind!=="types-inline-unresolved");for(let Xe of Fe){let Qe=await Kg(We,Xe,je);if(Qe.status==="inlined")Ge.push(Xe);else if(Qe.status==="refused")for(let Ze of Qe.failures)ze.push(Cn({component:$e.filePath,kind:"types-inline-unresolved",name:Ze.name,message:`Cannot inline "${Ze.name}": ${Ze.reason}.`}))}if($e.diagnostics=ze,Ge.length===0&&We.order.length===0)return;Oe.set($e.filePath,{droppedImportStatements:Ge,declarations:We.order.map((Xe)=>We.textByKey.get(Xe)??""),dependencies:Array.from(We.dependencies)})})),Oe}import{hash as Xg}from"node:crypto";import{mkdirSync as Jg,readFileSync as Yg,renameSync as Qg,writeFileSync as Op}from"node:fs";import{dirname as Zg,isAbsolute as ex,join as tx,resolve as Mp}from"node:path";var Bo=3,nx=tx("node_modules",".cache","sveld","parse-cache.json");function Fo(){return`${Ps}+svelte@${Fr}`}function Bp(i,Ie){if(typeof Ie==="string")return ex(Ie)?Ie:Mp(i,Ie);return Mp(i,nx)}function Fp(i){return Xg("sha256",i,"hex")}function $p(){return{formatVersion:Bo,toolchainVersion:Fo(),entries:{}}}function rx(i){try{let Ie=Yg(i,"utf-8"),Re=JSON.parse(Ie);if(Re.formatVersion!==Bo||Re.toolchainVersion!==Fo())return $p();return Re}catch{return $p()}}class jo{cacheFilePath;file;next=new Map;blocked=new Set;constructor(i){this.cacheFilePath=i,this.file=rx(i)}has(i,Ie){if(this.blocked.has(i))return!1;let Re=this.file.entries[i];return Re!==void 0&&Re.hash===Ie}get(i,Ie){if(this.blocked.has(i))return null;let Re=this.file.entries[i];if(Re===void 0||Re.hash!==Ie)return null;if(this.next.set(i,Re),Re.typeScriptMetadata!==void 0)Re.parsed[g]=Re.typeScriptMetadata;return Re.parsed}set(i,Ie,Re){this.next.set(i,{hash:Ie,parsed:Re,typeScriptMetadata:Re[g]})}invalidate(i){this.blocked.add(i)}getGeneratedText(i,Ie){let Re=this.next.get(i);if(Re?.generatedText===void 0||Re.generatedText.key!==Ie)return;return Re.generatedText.text}setGeneratedText(i,Ie,Re){let Le=this.next.get(i);if(Le===void 0)return;Le.generatedText={key:Ie,text:Re}}save(){Jg(Zg(this.cacheFilePath),{recursive:!0});let i={formatVersion:Bo,toolchainVersion:Fo(),entries:Object.fromEntries(this.next)},Ie=JSON.stringify(i),Re=`${this.cacheFilePath}.${process.pid}.tmp`;try{Op(Re,Ie),Qg(Re,this.cacheFilePath)}catch{try{Op(this.cacheFilePath,Ie)}catch{}}}}import{lstatSync as sx,readFileSync as ix}from"node:fs";import{basename as ox,dirname as Go,join as ax,relative as cx,resolve as qp}from"node:path";var Er=null,Vo=null;function tr(){if(Er)return Promise.resolve(Er);if(!Vo)Vo=Promise.all([import("./chunk-bxzbn9eg.js"),import("./chunk-znjmdeca.js")]).then(([i,Ie])=>(Er={ComponentParser:i.default,parseSvelte:Ie.parse},Er));return Vo}function Zs(){if(!Er)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return Er}var Wo=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],lx=/\r?\n/,px=/^\s*\*+/;function Pt(i){return i&&typeof i==="object"?i:void 0}function rr(i){return Array.isArray(i)?i:[]}function Pn(i){return s(i)?i.name:void 0}function xn(i,Ie){let Re=bo(i,Ie),Le=qp(Ie,Re),Oe=Go(Le),$e=ox(Le);if(An(Oe,$e)){let Fe=Fs(Oe,$e)??sx(Le,{throwIfNoEntry:!1});if(Fe?.isFile())return Le;for(let je of Wo)if(An(Oe,$e+je))return Le+je;if(Fe?.isDirectory()){for(let je of Wo)if(An(Le,`index${je}`))return ax(Le,`index${je}`)}return null}for(let Me of Wo)if(An(Oe,$e+Me))return Le+Me;return null}function ux(i,Ie){let Re=i.slice(0,Ie).trimEnd();if(!Re.endsWith("*/"))return;let Le=Re.length-2,Oe=Re.lastIndexOf("/**",Le);if(Oe===-1)return;let $e=[];for(let Me of Re.slice(Oe+3,Le).split(lx)){let Fe=Me.replace(px,"").trim();if(Fe.startsWith("@"))break;if(Fe)$e.push(Fe)}return $e.join(" ")||void 0}function dx(i,Ie){let Re=i.slice(0,Ie).trimEnd();if(!Re.endsWith("*/"))return;let Le=Re.length-2,Oe=Re.lastIndexOf("/**",Le);if(Oe===-1)return;return Re.slice(Oe,Le+2)}function nr(i,Ie){if(!Ie)return;return i.text.slice(Ie.start,Ie.end)}function fx(i,Ie){let Re=Pt(Ie?.typeAnnotation);if(Re?.type!=="TSTypeAnnotation")return;return nr(i,Pt(Re.typeAnnotation))}function qo(i,Ie){let Re=Pt(Ie.returnType);return Re?.type==="TSTypeAnnotation"?nr(i,Pt(Re.typeAnnotation)):void 0}function jp(i,Ie){let Re=rr(Ie.params).map((Oe)=>nr(i,Oe)??"").join(", "),Le=qo(i,Ie);return`(${Re})${Le?` => ${Le}`:""}`}function Gp(i){if(i.type==="Literal"){let Ie=i.value;if(typeof Ie==="string")return"string";if(typeof Ie==="number")return"number";if(typeof Ie==="boolean")return"boolean"}if(i.type==="TemplateLiteral")return"string";return}function hx(i,Ie){let Re=nr(i,Ie);if(Re===void 0)return;if(Ie.type==="Literal"){let Oe=Ie.value;if(typeof Oe==="string"||typeof Oe==="number"||typeof Oe==="boolean")return{raw:Re,value:Oe,type:typeof Oe};return}if(Ie.type==="UnaryExpression"&&Ie.operator==="-"){let Oe=Pt(Ie.argument);if(Oe?.type==="Literal"&&typeof Oe.value==="number")return{raw:Re,value:-Oe.value,type:"number"};return}let Le=Ie.type==="TemplateLiteral"?qn(Ie):null;return Le===null?void 0:{raw:Re,value:Le,type:"string"}}function mx(i){if(!i)return;let Ie=i.lastIndexOf("=>");if(Ie===-1)return;return i.slice(Ie+2).trim()||void 0}function Vp(i){if(i.async||i.generator)return;let Ie=Pt(i.body);if(!Ie)return;let Re=[];if(Ie.type==="BlockStatement"){if(Kr(Ie,Re),Re.length===0)return}else Re.push(Ie);let Le;for(let Oe of Re){if(!Oe)return;let $e=Gp(Oe);if(!$e)return;if(Le===void 0)Le=$e;else if(Le!==$e)return}return Le}function Kr(i,Ie){for(let Re of rr(i.body)){if(Re.type==="FunctionDeclaration"||Re.type==="FunctionExpression"||Re.type==="ArrowFunctionExpression")continue;if(Re.type==="ReturnStatement"){Ie.push(Pt(Re.argument)??null);continue}if(Re.type==="BlockStatement"){Kr(Re,Ie);continue}let Le=Pt(Re.consequent);if(Le?.type==="BlockStatement")Kr(Le,Ie);else if(Le?.type==="ReturnStatement")Ie.push(Pt(Le.argument)??null);let Oe=Pt(Re.alternate);if(Oe?.type==="BlockStatement")Kr(Oe,Ie);else if(Oe?.type==="ReturnStatement")Ie.push(Pt(Oe.argument)??null);let $e=Pt(Re.body);if($e?.type==="BlockStatement")Kr($e,Ie)}}function yx(i){let Ie=Pt(i.initializer);if(!Ie)return;if(Ie.type==="Literal"){let Re=Ie.value;return typeof Re==="string"||typeof Re==="number"?Re:void 0}if(Ie.type==="UnaryExpression"){let Re=Pt(Ie.argument);if(Ie.operator==="-"&&Re?.type==="Literal"){let Oe=Re.value;if(typeof Oe==="number")return-Oe}}return}function gx(i){let Ie=rr(i.members);if(Ie.length===0)return;let Re=[],Le=0;for(let Oe of Ie){if(!Pt(Oe.initializer)){Re.push(String(Le)),Le+=1;continue}let Me=yx(Oe);if(Me===void 0)return;Re.push(typeof Me==="string"?JSON.stringify(Me):String(Me)),Le=typeof Me==="number"?Me+1:Le}return Re.join(" | ")}function Wp(i,Ie,Re){let Le=i.filePath,Oe=ux(i.text,Re),$e=dx(i.text,Re),Me=$e?Ll($e):void 0,{deprecated:Fe,tags:je,internal:qe}=$e?Ol($e):{deprecated:void 0,tags:void 0,internal:!1},We=qe?{internal:!0}:{};if(Ie.type==="VariableDeclaration"){let Ge=Ie.kind??"const",ze=[];for(let Xe of rr(Ie.declarations)){let Qe=Pt(Xe.id),Ze=Pn(Qe);if(!Ze)continue;let nt=fx(i,Qe),at,pt,tt,lt,ct=Pt(Xe.init);if(ct)if(ct.type==="ArrowFunctionExpression"||ct.type==="FunctionExpression"){if(!nt)nt=jp(i,ct);pt=qo(i,ct)??Me??mx(nt)??Vp(ct)}else{if(at=nr(i,ct),!nt)nt=Gp(ct);if(tt=qn(ct)??void 0,Ge==="const")lt=hx(i,ct)}ze.push({name:Ze,kind:Ge,type:nt,value:at,returnType:pt,literalValue:tt,primitiveLiteral:lt,description:Oe,deprecated:Fe,tags:je,...We,declFile:Le,isTypeOnly:!1})}return ze}if(Ie.type==="FunctionDeclaration"||Ie.type==="TSDeclareFunction"){let Ge=Pn(Pt(Ie.id));if(!Ge)return[];return[{name:Ge,kind:"function",type:jp(i,Ie),returnType:qo(i,Ie)??Me??Vp(Ie),description:Oe,deprecated:Fe,tags:je,...We,declFile:Le,isTypeOnly:!1}]}if(Ie.type==="ClassDeclaration"){let Ge=Pn(Pt(Ie.id));if(!Ge)return[];return[{name:Ge,kind:"class",type:Ge,description:Oe,deprecated:Fe,tags:je,...We,declFile:Le,isTypeOnly:!1}]}if(Ie.type==="TSTypeAliasDeclaration"){let Ge=Pn(Pt(Ie.id));if(!Ge)return[];return[{name:Ge,kind:"type",type:nr(i,Pt(Ie.typeAnnotation)),description:Oe,deprecated:Fe,tags:je,...We,declFile:Le,isTypeOnly:!0}]}if(Ie.type==="TSInterfaceDeclaration"){let Ge=Pn(Pt(Ie.id));if(!Ge)return[];return[{name:Ge,kind:"interface",type:nr(i,Pt(Ie.body)),description:Oe,deprecated:Fe,tags:je,...We,declFile:Le,isTypeOnly:!0}]}if(Ie.type==="TSEnumDeclaration"){let Ge=Pn(Pt(Ie.id));if(!Ge)return[];return[{name:Ge,kind:"enum",type:gx(Ie)??Ge,description:Oe,deprecated:Fe,tags:je,...We,declFile:Le,isTypeOnly:!1}]}return[]}function xx(i){let Ie;try{Ie=ix(i,"utf-8")}catch{return null}let Re=`<script lang="ts">
|
|
217
|
+
${Ie}
|
|
218
|
+
</script>`;try{let Le=Zs().parseSvelte(Re),Oe=rr(Le.instance?.content?.body);return{source:{text:Re,filePath:i,dir:Go(i)},body:Oe}}catch(Le){let Oe=Le instanceof Error?Le.message:String(Le);return console.warn(`Warning: Failed to parse entry export module ${i}: ${Oe}`),null}}function bx(i,Ie){for(let Re of i){if(Re.type!=="ImportDeclaration")continue;let Le=Pt(Re.source)?.value;if(typeof Le!=="string")continue;for(let Oe of rr(Re.specifiers)){if(Oe.type!=="ImportSpecifier")continue;if(Pn(Pt(Oe.local))===Ie){let $e=Pn(Pt(Oe.imported))??Ie;return{specifier:Le,importedName:$e}}}}return null}function vn(i,Ie){let Re=Ie.cache.get(i);if(Re)return Re;if(Ie.computing.has(i))return[];Ie.computing.add(i);let Le=xx(i);if(!Le)return Ie.computing.delete(i),Ie.cache.set(i,[]),[];let{source:Oe,body:$e}=Le,Me=[],Fe=new Map;for(let qe of $e){let We=qe.type==="ExportNamedDeclaration"?Pt(qe.declaration):qe;if(!We)continue;for(let Ge of Wp(Oe,We,We.start))Fe.set(Ge.name,Ge)}let je=(qe)=>{let We=Fe.get(qe);if(We)return We;let Ge=bx($e,qe);if(!Ge||Ge.specifier.endsWith(".svelte"))return null;let ze=xn(Ge.specifier,Oe.dir);if(!ze)return null;return vn(ze,Ie).findLast((Xe)=>Xe.name===Ge.importedName)??null};for(let qe of $e){if(qe.type==="ExportAllDeclaration"){let Qe=Pt(qe.source)?.value;if(typeof Qe!=="string"||Qe.endsWith(".svelte"))continue;let Ze=xn(Qe,Oe.dir);if(!Ze)continue;let nt=qe.exportKind==="type";for(let at of vn(Ze,Ie))Me.push(nt?{...at,isTypeOnly:!0}:at);continue}if(qe.type!=="ExportNamedDeclaration")continue;let We=Pt(qe.declaration);if(We){Me.push(...Wp(Oe,We,qe.start));continue}let Ge=Pt(qe.source)?.value,ze=typeof Ge==="string"?Ge:void 0;if(ze?.endsWith(".svelte"))continue;let Xe=qe.exportKind==="type";for(let Qe of rr(qe.specifiers)){if(Qe.type!=="ExportSpecifier")continue;let Ze=Pn(Pt(Qe.exported)),nt=Pn(Pt(Qe.local));if(!Ze||!nt||nt==="default"||Ze==="default")continue;let at=Xe||Qe.exportKind==="type",pt=null;if(ze){let tt=xn(ze,Oe.dir);if(tt)pt=vn(tt,Ie).findLast((lt)=>lt.name===nt)??null}else pt=je(nt);if(pt?.declFile.endsWith(".svelte"))continue;if(pt)Me.push({...pt,name:Ze,isTypeOnly:pt.isTypeOnly||at});else Me.push({name:Ze,kind:at?"type":"const",declFile:i,isTypeOnly:at})}}return Ie.computing.delete(i),Ie.cache.set(i,Me),Me}async function zr(i){await tr();let Ie=qp(i),Re=Go(Ie),Le=vn(Ie,{cache:new Map,computing:new Set}),Oe=(Fe)=>e(`./${cx(Re,Fe)}`),$e=new Map,Me=new Map;for(let Fe of Le){let je=Me.get(Fe.name);if(je!==void 0&&je!==Fe.declFile){console.warn(`Warning: "${Fe.name}" is exported from both "${Oe(je)}" and "${Oe(Fe.declFile)}"; keeping the first and dropping the rest.`);continue}Me.set(Fe.name,Fe.declFile);let{declFile:qe,returnType:We,literalValue:Ge,primitiveLiteral:ze,...Xe}=Fe;$e.set(Fe.name,{...Xe,source:Oe(qe)})}return Array.from($e.values()).sort((Fe,je)=>Fe.name.localeCompare(je.name))}import{readFileSync as Hp}from"node:fs";import{dirname as Kp,join as Ex,relative as Cx,resolve as vx}from"node:path";var Up=new Map;function Sx(i){return Ri(i,{ecmaVersion:"latest",sourceType:"module"})}function Tx(i,Ie,Re){let Le=xn(i,Ie);if(!Le)return null;let Oe=Kp(Le);if(Re.has(Le))return{dir:Oe,exports:{}};Re.add(Le);try{return{dir:Oe,exports:ei(Hp(Le,"utf-8"),Oe,Re,Le)}}catch{return{dir:Oe,exports:{}}}finally{Re.delete(Le)}}function ei(i,Ie,Re=new Set,Le=Ie){let Oe=Up.get(i);if(!Oe)Oe=Sx(i),Up.set(i,Oe);let $e={};for(let Me of Oe.body)if(Me.type==="ExportDefaultDeclaration"){let Fe=Me.declaration.name;if(Fe in $e)$e[Fe].default=!0;else $e[Fe]={source:Ln(""),default:!0}}else if(Me.type==="ExportAllDeclaration"){if(!Me.source)continue;let Fe=Me.source.value,je=xn(Fe,Ie);if(!je){let Ge=yr(Fe,Ie);throw new mr(Fe,Le,Ge.unresolved?Ge.searched:"no matching file or index found")}if(Re.has(je))continue;Re.add(je);let qe=Hp(je,"utf-8"),We=ei(qe,Kp(je),Re,je);Re.delete(je);for(let[Ge,ze]of Object.entries(We)){let Xe=Ln(e(`./${Ex(Fe,ze.source)}`));$e[Ge]={...ze,source:Xe}}}else if(Me.type==="ExportNamedDeclaration"){let Fe=Me.source?.value,je=Fe!==void 0&&wn.test(Fe);if(je){let Ge=yr(Fe,Ie);if(Ge.unresolved)throw new mr(Fe,Le,Ge.searched)}let We=Fe!==void 0&&!je?Tx(Fe,Ie,Re):void 0;if(We===null)console.warn(`sveld: could not resolve re-exported module "${Fe}" from barrel "${Ie||"."}"; skipping.`);for(let Ge of Me.specifiers){let ze=Ge.exported.name,Xe=Ge.local.name,Qe=ze||Xe;if(We===null)continue;let Ze=We?.exports[Xe],nt=Ze?Ln(e(`./${Cx(Ie,vx(We.dir,Ze.source))}`)):Ln(Gs(Fe??"",Ie)),at=Ze?Ze.default:Xe==="default";if(Qe in $e){if($e[Qe].mixed=!0,!$e[Qe].source)$e[Qe].source=nt}else $e[Qe]={source:nt,default:at}}}else if(Me.type==="ImportDeclaration"){let Fe=Me.specifiers[0].local.name;if(Fe in $e){if(!$e[Fe].source)$e[Fe].source=Ln(Gs(Me.source?.value??"",Ie))}else $e[Fe]={source:Ln(Gs(Me.source?.value??"",Ie)),default:Fe==="default"}}return $e}import{existsSync as kx}from"node:fs";import{dirname as wx}from"node:path";function zp(){return{cache:new Map,computing:new Set}}var Ax=/\.[^./\\]+$/;function Px(i){if(i.endsWith(".d.ts"))return null;let Ie=i.replace(Ax,".d.ts");return kx(Ie)?Ie:null}function Xp(i,Ie,Re){let Le=wx(i);return Ie.map((Oe)=>{if(!Oe.importSource||!Oe.importedName)return{candidate:Oe};let $e=xn(Oe.importSource,Le);if(!$e)return{candidate:Oe,failureReason:"module-not-found"};let Me=vn($e,Re).find((je)=>je.name===Oe.importedName);if(!Me)return{candidate:Oe,failureReason:"export-not-found"};if(Me.returnType)return{candidate:Oe,type:Me.returnType};let Fe=Px($e);if(Fe){let je=vn(Fe,Re).find((qe)=>qe.name===Oe.importedName);if(je?.returnType)return{candidate:Oe,type:je.returnType}}return{candidate:Oe,failureReason:"return-type-unresolved"}})}function Jp(i,Ie){switch(Ie){case"module-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importedName}" is not exported from "${i.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${i.propName}" default calls "${i.calleeName}()" imported from "${i.importSource}", but its return type could not be resolved; falling back to "any".`}}import{dirname as Nx}from"node:path";function Yp(i,Ie,Re){let Le=Nx(i);return Ie.map((Oe)=>{let $e=xn(Oe.importSource,Le);if(!$e)return{candidate:Oe};let Me=vn($e,Re).find((Fe)=>Fe.name===Oe.importedName);if(!Me?.primitiveLiteral)return{candidate:Oe};return{candidate:Oe,literal:Me.primitiveLiteral}})}import{dirname as _x}from"node:path";function Qp(i,Ie,Re){let Le=_x(i);return Ie.map((Oe)=>{let $e=xn(Oe.importSource,Le);if(!$e)return{candidate:Oe};let Me=vn($e,Re).find((Fe)=>Fe.name===Oe.importedName);if(Me?.kind!=="const"||Me.literalValue===void 0)return{candidate:Oe};return{candidate:Oe,key:Me.literalValue}})}function b(i){return{failFast:i?.failFast,resolveTypes:i?.resolveTypes===!0,documentExports:i?.documentExports===!0,cache:i?.cache,checkExamples:i?.checkExamples==="syntax"?"syntax":i?.checkExamples===!0,dryRun:i?.dryRun===!0,diagnostics:i?.diagnostics,typesTypeNames:i?.typesOptions?.typeNames,typesInline:i?.typesOptions?.inline}}var Bx=/-/g,Fx=/[^A-Za-z0-9_$]/g,jx=/^[0-9]/;function Vx(i){let Ie=i.replace(Fx,""),Re=jx.test(Ie)?`_${Ie}`:Ie;if(Re!==i)console.warn(`Warning: "${i}" is not a valid identifier; using "${Re}" instead.`);return Re}function iu(i,Ie=[],Re=new Set,Le){let Oe;try{Oe=Le??Ix(i)}catch{return Ie}if(Re.has(Oe))return Ie;Re.add(Oe);let $e=Bs(i);if($e===null)return Ie;let Me=$e.entries;for(let Fe of Me){if(Fe.name.startsWith("."))continue;let je=eu(i,Fe.name),qe=Fe.isSymbolicLink(),We=qe?ru(je,{throwIfNoEntry:!1}):Fe;if(!We)continue;if(We.isDirectory())iu(je,Ie,Re,qe?void 0:eu(Oe,Fe.name));else if(We.isFile()&&Fe.name.endsWith(".svelte"))Ie.push(je)}return Ie}function Wx(i){return iu(i).map((Ie)=>{let Re=Vx(Lx(Ie,".svelte").replace(Bx,"")),Le=Ln(e(`./${Uo(i,Ie)}`));return{moduleName:Re,source:Le}}).sort((Ie,Re)=>Ie.source.localeCompare(Re.source))}function qx(i){return!ws(i)}function Gx(i,Ie){let Re=i.endsWith("/")?i:`${i}/`;return Ie.startsWith(Re)}function ti(i,Ie){return{seenPaths:new Set(i.map(([,Re])=>Ie(Re.source))),seenModuleNamePaths:new Map(i.map(([Re,Le])=>[Re,Ie(Le.source)])),warnedModuleNames:new Set}}function Ho(i,Ie,Re,Le,Oe){for(let{moduleName:$e,source:Me}of Wx(i)){let Fe=Le(Me),je=Ie[$e];if(je&&qx(je.source)&&Gx(je.source,Me)){Oe.seenPaths.delete(Le(je.source)),je.source=Me,Oe.seenPaths.add(Fe),Oe.seenModuleNamePaths.set($e,Fe);continue}if(Oe.seenPaths.has(Fe))continue;Oe.seenPaths.add(Fe);let qe=Oe.seenModuleNamePaths.get($e);if(qe===void 0)Oe.seenModuleNamePaths.set($e,Fe);else if(qe!==Fe&&!Oe.warnedModuleNames.has($e))Oe.warnedModuleNames.add($e),console.warn(`Warning: multiple components named "${$e}" found (${e(Uo(i,qe))} and ${e(Uo(i,Fe))}). Both are included in TypeScript definitions, but only one can be the named export.`);Re.push([$e,{source:Me,default:!1}])}}function ni(i,Ie,Re=!1){$s();let Le=nu(i).isFile(),Oe=Le?su(i):i,$e=Cr(Oe),Me=new Map,Fe=(We)=>{let Ge=Me.get(We);if(Ge===void 0)Ge=Mx(We)?Cr(We):Cr($e,We),Me.set(We,Ge);return Ge},je={};if(Le){let We=Dx(i,"utf-8");try{je=ei(We,$e,new Set([Cr(i)]))}catch(Ge){if(!Re)throw Ge;let ze=Ge instanceof Error?Ge.message:String(Ge);console.warn(`Warning: Failed to parse component exports from ${i}: ${ze}`)}}let qe=Object.entries(je);if(Ie){let We=ti(qe,Fe);if(Ho($e,je,qe,Fe,We),!Le)je=Object.fromEntries(qe.map(([Ge,ze])=>[Ge,{...ze,default:!0}]))}return{exports:je,allComponentEntries:qe,rootDir:$e,resolveComponentFilePath:Fe}}async function ri(i){let Ie=await Promise.all(Array.from(i).map(async(Re)=>{try{let Le=await Rx(Re,"utf-8");return{path:Re,content:Le}}catch(Le){return console.warn(`Warning: Failed to read file ${Re}:`,Le),{path:Re,content:null}}}));return new Map(Ie.map(({path:Re,content:Le})=>[Re,Le]))}function Un([i,Ie],Re,Le,Oe,$e={}){let Me=Ie.source,Fe=i;if(Re.length===1&&i==="default")Fe=$x(Me).name;if(ws(Me)){let je=Oe(Me),qe=Le.get(je);if(qe===null||qe===void 0)return null;let We=e(Me),Ge=$e.memo?.get(je),ze=$e.hashes?.get(je),Xe=Ge===void 0?ze===void 0?null:$e.cache?.get(je,ze):null,Qe;if(Ge!==void 0)Qe=Ge;else if(Xe)Qe=Xe;else{let Ze=new(Zs()).ComponentParser;try{Qe=Ze.parseSvelteComponent(qe,{moduleName:Fe,filePath:We})}catch(nt){if($e.failFast)throw nt;let at=nt instanceof Error?nt.message:String(nt),pt=nt instanceof Error?nt.stack:void 0;return $e.onParseError?.({filePath:We,moduleName:Fe,message:at,stack:pt}),null}if(ze!==void 0)$e.cache?.set(je,ze,Qe);$e.memo?.set(je,Qe)}return{moduleName:Fe,filePath:We,...Qe}}return null}function Ko(i,Ie){let Re=new Set;for(let Le of i)for(let[,Oe]of Le)if(ws(Oe.source))Re.add(Ie(Oe.source));return Re}function si(i){if(i.length===0)return;console.error(`sveld: failed to parse ${i.length} component(s):`);for(let{filePath:Ie,message:Re}of i)console.error(` - ${Ie}: ${Re}`)}async function S(i,Ie,Re={}){let Le=Re.documentExports===!0,{exports:Oe,allComponentEntries:$e,rootDir:Me,resolveComponentFilePath:Fe}=ni(i,Ie,Le),je=Le&&nu(i).isFile()?await zr(Cr(i)):[],qe=Object.entries(Oe),We=Ko([qe,$e],Fe),Ge=await ri(We),ze=new Map,Xe=new Map,Qe=Re.cache===!1?void 0:new jo(Bp(Me,Re.cache??!0)),Ze=Qe?new Map:void 0,nt=new Set,at=new Map;if(Qe)for(let et of We){let ot=Ge.get(et);if(ot===null||ot===void 0)continue;let ut=Fp(ot);if(at.set(et,ut),!Qe.has(et,ut))nt.add(et)}if(We.size>0&&(!Qe||nt.size>0))await tr();let pt=new Map,tt=new Map,lt={failFast:Re.failFast===!0,onParseError:(et)=>pt.set(et.filePath,et),cache:Qe,hashes:at,memo:tt};for(let et of qe){let ot=Un(et,qe,Ge,Fe,lt);if(ot)ze.set(ot.moduleName,ot)}for(let et of $e){let ot=Un(et,$e,Ge,Fe,lt);if(ot)Xe.set(ot.filePath,ot),Ze?.set(ot.filePath,Fe(et[1].source))}if(Qe&&nt.size>0){let et=Vr(Xe,Fe),ot=Os(nt,et);for(let ut of ot){if(nt.has(ut))continue;Qe.invalidate(ut),tt.delete(ut)}for(let ut of qe){let mt=Fe(ut[1].source);if(!ot.has(mt)||nt.has(mt))continue;let gt=Un(ut,qe,Ge,Fe,lt);if(gt)ze.set(gt.moduleName,gt)}for(let ut of $e){let mt=Fe(ut[1].source);if(!ot.has(mt)||nt.has(mt))continue;let gt=Un(ut,$e,Ge,Fe,lt);if(gt)Xe.set(gt.filePath,gt),Ze?.set(gt.filePath,mt)}}let ct=Array.from(pt.values());if(si(ct),!Re.dryRun)Qe?.save();let Nt=Re.resolveTypes?Yx(ze):[],Et=Re.checkExamples?Zx(Xe):[],vt=Re.checkExamples===!0?tu(Et,"compile"):[],Be=Re.checkExamples?tu(Et,"syntax"):[];if(Be.length>0)e0(Be);let Ve=Re.typesInline==="all"?Ys(Xe,Fe):new Map,Ue,Ke;if(Nt.length>0||vt.length>0||Ve.size>0){let{TypeResolver:et}=await import("./chunk-a2krprqa.js"),ot=await et.create(Me);if(!ot.ok){let mt=[Nt.length>0?"resolveTypes":null,vt.length>0?"checkExamples":null,Ve.size>0?'typesOptions.inline: "all"':null].filter((gt)=>gt!==null).join(" and ");throw Error(`sveld: \`${mt}\` ${ot.message}.`)}let ut=ot.resolver;try{if(Nt.length>0)await Qx(Nt,ut,Fe);if(vt.length>0)await t0(vt,ut,Fe);if(Ve.size>0)Ue=await ut.openBareTypeSession(Ve),Ke=ut;else await ut.dispose()}catch(mt){throw await ut.dispose(),mt}}let Je=Ux(Xe),Ye=Kx(Xe),rt=Xx(Xe);if(Je.length>0||Ye.length>0||rt.length>0){await tr();let et=zp();for(let{component:ot,candidates:ut}of Je){let mt=Xp(Fe(ot.filePath),ut,et);Hx(ot,mt)}for(let{component:ot,candidates:ut}of Ye){let mt=Yp(Fe(ot.filePath),ut,et);zx(ot,mt)}for(let{component:ot,candidates:ut}of rt){let mt=Qp(Fe(ot.filePath),ut,et);Jx(ot,mt)}}o0(Xe,Fe,Re.typesTypeNames),i0(Xe,Re.typesTypeNames);let it;try{it=Re.typesInline==="local"||Re.typesInline==="all"?await Qs(Xe,Fe,Re.typesTypeNames,Ue):void 0}finally{if(Ue)await Ue.dispose();if(Ke)await Ke.dispose()}let st=ll(Es(Array.from(Xe.values()).flatMap((et)=>et.diagnostics??[])),Re.diagnostics?.ignore);return{exports:Oe,entryExports:je,components:ze,allComponentsForTypes:Xe,errors:ct,diagnostics:st,cache:Qe,resolvedPathByFilePath:Ze,inlinedTypesByFilePath:it}}function Ux(i){let Ie=[];for(let Re of i.values()){let Le=En(Re)?.pendingCallDefaultCandidates?.filter((Oe)=>Oe.importSource!==void 0);if(!Le||Le.length===0)continue;Ie.push({component:Re,candidates:Le})}return Ie}function Hx(i,Ie){for(let{candidate:Re,type:Le,failureReason:Oe}of Ie){let Me=(Re.location==="props"?i.props:i.moduleExports).find((Fe)=>Fe.name===Re.propName);if(Me?.typeSource!=="unknown")continue;if(Le){if(Me.type=Le,Me.typeSource="typescript",Re.location==="props")i.diagnostics=(i.diagnostics??[]).filter((Fe)=>!(Fe.kind==="prop-unknown-type"&&Fe.name===Re.propName));continue}if(Re.location==="props"&&Oe){let Fe=i.diagnostics?.find((je)=>je.kind==="prop-unknown-type"&&je.name===Re.propName);if(Fe)Fe.message=Jp(Re,Oe)}}}function Kx(i){let Ie=[];for(let Re of i.values()){let Le=En(Re)?.pendingConstDefaultCandidates;if(!Le||Le.length===0)continue;Ie.push({component:Re,candidates:Le})}return Ie}function zx(i,Ie){for(let{candidate:Re,literal:Le}of Ie){if(!Le)continue;let $e=(Re.location==="props"?i.props:i.moduleExports).find((Me)=>Me.name===Re.propName);if(!$e)continue;if($e.value=Le.raw,$e.defaultValue={raw:Le.raw,kind:"literal",value:Le.value},$e.typeSource!=="unknown")continue;if($e.type=Le.type,$e.typeSource="default",Re.location==="props")i.diagnostics=(i.diagnostics??[]).filter((Me)=>!(Me.kind==="prop-unknown-type"&&Me.name===Re.propName))}}function Xx(i){let Ie=[];for(let Re of i.values()){let Le=En(Re)?.pendingContextKeyCandidates;if(!Le||Le.length===0)continue;Ie.push({component:Re,candidates:Le})}return Ie}function Jx(i,Ie){for(let{candidate:Re,key:Le}of Ie){if(!Le){console.warn(`Warning: Could not resolve setContext key in ${i.filePath}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);continue}if(i.contexts?.some((Oe)=>Oe.key===Le))continue;i.contexts=[...i.contexts??[],{key:Le,typeName:$r(Le),description:Re.description,properties:Re.properties,source:Re.source}]}}function Yx(i){let Ie=[];for(let Re of i.values()){let Le=En(Re);if(!Le?.canonicalPropsType||Re.props.length>0)continue;Ie.push({component:Re,metadata:Le})}return Ie}async function Qx(i,Ie,Re){let Le=await Ie.expandAll(i.map(({component:Oe,metadata:$e})=>({moduleName:Oe.moduleName,metadata:$e,filePath:Re(Oe.filePath)})));for(let{component:Oe}of i){let $e=Le.get(Re(Oe.filePath));if($e)al(Oe,$e)}}function Zx(i){let Ie=[];for(let Re of i.values()){let Le=rp(Re);if(Le.length===0)continue;Ie.push({component:Re,sources:Le})}return Ie}function tu(i,Ie){let Re=[];for(let{component:Le,sources:Oe}of i){let $e=Oe.filter((Me)=>Me.kind===Ie);if($e.length===0)continue;Re.push({component:Le,sources:$e})}return Re}function e0(i){for(let{component:Ie,sources:Re}of i){let Le=Ie.diagnostics??[];for(let Oe of Re)try{A(Oe.code)}catch($e){if($e instanceof T)continue;Le.push(Cn({component:Ie.filePath,kind:"example-syntax-error",name:Oe.name,message:$e instanceof Error?$e.message:String($e),...Oe.source?{source:Oe.source}:{}}))}Ie.diagnostics=Le}}async function t0(i,Ie,Re){let Le=await Ie.checkExamples(i.map(({component:Oe,sources:$e})=>({moduleName:Oe.moduleName,filePath:Re(Oe.filePath),sources:$e})));for(let{component:Oe,sources:$e}of i){let Me=Le.get(Re(Oe.filePath));if(!Me||Me.length===0)continue;let Fe=new Map($e.map((qe)=>[qe.id,qe.source])),je=Oe.diagnostics??[];for(let qe of Me){let We=Fe.get(qe.id);je.push(Cn({component:Oe.filePath,kind:"example-compile-error",name:qe.name,message:qe.message,...We?{source:We}:{}}))}Oe.diagnostics=je}}var n0=[".ts",".tsx",".d.ts",".svelte"];function r0(i){let Ie=i.trim();if(Ie.length<2)return;let Re=Ie[0],Le=Ie[Ie.length-1];if((Re==='"'||Re==="'"||Re==="`")&&Re===Le)return Ie.slice(1,-1);return}function s0(i,Ie){let Re=Cr(su(i),Ie);if(Zp(Re)&&ru(Re).isFile())return Re;if(Ox(Ie)!=="")return;for(let Le of n0){let Oe=`${Re}${Le}`;if(Zp(Oe))return Oe}return}function i0(i,Ie){for(let Re of i.values()){let Le=Re.moduleExports.filter((Me)=>Me.kind==="re-export");if(Le.length===0)continue;let Oe=new Set([Mn(Re.moduleName,Ie),Zn(Re.moduleName,Ie)]),$e=Re.diagnostics??[];for(let Me of Le){if(!Oe.has(Me.name))continue;$e.push(Cn({component:Re.filePath,kind:"module-export-conflict",name:Me.name,message:`Re-export "${Me.name}" has the same name as the generated "${Me.name}" type; the .d.ts won't type-check if "${Me.reExport?.from}" exports a type by that name.`,source:Me.source}))}Re.diagnostics=$e}}function o0(i,Ie,Re){let Le=new Map(Array.from(i.values()).map((Oe)=>[Ie(Oe.filePath),Oe]));for(let Oe of i.values()){let $e=Oe.extends;if(!$e)continue;let Me=r0($e.import);if(Me===void 0||!Me.startsWith(".")&&!Me.startsWith("/"))continue;let Fe=Ie(Oe.filePath),je=s0(Fe,Me),qe=Oe.diagnostics??[];if(je===void 0){qe.push(Cn({component:Oe.filePath,kind:"extend-props-target-missing",name:$e.interface,message:`@extends/@extendProps target "${Me}" was not found on disk.`})),Oe.diagnostics=qe;continue}let We=Le.get(je);if(!We)continue;let Ge=Mn(We.moduleName,Re);if($e.interface!==Ge){qe.push(Cn({component:Oe.filePath,kind:"extend-props-target-missing",name:$e.interface,message:`@extends/@extendProps names "${$e.interface}", but "${Me}" generates "${Ge}".`})),Oe.diagnostics=qe;continue}for(let ze of Oe.props){let Xe=We.props.find((Qe)=>Qe.name===ze.name);if(Xe&&Xe.type!==ze.type)qe.push(Cn({component:Oe.filePath,kind:"extend-props-override",name:ze.name,message:`Own prop "${ze.name}" (${ze.type}) overrides "${Ge}"'s "${ze.name}" (${Xe.type}).`}))}Oe.diagnostics=qe}}import{existsSync as ou,readFileSync as a0}from"node:fs";import{join as au}from"node:path";function D(i){if(i){let Re=au(process.cwd(),i);if(ou(Re))return jr(i);return console.error(`Invalid entry point: ${Re}. Pass a valid --entry (or "entry" option), or unset it and`),console.error('set the "svelte" field in your package.json instead.'),null}let Ie=au(process.cwd(),"package.json");if(!ou(Ie))return console.error("Could not locate a package.json file."),console.error(`Specify an entry point with --entry (or the "entry" option) instead.
|
|
219
|
+
`),null;try{let Re=js(JSON.parse(a0(Ie,"utf-8")));if(Re.svelte?.trim())return jr(Re.svelte);return console.error(`Could not determine an entry point.
|
|
220
|
+
`),console.error(`Specify an entry point to your Svelte code in the "svelte" field of your package.json, or pass --entry (or the "entry" option).
|
|
221
|
+
`),null}catch(Re){throw console.error("Error reading package.json:",Re),Re}}var zo=!1;function I(i){zo=i}function cn(i){if(!zo)console.error(i)}function cu(i){if(!zo)console.error(i)}import{lstatSync as c0}from"node:fs";import{resolve as ii}from"node:path";async function lu(i,Ie,Re=!1,Le,Oe){let $e=c0(i).isFile(),Me=$e?ii(i):null,Fe=ni(i,Ie,Re),{rootDir:je,exports:qe,allComponentEntries:We,resolveComponentFilePath:Ge}=Fe,ze;if(Le==="all"){let{TypeResolver:Ue}=await import("./chunk-a2krprqa.js"),Ke=await Ue.create(je);if(!Ke.ok)throw Error(`sveld: \`typesOptions.inline: "all"\` ${Ke.message}.`);ze=Ke.resolver}let Xe=Re&&$e?await zr(ii(i)):[],Qe=Object.entries(qe),Ze=ti(We,Ge),nt=new Map,at=new Map;await tr();let pt=new Map,tt={onParseError:(Ue)=>pt.set(Ue.filePath,Ue)},lt=new Map,ct=new Map,Nt=async(Ue)=>{if(Le!=="local"&&Le!=="all")return;for(let Ye of Ue.values()){lt.delete(Ye.filePath);for(let rt of ct.values())rt.delete(Ye.filePath)}let Ke=new Map;if(Le==="all"&&ze)ze.forgetOverlayFiles(Array.from(Ue.values(),(Ye)=>$o(Ge(Ye.filePath),Ye.moduleName))),Ke=Ys(Ue,Ge);let Je;try{if(ze&&Ke.size>0)Je=await ze.openBareTypeSession(Ke);let Ye=await Qs(Ue,Ge,Oe,Je);for(let[rt,it]of Ye){lt.set(rt,it);for(let st of it.dependencies){let et=ct.get(st);if(!et)et=new Set,ct.set(st,et);et.add(rt)}}}finally{if(Je)await Je.dispose()}},Et=()=>({exports:qe,entryExports:Xe,components:nt,allComponentsForTypes:at,errors:Array.from(pt.values()),diagnostics:Es(Array.from(at.values()).flatMap((Ue)=>Ue.diagnostics??[])),inlinedTypesByFilePath:Le==="local"||Le==="all"?lt:void 0});{let Ue=Ko([Qe,We],Ge),Ke=await ri(Ue);for(let Je of Qe){let Ye=Un(Je,Qe,Ke,Ge,tt);if(Ye)nt.set(Ye.moduleName,Ye)}for(let Je of We){let Ye=Un(Je,We,Ke,Ge,tt);if(Ye)at.set(Ye.filePath,Ye)}await Nt(at),si(Array.from(pt.values()))}let vt=Vr(at,Ge),Be=(Ue,Ke,Je,Ye,rt)=>{let it=new Set;for(let st of Je){let et=Ge(st[1].source);if(!Ye.has(et))continue;let ot=Un(st,Je,rt,Ge,tt);if(ot)Ue.set(Ke(ot),ot),it.add(et);else for(let[ut,mt]of Ue)if(Ge(mt.filePath)===et)Ue.delete(ut)}return it};return{get result(){return Promise.resolve(Et())},update:async(Ue)=>{let Ke=Ue.map((gt)=>ii(gt));if($s(),Ke.length===0)return{result:Et(),reparsed:[]};let Je=new Set;for(let gt of Ke){let Ct=ct.get(gt);if(Ct)for(let $t of Ct)Je.add($t)}let Ye=Me!==null&&Ke.includes(Me),rt=[];if(Ye){let gt=ni(i,Ie,Re),Ct=new Set(Object.keys(qe)),$t=new Set(Object.keys(gt.exports));for(let Wt of Ct)if(!$t.has(Wt))nt.delete(Wt);for(let Wt of $t)if(!Ct.has(Wt))rt.push(gt.resolveComponentFilePath(gt.exports[Wt].source));if(qe=gt.exports,We=gt.allComponentEntries,Ge=gt.resolveComponentFilePath,Qe=Object.entries(qe),Ze=ti(We,Ge),Re&&$e)Xe=await zr(ii(i))}if(Ie)Ho(je,qe,We,Ge,Ze);let it=Ke.filter((gt)=>wn.test(gt)||vt.has(gt));if(it.length===0&&rt.length===0){if(Je.size>0){let gt=new Map;for(let[Ct,$t]of at)if(Je.has($t.filePath))gt.set(Ct,$t);await Nt(gt)}return{result:Et(),reparsed:[]}}let st=Os([...it,...rt],vt);for(let[gt,Ct]of pt)if(st.has(Ge(Ct.filePath)))pt.delete(gt);let et=await ri(st),ot=new Set;for(let gt of Be(nt,(Ct)=>Ct.moduleName,Qe,st,et))ot.add(gt);for(let gt of Be(at,(Ct)=>Ct.filePath,We,st,et))ot.add(gt);vt=Vr(at,Ge);let ut=new Map;for(let[gt,Ct]of at)if(ot.has(Ge(Ct.filePath))||Je.has(Ct.filePath))ut.set(gt,Ct);await Nt(ut);for(let gt of lt.keys())if(!at.has(gt))lt.delete(gt);let mt=Et();return si(mt.errors),{result:mt,reparsed:Array.from(ot)}}}}import T0 from"node:path";import{mkdir as l0,readFile as p0,writeFile as u0}from"node:fs/promises";import{parse as d0}from"node:path";class Jt{dryRun;ensuredDirs=new Set;constructor(i){this.dryRun=i?.dryRun===!0}async write(i,Ie){if(this.dryRun)return console.log(`would write "${e(i)}"`),!0;try{if(await p0(i,"utf-8")===Ie)return!1}catch{}let Re=d0(i).dir;if(!this.ensuredDirs.has(Re))await l0(Re,{recursive:!0}),this.ensuredDirs.add(Re);return await u0(i,Ie),!0}}var f0=/^=>\s*/;function h0(i){let Ie=i.trim();if(!Ie.startsWith("("))return{parameters:[],returnTypeText:Ie||"any"};let Re=0,Le=-1;for(let Fe=0;Fe<Ie.length;Fe++)if(Ie[Fe]==="(")Re++;else if(Ie[Fe]===")"){if(Re--,Re===0){Le=Fe;break}}if(Le===-1)return{parameters:[],returnTypeText:"any"};let Oe=Ie.slice(1,Le).trim(),$e=Ie.slice(Le+1).trim().replace(f0,"");return{parameters:Oe===""?[]:kn(Oe).map((Fe)=>{let je=Fe.trim(),qe=je.startsWith("..."),We=qe?je.slice(3):je,Ge=We.indexOf(":"),ze=(Ge===-1?We:We.slice(0,Ge)).trim(),Xe=Ge===-1?void 0:We.slice(Ge+1).trim(),Qe=ze.endsWith("?"),Ze={name:Qe?ze.slice(0,-1):ze};if(Xe)Ze.type={text:Xe};if(Qe)Ze.optional=!0;if(qe)Ze.rest=!0;return Ze}),returnTypeText:$e||"any"}}function m0(i){if(i.params!==void 0||i.returnType!==void 0)return{parameters:(i.params??[]).map((Re)=>{let Le={name:Re.name};if(Re.type)Le.type={text:Re.type};if(Re.optional)Le.optional=!0;return Le}),returnTypeText:i.returnType??"any"};return i.type?h0(i.type):{parameters:[],returnTypeText:"any"}}function y0(i){return i.map((Ie)=>{if(Ie.isFunctionDeclaration){let{parameters:Le,returnTypeText:Oe}=m0(Ie),$e={kind:"method",name:Ie.name,static:!1};if(Le.length>0)$e.parameters=Le;if($e.return={type:{text:Oe}},Ie.description)$e.description=Ie.description;if(Ie.deprecated!==void 0)$e.deprecated=Ie.deprecated;return $e}let Re={kind:"field",name:Ie.name};if(Ie.type)Re.type={text:Ie.type};if(Ie.value!==void 0)Re.default=Ie.value;if(Ie.description)Re.description=Ie.description;if(Ie.deprecated!==void 0)Re.deprecated=Ie.deprecated;if(Ie.kind==="const")Re.readonly=!0;return Re})}function g0(i){let Ie=i.customElement?.props,Re=new Map,Le=[];for(let Oe of i.props){if(Oe.isFunctionDeclaration)continue;let $e=Ie?.[Oe.name];if($e?.attribute===!1)continue;let Me=$e?.attribute||Oe.name.toLowerCase(),Fe=Re.get(Me);if(Fe!==void 0){console.warn(`sveld: props "${Fe}" and "${Oe.name}" of component "${i.moduleName}" both map to the custom-element attribute "${Me}"; only "${Fe}" is included.`);continue}Re.set(Me,Oe.name);let qe=$e?.type==="Array"||$e?.type==="Object"?[Oe.description,"Serialized to/from JSON for the attribute."].filter(Boolean).join(" "):Oe.description,We={name:Me,fieldName:Oe.name};if(Oe.type)We.type={text:Oe.type};if(Oe.value!==void 0)We.default=Oe.value;if(qe)We.description=qe;if($e?.reflect)We.reflects=!0;Le.push(We)}return Le}function x0(i){if(!i||i.length===0)return;return i.map((Ie)=>{let Re={name:Ie.name};if(Ie.description)Re.description=Ie.description;return Re})}function b0(i){if(!i||i.length===0)return;return i.map((Ie)=>{let Re={name:Ie.name};if(Ie.type)Re.type={text:Ie.type};if(Ie.default!==void 0)Re.default=Ie.default;if(Ie.description)Re.description=Ie.description;return Re})}function E0(i){return i.filter((Ie)=>Ie.type==="dispatched").map((Ie)=>{let Re={name:Ie.name,type:{text:`CustomEvent<${Ie.detail??"unknown"}>`}};if(Ie.description)Re.description=Ie.description;if(Ie.deprecated!==void 0)Re.deprecated=Ie.deprecated;return Re})}function C0(i){return i.map((Ie)=>{let Re={name:Ie.default?"":Ie.name??""};if(Ie.description)Re.description=Ie.description;if(Ie.deprecated!==void 0)Re.deprecated=Ie.deprecated;return Re})}function v0(i){let Ie=x0(i.cssParts),Re=b0(i.cssProperties),Le=y0(i.props),Oe=g0(i),$e=E0(i.events),Me=C0(i.slots),Fe=i.moduleName,je=i.componentComment?{kind:"class",name:Fe,description:i.componentComment,members:Le,attributes:Oe,events:$e,slots:Me}:{kind:"class",name:Fe,members:Le,attributes:Oe,events:$e,slots:Me};if(Ie)je.cssParts=Ie;if(Re)je.cssProperties=Re;if(i.customElementTag)je.tagName=i.customElementTag,je.customElement=!0;return je}function S0(i,Ie){let Re=[{kind:"js",name:i.moduleName,declaration:{name:i.moduleName,module:Ie}}];if(i.customElementTag)Re.push({kind:"custom-element-definition",name:i.customElementTag,declaration:{name:i.moduleName,module:Ie}});return Re}function pu(i,Ie={}){let Re=o(i),Le=Ie.resolveModulePath??(($e)=>$e.filePath);return{schemaVersion:"1.0.0",modules:Re.components.map(($e)=>{let Me=Le($e);return{kind:"javascript-module",path:Me,declarations:[v0($e)],exports:S0($e,Me)}})}}function Xo(i,Ie){let Re=pu(i,{resolveModulePath:(Le)=>As(Le.filePath,Ie.inputDir)});return Qn(Re)}async function Jo(i,Ie){let Re=Xo(i,Ie),Le=T0.join(process.cwd(),Ie.outFile),$e=await new Jt({dryRun:Ie.dryRun}).write(Le,Re);if(!Ie.dryRun)cn(`${$e?"created":"unchanged"} "${Ie.outFile}".`)}import Qo from"node:path";function uu(i){let Ie=new Map;for(let[Le,Oe]of Object.entries(i)){let $e=Ie.get(Oe.source)||[];$e.push({id:Le,exportee:Oe}),Ie.set(Oe.source,$e)}let Re=[];for(let[Le,Oe]of Ie){let $e=wn.test(Le),Me=Oe.some(({id:ze,exportee:Xe})=>ze!=="default"&&Xe.default),Fe=Oe.some(({exportee:ze})=>!ze.default),je=$e&&Me&&Fe,qe=[],We=[],Ge=[];for(let{id:ze,exportee:Xe}of Oe){if(ze==="default"){We.push(`export { default } from "${Le}";`);continue}if(Xe.default)if(Xe.mixed)We.push(`export { default as ${ze} } from "${Le}";`),We.push(`export { default } from "${Le}";`);else Ge.push(`default as ${ze}`);else if($e&&!je)Ge.push(`default as ${ze}`);else qe.push(ze)}if(Ge.length>0&&qe.length>0)Re.push(`export { ${[...Ge,...qe].join(", ")} } from "${Le}";`);else{if(qe.length>0)Re.push(`export { ${qe.join(", ")} } from "${Le}";`);if(Ge.length>0)Re.push(`export { ${Ge.join(", ")} } from "${Le}";`)}Re.push(...We)}return Re.join(`
|
|
222
|
+
`)}function du(i){return i.filter((Ie)=>Ie.names.length>0).map((Ie)=>`export type { ${Ie.names.join(", ")} } from "${Ie.source}";`).join(`
|
|
223
|
+
`)}function fu(i){return i.replace(wn,"")}function Yo(i){return i.replace(wn,".svelte.d.ts")}function k0(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)&&"start"in i&&"end"in i}function Xr(i){if(Array.isArray(i))return i.map((Ie)=>Xr(Ie));if(i!==null&&typeof i==="object"){let Ie={};for(let[Re,Le]of Object.entries(i)){if((Re==="source"||Re==="componentCommentSource")&&k0(Le))continue;Ie[Re]=Xr(Le)}return Ie}return i}function Zo(i,Ie){return i.map((Re)=>({...Re,filePath:As(Re.filePath,Ie)}))}function w0(i,Ie,Re){if(!Ie)return`${i.moduleName}.api.json`;if(!Re.has(i.moduleName))Re.add(i.moduleName),console.warn(`Warning: multiple components named "${i.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${fu(i.filePath)}.api.json`}async function A0(i,Ie){let Re=o(i),Le=Zo(Re.components,Ie.inputDir);if(Ie.source===!1)Le=Xr(Le);let Oe=new Map;for(let Me of Le)Oe.set(Me.moduleName,(Oe.get(Me.moduleName)??0)+1);let $e=new Set;await Promise.all(Le.map(async(Me)=>{let Fe=(Oe.get(Me.moduleName)??0)>1,je=w0(Me,Fe,$e),qe=Qo.resolve(Qo.join(Ie.outDir||"",je)),Ge=await new Jt({dryRun:Ie.dryRun}).write(qe,Qn(Me));if(!Ie.dryRun)cn(`${Ge?"created":"unchanged"} "${qe}".`)}))}function ea(i,Ie){let Re=o(i,{entryExports:Ie.entryExports}),Le={...Re,components:Zo(Re.components,Ie.inputDir)};if(Ie.source===!1)Le=Xr(Le);return Qn(Le)}function hu(i,Ie){let Re=o(i,{entryExports:Ie.entryExports}),Le=Zo(Re.components,Ie.inputDir);if(Ie.source===!1)Le=Xr(Le);return`${Le.map((Oe)=>JSON.stringify(Oe)).join(`
|
|
224
|
+
`)}
|
|
225
|
+
`}async function P0(i,Ie){let Re=ea(i,Ie),Le=Qo.join(process.cwd(),Ie.outFile),$e=await new Jt({dryRun:Ie.dryRun}).write(Le,Re);if(!Ie.dryRun)cn(`${$e?"created":"unchanged"} "${Ie.outFile}".`)}async function ta(i,Ie){if(Ie.outDir)await A0(i,Ie);else await P0(i,Ie)}import fi from"node:path";import{readFileSync as N0}from"node:fs";import{join as _0}from"node:path";function mu(){try{let{name:i,description:Ie}=js(JSON.parse(N0(_0(process.cwd(),"package.json"),"utf-8")));return{name:i,description:Ie}}catch{return{}}}var ra=/`/g,yu=/\s+/g,nn="--",gu=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
|
|
226
|
+
| :- | :- | :- | :- | :- | :- | :- | :- |
|
|
227
|
+
`,oi=`| Slot name | Default | Props | Fallback | Description |
|
|
228
|
+
| :- | :- | :- | :- | :- |
|
|
229
|
+
`,ai=`| Event name | Type | Detail | Description |
|
|
230
|
+
| :- | :- | :- | :- |
|
|
231
|
+
`,sa=`| Name | Kind | Type | Description |
|
|
232
|
+
| :- | :- | :- | :- |
|
|
233
|
+
`,xu=`| Part name | Description |
|
|
234
|
+
| :- | :- |
|
|
235
|
+
`,bu=`| Property name | Type | Default value | Description |
|
|
236
|
+
| :- | :- | :- | :- |
|
|
237
|
+
`,Yr=/\|/g,D0=/</g,I0=/>/g,vr=/\n/g,R0=/^[A-Za-z_$][\w$]*$/,L0=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function na(i){return i.replace(L0,(Ie,Re,Le)=>`[${Le===void 0?Re:Le.trim()}](${Re})`)}function bn(i){if(i===void 0)return nn;return`<code>${i.replace(Yr,"|")}</code>`}function ci(i){if(!i.reExport)return bn(i.type);let{from:Ie,imported:Re}=i.reExport,Le=Re==="*"?"":R0.test(Re)?`.${Re}`:`[${JSON.stringify(Re)}]`;return bn(`typeof import(${JSON.stringify(Ie)})${Le}`)}function Jr(i){return i.replace(D0,"<").replace(I0,">")}function Qr(i){if(i===void 0)return nn;return`<code>${i.replace(ra,"\\`").replace(Yr,"|")}</code>`}function Nn(i,Ie){if(Ie===void 0)return i;let Re=typeof Ie==="string"&&Ie.trim().length>0?`: ${Jr(Ie).replace(vr," ").replace(Yr,"|")}`:"";return`<s>${i}</s><br />**Deprecated**${Re}`}function li(i){if(i===void 0||i.trim().length===0)return nn;return Jr(na(i)).replace(Yr,"|").replace(vr,"<br />")}function pi(i){if(i===void 0||i==="{}")return nn;return bn(Ks(i).replace(vr," "))}function ui(i){if(i===void 0)return nn;return bn(Jr(i).replace(vr,"<br />"))}function $n(i,Ie){let Re=[];if(i!==void 0&&i.trim().length>0)Re.push(Jr(na(i)));for(let{name:Le,body:Oe}of Ie??[]){let $e=Oe?.trim();Re.push($e?`@${Le} ${Jr(na($e))}`:`@${Le}`)}if(Re.length===0)return nn;return Re.join(`
|
|
238
|
+
`).replace(Yr,"|").replace(vr,"<br />")}function di(i){if(i===void 0)return nn;return bn(i.replace(vr," "))}var O0=/[^\w\- ]+/g,M0=/\s+/g;function $0(i,Ie){let Re=i.toLowerCase().replace(ra,"").replace(O0,"").replace(M0,"-"),Le=Ie.get(Re)??0;return Ie.set(Re,Le+1),Le===0?Re:`${Re}-${Le}`}class Sr{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
|
|
239
|
+
|
|
240
|
+
`),this}append(i,Ie){switch(i){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let Re=Number(i.slice(-1));if(this.sourceParts.push(`${"#".repeat(Re)} ${Ie}`),this.hasToC&&i==="h2")this.toc.push({indent:0,raw:Ie??""});break}case"quote":this.sourceParts.push(`> ${Ie}`);break;case"p":this.sourceParts.push(Ie??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(Ie??"");break}if(i!=="raw")this.appendLineBreaks();return this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let i=this.sourceParts.join("");if(!this.hasToC)return i;let Ie="<!-- __TOC__ -->",Re=i.indexOf(Ie);if(Re===-1)return i;let Le=new Map,Oe=this.toc.map(({indent:$e,raw:Me})=>`${" ".repeat($e)}- [${Me}](#${$0(Me,Le)})`).join(`
|
|
241
|
+
`);return i.slice(0,Re)+Oe+i.slice(Re+Ie.length)}}var B0=`| Name | Type | Default | Required | Description |
|
|
242
|
+
| :- | :- | :- | :- | :- |
|
|
243
|
+
`,F0=/[.!?](?:\s|$)/,j0=/\r?\n[ \t]*\r?\n/,V0=/\s+/g;function Eu(i,Ie){if(!i)return Ie;let Re=i.trim().split(j0)[0]?.replace(V0," ").trim();if(!Re)return Ie;let Le=F0.exec(Re);return Le?Re.slice(0,Le.index+1):Re}function ia(i,Ie,Re){if(Re.length===0)return;i.append("h3",Ie),i.append("raw",B0);for(let Le of Re)i.append("raw",`| ${Nn(Le.name,Le.deprecated)} | ${ci(Le)} | ${Qr(Le.value)} | ${Le.isRequired?"Yes":"No"} | ${$n(Le.description,Le.tags)} |
|
|
244
|
+
`);i.append("raw",`
|
|
245
|
+
`)}function W0(i,Ie){if(Ie.length===0)return;i.append("h3","Events"),i.append("raw",ai);for(let Re of Ie)i.append("raw",`| ${Nn(Re.name,Re.deprecated)} | ${Re.type} | ${Re.type==="dispatched"?di(Re.detail):nn} | ${$n(Re.description,Re.tags)} |
|
|
246
|
+
`);i.append("raw",`
|
|
247
|
+
`)}function q0(i,Ie,Re){if(Re.length===0)return;i.append("h3",Ie),i.append("raw",oi);for(let Le of Re)i.append("raw",`| ${Nn(Le.default?nn:Le.name??nn,Le.deprecated)} | ${Le.default?"Yes":"No"} | ${pi(Le.slot_props)} | ${ui(Le.fallback)} | ${$n(Le.description,Le.tags)} |
|
|
248
|
+
`);i.append("raw",`
|
|
249
|
+
`)}function G0(i,Ie){if(Ie.typedefs.length===0)return;i.append("h3","Typedefs"),i.append("raw",`\`\`\`ts
|
|
250
|
+
${br({typedefs:Ie.typedefs})}
|
|
251
|
+
\`\`\`
|
|
252
|
+
|
|
253
|
+
`)}function U0(i,Ie){if(i.append("h2",Ie.moduleName),Ie.generics)i.append("p",`Type parameters: ${bn(`<${Ie.generics[1]}>`)}`);if(Ie.componentComment?.trim())i.append("p",Ie.componentComment.trim());ia(i,"Props",Ie.props),ia(i,"Bindings",Ie.props.filter((Re)=>Re.reactive)),W0(i,Ie.events),q0(i,Ie.syntaxMode==="runes"?"Snippets":"Slots",Ie.slots),G0(i,Ie),ia(i,"Module exports",Ie.moduleExports)}function H0(i,Ie,Re,Le){let Oe=new Sr,$e=Le.linkBase??"";if(Oe.append("h1",Ie),Re)Oe.append("quote",Re);Oe.append("h2","Components");for(let Me of i)Oe.append("raw",`- [${Me.moduleName}](${$e}/${Me.moduleName}): ${Eu(Me.componentComment,"Component")}
|
|
254
|
+
`);if(Oe.append("raw",`
|
|
255
|
+
`),Le.entryExports&&Le.entryExports.length>0){Oe.append("h2","Exports");for(let Me of Le.entryExports)Oe.append("raw",`- \`${Me.name}\`: ${Eu(Me.description,Me.kind)}
|
|
256
|
+
`);Oe.append("raw",`
|
|
257
|
+
`)}return Oe.end()}function K0(i,Ie,Re){let Le=new Sr;if(Le.append("h1",Ie),Re)Le.append("quote",Re);for(let Oe of i)U0(Le,Oe);return Le.end()}function z0(i,Ie){let Re=o(i,{entryExports:Ie.entryExports}),Le=mu(),Oe=Ie.title??Le.name??"Components",$e=Ie.summary??Le.description;return{llmsTxt:H0(Re.components,Oe,$e,Ie),llmsFullTxt:K0(Re.components,Oe,$e)}}async function oa(i,Ie){let{llmsTxt:Re,llmsFullTxt:Le}=z0(i,Ie),Oe=new Jt({dryRun:Ie.dryRun}),$e=e(fi.join(Ie.outDir??"","llms.txt")),Me=e(fi.join(Ie.outDir??"","llms-full.txt")),[Fe,je]=await Promise.all([Oe.write(fi.join(process.cwd(),$e),Re),Oe.write(fi.join(process.cwd(),Me),Le)]);if(!Ie.dryRun)cn(`${Fe?"created":"unchanged"} "${$e}".`),cn(`${je?"created":"unchanged"} "${Me}".`)}import{join as ca,resolve as wu}from"node:path";function Cu(i,Ie,Re){if(i.append("h1","Component Index"),i.append("h2","Components").tableOfContents(),i.append("divider"),Re&&Re.length>0)Su(i,Re);let Le=o(Ie);for(let Oe of Le.components)ku(i,Oe)}function vu(i,Ie,Re){i.append("h1","Component Index"),i.append("h2","Components");for(let Le of Ie)i.append("raw",`- [${Le.moduleName}](./${Le.moduleName}.md)
|
|
258
|
+
`);if(i.append("raw",`
|
|
259
|
+
`),i.append("divider"),Re&&Re.length>0)Su(i,Re)}function Su(i,Ie){i.append("h2","Exports"),i.append("raw",sa);for(let Re of Ie){let Le=(Re.type??Re.value)?.replace(yu," ").trim();i.append("raw",`| ${Nn(Re.name,Re.deprecated)} | ${`<code>${Re.kind}</code>`} | ${bn(Le)} | ${li(Re.description)} |
|
|
260
|
+
`)}i.append("raw",`
|
|
261
|
+
`),i.append("divider")}function X0(i){return i.kind==="const"||i.isFunctionDeclaration}function J0(i,Ie){i.append("h3","Module exports"),i.append("raw",sa);for(let Re of Ie)i.append("raw",`| ${Nn(Re.name,Re.deprecated)} | ${`<code>${Re.kind}</code>`} | ${ci(Re)} | ${$n(Re.description,Re.tags)} |
|
|
262
|
+
`);i.append("raw",`
|
|
263
|
+
`)}function aa(i,Ie,Re,Le){if(Ie.length>0)Re(),i.append("raw",`
|
|
264
|
+
`);else i.append("p",Le??"None.")}function Tu(i,Ie){ku(i,Ie)}function ku(i,Ie){if(i.append("h2",`\`${Ie.moduleName}\``),Ie.generics)i.append("p",`**Type parameters:** ${bn(`<${Ie.generics[1]}>`)}`);if(Ie.typedefs.length>0)i.append("h3","Types").append("raw",`\`\`\`ts
|
|
265
|
+
${br({typedefs:Ie.typedefs})}
|
|
266
|
+
\`\`\`
|
|
267
|
+
|
|
268
|
+
`);if(i.append("h3","Props"),aa(i,Ie.props,()=>{i.append("raw",gu);let Re=(Oe)=>Oe.reactive?0:Oe.constant?2:1,Le=Ie.props.map((Oe,$e)=>({prop:Oe,index:$e})).sort((Oe,$e)=>Re(Oe.prop)-Re($e.prop)||Oe.index-$e.index).map(({prop:Oe})=>Oe);for(let Oe of Le){let $e=X0(Oe)?"accessor":Oe.kind;i.append("raw",`| ${Nn(Oe.name,Oe.deprecated)} | ${Oe.isRequired?"Yes":"No"} | ${`<code>${$e}</code>`} | ${Oe.reactive?"Yes":"No"} | ${Oe.binding??"--"} | ${bn(Oe.type)} | ${Qr(Oe.value)} | ${$n(Oe.description,Oe.tags)} |
|
|
269
|
+
`)}}),Ie.moduleExports.length>0)J0(i,Ie.moduleExports);if(i.append("h3","Slots"),aa(i,Ie.slots,()=>{i.append("raw",oi);for(let Re of Ie.slots)i.append("raw",`| ${Nn(Re.default?nn:Re.name??nn,Re.deprecated)} | ${Re.default?"Yes":"No"} | ${pi(Re.slot_props)} | ${ui(Re.fallback)} | ${$n(Re.description,Re.tags)} |
|
|
270
|
+
`)}),i.append("h3","Events"),aa(i,Ie.events,()=>{i.append("raw",ai);for(let Re of Ie.events)i.append("raw",`| ${Nn(Re.name,Re.deprecated)} | ${Re.type} | ${Re.type==="dispatched"?di(Re.detail):nn} | ${$n(Re.description,Re.tags)} |
|
|
271
|
+
`)}),Ie.cssParts&&Ie.cssParts.length>0){i.append("h3","CSS Parts"),i.append("raw",xu);for(let Re of Ie.cssParts)i.append("raw",`| ${Re.name} | ${li(Re.description)} |
|
|
272
|
+
`);i.append("raw",`
|
|
273
|
+
`)}if(Ie.cssProperties&&Ie.cssProperties.length>0){i.append("h3","CSS Custom Properties"),i.append("raw",bu);for(let Re of Ie.cssProperties)i.append("raw",`| ${Re.name} | ${bn(Re.type)} | ${Qr(Re.default)} | ${li(Re.description)} |
|
|
274
|
+
`);i.append("raw",`
|
|
275
|
+
`)}}class hi extends Jt{onAppend;markdownBase;constructor(i){super();this.onAppend=i.onAppend,this.markdownBase=new Sr}get source(){return this.markdownBase.source}get hasToC(){return this.markdownBase.hasToC}get toc(){return this.markdownBase.toc}appendLineBreaks(){return this.markdownBase.appendLineBreaks(),this}append(i,Ie){return this.markdownBase.append(i,Ie),this.onAppend?.call(this,i,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function la(i,Ie){return new hi({onAppend:(Re,Le)=>{i.onAppend?.call(null,Re,Le,Ie)}})}async function Y0(i,Ie){let Re=Ie.outDir,Le=o(i,{entryExports:Ie.entryExports}),Oe=new Jt({dryRun:Ie.dryRun}),$e=la(Ie,i);vu($e,Le.components,Ie.entryExports);let Me=wu(ca(Re,"README.md")),Fe=await Oe.write(Me,$e.end());if(!Ie.dryRun)cn(`${Fe?"created":"unchanged"} "${Me}".`);await Promise.all(Le.components.map(async(je)=>{let qe=la(Ie,i);Tu(qe,je);let We=wu(ca(Re,`${je.moduleName}.md`)),Ge=await Oe.write(We,qe.end());if(!Ie.dryRun)cn(`${Ge?"created":"unchanged"} "${We}".`)}))}function pa(i,Ie){let Re=la(Ie,i);return Cu(Re,i,Ie.entryExports),Re.end()}async function ua(i,Ie){if(Ie.outDir){if(Ie.write!==!1)await Y0(i,Ie);return}let Re=Ie?.write!==!1,Le=pa(i,Ie);if(Re){let Oe=ca(process.cwd(),Ie.outFile),$e=await new Jt({dryRun:Ie.dryRun}).write(Oe,Le);if(!Ie.dryRun)cn(`${$e?"created":"unchanged"} "${Ie.outFile}".`)}return Le}import{join as Au}from"node:path";function Q0(i){let Ie=new Set;for(let Re of i)if(Re.extends)Ie.add(Re.extends.interface);return Ie}function Z0(i){return Xs(i,Po,!0).props}var eb={props:!0,exports:!0,typedefs:!1,contexts:!1};function tb(i){if(!i)return;return Xs(i,eb,!1)}function nb(i,Ie,Re){let Le=tb(Ie.indexTypes);if(!Le)return[];let Oe=No(Ie),$e=Ie.format==="component",Me=new Map,Fe=new Set,je=[];for(let[,qe]of Object.entries(Ie.exports)){if(!qe.default||!wn.test(qe.source))continue;let We=e(qe.source);if(Fe.has(We))continue;Fe.add(We);let Ge=i.components.find((nt)=>nt.filePath===We);if(!Ge)continue;let ze=Mn(Ge.moduleName,Ie.typeNames),Xe=Re.has(ze),Qe=[];if(Le.props&&(Oe.props||Xe))Qe.push(ze);if(Le.exports&&$e&&Oe.exports)Qe.push(Zn(Ge.moduleName,Ie.typeNames));if(Le.typedefs&&Oe.typedefs)for(let nt of Ge.typedefs)Qe.push(nt.name);if(Le.contexts&&Oe.contexts)for(let nt of Ge.contexts??[])Qe.push(nt.typeName);let Ze=[];for(let nt of Qe){let at=Me.get(nt);if(at!==void 0){cu(`sveld: index.d.ts skips duplicate type export "${nt}" from "${qe.source}" (already exported from "${at}").`);continue}Me.set(nt,qe.source),Ze.push(nt)}if(Ze.length>0)je.push({source:qe.source,names:Ze})}return je}async function Pu(i,Ie,Re){if(!i)return Ie;try{let Le=await i(Ie,Re);if(typeof Le!=="string")throw TypeError(`must return a string, got ${typeof Le}`);return Le}catch(Le){let Oe=Le instanceof Error?Le.message:String(Le);throw Error(`sveld: typesOptions.transform failed for "${Re.filePath}": ${Oe}`,{cause:Le})}}async function da(i,Ie){let Re=Au(process.cwd(),Ie.outDir,"index.d.ts"),Le=new Jt({dryRun:Ie.dryRun}),Oe=o(i),$e=Q0(Oe.components),Me=du(nb(Oe,Ie,$e)),Fe=Ie.preamble+[uu(Ie.exports),Me].filter((Ge)=>Ge!=="").join(`
|
|
276
|
+
|
|
277
|
+
`),je=_o(Ie),qe=Oe.components.map(async(Ge)=>{let ze=Yo(Au(Ie.outDir,Ge.filePath)),Xe=e(Yo(Ge.filePath)),Qe=Ie.resolvedPathByFilePath?.get(Ge.filePath),Ze=Ie.inlinedTypesByFilePath?.get(Ge.filePath),nt=$e.has(Mn(Ge.moduleName,Ie.typeNames))&&!Z0(je.exportTypes)?{...je,forceExportProps:!0}:je,at=Ze?{...nt,inlined:Ze}:nt,pt=(Ze?.declarations.length??0)>0,tt=Pp(at),lt=!pt&&Qe?Ie.cache?.getGeneratedText(Qe,tt):void 0;if(lt===void 0){if(lt=Do(Ge,at),!pt&&Qe)Ie.cache?.setGeneratedText(Qe,tt,lt)}let ct=await Pu(Ie.transform,lt,{kind:"component",component:Ge,filePath:Xe});await Le.write(ze,ct)}),We=(async()=>{let Ge=await Pu(Ie.transform,Fe,{kind:"index",filePath:"index.d.ts"});await Le.write(Re,`${Ge}
|
|
278
|
+
`)})();if(await Promise.all([...qe,We]),!Ie.dryRun)cn("created TypeScript definitions.")}k({name:"json",componentSet:"exported",write:ta});k({name:"markdown",componentSet:"exported",write:ua});k({name:"types",componentSet:"all",write:da});k({name:"custom-elements",componentSet:"exported",write:Jo});k({name:"llms",componentSet:"exported",write:oa});var Nu='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',ib=50;function ob(i){let Ie=Promise.resolve();return()=>{Ie=Ie.then(i,i)}}function Ae(i){let Ie=i?.watch===!0,Re,Le,Oe=i??{},$e,Me=null,Fe,je=new Set,We=ob(async()=>{if(Me==null||Le==null||je.size===0)return;let ze=Array.from(je);je.clear();try{let{result:Xe}=await Me.update(ze);await w(Xe,Oe,Le)}catch(Xe){console.error("sveld: failed to regenerate types in watch mode:",Xe)}}),Ge=(ze)=>{if(!Ie||Me==null||!Fl.test(ze))return;je.add(ze),clearTimeout(Fe),Fe=setTimeout(We,ib)};return{name:"vite-plugin-sveld",apply:Ie?void 0:"build",enforce:"post",configResolved(ze){$e=ze.root},async buildStart(){if(i?.config){let ze=$e??process.cwd(),Xe=typeof i.config==="string"?await yo(rb(i.config)?i.config:sb(ze,i.config)):await _(ze);Oe=E(Xe,i)}if(N(Oe),I(Oe.quiet===!0),Le=D(Oe.entry),Ie&&Le!=null)try{Me=await lu(Le,Oe.glob===!0,Oe.documentExports===!0,Oe.typesOptions?.inline,Oe.typesOptions?.typeNames),await w(await Me.result,Oe,Le)}catch(ze){console.error("sveld: failed to generate initial types in watch mode:",ze)}},async generateBundle(){if(Ie)return;if(Le==null)this.error(Nu);Re=await S(Le,Oe.glob===!0,b(Oe))},async writeBundle(){if(Ie)return;if(Le==null)this.error(Nu);await w(Re,Oe,Le),Re.cache?.save()},handleHotUpdate(ze){Ge(ze.file)},watchChange(ze){Ge(ze)}}}function Zr(i,Ie,Re){let Le=X(i);if(!Le)throw Error(`sveld: built-in writer "${i}" is not registered.`);return Le.write(Ie,Re)}async function w(i,Ie,Re){let Le=_u(Re),Oe=Ie?.dryRun===!0;if(Ie?.types!==!1)await Zr("types",i.allComponentsForTypes,{outDir:"types",preamble:"",...Ie?.typesOptions,exports:i.exports,inputDir:Le,dryRun:Oe,cache:i.cache,resolvedPathByFilePath:i.resolvedPathByFilePath,inlinedTypesByFilePath:i.inlinedTypesByFilePath});if(Ie?.json)await Zr("json",i.components,{outFile:"COMPONENT_API.json",...Ie?.jsonOptions,input:Re,inputDir:Le,entryExports:i.entryExports,dryRun:Oe});if(Ie?.markdown)await Zr("markdown",i.components,{outFile:"COMPONENT_INDEX.md",...Ie?.markdownOptions,entryExports:i.entryExports,dryRun:Oe});if(Ie?.customElements)await Zr("custom-elements",i.components,{outFile:"custom-elements.json",...Ie?.customElementsOptions,inputDir:Le,dryRun:Oe});if(Ie?.llms)await Zr("llms",i.components,{...Ie?.llmsOptions,entryExports:i.entryExports,dryRun:Oe});let $e=Object.entries(Ie?.additionalWriters??{}).map(([Me,Fe])=>{let je=X(Me);if(!je){console.warn(`sveld: no writer registered with name "${Me}"; skipping.`);return}let qe=je.componentSet==="all"?i.allComponentsForTypes:i.components,We={...Fe,dryRun:Oe};return ab(Me,je,qe,We)});await Promise.all($e)}async function ab(i,Ie,Re,Le){try{return await Ie.write(Re,Le)}catch(Oe){let $e=Oe instanceof Error?Oe.message:String(Oe);throw Error(`sveld: writer "${i}" failed: ${$e}`,{cause:Oe})}}async function Du(i,Ie,Re){let Le=_u(Re);if(Ie?.json){let Oe={...Ie?.jsonOptions,inputDir:Le,entryExports:i.entryExports},$e=Ie.stdout==="ndjson"?hu(i.components,Oe):ea(i.components,Oe);process.stdout.write($e);return}if(Ie?.markdown){let Oe=pa(i.components,{...Ie?.markdownOptions,entryExports:i.entryExports});process.stdout.write(Oe);return}if(Ie?.customElements){let Oe=Xo(i.components,{...Ie?.customElementsOptions,inputDir:Le});process.stdout.write(Oe)}}import{appendFileSync as ub,existsSync as db}from"node:fs";import{join as fb}from"node:path";var Ru=/%/g,Lu=/\r/g,Ou=/\n/g,cb=/,/g,lb=/:/g,Mu=/\|/g;function Iu(i){return i.replace(Ru,"%25").replace(Lu,"%0D").replace(Ou,"%0A").replace(cb,"%2C").replace(lb,"%3A")}function pb(i){return i.replace(Ru,"%25").replace(Lu,"%0D").replace(Ou,"%0A")}function $u(i,Ie,Re,Le,Oe,$e){let Me=i==="error"?"error":"warning",Fe=[];if(Le!==void 0)Fe.push(`file=${Iu(Le)}`);if(Oe!==void 0)Fe.push(`line=${Oe}`);if($e!==void 0)Fe.push(`col=${$e}`);return Fe.push(`title=${Iu(Ie)}`),`::${Me} ${Fe.join(",")}::${pb(Re)}`}function Bu(i){return i.filter((Ie)=>!Ie.ignored).map((Ie)=>$u(Ie.severity,`sveld ${Ie.code}`,Ie.message,Ie.component,Ie.source?.start.line,Ie.source?.start.column)).join(`
|
|
279
|
+
`)}function Fu(i){let Ie=i.filter((Le)=>!Le.ignored);if(Ie.length===0)return"";return["### sveld diagnostics","","| Severity | Code | Location | Message |","| --- | --- | --- | --- |",...Ie.map((Le)=>{let Oe=Le.source?`${Le.component}:${Le.source.start.line}`:Le.component;return`| ${Le.severity} | ${Le.code} | ${Oe} | ${Le.message.replace(Mu,"\\|")} |`})].join(`
|
|
280
|
+
`)}function ju(i,Ie){return i.changes.filter((Re)=>Is(Re.bump,Ie))}function Vu(i,Ie){return ju(i,Ie).map((Re)=>$u("error","sveld breaking change",Re.message,Re.component==="*"?void 0:Re.component)).join(`
|
|
281
|
+
`)}function Wu(i,Ie){let Re=ju(i,Ie);if(Re.length===0)return"";return["### sveld breaking changes","","| Component | Kind | Message |","| --- | --- | --- |",...Re.map((Oe)=>`| ${Oe.component} | ${Oe.kind} | ${Oe.message.replace(Mu,"\\|")} |`)].join(`
|
|
282
|
+
`)}var fa="src/index.js",jt={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},hb=`Usage: sveld [options]
|
|
283
|
+
|
|
284
|
+
Generate TypeScript definitions and component documentation for a Svelte
|
|
285
|
+
library. With no flags, only TypeScript definitions are generated for the
|
|
286
|
+
entry resolved from package.json#svelte.
|
|
287
|
+
|
|
288
|
+
--entry, --cache, --check, --types-format, --types-export,
|
|
289
|
+
--types-comments, --types-inline, and --types-props-declaration accept
|
|
290
|
+
their value as --flag=value or as a separate --flag value argument.
|
|
291
|
+
|
|
292
|
+
Options:
|
|
293
|
+
--entry=<path> Entry point to uncompiled Svelte source (default: package.json "svelte" field)
|
|
294
|
+
--glob Analyze all *.svelte files instead of the entry barrel
|
|
295
|
+
--types Generate TypeScript definitions (default: true)
|
|
296
|
+
--json Generate component documentation in JSON format
|
|
297
|
+
--markdown Generate component documentation in Markdown format
|
|
298
|
+
--custom-elements Generate a Custom Elements Manifest (custom-elements.json)
|
|
299
|
+
--llms Generate an llms.txt / llms-full.txt pair (https://llmstxt.org)
|
|
300
|
+
--fail-fast Abort the run when a single component fails to parse
|
|
301
|
+
--dry-run Resolve, parse, and print "would write" lines for each output file instead of writing anything (including the parse cache)
|
|
302
|
+
--quiet Suppress progress logs (errors, the diagnostics summary, and the --check report are unaffected)
|
|
303
|
+
--stdout[=json|ndjson] Print the document from exactly one of --json, --markdown, or --custom-elements to stdout and write nothing to disk (rejects --types and --check); --stdout=ndjson prints one JSON object per component per line and requires --json
|
|
304
|
+
--cache[=<path>] Persist parsed output and skip re-parsing unchanged files (on by default, default path: node_modules/.cache/sveld/parse-cache.json; pass --cache=false to disable)
|
|
305
|
+
--resolve-types Expand opaque imported $props() types into JSON (alias: --resolveTypes, deprecated)
|
|
306
|
+
--check-examples[=syntax] Check @example blocks: TS/JS against the TypeScript program, svelte/html markup against sveld's own parser (alias: --checkExamples, deprecated); --check-examples=syntax runs only the markup path and never loads TypeScript
|
|
307
|
+
--report-diagnostics Print unresolved-type diagnostics to stderr
|
|
308
|
+
--strict[=errors|ci|local] Exit with code 4 when diagnostics exist (implies --report-diagnostics); --strict=errors only fails on error-severity diagnostics; --strict=ci expands to {strict:true, reportDiagnostics:true, check:true, checkExamples:true}, --strict=local to {reportDiagnostics:true}
|
|
309
|
+
--types-format=<format> ".d.ts" output format: "class" (default) or "component" (Svelte 5 Component<...>)
|
|
310
|
+
--types-export=<all|none> Sets typesOptions.exportTypes; "all" exports every generated type (default), "none" keeps them all local
|
|
311
|
+
--types-comments=<all|descriptions|none> Sets typesOptions.comments; how much JSDoc lands in the generated .d.ts (default: all)
|
|
312
|
+
--types-inline=<local|all> Sets typesOptions.inline; copies imported types into the .d.ts instead of importing them (default: false; pass --types-inline=false to reset)
|
|
313
|
+
--types-index-types Sets typesOptions.indexTypes; also re-exports generated types from index.d.ts (pass --types-index-types=false to disable)
|
|
314
|
+
--types-props-declaration=<type|interface> Sets typesOptions.propsDeclaration; emits the props type as a type alias (default) or an interface
|
|
315
|
+
--check[=<path>] Diff the parsed API against a committed snapshot; exit 3 on a breaking change (default path: COMPONENT_API.json)
|
|
316
|
+
--check-level=<major|minor|patch> Minimum bump --check fails the run on (default: major)
|
|
317
|
+
--format=<text|json|github> Output format for the --check report and the diagnostics summary (default: text); "github" prints GitHub Actions ::error/::warning lines and appends a GITHUB_STEP_SUMMARY table when that env var is set
|
|
318
|
+
--help Print this help message and exit
|
|
319
|
+
--version Print the installed sveld version and exit
|
|
320
|
+
|
|
321
|
+
Exit codes:
|
|
322
|
+
0 success
|
|
323
|
+
1 usage or configuration error
|
|
324
|
+
2 generation failure
|
|
325
|
+
3 breaking API change detected by --check
|
|
326
|
+
4 diagnostics present under --strict
|
|
327
|
+
`,ha={resolveTypes:"resolve-types",checkExamples:"check-examples"},mb=["help","version","glob","types","json","markdown","quiet","stdout","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","entry","cache","check","check-level","types-format","types-export","types-comments","types-inline","types-index-types","types-props-declaration","format"],yb=[...mb,...Object.keys(ha)],gb=new Set(["glob","types","json","markdown","quiet","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","types-index-types"]),xb=new Set(["entry","cache","check","types-format","types-export","types-comments","types-inline","types-props-declaration"]),bb=new Set(["entry","types-format","types-export","types-comments","types-inline","types-props-declaration"]);function Eb(i){let Ie=Rs(i,yb);return Ie===void 0?void 0:ha[Ie]??Ie}function Cb(i,Ie){let Re=i.indexOf("="),Le=Re===-1?i.slice(2):i.slice(2,Re),Oe=ha[Le]??Le,$e=Re===-1?!0:i.slice(Re+1),Me=!1;if(Re===-1&&xb.has(Oe)){if(Ie!==void 0&&!Ie.startsWith("--"))$e=Ie,Me=!0;else if(bb.has(Oe))return{result:{kind:"usage-error",message:`sveld: --${Oe} requires a value (pass --${Oe}=<value> or --${Oe} <value>).`},consumedNext:!1,flag:Oe}}return{result:vb(Oe,$e,i,Le),consumedNext:Me,flag:Oe}}function vb(i,Ie,Re,Le){switch(i){case"help":return{kind:"help"};case"version":return{kind:"version"};case"glob":case"types":case"json":case"markdown":case"quiet":return{kind:"option",option:{[i]:Ie===!0||Ie==="true"}};case"stdout":if(Ie===!0||Ie==="true")return{kind:"option",option:{stdout:!0}};if(Ie==="false")return{kind:"option",option:{stdout:!1}};return{kind:"option",option:{stdout:Ie}};case"custom-elements":return{kind:"option",option:{customElements:Ie===!0||Ie==="true"}};case"llms":return{kind:"option",option:{llms:Ie===!0||Ie==="true"}};case"strict":if(Ie===!0||Ie==="true")return{kind:"option",option:{strict:!0}};if(Ie==="false")return{kind:"option",option:{strict:!1}};return{kind:"option",option:{strict:Ie}};case"report-diagnostics":return{kind:"option",option:{reportDiagnostics:Ie===!0||Ie==="true"}};case"resolve-types":return{kind:"option",option:{resolveTypes:Ie===!0||Ie==="true"}};case"check-examples":if(Ie===!0||Ie==="true")return{kind:"option",option:{checkExamples:!0}};if(Ie==="false")return{kind:"option",option:{checkExamples:!1}};return{kind:"option",option:{checkExamples:Ie}};case"fail-fast":return{kind:"option",option:{failFast:Ie===!0||Ie==="true"}};case"dry-run":return{kind:"option",option:{dryRun:Ie===!0||Ie==="true"}};case"entry":return typeof Ie==="string"?{kind:"option",option:{entry:Ie}}:{kind:"option",option:{}};case"cache":if(Ie==="false")return{kind:"option",option:{cache:!1}};return{kind:"option",option:{cache:typeof Ie==="string"?Ie:!0}};case"check":if(Ie==="false")return{kind:"option",option:{check:!1}};return{kind:"option",option:{check:typeof Ie==="string"?Ie:!0}};case"types-format":return typeof Ie==="string"?{kind:"option",option:{typesOptions:{format:Ie}}}:{kind:"option",option:{}};case"types-export":return typeof Ie==="string"?{kind:"option",option:{typesOptions:{exportTypes:Ie}}}:{kind:"option",option:{}};case"types-comments":return typeof Ie==="string"?{kind:"option",option:{typesOptions:{comments:Ie}}}:{kind:"option",option:{}};case"types-inline":if(Ie==="false")return{kind:"option",option:{typesOptions:{inline:!1}}};return typeof Ie==="string"?{kind:"option",option:{typesOptions:{inline:Ie}}}:{kind:"option",option:{}};case"types-index-types":return{kind:"option",option:{typesOptions:{indexTypes:Ie===!0||Ie==="true"}}};case"types-props-declaration":return typeof Ie==="string"?{kind:"option",option:{typesOptions:{propsDeclaration:Ie}}}:{kind:"option",option:{}};case"format":return typeof Ie==="string"?{kind:"option",option:{format:Ie}}:{kind:"option",option:{}};case"check-level":return typeof Ie==="string"?{kind:"option",option:{checkLevel:Ie}}:{kind:"option",option:{}};default:return{kind:"unknown",arg:Re,suggestion:Eb(Le)}}}function Sb(i){let Ie={},Re=!1;for(let Le=0;Le<i.length;Le++){let Oe=i[Le];if(!Oe.startsWith("--"))return{kind:"unknown",arg:Oe,positionalHint:Re?!0:void 0};let{result:$e,consumedNext:Me,flag:Fe}=Cb(Oe,i[Le+1]);if($e.kind!=="option")return $e;if(Ie=E(Ie,$e.option),Re=gb.has(Fe),Me)Le++}return{kind:"options",options:Ie}}var Tb=[{flagName:"types-format",key:"format",values:["class","component"]},{flagName:"types-comments",key:"comments",values:["all","descriptions","none"]},{flagName:"types-inline",key:"inline",values:["local","all"]},{flagName:"types-props-declaration",key:"propsDeclaration",values:["type","interface"]}];function kb(i){let Ie=i.map((Re)=>`"${Re}"`);return Ie.length<=2?Ie.join(" or "):`${Ie.slice(0,-1).join(", ")}, or ${Ie.at(-1)}`}async function oe(i){let Ie=Sb(i.argv.slice(2));if(Ie.kind==="help"){console.log(hb);return}if(Ie.kind==="version"){console.log(Vl.version);return}if(Ie.kind==="usage-error"){console.error(Ie.message),i.exitCode=jt.USAGE_ERROR;return}if(Ie.kind==="unknown"){let Ze=`Unknown flag: ${Ie.arg}`;if(Ie.suggestion)Ze+=` Did you mean --${Ie.suggestion}?`;if(Ie.positionalHint)Ze+=" (values are passed as --flag=value or --flag value)";console.error(Ze),console.error("Run sveld --help for a list of available flags."),i.exitCode=jt.USAGE_ERROR;return}let Re=Ie.options,Le=await _(),Oe=z(E(Le,Re));if(N(Oe),Oe.stdout){if(Oe.stdout!==!0&&Oe.stdout!=="json"&&Oe.stdout!=="ndjson"){console.error(`sveld: --stdout must be "json" or "ndjson"; got "${Oe.stdout}".`),i.exitCode=jt.USAGE_ERROR;return}if([Oe.json,Oe.markdown,Oe.customElements].filter(Boolean).length!==1){console.error("sveld: --stdout requires exactly one of --json, --markdown, or --custom-elements."),i.exitCode=jt.USAGE_ERROR;return}if(Oe.stdout==="ndjson"&&!Oe.json){console.error("sveld: --stdout=ndjson is only valid with --json."),i.exitCode=jt.USAGE_ERROR;return}if(Oe.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),i.exitCode=jt.USAGE_ERROR;return}if(Oe.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),i.exitCode=jt.USAGE_ERROR;return}}if(Oe.format!==void 0&&Oe.format!=="text"&&Oe.format!=="json"&&Oe.format!=="github"){console.error(`sveld: --format must be "text", "json", or "github"; got "${Oe.format}".`),i.exitCode=jt.USAGE_ERROR;return}if(Oe.strict!==void 0&&Oe.strict!==!0&&Oe.strict!==!1&&Oe.strict!=="errors"){console.error(`sveld: --strict must be "errors", "ci", or "local" when given a value; got "${Oe.strict}".`),i.exitCode=jt.USAGE_ERROR;return}if(Oe.checkLevel!==void 0&&Oe.checkLevel!=="major"&&Oe.checkLevel!=="minor"&&Oe.checkLevel!=="patch"){console.error(`sveld: --check-level must be "major", "minor", or "patch"; got "${Oe.checkLevel}".`),i.exitCode=jt.USAGE_ERROR;return}if(Oe.checkExamples!==void 0&&Oe.checkExamples!==!0&&Oe.checkExamples!==!1&&Oe.checkExamples!=="syntax"){console.error(`sveld: --check-examples must be "syntax" when given a value; got "${Oe.checkExamples}".`),i.exitCode=jt.USAGE_ERROR;return}let $e=Oe.typesOptions?.exportTypes;if(typeof $e==="string"){if($e!=="all"&&$e!=="none"){console.error(`sveld: --types-export must be "all" or "none"; got "${$e}".`),i.exitCode=jt.USAGE_ERROR;return}Oe.typesOptions={...Oe.typesOptions,exportTypes:$e==="all"}}for(let{flagName:Ze,key:nt,values:at}of Tb){let pt=Oe.typesOptions?.[nt];if(pt===void 0||pt===!1)continue;if(!at.includes(pt)){console.error(`sveld: --${Ze} must be ${kb(at)}; got "${pt}".`),i.exitCode=jt.USAGE_ERROR;return}}I(Oe.quiet===!0);let Me=D(Oe.entry),Fe;if(Me!==null)Fe=Me;else if(db(fb(i.cwd(),fa)))console.error(`sveld: could not resolve an entry point; falling back to "${fa}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),Fe=jr(e(fa));else{i.exitCode=jt.USAGE_ERROR;return}let je,qe;try{if(je=await S(Fe,Oe.glob===!0,b(Oe)),Oe.check)qe=await B(je.components,G(Oe),{entryExports:je.entryExports});if(Oe.stdout)await Du(je,Oe,Fe);else if(await w(je,Oe,Fe),!Oe.dryRun)je.cache?.save()}catch(Ze){if(Ze instanceof mr){console.error(`sveld: ${Ze.message}`),i.exitCode=jt.USAGE_ERROR;return}console.error(Ze instanceof Error?Ze.message:String(Ze)),i.exitCode=jt.GENERATION_FAILURE;return}let We=Oe.reportDiagnostics||Oe.strict,Ge=J(je.diagnostics,We),ze=[];if(We&&Ge.length>0)if(Oe.format==="json")i.stderr.write(U(Ge));else if(Oe.format==="github"){let Ze=Bu(Ge);if(Ze)console.error(Ze);let nt=Fu(Ge);if(nt)ze.push(nt)}else console.error(V(Ge));if(qe)if(Oe.format==="json")i.stdout.write(ie(qe));else if(Oe.format==="github"){let Ze=Vu(qe,Oe.checkLevel??"major");if(Ze)console.log(Ze);let nt=Wu(qe,Oe.checkLevel??"major");if(nt)ze.push(nt)}else console.log(se(qe));if(Oe.format==="github"&&ze.length>0&&i.env.GITHUB_STEP_SUMMARY)ub(i.env.GITHUB_STEP_SUMMARY,`${ze.join(`
|
|
328
|
+
|
|
329
|
+
`)}
|
|
330
|
+
`);let Xe;if(qe?.changes.some((Ze)=>Ze.kind==="schema")??!1)Xe=jt.USAGE_ERROR;else if(qe&&Is(qe.bump,Oe.checkLevel??"major"))Xe=jt.BREAKING_CHANGE;if(q(Ge,Oe.strict).length>0)Xe=Xe===void 0?jt.DIAGNOSTICS:Math.min(Xe,jt.DIAGNOSTICS);if(Xe!==void 0)i.exitCode=Xe}
|
|
331
|
+
export{De,a,C,ae,f,s,ce,p,d,ue,g,j,F,J,q,V,pe,U,r,m,W,t,n,u,R,L,h,le,fe,de,Q,y,me,Y,he,ye,x,ge,c,P,xe,Z,Te,Ee,be,K,Se,O,H,ke,ee,te,re,M,l,we,Ce,ne,v,T,A,e,o,Pe,G,B,se,ve,ie,D,_e,_,E,z,N,I,b,S,k,X,Ne,Ae,w,oe};
|