sveld 0.37.6 → 0.37.8

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.
@@ -1,331 +0,0 @@
1
- import{createRequire as md}from"node:module";var od=Object.create;var{getPrototypeOf:ad,defineProperty:ki,getOwnPropertyNames:cd}=Object;var ka=Object.prototype.hasOwnProperty;function ld(i){return this[i]}var pd,ud,Le=(i,$e,Be)=>{var Fe=i!=null&&typeof i==="object";if(Fe){var je=$e?pd??=new WeakMap:ud??=new WeakMap,We=je.get(i);if(We)return We}Be=i!=null?od(ad(i)):{};let Ve=$e||!i||!i.__esModule||!ka.call(i,"default")?ki(Be,"default",{value:i,enumerable:!0}):Be;if(i&&typeof i==="object"||typeof i==="function"){for(let Ge of cd(i))if(!ka.call(Ve,Ge))ki(Ve,Ge,{get:ld.bind(i,Ge),enumerable:!0})}if(Fe)je.set(i,Ve);return Ve};var a=(i,$e)=>()=>($e||i(($e={exports:{}}).exports,$e),$e.exports);var dd=(i)=>i;function fd(i,$e){this[i]=dd.bind(null,$e)}var hd=(i,$e)=>{for(var Be in $e)ki(i,Be,{get:$e[Be],enumerable:!0,configurable:!0,set:fd.bind($e,Be)})};var v=md(import.meta.url);var yd={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 Aa(i,$e){let Be=yd[i];if(!Be)return!1;if(!$e)return!0;return(Be.direct??Be.descendant??[]).includes($e)}var ji={};hd(ji,{Node:()=>Mr,Parser:()=>jt,Position:()=>fr,SourceLocation:()=>Lr,TokContext:()=>vn,Token:()=>gs,TokenType:()=>It,defaultOptions:()=>as,getLineInfo:()=>Ri,isIdentifierChar:()=>un,isIdentifierStart:()=>sn,isNewLine:()=>er,keywordTypes:()=>ds,lineBreak:()=>on,lineBreakG:()=>La,nonASCIIwhitespace:()=>Ii,parse:()=>Fi,parseExpressionAt:()=>Qd,tokContexts:()=>Ft,tokTypes:()=>Ye,tokenizer:()=>Zd,version:()=>fc});var gd=[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],_a=[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],xd="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Ia="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ai={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"},wi="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",bd={5:wi,"5module":wi+" export import",6:wi+" const class extends export import super"},Ra=/^in(stanceof)?$/,Ed=new RegExp("["+Ia+"]"),Cd=new RegExp("["+Ia+xd+"]");function Pi(i,$e){var Be=65536;for(var Fe=0;Fe<$e.length;Fe+=2){if(Be+=$e[Fe],Be>i)return!1;if(Be+=$e[Fe+1],Be>=i)return!0}return!1}function sn(i,$e){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&&Ed.test(String.fromCharCode(i));if($e===!1)return!1;return Pi(i,_a)}function un(i,$e){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&&Cd.test(String.fromCharCode(i));if($e===!1)return!1;return Pi(i,_a)||Pi(i,gd)}var It=function($e,Be){if(Be===void 0)Be={};this.label=$e,this.keyword=Be.keyword,this.beforeExpr=!!Be.beforeExpr,this.startsExpr=!!Be.startsExpr,this.isLoop=!!Be.isLoop,this.isAssign=!!Be.isAssign,this.prefix=!!Be.prefix,this.postfix=!!Be.postfix,this.binop=Be.binop||null,this.updateContext=null};function En(i,$e){return new It(i,{beforeExpr:!0,binop:$e})}var Cn={beforeExpr:!0},pn={startsExpr:!0},ds={};function _t(i,$e){if($e===void 0)$e={};return $e.keyword=i,ds[i]=new It(i,$e)}var Ye={num:new It("num",pn),regexp:new It("regexp",pn),string:new It("string",pn),name:new It("name",pn),privateId:new It("privateId",pn),eof:new It("eof"),bracketL:new It("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new It("]"),braceL:new It("{",{beforeExpr:!0,startsExpr:!0}),braceR:new It("}"),parenL:new It("(",{beforeExpr:!0,startsExpr:!0}),parenR:new It(")"),comma:new It(",",Cn),semi:new It(";",Cn),colon:new It(":",Cn),dot:new It("."),question:new It("?",Cn),questionDot:new It("?."),arrow:new It("=>",Cn),template:new It("template"),invalidTemplate:new It("invalidTemplate"),ellipsis:new It("...",Cn),backQuote:new It("`",pn),dollarBraceL:new It("${",{beforeExpr:!0,startsExpr:!0}),eq:new It("=",{beforeExpr:!0,isAssign:!0}),assign:new It("_=",{beforeExpr:!0,isAssign:!0}),incDec:new It("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new It("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:En("||",1),logicalAND:En("&&",2),bitwiseOR:En("|",3),bitwiseXOR:En("^",4),bitwiseAND:En("&",5),equality:En("==/!=/===/!==",6),relational:En("</>/<=/>=",7),bitShift:En("<</>>/>>>",8),plusMin:new It("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:En("%",10),star:En("*",10),slash:En("/",10),starstar:new It("**",{beforeExpr:!0}),coalesce:En("??",1),_break:_t("break"),_case:_t("case",Cn),_catch:_t("catch"),_continue:_t("continue"),_debugger:_t("debugger"),_default:_t("default",Cn),_do:_t("do",{isLoop:!0,beforeExpr:!0}),_else:_t("else",Cn),_finally:_t("finally"),_for:_t("for",{isLoop:!0}),_function:_t("function",pn),_if:_t("if"),_return:_t("return",Cn),_switch:_t("switch"),_throw:_t("throw",Cn),_try:_t("try"),_var:_t("var"),_const:_t("const"),_while:_t("while",{isLoop:!0}),_with:_t("with"),_new:_t("new",{beforeExpr:!0,startsExpr:!0}),_this:_t("this",pn),_super:_t("super",pn),_class:_t("class",pn),_extends:_t("extends",Cn),_export:_t("export"),_import:_t("import",pn),_null:_t("null",pn),_true:_t("true",pn),_false:_t("false",pn),_in:_t("in",{beforeExpr:!0,binop:7}),_instanceof:_t("instanceof",{beforeExpr:!0,binop:7}),_typeof:_t("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:_t("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:_t("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},on=/\r\n?|\n|\u2028|\u2029/,La=new RegExp(on.source,"g");function er(i){return i===10||i===13||i===8232||i===8233}function Oa(i,$e,Be){if(Be===void 0)Be=i.length;for(var Fe=$e;Fe<Be;Fe++){var je=i.charCodeAt(Fe);if(er(je))return Fe<Be-1&&je===13&&i.charCodeAt(Fe+1)===10?Fe+2:Fe+1}return-1}var Ii=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Jt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ma=Object.prototype,{hasOwnProperty:vd,toString:Sd}=Ma,hr=Object.hasOwn||function(i,$e){return vd.call(i,$e)},wa=Array.isArray||function(i){return Sd.call(i)==="[object Array]"},Pa=Object.create(null);function Hn(i){return Pa[i]||(Pa[i]=new RegExp("^(?:"+i.replace(/ /g,"|")+")$"))}function Bn(i){if(i<=65535)return String.fromCharCode(i);return i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320)}var Td=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,fr=function($e,Be){this.line=$e,this.column=Be};fr.prototype.offset=function($e){return new fr(this.line,this.column+$e)};var Lr=function($e,Be,Fe){if(this.start=Be,this.end=Fe,$e.sourceFile!==null)this.source=$e.sourceFile};function Ri(i,$e){for(var Be=1,Fe=0;;){var je=Oa(i,Fe,$e);if(je<0)return new fr(Be,$e-Fe);++Be,Fe=je}}var as={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},Na=!1;function kd(i){var $e={};for(var Be in as)$e[Be]=i&&hr(i,Be)?i[Be]:as[Be];if($e.ecmaVersion==="latest")$e.ecmaVersion=1e8;else if($e.ecmaVersion==null){if(!Na&&typeof console==="object"&&console.warn)Na=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
2
- Defaulting to 2020, but this will stop working in the future.`);$e.ecmaVersion=11}else if($e.ecmaVersion>=2015)$e.ecmaVersion-=2009;if($e.allowReserved==null)$e.allowReserved=$e.ecmaVersion<5;if(!i||i.allowHashBang==null)$e.allowHashBang=$e.ecmaVersion>=14;if(wa($e.onToken)){var Fe=$e.onToken;$e.onToken=function(je){return Fe.push(je)}}if(wa($e.onComment))$e.onComment=Ad($e,$e.onComment);if($e.sourceType==="commonjs"&&$e.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return $e}function Ad(i,$e){return function(Be,Fe,je,We,Ve,Ge){var Ue={type:Be?"Block":"Line",value:Fe,start:je,end:We};if(i.locations)Ue.loc=new Lr(this,Ve,Ge);if(i.ranges)Ue.range=[je,We];$e.push(Ue)}}var Zn=1,tr=2,Li=4,$a=8,Oi=16,Ba=32,fs=64,Fa=128,nr=256,Or=512,ja=1024,hs=Zn|tr|nr;function Mi(i,$e){return tr|(i?Li:0)|($e?$a:0)}var cs=0,$i=1,jn=2,Va=3,Wa=4,qa=5,jt=function($e,Be,Fe){this.options=$e=kd($e),this.sourceFile=$e.sourceFile,this.keywords=Hn(bd[$e.ecmaVersion>=6?6:$e.sourceType==="module"?"5module":5]);var je="";if($e.allowReserved!==!0){if(je=Ai[$e.ecmaVersion>=6?6:$e.ecmaVersion===5?5:3],$e.sourceType==="module")je+=" await"}this.reservedWords=Hn(je);var We=(je?je+" ":"")+Ai.strict;if(this.reservedWordsStrict=Hn(We),this.reservedWordsStrictBind=Hn(We+" "+Ai.strictBind),this.input=String(Be),this.containsEsc=!1,this.pos=Fe||0,this.curLine=1,$e.startLocation)this.lineStart=this.pos-$e.startLocation.column,this.curLine=$e.startLocation.line;else if(Fe){if(this.lineStart=this.input.lastIndexOf(`
3
- `,Fe-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(on).length}else this.lineStart=0;if(this.type=Ye.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=$e.sourceType==="module",this.strict=this.inModule||$e.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&&$e.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?tr:Zn),this.regexpState=null,this.privateNameStack=[]},Tn={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}};jt.prototype.parse=function(){var $e=this,Be=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return $e.parseTopLevel(Be)})};Tn.inFunction.get=function(){return(this.currentVarScope().flags&tr)>0};Tn.inGenerator.get=function(){return(this.currentVarScope().flags&$a)>0};Tn.inAsync.get=function(){return(this.currentVarScope().flags&Li)>0};Tn.canAwait.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var $e=this.scopeStack[i],Be=$e.flags;if(Be&(nr|Or))return!1;if(Be&tr)return(Be&Li)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Tn.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Zn)return!0;return!1};Tn.allowSuper.get=function(){var i=this.currentThisScope(),$e=i.flags;return($e&fs)>0||this.options.allowSuperOutsideMethod};Tn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Fa)>0};Tn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Tn.allowNewDotTarget.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var $e=this.scopeStack[i],Be=$e.flags;if(Be&(nr|Or)||Be&tr&&!(Be&Oi))return!0}return!1};Tn.allowUsing.get=function(){var i=this.currentScope(),$e=i.flags;if($e&ja)return!1;if(!this.inModule&&$e&Zn)return!1;return!0};Tn.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&nr)>0};jt.extend=function(){var $e=[],Be=arguments.length;while(Be--)$e[Be]=arguments[Be];var Fe=this;for(var je=0;je<$e.length;je++)Fe=$e[je](Fe);return Fe};jt.parse=function($e,Be){return new this(Be,$e).parse()};jt.parseExpressionAt=function($e,Be,Fe){var je=new this(Fe,$e,Be);return je.nextToken(),je.parseExpression()};jt.tokenizer=function($e,Be){return new this(Be,$e)};Object.defineProperties(jt.prototype,Tn);var en=jt.prototype,wd=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;en.strictDirective=function(i){if(this.options.ecmaVersion<5)return!1;for(;;){Jt.lastIndex=i,i+=Jt.exec(this.input)[0].length;var $e=wd.exec(this.input.slice(i));if(!$e)return!1;if(($e[1]||$e[2])==="use strict"){Jt.lastIndex=i+$e[0].length;var Be=Jt.exec(this.input),Fe=Be.index+Be[0].length,je=this.input.charAt(Fe);return je===";"||je==="}"||on.test(Be[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(je)||je==="!"&&this.input.charAt(Fe+1)==="=")}if(i+=$e[0].length,Jt.lastIndex=i,i+=Jt.exec(this.input)[0].length,this.input[i]===";")i++}};en.eat=function(i){if(this.type===i)return this.next(),!0;else return!1};en.isContextual=function(i){return this.type===Ye.name&&this.value===i&&!this.containsEsc};en.eatContextual=function(i){if(!this.isContextual(i))return!1;return this.next(),!0};en.catchStackOverflow=function(i){try{return i()}catch($e){if($e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test($e.message)||/\btoo much recursion\b/i.test($e.message)))this.raise(this.start,"Not enough stack space to parse input");else throw $e}};en.expectContextual=function(i){if(!this.eatContextual(i))this.unexpected()};en.canInsertSemicolon=function(){return this.type===Ye.eof||this.type===Ye.braceR||on.test(this.input.slice(this.lastTokEnd,this.start))};en.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};en.semicolon=function(){if(!this.eat(Ye.semi)&&!this.insertSemicolon())this.unexpected()};en.afterTrailingComma=function(i,$e){if(this.type===i){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!$e)this.next();return!0}};en.expect=function(i){this.eat(i)||this.unexpected()};en.unexpected=function(i){this.raise(i!=null?i:this.start,"Unexpected token")};var ms=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};en.checkPatternErrors=function(i,$e){if(!i)return;if(i.trailingComma>-1)this.raiseRecoverable(i.trailingComma,"Comma is not permitted after the rest element");var Be=$e?i.parenthesizedAssign:i.parenthesizedBind;if(Be>-1)this.raiseRecoverable(Be,$e?"Assigning to rvalue":"Parenthesized pattern")};en.checkExpressionErrors=function(i,$e){if(!i)return!1;var{shorthandAssign:Be,doubleProto:Fe}=i;if(!$e)return Be>=0||Fe>=0;if(Be>=0)this.raise(Be,"Shorthand property assignments are valid only in destructuring patterns");if(Fe>=0)this.raiseRecoverable(Fe,"Redefinition of __proto__ property")};en.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")};en.isSimpleAssignTarget=function(i){if(i.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(i.expression);return i.type==="Identifier"||i.type==="MemberExpression"};var vt=jt.prototype;vt.parseTopLevel=function(i){var $e=Object.create(null);if(!i.body)i.body=[];while(this.type!==Ye.eof){var Be=this.parseStatement(null,!0,$e);i.body.push(Be)}if(this.inModule)for(var Fe=0,je=Object.keys(this.undefinedExports);Fe<je.length;Fe+=1){var We=je[Fe];this.raiseRecoverable(this.undefinedExports[We].start,"Export '"+We+"' 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 Bi={kind:"loop"},Pd={kind:"switch"};vt.isLet=function(i){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Jt.lastIndex=this.pos;var $e=Jt.exec(this.input),Be=this.pos+$e[0].length,Fe=this.fullCharCodeAt(Be);if(Fe===91||Fe===92)return!0;if(i)return!1;if(Fe===123)return!0;if(sn(Fe)){var je=Be;do Be+=Fe<=65535?1:2;while(un(Fe=this.fullCharCodeAt(Be)));if(Fe===92)return!0;var We=this.input.slice(je,Be);if(!Ra.test(We))return!0}return!1};vt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Jt.lastIndex=this.pos;var i=Jt.exec(this.input),$e=this.pos+i[0].length,Be;return!on.test(this.input.slice(this.pos,$e))&&this.input.slice($e,$e+8)==="function"&&($e+8===this.input.length||!(un(Be=this.fullCharCodeAt($e+8))||Be===92))};vt.isUsingKeyword=function(i,$e){if(this.options.ecmaVersion<17||!this.isContextual(i?"await":"using"))return!1;Jt.lastIndex=this.pos;var Be=Jt.exec(this.input),Fe=this.pos+Be[0].length;if(on.test(this.input.slice(this.pos,Fe)))return!1;if(i){var je=Fe+5,We;if(this.input.slice(Fe,je)!=="using"||je===this.input.length||un(We=this.fullCharCodeAt(je))||We===92)return!1;Jt.lastIndex=je;var Ve=Jt.exec(this.input);if(Fe=je+Ve[0].length,Ve&&on.test(this.input.slice(je,Fe)))return!1}var Ge=this.fullCharCodeAt(Fe);if(!sn(Ge)&&Ge!==92)return!1;var Ue=Fe;do Fe+=Ge<=65535?1:2;while(un(Ge=this.fullCharCodeAt(Fe)));if(Ge===92)return!0;var ze=this.input.slice(Ue,Fe);if(Ra.test(ze))return!1;if($e&&!i&&ze==="of"){Jt.lastIndex=Fe;var Ke=Jt.exec(this.input);if(Fe=Fe+Ke[0].length,this.input.charCodeAt(Fe)!==61||(Ge=this.input.charCodeAt(Fe+1))===61||Ge===62)return!1}return!0};vt.isAwaitUsing=function(i){return this.isUsingKeyword(!0,i)};vt.isUsing=function(i){return this.isUsingKeyword(!1,i)};vt.parseStatement=function(i,$e,Be){var Fe=this.type,je=this.startNode(),We;if(this.isLet(i))Fe=Ye._var,We="let";switch(Fe){case Ye._break:case Ye._continue:return this.parseBreakContinueStatement(je,Fe.keyword);case Ye._debugger:return this.parseDebuggerStatement(je);case Ye._do:return this.parseDoStatement(je);case Ye._for:return this.parseForStatement(je);case Ye._function:if(i&&(this.strict||i!=="if"&&i!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(je,!1,!i);case Ye._class:if(i)this.unexpected();return this.parseClass(je,!0);case Ye._if:return this.parseIfStatement(je);case Ye._return:return this.parseReturnStatement(je);case Ye._switch:return this.parseSwitchStatement(je);case Ye._throw:return this.parseThrowStatement(je);case Ye._try:return this.parseTryStatement(je);case Ye._const:case Ye._var:if(We=We||this.value,i&&We!=="var")this.unexpected();return this.parseVarStatement(je,We);case Ye._while:return this.parseWhileStatement(je);case Ye._with:return this.parseWithStatement(je);case Ye.braceL:return this.parseBlock(!0,je);case Ye.semi:return this.parseEmptyStatement(je);case Ye._export:case Ye._import:if(this.options.ecmaVersion>10&&Fe===Ye._import){Jt.lastIndex=this.pos;var Ve=Jt.exec(this.input),Ge=this.pos+Ve[0].length,Ue=this.input.charCodeAt(Ge);if(Ue===40||Ue===46)return this.parseExpressionStatement(je,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!$e)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 Fe===Ye._import?this.parseImport(je):this.parseExport(je,Be);default:if(this.isAsyncFunction()){if(i)this.unexpected();return this.next(),this.parseFunctionStatement(je,!0,!i)}var ze=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(ze){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(ze==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(je,!1,ze),this.semicolon(),this.finishNode(je,"VariableDeclaration")}var Ke=this.value,Xe=this.parseExpression();if(Fe===Ye.name&&Xe.type==="Identifier"&&this.eat(Ye.colon))return this.parseLabeledStatement(je,Ke,Xe,i);else return this.parseExpressionStatement(je,Xe)}};vt.parseBreakContinueStatement=function(i,$e){var Be=$e==="break";if(this.next(),this.eat(Ye.semi)||this.insertSemicolon())i.label=null;else if(this.type!==Ye.name)this.unexpected();else i.label=this.parseIdent(),this.semicolon();var Fe=0;for(;Fe<this.labels.length;++Fe){var je=this.labels[Fe];if(i.label==null||je.name===i.label.name){if(je.kind!=null&&(Be||je.kind==="loop"))break;if(i.label&&Be)break}}if(Fe===this.labels.length)this.raise(i.start,"Unsyntactic "+$e);return this.finishNode(i,Be?"BreakStatement":"ContinueStatement")};vt.parseDebuggerStatement=function(i){return this.next(),this.semicolon(),this.finishNode(i,"DebuggerStatement")};vt.parseDoStatement=function(i){if(this.next(),this.labels.push(Bi),i.body=this.parseStatement("do"),this.labels.pop(),this.expect(Ye._while),i.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(Ye.semi);else this.semicolon();return this.finishNode(i,"DoWhileStatement")};vt.parseForStatement=function(i){this.next();var $e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Bi),this.enterScope(0),this.expect(Ye.parenL),this.type===Ye.semi){if($e>-1)this.unexpected($e);return this.parseFor(i,null)}var Be=this.isLet();if(this.type===Ye._var||this.type===Ye._const||Be){var Fe=this.startNode(),je=Be?"let":this.value;return this.next(),this.parseVar(Fe,!0,je),this.finishNode(Fe,"VariableDeclaration"),this.parseForAfterInit(i,Fe,$e)}var We=this.isContextual("let"),Ve=!1,Ge=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Ge){var Ue=this.startNode();if(this.next(),Ge==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Ue,!0,Ge),this.finishNode(Ue,"VariableDeclaration"),this.parseForAfterInit(i,Ue,$e)}var ze=this.containsEsc,Ke=new ms,Xe=this.start,Ze=$e>-1?this.parseExprSubscripts(Ke,"await"):this.parseExpression(!0,Ke);if(this.type===Ye._in||(Ve=this.options.ecmaVersion>=6&&this.isContextual("of"))){if($e>-1){if(this.type===Ye._in)this.unexpected($e);i.await=!0}else if(Ve&&this.options.ecmaVersion>=8){if(Ze.start===Xe&&!ze&&Ze.type==="Identifier"&&Ze.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)i.await=!1}if(We&&Ve)this.raise(Ze.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(Ze,!1,Ke),this.checkLValPattern(Ze),this.parseForIn(i,Ze)}else this.checkExpressionErrors(Ke,!0);if($e>-1)this.unexpected($e);return this.parseFor(i,Ze)};vt.parseForAfterInit=function(i,$e,Be){if((this.type===Ye._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&$e.declarations.length===1){if(this.type===Ye._in){if(($e.kind==="using"||$e.kind==="await using")&&!$e.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&Be>-1)this.unexpected(Be)}else if(this.options.ecmaVersion>=9)i.await=Be>-1;return this.parseForIn(i,$e)}if(Be>-1)this.unexpected(Be);return this.parseFor(i,$e)};vt.parseFunctionStatement=function(i,$e,Be){return this.next(),this.parseFunction(i,Rr|(Be?0:Ni),!1,$e)};vt.parseIfStatement=function(i){return this.next(),i.test=this.parseParenExpression(),i.consequent=this.parseStatement("if"),i.alternate=this.eat(Ye._else)?this.parseStatement("if"):null,this.finishNode(i,"IfStatement")};vt.parseReturnStatement=function(i){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(Ye.semi)||this.insertSemicolon())i.argument=null;else i.argument=this.parseExpression(),this.semicolon();return this.finishNode(i,"ReturnStatement")};vt.parseSwitchStatement=function(i){this.next(),i.discriminant=this.parseParenExpression(),i.cases=[],this.expect(Ye.braceL),this.labels.push(Pd),this.enterScope(ja);var $e;for(var Be=!1;this.type!==Ye.braceR;)if(this.type===Ye._case||this.type===Ye._default){var Fe=this.type===Ye._case;if($e)this.finishNode($e,"SwitchCase");if(i.cases.push($e=this.startNode()),$e.consequent=[],this.next(),Fe)$e.test=this.parseExpression();else{if(Be)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");Be=!0,$e.test=null}this.expect(Ye.colon)}else{if(!$e)this.unexpected();$e.consequent.push(this.parseStatement(null))}if(this.exitScope(),$e)this.finishNode($e,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(i,"SwitchStatement")};vt.parseThrowStatement=function(i){if(this.next(),on.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 Nd=[];vt.parseCatchClauseParam=function(){var i=this.parseBindingAtom(),$e=i.type==="Identifier";return this.enterScope($e?Ba:0),this.checkLValPattern(i,$e?Wa:jn),this.expect(Ye.parenR),i};vt.parseTryStatement=function(i){if(this.next(),i.block=this.parseBlock(),i.handler=null,this.type===Ye._catch){var $e=this.startNode();if(this.next(),this.eat(Ye.parenL))$e.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();$e.param=null,this.enterScope(0)}$e.body=this.parseBlock(!1),this.exitScope(),i.handler=this.finishNode($e,"CatchClause")}if(i.finalizer=this.eat(Ye._finally)?this.parseBlock():null,!i.handler&&!i.finalizer)this.raise(i.start,"Missing catch or finally clause");return this.finishNode(i,"TryStatement")};vt.parseVarStatement=function(i,$e,Be){return this.next(),this.parseVar(i,!1,$e,Be),this.semicolon(),this.finishNode(i,"VariableDeclaration")};vt.parseWhileStatement=function(i){return this.next(),i.test=this.parseParenExpression(),this.labels.push(Bi),i.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(i,"WhileStatement")};vt.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")};vt.parseEmptyStatement=function(i){return this.next(),this.finishNode(i,"EmptyStatement")};vt.parseLabeledStatement=function(i,$e,Be,Fe){for(var je=0,We=this.labels;je<We.length;je+=1){var Ve=We[je];if(Ve.name===$e)this.raise(Be.start,"Label '"+$e+"' is already declared")}var Ge=this.type.isLoop?"loop":this.type===Ye._switch?"switch":null;for(var Ue=this.labels.length-1;Ue>=0;Ue--){var ze=this.labels[Ue];if(ze.statementStart===i.start)ze.statementStart=this.start,ze.kind=Ge;else break}return this.labels.push({name:$e,kind:Ge,statementStart:this.start}),i.body=this.parseStatement(Fe?Fe.indexOf("label")===-1?Fe+"label":Fe:"label"),this.labels.pop(),i.label=Be,this.finishNode(i,"LabeledStatement")};vt.parseExpressionStatement=function(i,$e){return i.expression=$e,this.semicolon(),this.finishNode(i,"ExpressionStatement")};vt.parseBlock=function(i,$e,Be){if(i===void 0)i=!0;if($e===void 0)$e=this.startNode();if($e.body=[],this.expect(Ye.braceL),i)this.enterScope(0);while(this.type!==Ye.braceR){var Fe=this.parseStatement(null);$e.body.push(Fe)}if(Be)this.strict=!1;if(this.next(),i)this.exitScope();return this.finishNode($e,"BlockStatement")};vt.parseFor=function(i,$e){return i.init=$e,this.expect(Ye.semi),i.test=this.type===Ye.semi?null:this.parseExpression(),this.expect(Ye.semi),i.update=this.type===Ye.parenR?null:this.parseExpression(),this.expect(Ye.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,"ForStatement")};vt.parseForIn=function(i,$e){var Be=this.type===Ye._in;if(this.next(),$e.type==="VariableDeclaration"&&$e.declarations[0].init!=null&&(!Be||this.options.ecmaVersion<8||this.strict||$e.kind!=="var"||$e.declarations[0].id.type!=="Identifier"))this.raise($e.start,(Be?"for-in":"for-of")+" loop variable declaration may not have an initializer");return i.left=$e,i.right=Be?this.parseExpression():this.parseMaybeAssign(),this.expect(Ye.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,Be?"ForInStatement":"ForOfStatement")};vt.parseVar=function(i,$e,Be,Fe){i.declarations=[],i.kind=Be;for(;;){var je=this.startNode();if(this.parseVarId(je,Be),this.eat(Ye.eq))je.init=this.parseMaybeAssign($e);else if(!Fe&&Be==="const"&&!(this.type===Ye._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!Fe&&(Be==="using"||Be==="await using")&&this.options.ecmaVersion>=17&&this.type!==Ye._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+Be+" declaration");else if(!Fe&&je.id.type!=="Identifier"&&!($e&&(this.type===Ye._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else je.init=null;if(i.declarations.push(this.finishNode(je,"VariableDeclarator")),!this.eat(Ye.comma))break}return i};vt.parseVarId=function(i,$e){i.id=$e==="using"||$e==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(i.id,$e==="var"?$i:jn,!1)};var Rr=1,Ni=2,Ga=4;vt.parseFunction=function(i,$e,Be,Fe,je){if(this.initFunction(i),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Fe){if(this.type===Ye.star&&$e&Ni)this.unexpected();i.generator=this.eat(Ye.star)}if(this.options.ecmaVersion>=8)i.async=!!Fe;if($e&Rr){if(i.id=$e&Ga&&this.type!==Ye.name?null:this.parseIdent(),i.id&&!($e&Ni))this.checkLValSimple(i.id,this.strict||i.generator||i.async?this.treatFunctionsAsVar?$i:jn:Va)}var We=this.yieldPos,Ve=this.awaitPos,Ge=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Mi(i.async,i.generator)),!($e&Rr))i.id=this.type===Ye.name?this.parseIdent():null;return this.parseFunctionParams(i),this.parseFunctionBody(i,Be,!1,je),this.yieldPos=We,this.awaitPos=Ve,this.awaitIdentPos=Ge,this.finishNode(i,$e&Rr?"FunctionDeclaration":"FunctionExpression")};vt.parseFunctionParams=function(i){this.expect(Ye.parenL),i.params=this.parseBindingList(Ye.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};vt.parseClass=function(i,$e){this.next();var Be=this.strict;this.strict=!0,this.parseClassId(i,$e),this.parseClassSuper(i);var Fe=this.enterClassBody(),je=this.startNode(),We=!1;je.body=[],this.expect(Ye.braceL);while(this.type!==Ye.braceR){var Ve=this.parseClassElement(i.superClass!==null);if(Ve){if(je.body.push(Ve),Ve.type==="MethodDefinition"&&Ve.kind==="constructor"){if(We)this.raiseRecoverable(Ve.start,"Duplicate constructor in the same class");We=!0}else if(Ve.key&&Ve.key.type==="PrivateIdentifier"&&Dd(Fe,Ve))this.raiseRecoverable(Ve.key.start,"Identifier '#"+Ve.key.name+"' has already been declared")}}return this.strict=Be,this.next(),i.body=this.finishNode(je,"ClassBody"),this.exitClassBody(),this.finishNode(i,$e?"ClassDeclaration":"ClassExpression")};vt.parseClassElement=function(i){if(this.eat(Ye.semi))return null;var $e=this.options.ecmaVersion,Be=this.startNode(),Fe="",je=!1,We=!1,Ve="method",Ge=!1;if(this.eatContextual("static")){if($e>=13&&this.eat(Ye.braceL))return this.parseClassStaticBlock(Be),Be;if(this.isClassElementNameStart()||this.type===Ye.star)Ge=!0;else Fe="static"}if(Be.static=Ge,!Fe&&$e>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Ye.star)&&!this.canInsertSemicolon())We=!0;else Fe="async";if(!Fe&&($e>=9||!We)&&this.eat(Ye.star))je=!0;if(!Fe&&!We&&!je){var Ue=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Ve=Ue;else Fe=Ue}if(Fe)Be.computed=!1,Be.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Be.key.name=Fe,this.finishNode(Be.key,"Identifier");else this.parseClassElementName(Be);if($e<13||this.type===Ye.parenL||Ve!=="method"||je||We){var ze=!Be.static&&ls(Be,"constructor"),Ke=ze&&i;if(ze&&Ve!=="method")this.raise(Be.key.start,"Constructor can't have get/set modifier");Be.kind=ze?"constructor":Ve,this.parseClassMethod(Be,je,We,Ke)}else this.parseClassField(Be);return Be};vt.isClassElementNameStart=function(){return this.type===Ye.name||this.type===Ye.privateId||this.type===Ye.num||this.type===Ye.string||this.type===Ye.bracketL||this.type.keyword};vt.parseClassElementName=function(i){if(this.type===Ye.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)};vt.parseClassMethod=function(i,$e,Be,Fe){var je=i.key;if(i.kind==="constructor"){if($e)this.raise(je.start,"Constructor can't be a generator");if(Be)this.raise(je.start,"Constructor can't be an async method")}else if(i.static&&ls(i,"prototype"))this.raise(je.start,"Classes may not have a static property named prototype");var We=i.value=this.parseMethod($e,Be,Fe);if(i.kind==="get"&&We.params.length!==0)this.raiseRecoverable(We.start,"getter should have no params");if(i.kind==="set"&&We.params.length!==1)this.raiseRecoverable(We.start,"setter should have exactly one param");if(i.kind==="set"&&We.params[0].type==="RestElement")this.raiseRecoverable(We.params[0].start,"Setter cannot use rest params");return this.finishNode(i,"MethodDefinition")};vt.parseClassField=function(i){if(ls(i,"constructor"))this.raise(i.key.start,"Classes can't have a field named 'constructor'");else if(i.static&&ls(i,"prototype"))this.raise(i.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(Ye.eq))this.enterScope(Or|fs),i.value=this.parseMaybeAssign(),this.exitScope();else i.value=null;return this.semicolon(),this.finishNode(i,"PropertyDefinition")};vt.parseClassStaticBlock=function(i){i.body=[];var $e=this.labels;this.labels=[],this.enterScope(nr|fs);while(this.type!==Ye.braceR){var Be=this.parseStatement(null);i.body.push(Be)}return this.next(),this.exitScope(),this.labels=$e,this.finishNode(i,"StaticBlock")};vt.parseClassId=function(i,$e){if(this.type===Ye.name){if(i.id=this.parseIdent(),$e)this.checkLValSimple(i.id,jn,!1)}else{if($e===!0)this.unexpected();i.id=null}};vt.parseClassSuper=function(i){i.superClass=this.eat(Ye._extends)?this.parseExprSubscripts(null,!1):null};vt.enterClassBody=function(){var i={declared:Object.create(null),used:[]};return this.privateNameStack.push(i),i.declared};vt.exitClassBody=function(){var i=this.privateNameStack.pop(),{declared:$e,used:Be}=i;if(!this.options.checkPrivateFields)return;var Fe=this.privateNameStack.length,je=Fe===0?null:this.privateNameStack[Fe-1];for(var We=0;We<Be.length;++We){var Ve=Be[We];if(!hr($e,Ve.name))if(je)je.used.push(Ve);else this.raiseRecoverable(Ve.start,"Private field '#"+Ve.name+"' must be declared in an enclosing class")}};function Dd(i,$e){var Be=$e.key.name,Fe=i[Be],je="true";if($e.type==="MethodDefinition"&&($e.kind==="get"||$e.kind==="set"))je=($e.static?"s":"i")+$e.kind;if(Fe==="iget"&&je==="iset"||Fe==="iset"&&je==="iget"||Fe==="sget"&&je==="sset"||Fe==="sset"&&je==="sget")return i[Be]="true",!1;else if(!Fe)return i[Be]=je,!1;else return!0}function ls(i,$e){var{computed:Be,key:Fe}=i;return!Be&&(Fe.type==="Identifier"&&Fe.name===$e||Fe.type==="Literal"&&Fe.value===$e)}vt.parseExportAllDeclaration=function(i,$e){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))i.exported=this.parseModuleExportName(),this.checkExport($e,i.exported,this.lastTokStart);else i.exported=null;if(this.expectContextual("from"),this.type!==Ye.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ExportAllDeclaration")};vt.parseExport=function(i,$e){if(this.next(),this.eat(Ye.star))return this.parseExportAllDeclaration(i,$e);if(this.eat(Ye._default))return this.checkExport($e,"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($e,i.declaration.declarations);else this.checkExport($e,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($e),this.eatContextual("from")){if(this.type!==Ye.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause()}else{for(var Be=0,Fe=i.specifiers;Be<Fe.length;Be+=1){var je=Fe[Be];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`.")}if(i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}this.semicolon()}return this.finishNode(i,"ExportNamedDeclaration")};vt.parseExportDeclaration=function(i){return this.parseStatement(null)};vt.parseExportDefaultDeclaration=function(){var i;if(this.type===Ye._function||(i=this.isAsyncFunction())){var $e=this.startNode();if(this.next(),i)this.next();return this.parseFunction($e,Rr|Ga,!1,i)}else if(this.type===Ye._class){var Be=this.startNode();return this.parseClass(Be,"nullableID")}else{var Fe=this.parseMaybeAssign();return this.semicolon(),Fe}};vt.checkExport=function(i,$e,Be){if(!i)return;if(typeof $e!=="string")$e=$e.type==="Identifier"?$e.name:$e.value;if(hr(i,$e))this.raiseRecoverable(Be,"Duplicate export '"+$e+"'");i[$e]=!0};vt.checkPatternExport=function(i,$e){var Be=$e.type;if(Be==="Identifier")this.checkExport(i,$e,$e.start);else if(Be==="ObjectPattern")for(var Fe=0,je=$e.properties;Fe<je.length;Fe+=1){var We=je[Fe];this.checkPatternExport(i,We)}else if(Be==="ArrayPattern")for(var Ve=0,Ge=$e.elements;Ve<Ge.length;Ve+=1){var Ue=Ge[Ve];if(Ue)this.checkPatternExport(i,Ue)}else if(Be==="Property")this.checkPatternExport(i,$e.value);else if(Be==="AssignmentPattern")this.checkPatternExport(i,$e.left);else if(Be==="RestElement")this.checkPatternExport(i,$e.argument)};vt.checkVariableExport=function(i,$e){if(!i)return;for(var Be=0,Fe=$e;Be<Fe.length;Be+=1){var je=Fe[Be];this.checkPatternExport(i,je.id)}};vt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};vt.parseExportSpecifier=function(i){var $e=this.startNode();return $e.local=this.parseModuleExportName(),$e.exported=this.eatContextual("as")?this.parseModuleExportName():$e.local,this.checkExport(i,$e.exported,$e.exported.start),this.finishNode($e,"ExportSpecifier")};vt.parseExportSpecifiers=function(i){var $e=[],Be=!0;this.expect(Ye.braceL);while(!this.eat(Ye.braceR)){if(!Be){if(this.expect(Ye.comma),this.afterTrailingComma(Ye.braceR))break}else Be=!1;$e.push(this.parseExportSpecifier(i))}return $e};vt.parseImport=function(i){if(this.next(),this.type===Ye.string)i.specifiers=Nd,i.source=this.parseExprAtom();else i.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),i.source=this.type===Ye.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ImportDeclaration")};vt.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,jn),this.finishNode(i,"ImportSpecifier")};vt.parseImportDefaultSpecifier=function(){var i=this.startNode();return i.local=this.parseIdent(),this.checkLValSimple(i.local,jn),this.finishNode(i,"ImportDefaultSpecifier")};vt.parseImportNamespaceSpecifier=function(){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,jn),this.finishNode(i,"ImportNamespaceSpecifier")};vt.parseImportSpecifiers=function(){var i=[],$e=!0;if(this.type===Ye.name){if(i.push(this.parseImportDefaultSpecifier()),!this.eat(Ye.comma))return i}if(this.type===Ye.star)return i.push(this.parseImportNamespaceSpecifier()),i;this.expect(Ye.braceL);while(!this.eat(Ye.braceR)){if(!$e){if(this.expect(Ye.comma),this.afterTrailingComma(Ye.braceR))break}else $e=!1;i.push(this.parseImportSpecifier())}return i};vt.parseWithClause=function(){var i=[];if(!this.eat(Ye._with))return i;this.expect(Ye.braceL);var $e={},Be=!0;while(!this.eat(Ye.braceR)){if(!Be){if(this.expect(Ye.comma),this.afterTrailingComma(Ye.braceR))break}else Be=!1;var Fe=this.parseImportAttribute(),je=Fe.key.type==="Identifier"?Fe.key.name:Fe.key.value;if(hr($e,je))this.raiseRecoverable(Fe.key.start,"Duplicate attribute key '"+je+"'");$e[je]=!0,i.push(Fe)}return i};vt.parseImportAttribute=function(){var i=this.startNode();if(i.key=this.type===Ye.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Ye.colon),this.type!==Ye.string)this.unexpected();return i.value=this.parseExprAtom(),this.finishNode(i,"ImportAttribute")};vt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Ye.string){var i=this.parseLiteral(this.value);if(Td.test(i.value))this.raise(i.start,"An export name cannot include a lone surrogate.");return i}return this.parseIdent(!0)};vt.adaptDirectivePrologue=function(i){for(var $e=0;$e<i.length&&this.isDirectiveCandidate(i[$e]);++$e)i[$e].directive=i[$e].expression.raw.slice(1,-1)};vt.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 kn=jt.prototype;kn.toAssignable=function(i,$e,Be){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",Be)this.checkPatternErrors(Be,!0);for(var Fe=0,je=i.properties;Fe<je.length;Fe+=1){var We=je[Fe];if(this.toAssignable(We,$e),We.type==="RestElement"&&(We.argument.type==="ArrayPattern"||We.argument.type==="ObjectPattern"))this.raise(We.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,$e);break;case"ArrayExpression":if(i.type="ArrayPattern",Be)this.checkPatternErrors(Be,!0);this.toAssignableList(i.elements,$e);break;case"SpreadElement":if(i.type="RestElement",this.toAssignable(i.argument,$e),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,$e);break;case"ParenthesizedExpression":this.toAssignable(i.expression,$e,Be);break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!$e)break;default:this.raise(i.start,"Assigning to rvalue")}else if(Be)this.checkPatternErrors(Be,!0);return i};kn.toAssignableList=function(i,$e){var Be=i.length;for(var Fe=0;Fe<Be;Fe++){var je=i[Fe];if(je)this.toAssignable(je,$e)}if(Be){var We=i[Be-1];if(this.options.ecmaVersion===6&&$e&&We&&We.type==="RestElement"&&We.argument.type!=="Identifier")this.unexpected(We.argument.start)}return i};kn.parseSpread=function(i){var $e=this.startNode();return this.next(),$e.argument=this.parseMaybeAssign(!1,i),this.finishNode($e,"SpreadElement")};kn.parseRestBinding=function(){var i=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==Ye.name)this.unexpected();return i.argument=this.parseBindingAtom(),this.finishNode(i,"RestElement")};kn.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Ye.bracketL:var i=this.startNode();return this.next(),i.elements=this.parseBindingList(Ye.bracketR,!0,!0),this.finishNode(i,"ArrayPattern");case Ye.braceL:return this.parseObj(!0)}return this.parseIdent()};kn.parseBindingList=function(i,$e,Be,Fe){var je=[],We=!0;while(!this.eat(i)){if(We)We=!1;else this.expect(Ye.comma);if($e&&this.type===Ye.comma)je.push(null);else if(Be&&this.afterTrailingComma(i))break;else if(this.type===Ye.ellipsis){var Ve=this.parseRestBinding();if(this.parseBindingListItem(Ve),je.push(Ve),this.type===Ye.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(i);break}else je.push(this.parseAssignableListItem(Fe))}return je};kn.parseAssignableListItem=function(i){var $e=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem($e),$e};kn.parseBindingListItem=function(i){return i};kn.parseMaybeDefault=function(i,$e,Be){if(Be=Be||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Ye.eq))return Be;var Fe=this.startNodeAt(i,$e);return Fe.left=Be,Fe.right=this.parseMaybeAssign(),this.finishNode(Fe,"AssignmentPattern")};kn.checkLValSimple=function(i,$e,Be){if($e===void 0)$e=cs;var Fe=$e!==cs;switch(i.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(i.name))this.raiseRecoverable(i.start,(Fe?"Binding ":"Assigning to ")+i.name+" in strict mode");if(Fe){if($e===jn&&i.name==="let")this.raiseRecoverable(i.start,"let is disallowed as a lexically bound name");if(Be){if(hr(Be,i.name))this.raiseRecoverable(i.start,"Argument name clash");Be[i.name]=!0}if($e!==qa)this.declareName(i.name,$e,i.start)}break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(Fe)this.raiseRecoverable(i.start,"Binding member expression");break;case"ParenthesizedExpression":if(Fe)this.raiseRecoverable(i.start,"Binding parenthesized expression");return this.checkLValSimple(i.expression,$e,Be);default:this.raise(i.start,(Fe?"Binding":"Assigning to")+" rvalue")}};kn.checkLValPattern=function(i,$e,Be){if($e===void 0)$e=cs;switch(i.type){case"ObjectPattern":for(var Fe=0,je=i.properties;Fe<je.length;Fe+=1){var We=je[Fe];this.checkLValInnerPattern(We,$e,Be)}break;case"ArrayPattern":for(var Ve=0,Ge=i.elements;Ve<Ge.length;Ve+=1){var Ue=Ge[Ve];if(Ue)this.checkLValInnerPattern(Ue,$e,Be)}break;default:this.checkLValSimple(i,$e,Be)}};kn.checkLValInnerPattern=function(i,$e,Be){if($e===void 0)$e=cs;switch(i.type){case"Property":this.checkLValInnerPattern(i.value,$e,Be);break;case"AssignmentPattern":this.checkLValPattern(i.left,$e,Be);break;case"RestElement":this.checkLValPattern(i.argument,$e,Be);break;default:this.checkLValPattern(i,$e,Be)}};var vn=function($e,Be,Fe,je,We){this.token=$e,this.isExpr=!!Be,this.preserveSpace=!!Fe,this.override=je,this.generator=!!We},Ft={b_stat:new vn("{",!1),b_expr:new vn("{",!0),b_tmpl:new vn("${",!1),p_stat:new vn("(",!1),p_expr:new vn("(",!0),q_tmpl:new vn("`",!0,!0,function(i){return i.tryReadTemplateToken()}),f_stat:new vn("function",!1),f_expr:new vn("function",!0),f_expr_gen:new vn("function",!0,!1,null,!0),f_gen:new vn("function",!1,!1,null,!0)},mr=jt.prototype;mr.initialContext=function(){return[Ft.b_stat]};mr.curContext=function(){return this.context[this.context.length-1]};mr.braceIsBlock=function(i){var $e=this.curContext();if($e===Ft.f_expr||$e===Ft.f_stat)return!0;if(i===Ye.colon&&($e===Ft.b_stat||$e===Ft.b_expr))return!$e.isExpr;if(i===Ye._return||i===Ye.name&&this.exprAllowed)return on.test(this.input.slice(this.lastTokEnd,this.start));if(i===Ye._else||i===Ye.semi||i===Ye.eof||i===Ye.parenR||i===Ye.arrow)return!0;if(i===Ye.braceL)return $e===Ft.b_stat;if(i===Ye._var||i===Ye._const||i===Ye.name)return!1;return!this.exprAllowed};mr.inGeneratorContext=function(){for(var i=this.context.length-1;i>=1;i--){var $e=this.context[i];if($e.token==="function")return $e.generator}return!1};mr.updateContext=function(i){var $e,Be=this.type;if(Be.keyword&&i===Ye.dot)this.exprAllowed=!1;else if($e=Be.updateContext)$e.call(this,i);else this.exprAllowed=Be.beforeExpr};mr.overrideContext=function(i){if(this.curContext()!==i)this.context[this.context.length-1]=i};Ye.parenR.updateContext=Ye.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var i=this.context.pop();if(i===Ft.b_stat&&this.curContext().token==="function")i=this.context.pop();this.exprAllowed=!i.isExpr};Ye.braceL.updateContext=function(i){this.context.push(this.braceIsBlock(i)?Ft.b_stat:Ft.b_expr),this.exprAllowed=!0};Ye.dollarBraceL.updateContext=function(){this.context.push(Ft.b_tmpl),this.exprAllowed=!0};Ye.parenL.updateContext=function(i){var $e=i===Ye._if||i===Ye._for||i===Ye._with||i===Ye._while;this.context.push($e?Ft.p_stat:Ft.p_expr),this.exprAllowed=!0};Ye.incDec.updateContext=function(){};Ye._function.updateContext=Ye._class.updateContext=function(i){if(i.beforeExpr&&i!==Ye._else&&!(i===Ye.semi&&this.curContext()!==Ft.p_stat)&&!(i===Ye._return&&on.test(this.input.slice(this.lastTokEnd,this.start)))&&!((i===Ye.colon||i===Ye.braceL)&&this.curContext()===Ft.b_stat))this.context.push(Ft.f_expr);else this.context.push(Ft.f_stat);this.exprAllowed=!1};Ye.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};Ye.backQuote.updateContext=function(){if(this.curContext()===Ft.q_tmpl)this.context.pop();else this.context.push(Ft.q_tmpl);this.exprAllowed=!1};Ye.star.updateContext=function(i){if(i===Ye._function){var $e=this.context.length-1;if(this.context[$e]===Ft.f_expr)this.context[$e]=Ft.f_expr_gen;else this.context[$e]=Ft.f_gen}this.exprAllowed=!0};Ye.name.updateContext=function(i){var $e=!1;if(this.options.ecmaVersion>=6&&i!==Ye.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())$e=!0}this.exprAllowed=$e};var Tt=jt.prototype;Tt.checkPropClash=function(i,$e,Be){if(this.options.ecmaVersion>=9&&i.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(i.computed||i.method||i.shorthand))return;var Fe=i.key,je;switch(Fe.type){case"Identifier":je=Fe.name;break;case"Literal":je=String(Fe.value);break;default:return}var We=i.kind;if(this.options.ecmaVersion>=6){if(je==="__proto__"&&We==="init"){if($e.proto)if(Be){if(Be.doubleProto<0)Be.doubleProto=Fe.start}else this.raiseRecoverable(Fe.start,"Redefinition of __proto__ property");$e.proto=!0}return}je="$"+je;var Ve=$e[je];if(Ve){var Ge;if(We==="init")Ge=this.strict&&Ve.init||Ve.get||Ve.set;else Ge=Ve.init||Ve[We];if(Ge)this.raiseRecoverable(Fe.start,"Redefinition of property")}else Ve=$e[je]={init:!1,get:!1,set:!1};Ve[We]=!0};Tt.parseExpression=function(i,$e){var Be=this;return this.catchStackOverflow(function(){var{start:Fe,startLoc:je}=Be,We=Be.parseMaybeAssign(i,$e);if(Be.type===Ye.comma){var Ve=Be.startNodeAt(Fe,je);Ve.expressions=[We];while(Be.eat(Ye.comma))Ve.expressions.push(Be.parseMaybeAssign(i,$e));return Be.finishNode(Ve,"SequenceExpression")}return We})};Tt.parseMaybeAssign=function(i,$e,Be){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(i);else this.exprAllowed=!1;var Fe=!1,je=-1,We=-1,Ve=-1;if($e)je=$e.parenthesizedAssign,We=$e.trailingComma,Ve=$e.doubleProto,$e.parenthesizedAssign=$e.trailingComma=-1;else $e=new ms,Fe=!0;var Ge=this.start,Ue=this.startLoc;if(this.type===Ye.parenL||this.type===Ye.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=i==="await";var ze=this.parseMaybeConditional(i,$e);if(Be)ze=Be.call(this,ze,Ge,Ue);if(this.type.isAssign){var Ke=this.startNodeAt(Ge,Ue);if(Ke.operator=this.value,this.type===Ye.eq)ze=this.toAssignable(ze,!1,$e);if(!Fe)$e.parenthesizedAssign=$e.trailingComma=$e.doubleProto=-1;if($e.shorthandAssign>=ze.start)$e.shorthandAssign=-1;if(this.type===Ye.eq)this.checkLValPattern(ze);else this.checkLValSimple(ze);if(Ke.left=ze,this.next(),Ke.right=this.parseMaybeAssign(i),Ve>-1)$e.doubleProto=Ve;return this.finishNode(Ke,"AssignmentExpression")}else if(Fe)this.checkExpressionErrors($e,!0);if(je>-1)$e.parenthesizedAssign=je;if(We>-1)$e.trailingComma=We;return ze};Tt.parseMaybeConditional=function(i,$e){var Be=this.start,Fe=this.startLoc,je=this.parseExprOps(i,$e);if(this.checkExpressionErrors($e))return je;if(!(je.type==="ArrowFunctionExpression"&&je.start===Be)&&this.eat(Ye.question)){var We=this.startNodeAt(Be,Fe);return We.test=je,We.consequent=this.parseMaybeAssign(),this.expect(Ye.colon),We.alternate=this.parseMaybeAssign(i),this.finishNode(We,"ConditionalExpression")}return je};Tt.parseExprOps=function(i,$e){var Be=this.start,Fe=this.startLoc,je=this.parseMaybeUnary($e,!1,!1,i);if(this.checkExpressionErrors($e))return je;return je.start===Be&&je.type==="ArrowFunctionExpression"?je:this.parseExprOp(je,Be,Fe,-1,i)};Tt.parseExprOp=function(i,$e,Be,Fe,je){var We=this.type.binop;if(We!=null&&(!je||this.type!==Ye._in)){if(We>Fe){var Ve=this.type===Ye.logicalOR||this.type===Ye.logicalAND,Ge=this.type===Ye.coalesce;if(Ge)We=Ye.logicalAND.binop;var Ue=this.value;this.next();var ze=this.start,Ke=this.startLoc,Xe=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,je),ze,Ke,We,je),Ze=this.buildBinary($e,Be,i,Xe,Ue,Ve||Ge);if(Ve&&this.type===Ye.coalesce||Ge&&(this.type===Ye.logicalOR||this.type===Ye.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(Ze,$e,Be,Fe,je)}}return i};Tt.buildBinary=function(i,$e,Be,Fe,je,We){if(Fe.type==="PrivateIdentifier")this.raise(Fe.start,"Private identifier can only be left side of binary expression");var Ve=this.startNodeAt(i,$e);return Ve.left=Be,Ve.operator=je,Ve.right=Fe,this.finishNode(Ve,We?"LogicalExpression":"BinaryExpression")};Tt.parseMaybeUnary=function(i,$e,Be,Fe){var je=this.start,We=this.startLoc,Ve;if(this.isContextual("await")&&this.canAwait)Ve=this.parseAwait(Fe),$e=!0;else if(this.type.prefix){var Ge=this.startNode(),Ue=this.type===Ye.incDec;if(Ge.operator=this.value,Ge.prefix=!0,this.next(),Ge.argument=this.parseMaybeUnary(null,!0,Ue,Fe),this.checkExpressionErrors(i,!0),Ue)this.checkLValSimple(Ge.argument);else if(this.strict&&Ge.operator==="delete"&&Ua(Ge.argument))this.raiseRecoverable(Ge.start,"Deleting local variable in strict mode");else if(Ge.operator==="delete"&&Di(Ge.argument))this.raiseRecoverable(Ge.start,"Private fields can not be deleted");else $e=!0;Ve=this.finishNode(Ge,Ue?"UpdateExpression":"UnaryExpression")}else if(!$e&&this.type===Ye.privateId){if((Fe||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Ve=this.parsePrivateIdent(),this.type!==Ye._in)this.unexpected()}else{if(Ve=this.parseExprSubscripts(i,Fe),this.checkExpressionErrors(i))return Ve;while(this.type.postfix&&!this.canInsertSemicolon()){var ze=this.startNodeAt(je,We);ze.operator=this.value,ze.prefix=!1,ze.argument=Ve,this.checkLValSimple(Ve),this.next(),Ve=this.finishNode(ze,"UpdateExpression")}}if(!Be&&!(Ve.type==="ArrowFunctionExpression"&&Ve.start===je)&&this.eat(Ye.starstar))if($e)this.unexpected(this.lastTokStart);else return this.buildBinary(je,We,Ve,this.parseMaybeUnary(null,!1,!1,Fe),"**",!1);else return Ve};function Ua(i){return i.type==="Identifier"||i.type==="ParenthesizedExpression"&&Ua(i.expression)}function Di(i){return i.type==="MemberExpression"&&i.property.type==="PrivateIdentifier"||i.type==="ChainExpression"&&Di(i.expression)||i.type==="ParenthesizedExpression"&&Di(i.expression)}Tt.parseExprSubscripts=function(i,$e){var Be=this.start,Fe=this.startLoc,je=this.parseExprAtom(i,$e);if(je.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return je;var We=this.parseSubscripts(je,Be,Fe,!1,$e);if(i&&We.type==="MemberExpression"){if(i.parenthesizedAssign>=We.start)i.parenthesizedAssign=-1;if(i.parenthesizedBind>=We.start)i.parenthesizedBind=-1;if(i.trailingComma>=We.start)i.trailingComma=-1}return We};Tt.parseSubscripts=function(i,$e,Be,Fe,je){var We=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,Ve=!1;while(!0){var Ge=this.parseSubscript(i,$e,Be,Fe,We,Ve,je);if(Ge.optional)Ve=!0;if(Ge===i||Ge.type==="ArrowFunctionExpression"){if(Ve){var Ue=this.startNodeAt($e,Be);Ue.expression=Ge,Ge=this.finishNode(Ue,"ChainExpression")}return Ge}i=Ge}};Tt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Ye.arrow)};Tt.parseSubscriptAsyncArrow=function(i,$e,Be,Fe){return this.parseArrowExpression(this.startNodeAt(i,$e),Be,!0,Fe)};Tt.parseSubscript=function(i,$e,Be,Fe,je,We,Ve){var Ge=this.options.ecmaVersion>=11,Ue=Ge&&this.eat(Ye.questionDot);if(Fe&&Ue)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var ze=this.eat(Ye.bracketL);if(ze||Ue&&this.type!==Ye.parenL&&this.type!==Ye.backQuote||this.eat(Ye.dot)){var Ke=this.startNodeAt($e,Be);if(Ke.object=i,ze)Ke.property=this.parseExpression(),this.expect(Ye.bracketR);else if(this.type===Ye.privateId&&i.type!=="Super")Ke.property=this.parsePrivateIdent();else Ke.property=this.parseIdent(this.options.allowReserved!=="never");if(Ke.computed=!!ze,Ge)Ke.optional=Ue;i=this.finishNode(Ke,"MemberExpression")}else if(!Fe&&this.eat(Ye.parenL)){var Xe=new ms,Ze=this.yieldPos,et=this.awaitPos,nt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var st=this.parseExprList(Ye.parenR,this.options.ecmaVersion>=8,!1,Xe);if(je&&!Ue&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Xe,!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=et,this.awaitIdentPos=nt,this.parseSubscriptAsyncArrow($e,Be,st,Ve)}this.checkExpressionErrors(Xe,!0),this.yieldPos=Ze||this.yieldPos,this.awaitPos=et||this.awaitPos,this.awaitIdentPos=nt||this.awaitIdentPos;var ot=this.startNodeAt($e,Be);if(ot.callee=i,ot.arguments=st,Ge)ot.optional=Ue;i=this.finishNode(ot,"CallExpression")}else if(this.type===Ye.backQuote){if(Ue||We)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var ut=this.startNodeAt($e,Be);ut.tag=i,ut.quasi=this.parseTemplate({isTagged:!0}),i=this.finishNode(ut,"TaggedTemplateExpression")}return i};Tt.parseExprAtom=function(i,$e,Be){if(this.type===Ye.slash)this.readRegexp();var Fe,je=this.potentialArrowAt===this.start;switch(this.type){case Ye._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(Fe=this.startNode(),this.next(),this.type===Ye.parenL&&!this.allowDirectSuper)this.raise(Fe.start,"super() call outside constructor of a subclass");if(this.type!==Ye.dot&&this.type!==Ye.bracketL&&this.type!==Ye.parenL)this.unexpected();return this.finishNode(Fe,"Super");case Ye._this:return Fe=this.startNode(),this.next(),this.finishNode(Fe,"ThisExpression");case Ye.name:var We=this.start,Ve=this.startLoc,Ge=this.containsEsc,Ue=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Ge&&Ue.name==="async"&&!this.canInsertSemicolon()&&this.eat(Ye._function))return this.overrideContext(Ft.f_expr),this.parseFunction(this.startNodeAt(We,Ve),0,!1,!0,$e);if(je&&!this.canInsertSemicolon()){if(this.eat(Ye.arrow))return this.parseArrowExpression(this.startNodeAt(We,Ve),[Ue],!1,$e);if(this.options.ecmaVersion>=8&&Ue.name==="async"&&this.type===Ye.name&&!Ge&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Ue=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Ye.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(We,Ve),[Ue],!0,$e)}}return Ue;case Ye.regexp:var ze=this.value;return Fe=this.parseLiteral(ze.value),Fe.regex={pattern:ze.pattern,flags:ze.flags},Fe;case Ye.num:case Ye.string:return this.parseLiteral(this.value);case Ye._null:case Ye._true:case Ye._false:return Fe=this.startNode(),Fe.value=this.type===Ye._null?null:this.type===Ye._true,Fe.raw=this.type.keyword,this.next(),this.finishNode(Fe,"Literal");case Ye.parenL:var Ke=this.start,Xe=this.parseParenAndDistinguishExpression(je,$e);if(i){if(i.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Xe))i.parenthesizedAssign=Ke;if(i.parenthesizedBind<0)i.parenthesizedBind=Ke}return Xe;case Ye.bracketL:return Fe=this.startNode(),this.next(),Fe.elements=this.parseExprList(Ye.bracketR,!0,!0,i),this.finishNode(Fe,"ArrayExpression");case Ye.braceL:return this.overrideContext(Ft.b_expr),this.parseObj(!1,i);case Ye._function:return Fe=this.startNode(),this.next(),this.parseFunction(Fe,0);case Ye._class:return this.parseClass(this.startNode(),!1);case Ye._new:return this.parseNew();case Ye.backQuote:return this.parseTemplate();case Ye._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(Be);else return this.unexpected();default:return this.parseExprAtomDefault()}};Tt.parseExprAtomDefault=function(){this.unexpected()};Tt.parseExprImport=function(i){var $e=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===Ye.parenL&&!i)return this.parseDynamicImport($e);else if(this.type===Ye.dot){var Be=this.startNodeAt($e.start,$e.loc&&$e.loc.start);return Be.name="import",$e.meta=this.finishNode(Be,"Identifier"),this.parseImportMeta($e)}else this.unexpected()};Tt.parseDynamicImport=function(i){if(this.next(),i.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(Ye.parenR))if(this.expect(Ye.comma),!this.afterTrailingComma(Ye.parenR)){if(i.options=this.parseMaybeAssign(),!this.eat(Ye.parenR)){if(this.expect(Ye.comma),!this.afterTrailingComma(Ye.parenR))this.unexpected()}}else i.options=null;else i.options=null;else if(!this.eat(Ye.parenR)){var $e=this.start;if(this.eat(Ye.comma)&&this.eat(Ye.parenR))this.raiseRecoverable($e,"Trailing comma is not allowed in import()");else this.unexpected($e)}return this.finishNode(i,"ImportExpression")};Tt.parseImportMeta=function(i){this.next();var $e=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($e)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")};Tt.parseLiteral=function(i){var $e=this.startNode();if($e.value=i,$e.raw=this.input.slice(this.start,this.end),$e.raw.charCodeAt($e.raw.length-1)===110)$e.bigint=$e.value!=null?$e.value.toString():$e.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode($e,"Literal")};Tt.parseParenExpression=function(){this.expect(Ye.parenL);var i=this.parseExpression();return this.expect(Ye.parenR),i};Tt.shouldParseArrow=function(i){return!this.canInsertSemicolon()};Tt.parseParenAndDistinguishExpression=function(i,$e){var Be=this.start,Fe=this.startLoc,je,We=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Ve=this.start,Ge=this.startLoc,Ue=[],ze=!0,Ke=!1,Xe=new ms,Ze=this.yieldPos,et=this.awaitPos,nt;this.yieldPos=0,this.awaitPos=0;while(this.type!==Ye.parenR)if(ze?ze=!1:this.expect(Ye.comma),We&&this.afterTrailingComma(Ye.parenR,!0)){Ke=!0;break}else if(this.type===Ye.ellipsis){if(nt=this.start,Ue.push(this.parseParenItem(this.parseRestBinding())),this.type===Ye.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Ue.push(this.parseMaybeAssign(!1,Xe,this.parseParenItem));var st=this.lastTokEnd,ot=this.lastTokEndLoc;if(this.expect(Ye.parenR),i&&this.shouldParseArrow(Ue)&&this.eat(Ye.arrow))return this.checkPatternErrors(Xe,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Ze,this.awaitPos=et,this.parseParenArrowList(Be,Fe,Ue,$e);if(!Ue.length||Ke)this.unexpected(this.lastTokStart);if(nt)this.unexpected(nt);if(this.checkExpressionErrors(Xe,!0),this.yieldPos=Ze||this.yieldPos,this.awaitPos=et||this.awaitPos,Ue.length>1)je=this.startNodeAt(Ve,Ge),je.expressions=Ue,this.finishNodeAt(je,"SequenceExpression",st,ot);else je=Ue[0]}else je=this.parseParenExpression();if(this.options.preserveParens){var ut=this.startNodeAt(Be,Fe);return ut.expression=je,this.finishNode(ut,"ParenthesizedExpression")}else return je};Tt.parseParenItem=function(i){return i};Tt.parseParenArrowList=function(i,$e,Be,Fe){return this.parseArrowExpression(this.startNodeAt(i,$e),Be,!1,Fe)};var _d=[];Tt.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===Ye.dot){var $e=this.startNodeAt(i.start,i.loc&&i.loc.start);$e.name="new",i.meta=this.finishNode($e,"Identifier"),this.next();var Be=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(Be)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 Fe=this.start,je=this.startLoc;if(i.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Fe,je,!0,!1),i.callee.type==="Super")this.raiseRecoverable(Fe,"Invalid use of 'super'");if(this.eat(Ye.parenL))i.arguments=this.parseExprList(Ye.parenR,this.options.ecmaVersion>=8,!1);else i.arguments=_d;return this.finishNode(i,"NewExpression")};Tt.parseTemplateElement=function(i){var $e=i.isTagged,Be=this.startNode();if(this.type===Ye.invalidTemplate){if(!$e)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");Be.value={raw:this.value.replace(/\r\n?/g,`
4
- `),cooked:null}}else Be.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
5
- `),cooked:this.value};return this.next(),Be.tail=this.type===Ye.backQuote,this.finishNode(Be,"TemplateElement")};Tt.parseTemplate=function(i){if(i===void 0)i={};var $e=i.isTagged;if($e===void 0)$e=!1;var Be=this.startNode();this.next(),Be.expressions=[];var Fe=this.parseTemplateElement({isTagged:$e});Be.quasis=[Fe];while(!Fe.tail){if(this.type===Ye.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Ye.dollarBraceL),Be.expressions.push(this.parseExpression()),this.expect(Ye.braceR),Be.quasis.push(Fe=this.parseTemplateElement({isTagged:$e}))}return this.next(),this.finishNode(Be,"TemplateLiteral")};Tt.isAsyncProp=function(i){return!i.computed&&i.key.type==="Identifier"&&i.key.name==="async"&&(this.type===Ye.name||this.type===Ye.num||this.type===Ye.string||this.type===Ye.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Ye.star)&&!on.test(this.input.slice(this.lastTokEnd,this.start))};Tt.parseObj=function(i,$e){var Be=this.startNode(),Fe=!0,je={};Be.properties=[],this.next();while(!this.eat(Ye.braceR)){if(!Fe){if(this.expect(Ye.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Ye.braceR))break}else Fe=!1;var We=this.parseProperty(i,$e);if(!i)this.checkPropClash(We,je,$e);Be.properties.push(We)}return this.finishNode(Be,i?"ObjectPattern":"ObjectExpression")};Tt.parseProperty=function(i,$e){var Be=this.startNode(),Fe,je,We,Ve;if(this.options.ecmaVersion>=9&&this.eat(Ye.ellipsis)){if(i){if(Be.argument=this.parseIdent(!1),this.type===Ye.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(Be,"RestElement")}if(Be.argument=this.parseMaybeAssign(!1,$e),this.type===Ye.comma&&$e&&$e.trailingComma<0)$e.trailingComma=this.start;return this.finishNode(Be,"SpreadElement")}if(this.options.ecmaVersion>=6){if(Be.method=!1,Be.shorthand=!1,i||$e)We=this.start,Ve=this.startLoc;if(!i)Fe=this.eat(Ye.star)}var Ge=this.containsEsc;if(this.parsePropertyName(Be),!i&&!Ge&&this.options.ecmaVersion>=8&&!Fe&&this.isAsyncProp(Be))je=!0,Fe=this.options.ecmaVersion>=9&&this.eat(Ye.star),this.parsePropertyName(Be);else je=!1;return this.parsePropertyValue(Be,i,Fe,je,We,Ve,$e,Ge),this.finishNode(Be,"Property")};Tt.parseGetterSetter=function(i){var $e=i.key.name;this.parsePropertyName(i),i.value=this.parseMethod(!1),i.kind=$e;var Be=i.kind==="get"?0:1;if(i.value.params.length!==Be){var Fe=i.value.start;if(i.kind==="get")this.raiseRecoverable(Fe,"getter should have no params");else this.raiseRecoverable(Fe,"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")};Tt.parsePropertyValue=function(i,$e,Be,Fe,je,We,Ve,Ge){if((Be||Fe)&&this.type===Ye.colon)this.unexpected();if(this.eat(Ye.colon))i.value=$e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Ve),i.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Ye.parenL){if($e)this.unexpected();i.method=!0,i.value=this.parseMethod(Be,Fe),i.kind="init"}else if(!$e&&!Ge&&this.options.ecmaVersion>=5&&!i.computed&&i.key.type==="Identifier"&&(i.key.name==="get"||i.key.name==="set")&&(this.type!==Ye.comma&&this.type!==Ye.braceR&&this.type!==Ye.eq)){if(Be||Fe)this.unexpected();this.parseGetterSetter(i)}else if(this.options.ecmaVersion>=6&&!i.computed&&i.key.type==="Identifier"){if(Be||Fe)this.unexpected();if(this.checkUnreserved(i.key),i.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=je;if($e)i.value=this.parseMaybeDefault(je,We,this.copyNode(i.key));else if(this.type===Ye.eq&&Ve){if(Ve.shorthandAssign<0)Ve.shorthandAssign=this.start;i.value=this.parseMaybeDefault(je,We,this.copyNode(i.key))}else i.value=this.copyNode(i.key);i.kind="init",i.shorthand=!0}else this.unexpected()};Tt.parsePropertyName=function(i){if(this.options.ecmaVersion>=6)if(this.eat(Ye.bracketL))return i.computed=!0,i.key=this.parseMaybeAssign(),this.expect(Ye.bracketR),i.key;else i.computed=!1;return i.key=this.type===Ye.num||this.type===Ye.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Tt.initFunction=function(i){if(i.id=null,this.options.ecmaVersion>=6)i.generator=i.expression=!1;if(this.options.ecmaVersion>=8)i.async=!1};Tt.parseMethod=function(i,$e,Be){var Fe=this.startNode(),je=this.yieldPos,We=this.awaitPos,Ve=this.awaitIdentPos;if(this.initFunction(Fe),this.options.ecmaVersion>=6)Fe.generator=i;if(this.options.ecmaVersion>=8)Fe.async=!!$e;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Mi($e,Fe.generator)|fs|(Be?Fa:0)),this.expect(Ye.parenL),Fe.params=this.parseBindingList(Ye.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Fe,!1,!0,!1),this.yieldPos=je,this.awaitPos=We,this.awaitIdentPos=Ve,this.finishNode(Fe,"FunctionExpression")};Tt.parseArrowExpression=function(i,$e,Be,Fe){var je=this.yieldPos,We=this.awaitPos,Ve=this.awaitIdentPos;if(this.enterScope(Mi(Be,!1)|Oi),this.initFunction(i),this.options.ecmaVersion>=8)i.async=!!Be;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,i.params=this.toAssignableList($e,!0),this.parseFunctionBody(i,!0,!1,Fe),this.yieldPos=je,this.awaitPos=We,this.awaitIdentPos=Ve,this.finishNode(i,"ArrowFunctionExpression")};Tt.parseFunctionBody=function(i,$e,Be,Fe){var je=$e&&this.type!==Ye.braceL,We=this.strict,Ve=!1;if(je)i.body=this.parseMaybeAssign(Fe),i.expression=!0,this.checkParams(i,!1);else{var Ge=this.options.ecmaVersion>=7&&!this.isSimpleParamList(i.params);if(!We||Ge){if(Ve=this.strictDirective(this.end),Ve&&Ge)this.raiseRecoverable(i.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Ue=this.labels;if(this.labels=[],Ve)this.strict=!0;if(this.checkParams(i,!We&&!Ve&&!$e&&!Be&&this.isSimpleParamList(i.params)),this.strict&&i.id)this.checkLValSimple(i.id,qa);i.body=this.parseBlock(!1,void 0,Ve&&!We),i.expression=!1,this.adaptDirectivePrologue(i.body.body),this.labels=Ue}this.exitScope()};Tt.isSimpleParamList=function(i){for(var $e=0,Be=i;$e<Be.length;$e+=1){var Fe=Be[$e];if(Fe.type!=="Identifier")return!1}return!0};Tt.checkParams=function(i,$e){var Be=Object.create(null);for(var Fe=0,je=i.params;Fe<je.length;Fe+=1){var We=je[Fe];this.checkLValInnerPattern(We,$i,$e?null:Be)}};Tt.parseExprList=function(i,$e,Be,Fe){var je=[],We=!0;while(!this.eat(i)){if(!We){if(this.expect(Ye.comma),$e&&this.afterTrailingComma(i))break}else We=!1;var Ve=void 0;if(Be&&this.type===Ye.comma)Ve=null;else if(this.type===Ye.ellipsis){if(Ve=this.parseSpread(Fe),Fe&&this.type===Ye.comma&&Fe.trailingComma<0)Fe.trailingComma=this.start}else Ve=this.parseMaybeAssign(!1,Fe);je.push(Ve)}return je};Tt.checkUnreserved=function(i){var{start:$e,end:Be,name:Fe}=i;if(this.inGenerator&&Fe==="yield")this.raiseRecoverable($e,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&Fe==="await")this.raiseRecoverable($e,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&hs)&&Fe==="arguments")this.raiseRecoverable($e,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(Fe==="arguments"||Fe==="await"))this.raise($e,"Cannot use "+Fe+" in class static initialization block");if(this.keywords.test(Fe))this.raise($e,"Unexpected keyword '"+Fe+"'");if(this.options.ecmaVersion<6&&this.input.slice($e,Be).indexOf("\\")!==-1)return;var je=this.strict?this.reservedWordsStrict:this.reservedWords;if(je.test(Fe)){if(!this.inAsync&&Fe==="await")this.raiseRecoverable($e,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable($e,"The keyword '"+Fe+"' is reserved")}};Tt.parseIdent=function(i){var $e=this.parseIdentNode();if(this.next(!!i),this.finishNode($e,"Identifier"),!i){if(this.checkUnreserved($e),$e.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=$e.start}return $e};Tt.parseIdentNode=function(){var i=this.startNode();if(this.type===Ye.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=Ye.name}else this.unexpected();return i};Tt.parsePrivateIdent=function(){var i=this.startNode();if(this.type===Ye.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};Tt.parseYield=function(i){if(!this.yieldPos)this.yieldPos=this.start;var $e=this.startNode();if(this.next(),this.type===Ye.semi||this.canInsertSemicolon()||this.type!==Ye.star&&!this.type.startsExpr)$e.delegate=!1,$e.argument=null;else $e.delegate=this.eat(Ye.star),$e.argument=this.parseMaybeAssign(i);return this.finishNode($e,"YieldExpression")};Tt.parseAwait=function(i){if(!this.awaitPos)this.awaitPos=this.start;var $e=this.startNode();return this.next(),$e.argument=this.parseMaybeUnary(null,!0,!1,i),this.finishNode($e,"AwaitExpression")};var ps=jt.prototype;ps.raise=function(i,$e){var Be=Ri(this.input,i);if($e+=" ("+Be.line+":"+Be.column+")",this.sourceFile)$e+=" in "+this.sourceFile;var Fe=SyntaxError($e);throw Fe.pos=i,Fe.loc=Be,Fe.raisedAt=this.pos,Fe};ps.raiseRecoverable=ps.raise;ps.curPosition=function(){if(this.options.locations)return new fr(this.curLine,this.pos-this.lineStart)};var Kn=jt.prototype,Id=function($e){this.flags=$e,this.var=[],this.lexical=[],this.functions=[]};Kn.enterScope=function(i){this.scopeStack.push(new Id(i))};Kn.exitScope=function(){this.scopeStack.pop()};Kn.treatFunctionsAsVarInScope=function(i){return i.flags&tr||!this.inModule&&i.flags&Zn};Kn.declareName=function(i,$e,Be){var Fe=!1;if($e===jn){var je=this.currentScope();if(Fe=je.lexical.indexOf(i)>-1||je.functions.indexOf(i)>-1||je.var.indexOf(i)>-1,je.lexical.push(i),this.inModule&&je.flags&Zn)delete this.undefinedExports[i]}else if($e===Wa){var We=this.currentScope();We.lexical.push(i)}else if($e===Va){var Ve=this.currentScope();if(this.treatFunctionsAsVar)Fe=Ve.lexical.indexOf(i)>-1;else Fe=Ve.lexical.indexOf(i)>-1||Ve.var.indexOf(i)>-1;Ve.functions.push(i)}else for(var Ge=this.scopeStack.length-1;Ge>=0;--Ge){var Ue=this.scopeStack[Ge];if(Ue.lexical.indexOf(i)>-1&&!(Ue.flags&Ba&&Ue.lexical[0]===i)||!this.treatFunctionsAsVarInScope(Ue)&&Ue.functions.indexOf(i)>-1){Fe=!0;break}if(Ue.var.push(i),this.inModule&&Ue.flags&Zn)delete this.undefinedExports[i];if(Ue.flags&hs)break}if(Fe)this.raiseRecoverable(Be,"Identifier '"+i+"' has already been declared")};Kn.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};Kn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Kn.currentVarScope=function(){for(var i=this.scopeStack.length-1;;i--){var $e=this.scopeStack[i];if($e.flags&(hs|Or|nr))return $e}};Kn.currentThisScope=function(){for(var i=this.scopeStack.length-1;;i--){var $e=this.scopeStack[i];if($e.flags&(hs|Or|nr)&&!($e.flags&Oi))return $e}};var Mr=function($e,Be,Fe){if(this.type="",this.start=Be,this.end=0,$e.options.locations)this.loc=new Lr($e,Fe);if($e.options.directSourceFile)this.sourceFile=$e.options.directSourceFile;if($e.options.ranges)this.range=[Be,0]},$r=jt.prototype;$r.startNode=function(){return new Mr(this,this.start,this.startLoc)};$r.startNodeAt=function(i,$e){return new Mr(this,i,$e)};function Ha(i,$e,Be,Fe){if(i.type=$e,i.end=Be,this.options.locations)i.loc.end=Fe;if(this.options.ranges)i.range[1]=Be;return i}$r.finishNode=function(i,$e){return Ha.call(this,i,$e,this.lastTokEnd,this.lastTokEndLoc)};$r.finishNodeAt=function(i,$e,Be,Fe){return Ha.call(this,i,$e,Be,Fe)};$r.copyNode=function(i){var $e=new Mr(this,i.start,this.startLoc);for(var Be in i)$e[Be]=i[Be];return $e};var Rd="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",Ka="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",za=Ka+" Extended_Pictographic",Xa=za,Ja=Xa+" EBase EComp EMod EPres ExtPict",Ya=Ja,Ld=Ya,Od={9:Ka,10:za,11:Xa,12:Ja,13:Ya,14:Ld},Md="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",$d={9:"",10:"",11:"",12:"",13:"",14:Md},Da="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",Qa="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",Za=Qa+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ec=Za+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",tc=ec+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",nc=tc+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Bd=nc+" "+Rd,Fd={9:Qa,10:Za,11:ec,12:tc,13:nc,14:Bd},rc={};function jd(i){var $e=rc[i]={binary:Hn(Od[i]+" "+Da),binaryOfStrings:Hn($d[i]),nonBinary:{General_Category:Hn(Da),Script:Hn(Fd[i])}};$e.nonBinary.Script_Extensions=$e.nonBinary.Script,$e.nonBinary.gc=$e.nonBinary.General_Category,$e.nonBinary.sc=$e.nonBinary.Script,$e.nonBinary.scx=$e.nonBinary.Script_Extensions}for(Ir=0,os=[9,10,11,12,13,14];Ir<os.length;Ir+=1)_i=os[Ir],jd(_i);var _i,Ir,os,bt=jt.prototype,us=function($e,Be){this.parent=$e,this.base=Be||this};us.prototype.separatedFrom=function($e){for(var Be=this;Be;Be=Be.parent)for(var Fe=$e;Fe;Fe=Fe.parent)if(Be.base===Fe.base&&Be!==Fe)return!0;return!1};us.prototype.sibling=function(){return new us(this.parent,this.base)};var Nn=function($e){this.parser=$e,this.validFlags="gim"+($e.options.ecmaVersion>=6?"uy":"")+($e.options.ecmaVersion>=9?"s":"")+($e.options.ecmaVersion>=13?"d":"")+($e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=rc[$e.options.ecmaVersion>=14?14:$e.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};Nn.prototype.reset=function($e,Be,Fe){var je=Fe.indexOf("v")!==-1,We=Fe.indexOf("u")!==-1;if(this.start=$e|0,this.source=Be+"",this.flags=Fe,je&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=We&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=We&&this.parser.options.ecmaVersion>=9};Nn.prototype.raise=function($e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+$e)};Nn.prototype.at=function($e,Be){if(Be===void 0)Be=!1;var Fe=this.source,je=Fe.length;if($e>=je)return-1;var We=Fe.charCodeAt($e);if(!(Be||this.switchU)||We<=55295||We>=57344||$e+1>=je)return We;var Ve=Fe.charCodeAt($e+1);return Ve>=56320&&Ve<=57343?(We<<10)+Ve-56613888:We};Nn.prototype.nextIndex=function($e,Be){if(Be===void 0)Be=!1;var Fe=this.source,je=Fe.length;if($e>=je)return je;var We=Fe.charCodeAt($e),Ve;if(!(Be||this.switchU)||We<=55295||We>=57344||$e+1>=je||(Ve=Fe.charCodeAt($e+1))<56320||Ve>57343)return $e+1;return $e+2};Nn.prototype.current=function($e){if($e===void 0)$e=!1;return this.at(this.pos,$e)};Nn.prototype.lookahead=function($e){if($e===void 0)$e=!1;return this.at(this.nextIndex(this.pos,$e),$e)};Nn.prototype.advance=function($e){if($e===void 0)$e=!1;this.pos=this.nextIndex(this.pos,$e)};Nn.prototype.eat=function($e,Be){if(Be===void 0)Be=!1;if(this.current(Be)===$e)return this.advance(Be),!0;return!1};Nn.prototype.eatChars=function($e,Be){if(Be===void 0)Be=!1;var Fe=this.pos;for(var je=0,We=$e;je<We.length;je+=1){var Ve=We[je],Ge=this.at(Fe,Be);if(Ge===-1||Ge!==Ve)return!1;Fe=this.nextIndex(Fe,Be)}return this.pos=Fe,!0};bt.validateRegExpFlags=function(i){var{validFlags:$e,flags:Be}=i,Fe=!1,je=!1;for(var We=0;We<Be.length;We++){var Ve=Be.charAt(We);if($e.indexOf(Ve)===-1)this.raise(i.start,"Invalid regular expression flag");if(Be.indexOf(Ve,We+1)>-1)this.raise(i.start,"Duplicate regular expression flag");if(Ve==="u")Fe=!0;if(Ve==="v")je=!0}if(this.options.ecmaVersion>=15&&Fe&&je)this.raise(i.start,"Invalid regular expression flag")};function Vd(i){for(var $e in i)return!0;return!1}bt.validateRegExpPattern=function(i){if(this.regexp_pattern(i),!i.switchN&&this.options.ecmaVersion>=9&&Vd(i.groupNames))i.switchN=!0,this.regexp_pattern(i)};bt.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 $e=0,Be=i.backReferenceNames;$e<Be.length;$e+=1){var Fe=Be[$e];if(!i.groupNames[Fe])i.raise("Invalid named capture referenced")}};bt.regexp_disjunction=function(i){var $e=this.options.ecmaVersion>=16;if($e)i.branchID=new us(i.branchID,null);this.regexp_alternative(i);while(i.eat(124)){if($e)i.branchID=i.branchID.sibling();this.regexp_alternative(i)}if($e)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")};bt.regexp_alternative=function(i){while(i.pos<i.source.length&&this.regexp_eatTerm(i));};bt.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};bt.regexp_eatAssertion=function(i){var $e=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=$e}if(i.eat(40)&&i.eat(63)){var Be=!1;if(this.options.ecmaVersion>=9)Be=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=!Be,!0}}return i.pos=$e,!1};bt.regexp_eatQuantifier=function(i,$e){if($e===void 0)$e=!1;if(this.regexp_eatQuantifierPrefix(i,$e))return i.eat(63),!0;return!1};bt.regexp_eatQuantifierPrefix=function(i,$e){return i.eat(42)||i.eat(43)||i.eat(63)||this.regexp_eatBracedQuantifier(i,$e)};bt.regexp_eatBracedQuantifier=function(i,$e){var Be=i.pos;if(i.eat(123)){var Fe=0,je=-1;if(this.regexp_eatDecimalDigits(i)){if(Fe=i.lastIntValue,i.eat(44)&&this.regexp_eatDecimalDigits(i))je=i.lastIntValue;if(i.eat(125)){if(je!==-1&&je<Fe&&!$e)i.raise("numbers out of order in {} quantifier");return!0}}if(i.switchU&&!$e)i.raise("Incomplete quantifier");i.pos=Be}return!1};bt.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)};bt.regexp_eatReverseSolidusAtomEscape=function(i){var $e=i.pos;if(i.eat(92)){if(this.regexp_eatAtomEscape(i))return!0;i.pos=$e}return!1};bt.regexp_eatUncapturingGroup=function(i){var $e=i.pos;if(i.eat(40)){if(i.eat(63)){if(this.options.ecmaVersion>=16){var Be=this.regexp_eatModifiers(i),Fe=i.eat(45);if(Be||Fe){for(var je=0;je<Be.length;je++){var We=Be.charAt(je);if(Be.indexOf(We,je+1)>-1)i.raise("Duplicate regular expression modifiers")}if(Fe){var Ve=this.regexp_eatModifiers(i);if(!Be&&!Ve&&i.current()===58)i.raise("Invalid regular expression modifiers");for(var Ge=0;Ge<Ve.length;Ge++){var Ue=Ve.charAt(Ge);if(Ve.indexOf(Ue,Ge+1)>-1||Be.indexOf(Ue)>-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=$e}return!1};bt.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};bt.regexp_eatModifiers=function(i){var $e="",Be=0;while((Be=i.current())!==-1&&Wd(Be))$e+=Bn(Be),i.advance();return $e};function Wd(i){return i===105||i===109||i===115}bt.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)};bt.regexp_eatInvalidBracedQuantifier=function(i){if(this.regexp_eatBracedQuantifier(i,!0))i.raise("Nothing to repeat");return!1};bt.regexp_eatSyntaxCharacter=function(i){var $e=i.current();if(sc($e))return i.lastIntValue=$e,i.advance(),!0;return!1};function sc(i){return i===36||i>=40&&i<=43||i===46||i===63||i>=91&&i<=94||i>=123&&i<=125}bt.regexp_eatPatternCharacters=function(i){var $e=i.pos,Be=0;while((Be=i.current())!==-1&&!sc(Be))i.advance();return i.pos!==$e};bt.regexp_eatExtendedPatternCharacter=function(i){var $e=i.current();if($e!==-1&&$e!==36&&!($e>=40&&$e<=43)&&$e!==46&&$e!==63&&$e!==91&&$e!==94&&$e!==124)return i.advance(),!0;return!1};bt.regexp_groupSpecifier=function(i){if(i.eat(63)){if(!this.regexp_eatGroupName(i))i.raise("Invalid group");var $e=this.options.ecmaVersion>=16,Be=i.groupNames[i.lastStringValue];if(Be)if($e)for(var Fe=0,je=Be;Fe<je.length;Fe+=1){var We=je[Fe];if(!We.separatedFrom(i.branchID))i.raise("Duplicate capture group name")}else i.raise("Duplicate capture group name");if($e)(Be||(i.groupNames[i.lastStringValue]=[])).push(i.branchID);else i.groupNames[i.lastStringValue]=!0}};bt.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};bt.regexp_eatRegExpIdentifierName=function(i){if(i.lastStringValue="",this.regexp_eatRegExpIdentifierStart(i)){i.lastStringValue+=Bn(i.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(i))i.lastStringValue+=Bn(i.lastIntValue);return!0}return!1};bt.regexp_eatRegExpIdentifierStart=function(i){var $e=i.pos,Be=this.options.ecmaVersion>=11,Fe=i.current(Be);if(i.advance(Be),Fe===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Be))Fe=i.lastIntValue;if(qd(Fe))return i.lastIntValue=Fe,!0;return i.pos=$e,!1};function qd(i){return sn(i,!0)||i===36||i===95}bt.regexp_eatRegExpIdentifierPart=function(i){var $e=i.pos,Be=this.options.ecmaVersion>=11,Fe=i.current(Be);if(i.advance(Be),Fe===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Be))Fe=i.lastIntValue;if(Gd(Fe))return i.lastIntValue=Fe,!0;return i.pos=$e,!1};function Gd(i){return un(i,!0)||i===36||i===95||i===8204||i===8205}bt.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};bt.regexp_eatBackReference=function(i){var $e=i.pos;if(this.regexp_eatDecimalEscape(i)){var Be=i.lastIntValue;if(i.switchU){if(Be>i.maxBackReference)i.maxBackReference=Be;return!0}if(Be<=i.numCapturingParens)return!0;i.pos=$e}return!1};bt.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};bt.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)};bt.regexp_eatCControlLetter=function(i){var $e=i.pos;if(i.eat(99)){if(this.regexp_eatControlLetter(i))return!0;i.pos=$e}return!1};bt.regexp_eatZero=function(i){if(i.current()===48&&!ys(i.lookahead()))return i.lastIntValue=0,i.advance(),!0;return!1};bt.regexp_eatControlEscape=function(i){var $e=i.current();if($e===116)return i.lastIntValue=9,i.advance(),!0;if($e===110)return i.lastIntValue=10,i.advance(),!0;if($e===118)return i.lastIntValue=11,i.advance(),!0;if($e===102)return i.lastIntValue=12,i.advance(),!0;if($e===114)return i.lastIntValue=13,i.advance(),!0;return!1};bt.regexp_eatControlLetter=function(i){var $e=i.current();if(ic($e))return i.lastIntValue=$e%32,i.advance(),!0;return!1};function ic(i){return i>=65&&i<=90||i>=97&&i<=122}bt.regexp_eatRegExpUnicodeEscapeSequence=function(i,$e){if($e===void 0)$e=!1;var Be=i.pos,Fe=$e||i.switchU;if(i.eat(117)){if(this.regexp_eatFixedHexDigits(i,4)){var je=i.lastIntValue;if(Fe&&je>=55296&&je<=56319){var We=i.pos;if(i.eat(92)&&i.eat(117)&&this.regexp_eatFixedHexDigits(i,4)){var Ve=i.lastIntValue;if(Ve>=56320&&Ve<=57343)return i.lastIntValue=(je-55296)*1024+(Ve-56320)+65536,!0}i.pos=We,i.lastIntValue=je}return!0}if(Fe&&i.eat(123)&&this.regexp_eatHexDigits(i)&&i.eat(125)&&Ud(i.lastIntValue))return!0;if(Fe)i.raise("Invalid unicode escape");i.pos=Be}return!1};function Ud(i){return i>=0&&i<=1114111}bt.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 $e=i.current();if($e!==99&&(!i.switchN||$e!==107))return i.lastIntValue=$e,i.advance(),!0;return!1};bt.regexp_eatDecimalEscape=function(i){i.lastIntValue=0;var $e=i.current();if($e>=49&&$e<=57){do i.lastIntValue=10*i.lastIntValue+($e-48),i.advance();while(($e=i.current())>=48&&$e<=57);return!0}return!1};var oc=0,Fn=1,Sn=2;bt.regexp_eatCharacterClassEscape=function(i){var $e=i.current();if(Hd($e))return i.lastIntValue=-1,i.advance(),Fn;var Be=!1;if(i.switchU&&this.options.ecmaVersion>=9&&((Be=$e===80)||$e===112)){i.lastIntValue=-1,i.advance();var Fe;if(i.eat(123)&&(Fe=this.regexp_eatUnicodePropertyValueExpression(i))&&i.eat(125)){if(Be&&Fe===Sn)i.raise("Invalid property name");return Fe}i.raise("Invalid property name")}return oc};function Hd(i){return i===100||i===68||i===115||i===83||i===119||i===87}bt.regexp_eatUnicodePropertyValueExpression=function(i){var $e=i.pos;if(this.regexp_eatUnicodePropertyName(i)&&i.eat(61)){var Be=i.lastStringValue;if(this.regexp_eatUnicodePropertyValue(i)){var Fe=i.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(i,Be,Fe),Fn}}if(i.pos=$e,this.regexp_eatLoneUnicodePropertyNameOrValue(i)){var je=i.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(i,je)}return oc};bt.regexp_validateUnicodePropertyNameAndValue=function(i,$e,Be){if(!hr(i.unicodeProperties.nonBinary,$e))i.raise("Invalid property name");if(!i.unicodeProperties.nonBinary[$e].test(Be))i.raise("Invalid property value")};bt.regexp_validateUnicodePropertyNameOrValue=function(i,$e){if(i.unicodeProperties.binary.test($e))return Fn;if(i.switchV&&i.unicodeProperties.binaryOfStrings.test($e))return Sn;i.raise("Invalid property name")};bt.regexp_eatUnicodePropertyName=function(i){var $e=0;i.lastStringValue="";while(ac($e=i.current()))i.lastStringValue+=Bn($e),i.advance();return i.lastStringValue!==""};function ac(i){return ic(i)||i===95}bt.regexp_eatUnicodePropertyValue=function(i){var $e=0;i.lastStringValue="";while(Kd($e=i.current()))i.lastStringValue+=Bn($e),i.advance();return i.lastStringValue!==""};function Kd(i){return ac(i)||ys(i)}bt.regexp_eatLoneUnicodePropertyNameOrValue=function(i){return this.regexp_eatUnicodePropertyValue(i)};bt.regexp_eatCharacterClass=function(i){if(i.eat(91)){var $e=i.eat(94),Be=this.regexp_classContents(i);if(!i.eat(93))i.raise("Unterminated character class");if($e&&Be===Sn)i.raise("Negated character class may contain strings");return!0}return!1};bt.regexp_classContents=function(i){if(i.current()===93)return Fn;if(i.switchV)return this.regexp_classSetExpression(i);return this.regexp_nonEmptyClassRanges(i),Fn};bt.regexp_nonEmptyClassRanges=function(i){while(this.regexp_eatClassAtom(i)){var $e=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassAtom(i)){var Be=i.lastIntValue;if(i.switchU&&($e===-1||Be===-1))i.raise("Invalid character class");if($e!==-1&&Be!==-1&&$e>Be)i.raise("Range out of order in character class")}}};bt.regexp_eatClassAtom=function(i){var $e=i.pos;if(i.eat(92)){if(this.regexp_eatClassEscape(i))return!0;if(i.switchU){var Be=i.current();if(Be===99||pc(Be))i.raise("Invalid class escape");i.raise("Invalid escape")}i.pos=$e}var Fe=i.current();if(Fe!==93)return i.lastIntValue=Fe,i.advance(),!0;return!1};bt.regexp_eatClassEscape=function(i){var $e=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=$e}return this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)};bt.regexp_classSetExpression=function(i){var $e=Fn,Be;if(this.regexp_eatClassSetRange(i));else if(Be=this.regexp_eatClassSetOperand(i)){if(Be===Sn)$e=Sn;var Fe=i.pos;while(i.eatChars([38,38])){if(i.current()!==38&&(Be=this.regexp_eatClassSetOperand(i))){if(Be!==Sn)$e=Fn;continue}i.raise("Invalid character in character class")}if(Fe!==i.pos)return $e;while(i.eatChars([45,45])){if(this.regexp_eatClassSetOperand(i))continue;i.raise("Invalid character in character class")}if(Fe!==i.pos)return $e}else i.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(i))continue;if(Be=this.regexp_eatClassSetOperand(i),!Be)return $e;if(Be===Sn)$e=Sn}};bt.regexp_eatClassSetRange=function(i){var $e=i.pos;if(this.regexp_eatClassSetCharacter(i)){var Be=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassSetCharacter(i)){var Fe=i.lastIntValue;if(Be!==-1&&Fe!==-1&&Be>Fe)i.raise("Range out of order in character class");return!0}i.pos=$e}return!1};bt.regexp_eatClassSetOperand=function(i){if(this.regexp_eatClassSetCharacter(i))return Fn;return this.regexp_eatClassStringDisjunction(i)||this.regexp_eatNestedClass(i)};bt.regexp_eatNestedClass=function(i){var $e=i.pos;if(i.eat(91)){var Be=i.eat(94),Fe=this.regexp_classContents(i);if(i.eat(93)){if(Be&&Fe===Sn)i.raise("Negated character class may contain strings");return Fe}i.pos=$e}if(i.eat(92)){var je=this.regexp_eatCharacterClassEscape(i);if(je)return je;i.pos=$e}return null};bt.regexp_eatClassStringDisjunction=function(i){var $e=i.pos;if(i.eatChars([92,113])){if(i.eat(123)){var Be=this.regexp_classStringDisjunctionContents(i);if(i.eat(125))return Be}else i.raise("Invalid escape");i.pos=$e}return null};bt.regexp_classStringDisjunctionContents=function(i){var $e=this.regexp_classString(i);while(i.eat(124))if(this.regexp_classString(i)===Sn)$e=Sn;return $e};bt.regexp_classString=function(i){var $e=0;while(this.regexp_eatClassSetCharacter(i))$e++;return $e===1?Fn:Sn};bt.regexp_eatClassSetCharacter=function(i){var $e=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=$e,!1}var Be=i.current();if(Be<0||Be===i.lookahead()&&zd(Be))return!1;if(Xd(Be))return!1;return i.advance(),i.lastIntValue=Be,!0};function zd(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 Xd(i){return i===40||i===41||i===45||i===47||i>=91&&i<=93||i>=123&&i<=125}bt.regexp_eatClassSetReservedPunctuator=function(i){var $e=i.current();if(Jd($e))return i.lastIntValue=$e,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}bt.regexp_eatClassControlLetter=function(i){var $e=i.current();if(ys($e)||$e===95)return i.lastIntValue=$e%32,i.advance(),!0;return!1};bt.regexp_eatHexEscapeSequence=function(i){var $e=i.pos;if(i.eat(120)){if(this.regexp_eatFixedHexDigits(i,2))return!0;if(i.switchU)i.raise("Invalid escape");i.pos=$e}return!1};bt.regexp_eatDecimalDigits=function(i){var $e=i.pos,Be=0;i.lastIntValue=0;while(ys(Be=i.current()))i.lastIntValue=10*i.lastIntValue+(Be-48),i.advance();return i.pos!==$e};function ys(i){return i>=48&&i<=57}bt.regexp_eatHexDigits=function(i){var $e=i.pos,Be=0;i.lastIntValue=0;while(cc(Be=i.current()))i.lastIntValue=16*i.lastIntValue+lc(Be),i.advance();return i.pos!==$e};function cc(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}function lc(i){if(i>=65&&i<=70)return 10+(i-65);if(i>=97&&i<=102)return 10+(i-97);return i-48}bt.regexp_eatLegacyOctalEscapeSequence=function(i){if(this.regexp_eatOctalDigit(i)){var $e=i.lastIntValue;if(this.regexp_eatOctalDigit(i)){var Be=i.lastIntValue;if($e<=3&&this.regexp_eatOctalDigit(i))i.lastIntValue=$e*64+Be*8+i.lastIntValue;else i.lastIntValue=$e*8+Be}else i.lastIntValue=$e;return!0}return!1};bt.regexp_eatOctalDigit=function(i){var $e=i.current();if(pc($e))return i.lastIntValue=$e-48,i.advance(),!0;return i.lastIntValue=0,!1};function pc(i){return i>=48&&i<=55}bt.regexp_eatFixedHexDigits=function(i,$e){var Be=i.pos;i.lastIntValue=0;for(var Fe=0;Fe<$e;++Fe){var je=i.current();if(!cc(je))return i.pos=Be,!1;i.lastIntValue=16*i.lastIntValue+lc(je),i.advance()}return!0};var gs=function($e){if(this.type=$e.type,this.value=$e.value,this.start=$e.start,this.end=$e.end,$e.options.locations)this.loc=new Lr($e,$e.startLoc,$e.endLoc);if($e.options.ranges)this.range=[$e.start,$e.end]},Nt=jt.prototype;Nt.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 gs(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};Nt.getToken=function(){return this.next(),new gs(this)};if(typeof Symbol<"u")Nt[Symbol.iterator]=function(){var i=this;return{next:function(){var $e=i.getToken();return{done:$e.type===Ye.eof,value:$e}}}};Nt.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(Ye.eof);if(i.override)return i.override(this);else this.readToken(this.fullCharCodeAtPos())};Nt.readToken=function(i){if(sn(i,this.options.ecmaVersion>=6)||i===92)return this.readWord();return this.getTokenFromCode(i)};Nt.fullCharCodeAt=function(i){var $e=this.input.charCodeAt(i);if($e<=55295||$e>=56320)return $e;var Be=this.input.charCodeAt(i+1);return Be<=56319||Be>=57344?$e:($e<<10)+Be-56613888};Nt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};Nt.skipBlockComment=function(){var i=this.options.onComment&&this.curPosition(),$e=this.pos,Be=this.input.indexOf("*/",this.pos+=2);if(Be===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Be+2,this.options.locations)for(var Fe=void 0,je=$e;(Fe=Oa(this.input,je,this.pos))>-1;)++this.curLine,je=this.lineStart=Fe;if(this.options.onComment)this.options.onComment(!0,this.input.slice($e+2,Be),$e,this.pos,i,this.curPosition())};Nt.skipLineComment=function(i){var $e=this.pos,Be=this.options.onComment&&this.curPosition(),Fe=this.input.charCodeAt(this.pos+=i);while(this.pos<this.input.length&&!er(Fe))Fe=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice($e+i,this.pos),$e,this.pos,Be,this.curPosition())};Nt.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&&Ii.test(String.fromCharCode(i)))++this.pos;else break e}}};Nt.finishToken=function(i,$e){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var Be=this.type;this.type=i,this.value=$e,this.updateContext(Be)};Nt.readToken_dot=function(){var i=this.input.charCodeAt(this.pos+1);if(i>=48&&i<=57)return this.readNumber(!0);var $e=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&i===46&&$e===46)return this.pos+=3,this.finishToken(Ye.ellipsis);else return++this.pos,this.finishToken(Ye.dot)};Nt.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(Ye.assign,2);return this.finishOp(Ye.slash,1)};Nt.readToken_mult_modulo_exp=function(i){var $e=this.input.charCodeAt(this.pos+1),Be=1,Fe=i===42?Ye.star:Ye.modulo;if(this.options.ecmaVersion>=7&&i===42&&$e===42)++Be,Fe=Ye.starstar,$e=this.input.charCodeAt(this.pos+2);if($e===61)return this.finishOp(Ye.assign,Be+1);return this.finishOp(Fe,Be)};Nt.readToken_pipe_amp=function(i){var $e=this.input.charCodeAt(this.pos+1);if($e===i){if(this.options.ecmaVersion>=12){var Be=this.input.charCodeAt(this.pos+2);if(Be===61)return this.finishOp(Ye.assign,3)}return this.finishOp(i===124?Ye.logicalOR:Ye.logicalAND,2)}if($e===61)return this.finishOp(Ye.assign,2);return this.finishOp(i===124?Ye.bitwiseOR:Ye.bitwiseAND,1)};Nt.readToken_caret=function(){var i=this.input.charCodeAt(this.pos+1);if(i===61)return this.finishOp(Ye.assign,2);return this.finishOp(Ye.bitwiseXOR,1)};Nt.readToken_plus_min=function(i){var $e=this.input.charCodeAt(this.pos+1);if($e===i){if($e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||on.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(Ye.incDec,2)}if($e===61)return this.finishOp(Ye.assign,2);return this.finishOp(Ye.plusMin,1)};Nt.readToken_lt_gt=function(i){var $e=this.input.charCodeAt(this.pos+1),Be=1;if($e===i){if(Be=i===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Be)===61)return this.finishOp(Ye.assign,Be+1);return this.finishOp(Ye.bitShift,Be)}if($e===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($e===61)Be=2;return this.finishOp(Ye.relational,Be)};Nt.readToken_eq_excl=function(i){var $e=this.input.charCodeAt(this.pos+1);if($e===61)return this.finishOp(Ye.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(i===61&&$e===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(Ye.arrow);return this.finishOp(i===61?Ye.eq:Ye.prefix,1)};Nt.readToken_question=function(){var i=this.options.ecmaVersion;if(i>=11){var $e=this.input.charCodeAt(this.pos+1);if($e===46){var Be=this.input.charCodeAt(this.pos+2);if(Be<48||Be>57)return this.finishOp(Ye.questionDot,2)}if($e===63){if(i>=12){var Fe=this.input.charCodeAt(this.pos+2);if(Fe===61)return this.finishOp(Ye.assign,3)}return this.finishOp(Ye.coalesce,2)}}return this.finishOp(Ye.question,1)};Nt.readToken_numberSign=function(){var i=this.options.ecmaVersion,$e=35;if(i>=13){if(++this.pos,$e=this.fullCharCodeAtPos(),sn($e,!0)||$e===92)return this.finishToken(Ye.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+Bn($e)+"'")};Nt.getTokenFromCode=function(i){switch(i){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Ye.parenL);case 41:return++this.pos,this.finishToken(Ye.parenR);case 59:return++this.pos,this.finishToken(Ye.semi);case 44:return++this.pos,this.finishToken(Ye.comma);case 91:return++this.pos,this.finishToken(Ye.bracketL);case 93:return++this.pos,this.finishToken(Ye.bracketR);case 123:return++this.pos,this.finishToken(Ye.braceL);case 125:return++this.pos,this.finishToken(Ye.braceR);case 58:return++this.pos,this.finishToken(Ye.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Ye.backQuote);case 48:var $e=this.input.charCodeAt(this.pos+1);if($e===120||$e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if($e===111||$e===79)return this.readRadixNumber(8);if($e===98||$e===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(Ye.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Bn(i)+"'")};Nt.finishOp=function(i,$e){var Be=this.input.slice(this.pos,this.pos+$e);return this.pos+=$e,this.finishToken(i,Be)};Nt.readRegexp=function(){var i,$e,Be=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(Be,"Unterminated regular expression");var Fe=this.input.charAt(this.pos);if(on.test(Fe))this.raise(Be,"Unterminated regular expression");if(!i){if(Fe==="[")$e=!0;else if(Fe==="]"&&$e)$e=!1;else if(Fe==="/"&&!$e)break;i=Fe==="\\"}else i=!1;++this.pos}var je=this.input.slice(Be,this.pos);++this.pos;var We=this.pos,Ve=this.readWord1();if(this.containsEsc)this.unexpected(We);var Ge=this.regexpState||(this.regexpState=new Nn(this));Ge.reset(Be,je,Ve),this.validateRegExpFlags(Ge),this.validateRegExpPattern(Ge);var Ue=null;try{Ue=new RegExp(je,Ve)}catch(ze){}return this.finishToken(Ye.regexp,{pattern:je,flags:Ve,value:Ue})};Nt.readInt=function(i,$e,Be){var Fe=this.options.ecmaVersion>=12&&$e===void 0,je=Be&&this.input.charCodeAt(this.pos)===48,We=this.pos,Ve=0,Ge=0;for(var Ue=0,ze=$e==null?1/0:$e;Ue<ze;++Ue,++this.pos){var Ke=this.input.charCodeAt(this.pos),Xe=void 0;if(Fe&&Ke===95){if(je)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(Ge===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Ue===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");Ge=Ke;continue}if(Ke>=97)Xe=Ke-97+10;else if(Ke>=65)Xe=Ke-65+10;else if(Ke>=48&&Ke<=57)Xe=Ke-48;else Xe=1/0;if(Xe>=i)break;Ge=Ke,Ve=Ve*i+Xe}if(Fe&&Ge===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===We||$e!=null&&this.pos-We!==$e)return null;return Ve};function Yd(i,$e){if($e)return parseInt(i,8);return parseFloat(i.replace(/_/g,""))}function uc(i){if(typeof BigInt!=="function")return null;return BigInt(i.replace(/_/g,""))}Nt.readRadixNumber=function(i){var $e=this.pos;this.pos+=2;var Be=this.readInt(i);if(Be==null)this.raise(this.start+2,"Expected number in radix "+i);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)Be=uc(this.input.slice($e,this.pos)),++this.pos;else if(sn(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Ye.num,Be)};Nt.readNumber=function(i){var $e=this.pos;if(!i&&this.readInt(10,void 0,!0)===null)this.raise($e,"Invalid number");var Be=this.pos-$e>=2&&this.input.charCodeAt($e)===48;if(Be&&this.strict)this.raise($e,"Invalid number");var Fe=this.input.charCodeAt(this.pos);if(!Be&&!i&&this.options.ecmaVersion>=11&&Fe===110){var je=uc(this.input.slice($e,this.pos));if(++this.pos,sn(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Ye.num,je)}if(Be&&/[89]/.test(this.input.slice($e,this.pos)))Be=!1;if(Fe===46&&!Be)++this.pos,this.readInt(10),Fe=this.input.charCodeAt(this.pos);if((Fe===69||Fe===101)&&!Be){if(Fe=this.input.charCodeAt(++this.pos),Fe===43||Fe===45)++this.pos;if(this.readInt(10)===null)this.raise($e,"Invalid number")}if(sn(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var We=Yd(this.input.slice($e,this.pos),Be);return this.finishToken(Ye.num,We)};Nt.readCodePoint=function(){var i=this.input.charCodeAt(this.pos),$e;if(i===123){if(this.options.ecmaVersion<6)this.unexpected();var Be=++this.pos;if($e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,$e>1114111)this.invalidStringToken(Be,"Code point out of bounds")}else $e=this.readHexChar(4);return $e};Nt.readString=function(i){var $e="",Be=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var Fe=this.input.charCodeAt(this.pos);if(Fe===i)break;if(Fe===92)$e+=this.input.slice(Be,this.pos),$e+=this.readEscapedChar(!1),Be=this.pos;else if(Fe===8232||Fe===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(er(Fe))this.raise(this.start,"Unterminated string constant");++this.pos}}return $e+=this.input.slice(Be,this.pos++),this.finishToken(Ye.string,$e)};var dc={};Nt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(i){if(i===dc)this.readInvalidTemplateToken();else throw i}this.inTemplateElement=!1};Nt.invalidStringToken=function(i,$e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw dc;else this.raise(i,$e)};Nt.readTmplToken=function(){var i="",$e=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var Be=this.input.charCodeAt(this.pos);if(Be===96||Be===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===Ye.template||this.type===Ye.invalidTemplate))if(Be===36)return this.pos+=2,this.finishToken(Ye.dollarBraceL);else return++this.pos,this.finishToken(Ye.backQuote);return i+=this.input.slice($e,this.pos),this.finishToken(Ye.template,i)}if(Be===92)i+=this.input.slice($e,this.pos),i+=this.readEscapedChar(!0),$e=this.pos;else if(er(Be)){switch(i+=this.input.slice($e,this.pos),++this.pos,Be){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:i+=`
6
- `;break;default:i+=String.fromCharCode(Be);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;$e=this.pos}else++this.pos}};Nt.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(Ye.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")};Nt.readEscapedChar=function(i){var $e=this.input.charCodeAt(++this.pos);switch(++this.pos,$e){case 110:return`
9
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Bn(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 Be=this.pos-1;this.invalidStringToken(Be,"Invalid escape sequence in template string")}default:if($e>=48&&$e<=55){var Fe=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],je=parseInt(Fe,8);if(je>255)Fe=Fe.slice(0,-1),je=parseInt(Fe,8);if(this.pos+=Fe.length-1,$e=this.input.charCodeAt(this.pos),(Fe!=="0"||$e===56||$e===57)&&(this.strict||i))this.invalidStringToken(this.pos-1-Fe.length,i?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(je)}if(er($e)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode($e)}};Nt.readHexChar=function(i){var $e=this.pos,Be=this.readInt(16,i);if(Be===null)this.invalidStringToken($e,"Bad character escape sequence");return Be};Nt.readWord1=function(){this.containsEsc=!1;var i="",$e=!0,Be=this.pos,Fe=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var je=this.fullCharCodeAtPos();if(un(je,Fe))this.pos+=je<=65535?1:2;else if(je===92){this.containsEsc=!0,i+=this.input.slice(Be,this.pos);var We=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Ve=this.readCodePoint();if(!($e?sn:un)(Ve,Fe))this.invalidStringToken(We,"Invalid Unicode escape");i+=Bn(Ve),Be=this.pos}else break;$e=!1}return i+this.input.slice(Be,this.pos)};Nt.readWord=function(){var i=this.readWord1(),$e=Ye.name;if(this.keywords.test(i))$e=ds[i];return this.finishToken($e,i)};var fc="8.18.0";jt.acorn={Parser:jt,version:fc,defaultOptions:as,Position:fr,SourceLocation:Lr,getLineInfo:Ri,Node:Mr,TokenType:It,tokTypes:Ye,keywordTypes:ds,TokContext:vn,tokContexts:Ft,isIdentifierChar:un,isIdentifierStart:sn,Token:gs,isNewLine:er,lineBreak:on,lineBreakG:La,nonASCIIwhitespace:Ii};function Fi(i,$e){return jt.parse(i,$e)}function Qd(i,$e,Be){return jt.parseExpressionAt(i,$e,Be)}function Zd(i,$e){return jt.tokenizer(i,$e)}var yn=!0,ef=new WeakMap;function tf(i){let $e=i.Parser.acorn||i,Be=ef.get($e);if(!Be){let Ge=function(yt){return yt===et.name||yt===et.string||yt===et.num||st.includes(yt)||ut.includes(yt)},Ue=function(yt){return yt===et.name||st.includes(yt)||ut.includes(yt)},ze=function(yt){return yt===et.name||ut.includes(yt)},Ke=function(yt){return yt===ot.abstract||yt===ot.declare||yt===ot.enum||yt===ot.module||yt===ot.namespace||yt===ot.interface||yt===ot.type},Xe=function(yt){return yt===ot.keyof||yt===ot.readonly||yt===ot.unique},Ze=function(yt){return yt===et.invalidTemplate},{tokTypes:et,keywordTypes:nt}=$e,st=Object.values(nt),ot=Ve(),ut=Object.values(ot),mt=We(),it=je(),ft=new RegExp(`^(?:${Object.keys(ot).join("|")})$`);mt.jsxTagStart.updateContext=function(){this.context.push(it.tc_expr),this.context.push(it.tc_oTag),this.exprAllowed=!1},mt.jsxTagEnd.updateContext=function(yt){let kt=this.context.pop();if(kt===it.tc_oTag&&yt===et.slash||kt===it.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===it.tc_expr;else this.exprAllowed=!0},Be={tokTypes:{...ot,...mt},tokContexts:{...it},keywordsRegExp:ft,tokenIsLiteralPropertyName:Ge,tokenIsKeywordOrIdentifier:Ue,tokenIsIdentifier:ze,tokenIsTSDeclarationStart:Ke,tokenIsTSTypeOperator:Xe,tokenIsTemplate:Ze}}return Be;function Fe(Ge,Ue={}){return new $e.TokenType("name",Ue)}function je(){return{tc_oTag:new $e.TokContext("<tag",!1,!1),tc_cTag:new $e.TokContext("</tag",!1,!1),tc_expr:new $e.TokContext("<tag>...</tag>",!0,!0)}}function We(){return{at:new $e.TokenType("@"),jsxName:new $e.TokenType("jsxName"),jsxText:new $e.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new $e.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new $e.TokenType("jsxTagEnd")}}function Ve(){return{assert:Fe("assert",{startsExpr:yn}),asserts:Fe("asserts",{startsExpr:yn}),global:Fe("global",{startsExpr:yn}),keyof:Fe("keyof",{startsExpr:yn}),readonly:Fe("readonly",{startsExpr:yn}),unique:Fe("unique",{startsExpr:yn}),abstract:Fe("abstract",{startsExpr:yn}),declare:Fe("declare",{startsExpr:yn}),enum:Fe("enum",{startsExpr:yn}),module:Fe("module",{startsExpr:yn}),namespace:Fe("namespace",{startsExpr:yn}),interface:Fe("interface",{startsExpr:yn}),type:Fe("type",{startsExpr:yn})}}}var nf=1048576,Br=2097152,gr=1,Es=2,rf=4,Gi=8,sf=16,Cc=64,vc=128,of=256,af=512,Sc=1024,Kb=gr|Es|Gi|vc,zb=gr|0|Gi|0,Xb=gr|0|rf|0,Jb=gr|0|sf|0,Yb=0|Es|0|vc,Qb=0|Es|0|0,cf=gr|Es|Gi|of,Zb=0|Sc,e1=0|Cc,t1=gr|0|0|Cc,n1=cf|af,r1=0|Sc,Tc=4,kc=2,Ac=1,s1=kc|Ac,i1=kc|Tc,o1=Ac|Tc,lf=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,hc=new RegExp("(?=("+lf.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),Fr=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function pf(i,$e){let Be="true";if($e.type==="MethodDefinition"&&($e.kind==="get"||$e.kind==="set"))Be=($e.static?"s":"i")+$e.kind;if(i==="iget"&&Be==="iset"||i==="iset"&&Be==="iget"||i==="sget"&&Be==="sset"||i==="sset"&&Be==="sget")return[!1,"true"];if(!i)return[!1,Be];return[!0,i]}function mc(i,$e){let{computed:Be,key:Fe}=i;return!Be&&(Fe.type==="Identifier"&&Fe.name===$e||Fe.type==="Literal"&&Fe.value===$e)}var Et={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."},bs={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 uf(i,$e,Be){let{tokTypes:Fe}=Be,{tokTypes:je}=$e;return class extends i{takeDecorators(Ve){let Ge=this.decoratorStack[this.decoratorStack.length-1];if(Ge.length)Ve.decorators=Ge,this.resetStartLocationFromNode(Ve,Ge[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(Ve){let Ge=this.decoratorStack[this.decoratorStack.length-1];while(this.match(je.at)){let Ue=this.parseDecorator();Ge.push(Ue)}if(this.match(Fe._export)){if(!Ve)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,bs.UnexpectedLeadingDecorator)}parseDecorator(){let Ve=this.startNode();this.next(),this.decoratorStack.push([]);let Ge=this.start,Ue=this.startLoc,ze;if(this.match(Fe.parenL)){let Ke=this.start,Xe=this.startLoc;if(this.next(),ze=this.parseExpression(),this.expect(Fe.parenR),this.options.preserveParens){let Ze=this.startNodeAt(Ke,Xe);Ze.expression=ze,ze=this.finishNode(Ze,"ParenthesizedExpression")}}else{ze=this.parseIdent(!1);while(this.eat(Fe.dot)){let Ke=this.startNodeAt(Ge,Ue);Ke.object=ze,Ke.property=this.parseIdent(!0),Ke.computed=!1,ze=this.finishNode(Ke,"MemberExpression")}}return Ve.expression=this.parseMaybeDecoratorArguments(ze),this.decoratorStack.pop(),this.finishNode(Ve,"Decorator")}parseMaybeDecoratorArguments(Ve){if(this.eat(Fe.parenL)){let Ge=this.startNodeAtNode(Ve);return Ge.callee=Ve,Ge.arguments=this.parseExprList(Fe.parenR,!1),this.finishNode(Ge,"CallExpression")}return Ve}}}var yc={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:"♦"},df=/^[\da-fA-F]+$/,ff=/^\d+$/;function jr(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 jr(i.object)+"."+jr(i.property)}function hf(i,$e,Be,Fe){let je=i.tokTypes,We=$e.tokTypes,{isNewLine:Ve,isIdentifierChar:Ge}=i,Ue=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},Fe||{});return class extends Be{jsx_readToken(){let Ke="",Xe=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(We.jsxTagStart);return this.getTokenFromCode(Ze)}return Ke+=this.input.slice(Xe,this.pos),this.finishToken(We.jsxText,Ke);case 38:Ke+=this.input.slice(Xe,this.pos),Ke+=this.jsx_readEntity(),Xe=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(Ze===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(Ve(Ze))Ke+=this.input.slice(Xe,this.pos),Ke+=this.jsx_readNewLine(!0),Xe=this.pos;else++this.pos}}}jsx_readNewLine(Ke){let Xe=this.input.charCodeAt(this.pos),Ze;if(++this.pos,Xe===13&&this.input.charCodeAt(this.pos)===10)++this.pos,Ze=Ke?`
10
- `:`\r
11
- `;else Ze=String.fromCharCode(Xe);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return Ze}jsx_readString(Ke){let Xe="",Ze=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let et=this.input.charCodeAt(this.pos);if(et===Ke)break;if(et===38)Xe+=this.input.slice(Ze,this.pos),Xe+=this.jsx_readEntity(),Ze=this.pos;else if(Ve(et))Xe+=this.input.slice(Ze,this.pos),Xe+=this.jsx_readNewLine(!1),Ze=this.pos;else++this.pos}return Xe+=this.input.slice(Ze,this.pos++),this.finishToken(je.string,Xe)}jsx_readEntity(){let Ke="",Xe=0,Ze,et=this.input[this.pos];if(et!=="&")this.raise(this.pos,"Entity must start with an ampersand");let nt=++this.pos;while(this.pos<this.input.length&&Xe++<10){if(et=this.input[this.pos++],et===";"){if(Ke[0]==="#"){let st;if(Ke[1]==="x"||Ke[1]==="X"){if(Ke=Ke.substr(2),df.test(Ke))st=parseInt(Ke,16)}else if(Ke=Ke.substr(1),ff.test(Ke))st=parseInt(Ke,10);if(st!==void 0&&st<=1114111)Ze=String.fromCodePoint(st)}else if(Object.prototype.hasOwnProperty.call(yc,Ke))Ze=yc[Ke];break}Ke+=et}if(Ze===void 0)return this.pos=nt,"&";return Ze}jsx_readWord(){let Ke,Xe=this.pos;do Ke=this.input.charCodeAt(++this.pos);while(Ge(Ke)||Ke===45);return this.finishToken(We.jsxName,this.input.slice(Xe,this.pos))}jsx_parseIdentifier(){let Ke=this.startNode();if(this.type===We.jsxName)Ke.name=this.value;else if(this.type.keyword)Ke.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(Ke,"JSXIdentifier")}jsx_parseNamespacedName(){let Ke=this.start,Xe=this.startLoc,Ze=this.jsx_parseIdentifier();if(!Ue.allowNamespaces||!this.eat(je.colon))return Ze;var et=this.startNodeAt(Ke,Xe);return et.namespace=Ze,et.name=this.jsx_parseIdentifier(),this.finishNode(et,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===We.jsxTagEnd)return"";let Ke=this.start,Xe=this.startLoc,Ze=this.jsx_parseNamespacedName();if(this.type===je.dot&&Ze.type==="JSXNamespacedName"&&!Ue.allowNamespacedObjects)this.unexpected();while(this.eat(je.dot)){let et=this.startNodeAt(Ke,Xe);et.object=Ze,et.property=this.jsx_parseIdentifier(),Ze=this.finishNode(et,"JSXMemberExpression")}return Ze}jsx_parseAttributeValue(){switch(this.type){case je.braceL:let Ke=this.jsx_parseExpressionContainer();if(Ke.expression.type==="JSXEmptyExpression")this.raise(Ke.start,"JSX attributes must only be assigned a non-empty expression");return Ke;case We.jsxTagStart:case je.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let Ke=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(Ke,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let Ke=this.startNode();if(this.next(),this.eat(je.ellipsis))return Ke.expression=this.parseExpression(),this.expect(je.braceR),this.finishNode(Ke,"JSXSpreadChild");return Ke.expression=this.type===je.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(je.braceR),this.finishNode(Ke,"JSXExpressionContainer")}jsx_parseAttribute(){let Ke=this.startNode();if(this.eat(je.braceL))return this.expect(je.ellipsis),Ke.argument=this.parseMaybeAssign(),this.expect(je.braceR),this.finishNode(Ke,"JSXSpreadAttribute");return Ke.name=this.jsx_parseNamespacedName(),Ke.value=this.eat(je.eq)?this.jsx_parseAttributeValue():null,this.finishNode(Ke,"JSXAttribute")}jsx_parseOpeningElementAt(Ke,Xe){let Ze=this.startNodeAt(Ke,Xe);Ze.attributes=[];let et=this.jsx_parseElementName();if(et)Ze.name=et;while(this.type!==je.slash&&this.type!==We.jsxTagEnd)Ze.attributes.push(this.jsx_parseAttribute());return Ze.selfClosing=this.eat(je.slash),this.expect(We.jsxTagEnd),this.finishNode(Ze,et?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(Ke,Xe){let Ze=this.startNodeAt(Ke,Xe),et=this.jsx_parseElementName();if(et)Ze.name=et;return this.expect(We.jsxTagEnd),this.finishNode(Ze,et?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(Ke,Xe){let Ze=this.startNodeAt(Ke,Xe),et=[],nt=this.jsx_parseOpeningElementAt(Ke,Xe),st=null;if(!nt.selfClosing){e:for(;;)switch(this.type){case We.jsxTagStart:if(Ke=this.start,Xe=this.startLoc,this.next(),this.eat(je.slash)){st=this.jsx_parseClosingElementAt(Ke,Xe);break e}et.push(this.jsx_parseElementAt(Ke,Xe));break;case We.jsxText:et.push(this.parseExprAtom());break;case je.braceL:et.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(jr(st.name)!==jr(nt.name))this.raise(st.start,"Expected corresponding JSX closing tag for <"+jr(nt.name)+">")}let ot=nt.name?"Element":"Fragment";if(Ze["opening"+ot]=nt,Ze["closing"+ot]=st,Ze.children=et,this.type===je.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(Ze,"JSX"+ot)}jsx_parseText(){let Ke=this.parseLiteral(this.value);return Ke.type="JSXText",Ke}jsx_parseElement(){let Ke=this.start,Xe=this.startLoc;return this.next(),this.jsx_parseElementAt(Ke,Xe)}}}function mf(i,$e,Be){let{tokTypes:Fe}=$e,{tokTypes:je}=Be;return class extends i{parseMaybeImportAttributes(Ve){if(this.type===je._with||this.type===Fe.assert){this.next();let Ge=this.parseImportAttributes();if(Ge)Ve.attributes=Ge}}parseImportAttributes(){this.expect(je.braceL);let Ve=this.parseWithEntries();return this.expect(je.braceR),Ve}parseWithEntries(){let Ve=[],Ge=new Set;do{if(this.type===je.braceR)break;let Ue=this.startNode(),ze;if(this.type===je.string)ze=this.parseLiteral(this.value);else ze=this.parseIdent(!0);if(this.next(),Ue.key=ze,Ge.has(Ue.key.name))this.raise(this.pos,"Duplicated key in attributes");if(Ge.add(Ue.key.name),this.type!==je.string)this.raise(this.pos,"Only string is supported as an attribute value");Ue.value=this.parseLiteral(this.value),Ve.push(this.finishNode(Ue,"ImportAttribute"))}while(this.eat(je.comma));return Ve}}}var Vi=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function wc(){return{_tag:"BufferedParserEvents",segments:[]}}var yf=wc();function gc(i){return i.segments.length>0}var gf=class{constructor(i,$e){this.options=i,this.state=$e,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 $e=this.currentFrame();if($e){if(i.output)this.appendOutput(this.outputFor($e),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??yf}replay(i){if(!gc(i))return;let $e=this.currentFrame();if($e){this.appendOutput(this.outputFor($e),i);return}this.flush(i)}set(i,$e,Be){this.willSet(i,$e),i[$e]=Be}remove(i,$e){this.willSet(i,$e),delete i[$e]}append(i,$e){this.willAppend(i),i.push($e)}pop(i){return this.willMutateTail(i,1),i.pop()}truncate(i,$e){if($e<i.length)this.willMutateTail(i,i.length-$e);else this.willAppend(i);i.length=$e}modify(i,$e,Be){let[Fe,je]=Be(i[$e]);return this.set(i,$e,je),Fe}willAppend(i){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:i,length:i.length})}willMutateTail(i,$e){if(!this.active)return;let Be=Math.max(0,i.length-$e);this.undoLog.push({_tag:"ArrayTail",target:i,start:Be,values:i.slice(Be)})}willSet(i,$e){if(!this.active)return;let Be=i;this.undoLog.push({_tag:"Property",target:Be,key:$e,had:Object.prototype.hasOwnProperty.call(Be,$e),value:Be[$e]})}captureCallbacks(){let i=!1;for(let $e of Vi){let Be=this.options[$e];if(!Be)continue;i=!0,this.callbacks[$e]=Be,this.callbackWrappers[$e]=(...Fe)=>{this.emit({name:$e,args:Fe})}}return i}activateCallbacks(){for(let i of Vi){let $e=this.callbackWrappers[i];if($e)this.options[i]=$e}}deactivateCallbacks(){for(let i of Vi){let $e=this.callbacks[i];if($e)this.options[i]=$e}}emit(i){let $e=this.currentFrame();if(!$e){this.invoke(i);return}let Be=this.outputFor($e).segments,Fe=Be[Be.length-1];if(Array.isArray(Fe))Fe.push(i);else Be.push([i])}appendOutput(i,$e){if(gc($e))i.segments.push($e)}outputFor(i){return i.output??=wc()}flush(i){let $e=[];for(let Be=i.segments.length-1;Be>=0;Be--)$e.push(i.segments[Be]);while($e.length>0){let Be=$e.pop();if(Array.isArray(Be)){for(let Fe of Be)this.invoke(Fe);continue}for(let Fe=Be.segments.length-1;Fe>=0;Fe--)$e.push(Be.segments[Fe])}}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 $e=this.undoLog.length-1;$e>=i;$e--){let Be=this.undoLog[$e];switch(Be._tag){case"ArrayLength":if(Be.target.length<Be.length)throw Error("A parse effect shortened an append-only array");Be.target.length=Be.length;break;case"ArrayTail":Be.target.length=Be.start;for(let Fe of Be.values)Be.target.push(Fe);break;case"Property":if(Be.had)Be.target[Be.key]=Be.value;else delete Be.target[Be.key];break}}this.undoLog.length=i}};function yr(i,$e,Be){if(i.length===$e)return i;if(i.length<$e)throw Error(`A parse branch shortened the ${Be} below its checkpoint`);return i.length=$e,i}function xf(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 bf(i,$e){i.setLookaheadTokenState($e.lookahead),i.context=yr($e.context,$e.contextLength,"token context stack"),i.scopeStack=yr($e.scopeStack,$e.scopeStackLength,"scope stack"),i.importsStack=yr($e.importsStack,$e.importsStackLength,"import stack"),i.labels=yr($e.labels,$e.labelsLength,"label stack"),i.privateNameStack=yr($e.privateNameStack,$e.privateNameStackLength,"private-name stack"),i.decoratorStack=yr($e.decoratorStack,$e.decoratorStackLength,"decorator stack"),i.strict=$e.strict,i.potentialArrowAt=$e.potentialArrowAt,i.potentialArrowInForAwait=$e.potentialArrowInForAwait,i.yieldPos=$e.yieldPos,i.awaitPos=$e.awaitPos,i.awaitIdentPos=$e.awaitIdentPos,i.regexpState=null,i.preValue=$e.preValue,i.preToken=$e.preToken,i.isLookahead=$e.isLookahead,i.isAmbientContext=$e.isAmbientContext,i.inAbstractClass=$e.inAbstractClass,i.inType=$e.inType,i.inDisallowConditionalTypesContext=$e.inDisallowConditionalTypesContext,i.maybeInArrowParameters=$e.maybeInArrowParameters,i.shouldParseArrowReturnType=$e.shouldParseArrowReturnType,i.shouldParseAsyncArrowReturnType=$e.shouldParseAsyncArrowReturnType,i.importOrExportOuterKind=$e.importOrExportOuterKind}function Ef(i){return{capture:()=>xf(i),restore:($e)=>bf(i,$e)}}function Cf(i,$e){let{acornTokenTypes:Be,typeScriptTokenTypes:Fe,scope:je}=$e,We=je.SCOPE_TOP|je.SCOPE_FUNCTION|je.SCOPE_CLASS_STATIC_BLOCK;return class extends i{constructor(Ge,Ue,ze){super(Ge,Ue,ze);this.parseEffects=new gf(this.options,Ef(this))}overrideContext(Ge){if(this.curContext()!==Ge)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(Ge)}takeDecorators(Ge){let Ue=this.decoratorStack.length-1;if(this.decoratorStack[Ue].length>0)this.parseEffects?.willSet(this.decoratorStack,String(Ue));return super.takeDecorators(Ge)}parseDecorators(Ge){let Ue=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(Ue),super.parseDecorators(Ge)}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(Ge,Ue,ze,Ke){for(let Xe=this.labels.length-1;Xe>=0;Xe--){let Ze=this.labels[Xe];if(Ze.statementStart!==Ge.start)break;this.parseEffects?.willSet(Ze,"statementStart"),this.parseEffects?.willSet(Ze,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(Ge,Ue,ze,Ke)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let Ge=this.privateNameStack[this.privateNameStack.length-2];if(Ge)this.parseEffects?.willAppend(Ge.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let Ge=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(Ge.used)}return super.parsePrivateIdent()}parseClassField(Ge){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(Ge)}updateContext(Ge){let{type:Ue}=this;if(Ue===Be.parenR||Ue===Be.braceR||Ue===Be.braceL||Ue===Be.dollarBraceL||Ue===Be.parenL||Ue===Be._function||Ue===Be._class||Ue===Be.colon||Ue===Be.backQuote||Ue===Be.star||Ue===Fe.jsxTagStart||Ue===Fe.jsxTagEnd||Ue===Be.slash&&Ge===Fe.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(Ge)}enterScope(Ge){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(Ge)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(Ge,Ue,ze){let Ke=this.parseEffects;if(Ke?.active)if(Ue===je.BIND_LEXICAL){let Xe=this.currentScope();if(Ke.willAppend(Xe.lexical),this.inModule&&Xe.flags&je.SCOPE_TOP)Ke.willSet(this.undefinedExports,Ge)}else if(Ue===je.BIND_SIMPLE_CATCH)Ke.willAppend(this.currentScope().lexical);else if(Ue===je.BIND_FUNCTION)Ke.willAppend(this.currentScope().functions);else for(let Xe=this.scopeStack.length-1;Xe>=0;Xe--){let Ze=this.scopeStack[Xe];if(Ke.willAppend(Ze.var),this.inModule&&Ze.flags&je.SCOPE_TOP)Ke.willSet(this.undefinedExports,Ge);if(Ze.flags&We)break}return super.declareName(Ge,Ue,ze)}checkLocalExport(Ge){return this.parseEffects?.willSet(this.undefinedExports,Ge.name),super.checkLocalExport(Ge)}}}var Wi=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function xc(i){if(!i)throw Error("Assert fail")}function vf(i){return i==="accessor"}function Sf(i){return i==="in"||i==="out"}var xs=1,bc=2,Tf=4,Dt={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 qi(i,$e){return Dt.SCOPE_FUNCTION|(i?Dt.SCOPE_ASYNC:0)|($e?Dt.SCOPE_GENERATOR:0)}function kf(i){if(i.type!=="MemberExpression")return!1;let{computed:$e,property:Be}=i;if($e&&(Be.type!=="TemplateLiteral"||Be.expressions.length>0))return!1;return Pc(i.object)}function Af(i){return i.type==="UnaryExpression"&&(i.operator==="-"||i.operator==="+")&&i.argument.type==="Literal"&&(typeof i.argument.value==="number"||typeof i.argument.value==="bigint")}function Pc(i){if(i.type==="Identifier")return!0;if(i.type!=="MemberExpression")return!1;if(i.computed)return!1;return Pc(i.object)}function Ec(i){return i==="private"||i==="public"||i==="protected"}function wf(i){return Boolean(i.startsExpr)}function Pf(i){if(i==null)throw Error(`Unexpected ${i} value.`);return i}function Nf(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 Nc(i){let{dts:$e=!1}=i||{},Be=!!i?.jsx;return function(Fe){let je=Fe.acorn||ji,We=tf(je),{tokTypes:Ve,keywordTypes:Ge,isIdentifierStart:Ue,lineBreak:ze,isNewLine:Ke,tokContexts:Xe,isIdentifierChar:Ze}=je,{tokTypes:et,tokContexts:nt,keywordsRegExp:st,tokenIsLiteralPropertyName:ot,tokenIsTemplate:ut,tokenIsTSDeclarationStart:mt,tokenIsIdentifier:it,tokenIsKeywordOrIdentifier:ft,tokenIsTSTypeOperator:yt}=We;function kt(qe,He,Je=qe.length){for(let Qe=He;Qe<Je;Qe++){let tt=qe.charCodeAt(Qe);if(Ke(tt))return Qe<Je-1&&tt===13&&qe.charCodeAt(Qe+1)===10?Qe+2:Qe+1}return-1}if(Fe=uf(Fe,We,je),i?.jsx)Fe=hf(je,We,Fe,typeof i.jsx==="boolean"?{}:i.jsx);Fe=mf(Fe,We,je);let wt=Cf(Fe,{acornTokenTypes:Ve,typeScriptTokenTypes:et,scope:Dt});class Pt extends wt{constructor(qe,He,Je){super(qe,He,Je);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=(Qe)=>{this.tsParseModifiers({modified:Qe,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:Et.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return We}get acornTypeScript(){return We}getTokenFromCodeInType(qe){if(qe===62)return this.finishOp(Ve.relational,1);if(qe===60)return this.finishOp(Ve.relational,1);return super.getTokenFromCode(qe)}readToken(qe){if(!this.inType){let He=this.curContext();if(He===nt.tc_expr)return this.jsx_readToken();if(He===nt.tc_oTag||He===nt.tc_cTag){if(Ue(qe))return this.jsx_readWord();if(qe==62)return++this.pos,this.finishToken(et.jsxTagEnd);if((qe===34||qe===39)&&He==nt.tc_oTag)return this.jsx_readString(qe)}if(qe===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,i?.jsx)return this.finishToken(et.jsxTagStart);else return this.finishToken(Ve.relational,"<")}return super.readToken(qe)}getTokenFromCode(qe){if(this.inType)return this.getTokenFromCodeInType(qe);if(qe===64)return++this.pos,this.finishToken(et.at);return super.getTokenFromCode(qe)}isAbstractClass(){return this.ts_isContextual(et.abstract)&&this.lookahead().type===Ve._class}isDeclareClass(){if(!this.ts_isContextual(et.declare))return!1;let qe=this.nextTokenStart();if(this.isUnparsedContextual(qe,"class"))return!0;if(!this.isUnparsedContextual(qe,"abstract"))return!1;let He=this.nextTokenStartSince(qe+8);return this.isUnparsedContextual(He,"class")}finishNode(qe,He){if(qe.type!==""&&qe.end!==0)return qe;return super.finishNode(qe,He)}tryParse(qe){let He={},Je=this.beginParseEffectScope(),Qe;try{Qe=qe(()=>{throw He})}catch(tt){let rt=tt===He;if(!rt&&!(tt instanceof SyntaxError))throw this.parseEffects.rollback(Je),tt;let at={events:this.parseEffects.rollbackWithEvents(Je),selected:!1};return rt?{node:null,error:null,thrown:!1,aborted:!0,failState:at}:{node:null,error:tt,thrown:!0,aborted:!1,failState:at}}return this.parseEffects.commit(Je),{node:Qe,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError(qe,He){qe.optionalParametersLoc=He?.loc??this.startLoc}reScan_lt_gt(){if(this.type===Ve.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:qe}=this;if(qe===Ve.bitShift)return this.pos-=2,this.finishOp(Ve.relational,1),Ve.relational;return qe}resetEndLocation(qe,He=this.lastTokEnd,Je=this.lastTokEndLoc){if(qe.end=He,qe.loc.end=Je,this.options.ranges)qe.range[1]=He}startNodeAtNode(qe){return super.startNodeAt(qe.start,qe.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(qe,He){return He.some((Je)=>{if(Ec(Je))return qe.accessibility===Je;return!!qe[Je]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(qe){qe.forEach((He)=>{if(He?.type==="TSTypeCastExpression")this.raise(He.typeAnnotation.start,Et.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(qe){return qe.type==="Identifier"&&qe.name==="async"&&this.lastTokEnd===qe.end&&!this.canInsertSemicolon()&&qe.end-qe.start===5&&qe.start===this.potentialArrowAt}tsIsIdentifier(){return it(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(Ve.colon)?this.tsParseTypeOrTypePredicateAnnotation(Ve.colon):void 0}tsTryParseGenericAsyncArrowFunction(qe,He,Je){if(!this.tsMatchLeftRelational())return;let Qe=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let tt=this.tsTryParseAndCatch(()=>{let rt=this.startNodeAt(qe,He);return rt.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(rt),rt.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(Ve.arrow),rt});if(this.maybeInArrowParameters=Qe,!tt)return;return this.parseArrowExpression(tt,tt.params,!0,Je)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==Ve.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext(qe){let He=this.context;this.context=[He[0]];try{return qe()}finally{this.context=He}}tsTryParseTypeAnnotation(){return this.match(Ve.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(qe,He){let Je=qe+He.length;if(this.input.slice(qe,Je)===He){let Qe=this.input.charCodeAt(Je);return!(Ze(Qe)||(Qe&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(et.abstract)&&this.lookahead().type===Ve._new}nextTokenStartSince(qe){return Wi.lastIndex=qe,Wi.test(this.input)?Wi.lastIndex:qe}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(qe){this.pos=qe.pos,this.value=qe.value,this.exprAllowed=qe.exprAllowed,this.endLoc=qe.endLoc,this.lastTokEnd=qe.lastTokEnd,this.lastTokStart=qe.lastTokStart,this.lastTokStartLoc=qe.lastTokStartLoc,this.type=qe.type,this.start=qe.start,this.end=qe.end,this.startLoc=qe.startLoc,this.lastTokEndLoc=qe.lastTokEndLoc,this.curLine=qe.curLine,this.lineStart=qe.lineStart,this.containsEsc=qe.containsEsc}setLookaheadState(qe){this.setLookaheadTokenState(qe),this.context=qe.context&&qe.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult(qe){let He=qe.failState;if(!He)return;if(He.selected)throw Error("A parse branch result can only be selected once");He.selected=!0,this.parseEffects.replay(He.events)}tsLookAhead(qe){let He=this.beginParseEffectScope();try{return qe()}finally{this.parseEffects.rollback(He)}}lookahead(qe){let He=this.getCurLookaheadState(),Je=this.context,Qe=this.preValue,tt=this.preToken,rt=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,qe!==void 0)for(let at=0;at<qe;at++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(He),this.context=Je,this.preValue=Qe,this.preToken=tt,this.isLookahead=rt}}readWord(){let qe=this.readWord1(),He=Ve.name;if(this.keywords.test(qe))He=Ge[qe];else if(new RegExp(st).test(qe))He=et[qe];return this.finishToken(He,qe)}skipBlockComment(){let qe;if(!this.isLookahead)qe=this.options.onComment&&this.curPosition();let He=this.pos,Je=this.input.indexOf("*/",this.pos+=2);if(Je===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Je+2,this.options.locations)for(let Qe,tt=He;(Qe=kt(this.input,tt,this.pos))>-1;)++this.curLine,tt=this.lineStart=Qe;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice(He+2,Je),He,this.pos,qe,this.curPosition())}skipLineComment(qe){let He=this.pos,Je;if(!this.isLookahead)Je=this.options.onComment&&this.curPosition();let Qe=this.input.charCodeAt(this.pos+=qe);while(this.pos<this.input.length&&!Ke(Qe))Qe=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice(He+qe,this.pos),He,this.pos,Je,this.curPosition())}finishToken(qe,He){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let Je=this.type;if(this.type=qe,this.value=He,!this.isLookahead)this.updateContext(Je)}resetStartLocation(qe,He,Je){if(qe.start=He,qe.loc.start=Je,this.options.ranges)qe.range[0]=He}isLineTerminator(){return this.eat(Ve.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return hc.lastIndex=this.end,hc.test(this.input)}addExtra(qe,He,Je,Qe=!0){if(!qe)return;let tt=qe.extra=qe.extra||{};if(Qe)tt[He]=Je;else Object.defineProperty(tt,He,{enumerable:Qe,value:Je})}isLiteralPropertyName(){return ot(this.type)}hasPrecedingLineBreak(){return ze.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(qe,He){return qe.name=He,this.finishNode(qe,"Identifier")}resetStartLocationFromNode(qe,He){this.resetStartLocation(qe,He.start,He.loc.start)}isThisParam(qe){return qe.type==="Identifier"&&qe.name==="this"}isLookaheadContextual(qe){let He=this.nextTokenStart();return this.isUnparsedContextual(He,qe)}ts_type_isContextual(qe,He){return qe===He&&!this.containsEsc}ts_isContextual(qe){return this.type===qe&&!this.containsEsc}ts_isContextualWithState(qe,He){return qe.type===He&&!qe.containsEsc}isContextualWithState(qe,He){return He.type===Ve.name&&He.value===qe&&!He.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(Ve.plusMin))return this.ts_isContextual(et.readonly);if(this.ts_isContextual(et.readonly))this.next();if(!this.match(Ve.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(Ve._in)}tsInDisallowConditionalTypesContext(qe){let He=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return qe()}finally{this.inDisallowConditionalTypesContext=He}}tsTryParseType(){return this.tsEatThenParseType(Ve.colon)}match(qe){return this.type===qe}matchJsx(qe){return this.type===We.tokTypes[qe]}ts_eatWithState(qe,He,Je){let Qe=Je.type;if(qe===Qe){for(let tt=0;tt<He;tt++)this.next();return!0}else return!1}ts_eatContextualWithState(qe,He,Je){if(st.test(qe)){if(this.ts_isContextualWithState(Je,et[qe])){for(let Qe=0;Qe<He;Qe++)this.next();return!0}return!1}else{if(!this.isContextualWithState(qe,Je))return!1;for(let Qe=0;Qe<He;Qe++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(Ve._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual(qe){if(st.test(qe)){if(this.ts_isContextual(et[qe]))return this.next(),!0;return!1}else return super.eatContextual(qe)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let qe=this.startNode();if(this.expectContextual("require"),this.expect(Ve.parenL),!this.match(Ve.string))this.unexpected();return qe.expression=this.parseExprAtom(),this.expect(Ve.parenR),this.finishNode(qe,"TSExternalModuleReference")}tsParseEntityName(qe=!0){let He=this.parseIdent(qe);while(this.eat(Ve.dot)){let Je=this.startNodeAtNode(He);Je.left=He,Je.right=this.parseIdent(qe),He=this.finishNode(Je,"TSQualifiedName")}return He}tsParseEnumMember(){let qe=this.startNode();if(qe.id=this.match(Ve.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(Ve.eq))qe.initializer=this.parseMaybeAssign();return this.finishNode(qe,"TSEnumMember")}tsParseEnumDeclaration(qe,He={}){if(He.const)qe.const=!0;if(He.declare)qe.declare=!0;this.expectContextual("enum"),qe.id=this.parseIdent();let Je=He.const?Dt.BIND_TS_CONST_ENUM:Dt.BIND_TS_ENUM;return this.checkLValSimple(qe.id,Je),this.expect(Ve.braceL),qe.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(Ve.braceR),this.finishNode(qe,"TSEnumDeclaration")}tsParseModuleBlock(){let qe=this.startNode();this.enterScope(nf),this.expect(Ve.braceL),qe.body=[];while(this.type!==Ve.braceR){let He=this.parseStatement(null,!0);qe.body.push(He)}return this.next(),super.exitScope(),this.finishNode(qe,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration(qe){if(this.ts_isContextual(et.global))qe.global=!0,qe.id=this.parseIdent();else if(this.match(Ve.string))qe.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(Ve.braceL))this.enterScope(Br),qe.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode(qe,"TSModuleDeclaration")}tsTryParseDeclare(qe){if(this.isLineTerminator())return;let He=this.type,Je;if(this.isContextual("let"))He=Ve._var,Je="let";return this.tsInAmbientContext(()=>{if(He===Ve._function)return qe.declare=!0,this.parseFunctionStatement(qe,!1,!0);if(He===Ve._class)return qe.declare=!0,this.parseClass(qe,!0);if(He===et.enum)return this.tsParseEnumDeclaration(qe,{declare:!0});if(He===et.global)return this.tsParseAmbientExternalModuleDeclaration(qe);if(He===Ve._const||He===Ve._var){if(!this.match(Ve._const)||!this.isLookaheadContextual("enum"))return qe.declare=!0,this.parseVarStatement(qe,Je||this.value,!0);return this.expect(Ve._const),this.tsParseEnumDeclaration(qe,{const:!0,declare:!0})}if(He===et.interface){let Qe=this.tsParseInterfaceDeclaration(qe,{declare:!0});if(Qe)return Qe}if(it(He))return this.tsParseDeclaration(qe,this.value,!0)})}tsIsListTerminator(qe){switch(qe){case"EnumMembers":case"TypeMembers":return this.match(Ve.braceR);case"HeritageClauseElement":return this.match(Ve.braceL);case"TupleElementTypes":return this.match(Ve.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(qe,He,Je,Qe){let tt=[],rt=-1;for(;;){if(this.tsIsListTerminator(qe))break;rt=-1;let at=He();if(at==null)return;if(tt.push(at),this.eat(Ve.comma)){rt=this.lastTokStart;continue}if(this.tsIsListTerminator(qe))break;if(Je)this.expect(Ve.comma);return}if(Qe)Qe.value=rt;return tt}tsParseDelimitedList(qe,He,Je){return Pf(this.tsParseDelimitedListWorker(qe,He,!0,Je))}tsParseBracketedList(qe,He,Je,Qe,tt){if(!Qe)if(Je)this.expect(Ve.bracketL);else this.expect(Ve.relational);let rt=this.tsParseDelimitedList(qe,He,tt);if(Je)this.expect(Ve.bracketR);else this.expect(Ve.relational);return rt}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(qe){return!this.match(qe)?void 0:this.tsNextThenParseType()}tsExpectThenParseType(qe){return this.tsDoThenParseType(()=>this.expect(qe))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(qe){return this.tsInType(()=>(qe(),this.tsParseType()))}tsSkipParameterStart(){if(it(this.type)||this.match(Ve._this))return this.next(),!0;if(this.match(Ve.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(Ve.bracketL)){this.next();try{return this.parseBindingList(Ve.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(Ve.parenR)||this.match(Ve.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(Ve.colon)||this.match(Ve.comma)||this.match(Ve.question)||this.match(Ve.eq))return!0;if(this.match(Ve.parenR)){if(this.next(),this.match(Ve.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(Ve.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(qe){let He=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return qe()}finally{this.inDisallowConditionalTypesContext=He}}tsParseBindingListForSignature(){return super.parseBindingList(Ve.parenR,!0,!0).map((qe)=>{if(qe.type!=="Identifier"&&qe.type!=="RestElement"&&qe.type!=="ObjectPattern"&&qe.type!=="ArrayPattern")this.raise(qe.start,Et.UnsupportedSignatureParameterKind({type:qe.type}));return qe})}tsParseTypePredicateAsserts(){if(this.type!==et.asserts)return!1;let qe=this.containsEsc;if(this.next(),!it(this.type)&&!this.match(Ve._this))return!1;if(qe)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let qe=this.startNode();return this.next(),this.finishNode(qe,"TSThisType")}tsParseTypeAnnotation(qe=!0,He=this.startNode()){return this.tsInType(()=>{if(qe)this.expect(Ve.colon);He.typeAnnotation=this.tsParseType()}),this.finishNode(He,"TSTypeAnnotation")}tsParseThisTypePredicate(qe){this.next();let He=this.startNodeAtNode(qe);return He.parameterName=qe,He.typeAnnotation=this.tsParseTypeAnnotation(!1),He.asserts=!1,this.finishNode(He,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let qe=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(qe);else return qe}tsParseTypePredicatePrefix(){let qe=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),qe}tsParseTypeOrTypePredicateAnnotation(qe){return this.tsInType(()=>{let He=this.startNode();this.expect(qe);let Je=this.startNode(),Qe=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(Qe){let pt=this.tsParseTypeAnnotation(!1);return Je.parameterName=Qe,Je.typeAnnotation=pt,Je.asserts=!1,He.typeAnnotation=this.finishNode(Je,"TSTypePredicate"),this.finishNode(He,"TSTypeAnnotation")}let tt=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(tt&&this.match(Ve._this)){let pt=this.tsParseThisTypeOrThisTypePredicate();if(pt.type==="TSThisType")Je.parameterName=pt,Je.asserts=!0,Je.typeAnnotation=null,pt=this.finishNode(Je,"TSTypePredicate");else this.resetStartLocationFromNode(pt,Je),pt.asserts=!0;return He.typeAnnotation=pt,this.finishNode(He,"TSTypeAnnotation")}let rt=tt&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!rt){if(!tt)return this.tsParseTypeAnnotation(!1,He);return Je.parameterName=this.parseIdent(),Je.asserts=tt,Je.typeAnnotation=null,He.typeAnnotation=this.finishNode(Je,"TSTypePredicate"),this.finishNode(He,"TSTypeAnnotation")}let at=this.tsParseTypeAnnotation(!1);return Je.parameterName=rt,Je.typeAnnotation=at,Je.asserts=tt,He.typeAnnotation=this.finishNode(Je,"TSTypePredicate"),this.finishNode(He,"TSTypeAnnotation")})}tsFillSignature(qe,He){let Je=qe===Ve.arrow,Qe="parameters",tt="typeAnnotation";if(He.typeParameters=this.tsTryParseTypeParameters(),this.expect(Ve.parenL),He.parameters=this.tsParseBindingListForSignature(),Je)He.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(qe);else if(this.match(qe))He.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(qe)}tsTryNextParseConstantContext(){if(this.lookahead().type!==Ve._const)return null;this.next();let qe=this.tsParseTypeReference();if(qe.typeParameters||qe.typeArguments)this.raise(qe.typeName.start,Et.CannotFindName({name:"const"}));return qe}tsParseFunctionOrConstructorType(qe,He){let Je=this.startNode();if(qe==="TSConstructorType"){if(Je.abstract=!!He,He)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(Ve.arrow,Je)),this.finishNode(Je,qe)}tsParseUnionOrIntersectionType(qe,He,Je){let Qe=this.startNode(),tt=this.eat(Je),rt=[];do rt.push(He());while(this.eat(Je));if(rt.length===1&&!tt)return rt[0];return Qe.types=rt,this.finishNode(Qe,qe)}tsCheckTypeAnnotationForReadOnly(qe){switch(qe.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(qe.start,Et.UnexpectedReadonly)}}tsParseTypeOperator(){let qe=this.startNode(),He=this.value;if(this.next(),qe.operator=He,qe.typeAnnotation=this.tsParseTypeOperatorOrHigher(),He==="readonly")this.tsCheckTypeAnnotationForReadOnly(qe);return this.finishNode(qe,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(Ve._extends)){let qe=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(Ve.question))return qe}}tsParseInferType(){let qe=this.startNode();this.expectContextual("infer");let He=this.startNode();return He.name=this.tsParseTypeParameterName(),He.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),qe.typeParameter=this.finishNode(He,"TSTypeParameter"),this.finishNode(qe,"TSInferType")}tsParseLiteralTypeNode(){let qe=this.startNode();return qe.literal=(()=>{switch(this.type){case Ve.num:case Ve.string:case Ve._true:case Ve._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(qe,"TSLiteralType")}tsParseImportType(){let qe=this.startNode();if(this.expect(Ve._import),this.expect(Ve.parenL),!this.match(Ve.string))this.raise(this.start,Et.UnsupportedImportTypeArgument);if(qe.argument=this.parseExprAtom(),this.expect(Ve.parenR),this.eat(Ve.dot))qe.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())qe.typeArguments=this.tsParseTypeArguments();return this.finishNode(qe,"TSImportType")}tsParseTypeQuery(){let qe=this.startNode();if(this.expect(Ve._typeof),this.match(Ve._import))qe.exprName=this.tsParseImportType();else qe.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())qe.typeArguments=this.tsParseTypeArguments();return this.finishNode(qe,"TSTypeQuery")}tsParseMappedTypeParameter(){let qe=this.startNode();return qe.name=this.tsParseTypeParameterName(),qe.constraint=this.tsExpectThenParseType(Ve._in),this.finishNode(qe,"TSTypeParameter")}tsParseMappedType(){let qe=this.startNode();if(this.expect(Ve.braceL),this.match(Ve.plusMin))qe.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))qe.readonly=!0;if(this.expect(Ve.bracketL),qe.typeParameter=this.tsParseMappedTypeParameter(),qe.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(Ve.bracketR),this.match(Ve.plusMin))qe.optional=this.value,this.next(),this.expect(Ve.question);else if(this.eat(Ve.question))qe.optional=!0;return qe.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(Ve.braceR),this.finishNode(qe,"TSMappedType")}tsParseTypeLiteral(){let qe=this.startNode();return qe.members=this.tsParseObjectTypeMembers(),this.finishNode(qe,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!ft(this.type))return!1;let qe=this.lookahead();if(qe.type===Ve.colon)return!0;if(qe.type!==Ve.question)return!1;return this.lookahead(2).type===Ve.colon}tsParseTupleElementType(){let qe=this.startLoc,He=this.start,Je=this.eat(Ve.ellipsis),Qe;if(this.tsIsTupleElementLabel()){let tt=this.startNode();tt.label=this.parseIdent(!0),tt.optional=this.eat(Ve.question),this.expect(Ve.colon),tt.elementType=this.tsParseType(),Qe=this.finishNode(tt,"TSNamedTupleMember")}else{Qe=this.tsParseType();let tt=this.eat(Ve.question);if(this.eat(Ve.colon))this.raise(Qe.start,Et.InvalidTupleMemberLabel);if(tt){let rt=this.startNodeAtNode(Qe);rt.typeAnnotation=Qe,Qe=this.finishNode(rt,"TSOptionalType")}}if(Je){let tt=this.startNodeAt(He,qe);tt.typeAnnotation=Qe,Qe=this.finishNode(tt,"TSRestType")}return Qe}tsParseTupleType(){let qe=this.startNode();qe.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let He=!1;return qe.elementTypes.forEach((Je)=>{let{type:Qe}=Je;if(He&&Qe!=="TSRestType"&&Qe!=="TSOptionalType"&&!(Qe==="TSNamedTupleMember"&&Je.optional))this.raise(Je.start,Et.OptionalTypeBeforeRequired);if(He||=Qe==="TSNamedTupleMember"&&Je.optional||Qe==="TSOptionalType",Qe==="TSRestType")Je=Je.typeAnnotation}),this.finishNode(qe,"TSTupleType")}tsParseTemplateLiteralType(){let qe=this.startNode();return qe.literal=this.parseTemplate({isTagged:!1}),this.finishNode(qe,"TSLiteralType")}tsParseTypeReference(){let qe=this.startNode();if(qe.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())qe.typeArguments=this.tsParseTypeArguments();return this.finishNode(qe,"TSTypeReference")}tsMatchLeftRelational(){return this.match(Ve.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(Ve.relational)&&this.value===">"}tsParseParenthesizedType(){let qe=this.startNode();return this.expect(Ve.parenL),qe.typeAnnotation=this.tsParseType(),this.expect(Ve.parenR),this.finishNode(qe,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case Ve.string:case Ve.num:case Ve._true:case Ve._false:return this.tsParseLiteralTypeNode();case Ve.plusMin:if(this.value==="-"){let qe=this.startNode();if(this.lookahead().type!==Ve.num)this.unexpected();return qe.literal=this.parseMaybeUnary(),this.finishNode(qe,"TSLiteralType")}break;case Ve._this:return this.tsParseThisTypeOrThisTypePredicate();case Ve._typeof:return this.tsParseTypeQuery();case Ve._import:return this.tsParseImportType();case Ve.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case Ve.bracketL:return this.tsParseTupleType();case Ve.parenL:return this.tsParseParenthesizedType();case Ve.backQuote:case Ve.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:qe}=this;if(ft(qe)||qe===Ve._void||qe===Ve._null){let He=qe===Ve._void?"TSVoidKeyword":qe===Ve._null?"TSNullKeyword":Nf(this.value);if(He!==void 0&&this.lookaheadCharCode()!==46){let Je=this.startNode();return this.next(),this.finishNode(Je,He)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let qe=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(Ve.bracketL))if(this.match(Ve.bracketR)){let He=this.startNodeAtNode(qe);He.elementType=qe,this.expect(Ve.bracketR),qe=this.finishNode(He,"TSArrayType")}else{let He=this.startNodeAtNode(qe);He.objectType=qe,He.indexType=this.tsParseType(),this.expect(Ve.bracketR),qe=this.finishNode(He,"TSIndexedAccessType")}return qe}tsParseTypeOperatorOrHigher(){return yt(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),Ve.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),Ve.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(Ve._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){xc(this.inType);let qe=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(Ve._extends))return qe;let He=this.startNodeAtNode(qe);return He.checkType=qe,He.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(Ve.question),He.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(Ve.colon),He.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(He,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),it(this.type))return this.next(),this.match(Ve.colon);return!1}tsInType(qe){let He=this.inType;this.inType=!0;try{return qe()}finally{this.inType=He}}tsTryParseIndexSignature(qe){if(!(this.match(Ve.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(Ve.bracketL);let He=this.parseIdent();He.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(He),this.expect(Ve.bracketR),qe.parameters=[He];let Je=this.tsTryParseTypeAnnotation();if(Je)qe.typeAnnotation=Je;return this.tsParseTypeMemberSemicolon(),this.finishNode(qe,"TSIndexSignature")}tsParseNoneModifiers(qe){this.tsParseModifiers({modified:qe,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:Et.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(qe=this.tsParseNoneModifiers.bind(this)){let He=this.startNode();return qe(He),He.name=this.tsParseTypeParameterName(),He.constraint=this.tsEatThenParseType(Ve._extends),He.default=this.tsEatThenParseType(Ve.eq),this.finishNode(He,"TSTypeParameter")}tsParseTypeParameters(qe){let He=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let Je={value:-1};if(He.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,qe),!1,!0,Je),He.params.length===0)this.raise(this.start,Et.EmptyTypeParameters);if(Je.value!==-1)this.addExtra(He,"trailingComma",Je.value);return this.finishNode(He,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(qe){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(qe)}tsTryParse(qe){let He=this.beginParseEffectScope(),Je;try{Je=qe()}catch(Qe){throw this.parseEffects.rollback(He),Qe}if(Je!==void 0&&Je!==!1)return this.parseEffects.commit(He),Je;this.parseEffects.rollback(He);return}tsTokenCanFollowModifier(){return(this.match(Ve.bracketL)||this.match(Ve.braceL)||this.match(Ve.star)||this.match(Ve.ellipsis)||this.match(Ve.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(qe,He){let Je=this.value;if(qe.indexOf(Je)!==-1&&!this.containsEsc){if(He&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return Je}return}tsParseModifiersByMap({modified:qe,map:He}){for(let Je of Object.keys(He))qe[Je]=He[Je]}tsParseModifiers({modified:qe,allowedModifiers:He,disallowedModifiers:Je,stopOnStartOfClassStaticBlock:Qe,errorTemplate:tt=Et.InvalidModifierOnTypeMember}){let rt={},at=(lt,ct,dt,ht)=>{if(ct===dt&&qe[ht])this.raise(lt.column,Et.InvalidModifiersOrder({orderedModifiers:[dt,ht]}))},pt=(lt,ct,dt,ht)=>{if(qe[dt]&&ct===ht||qe[ht]&&ct===dt)this.raise(lt.column,Et.IncompatibleModifiers({modifiers:[dt,ht]}))};for(;;){let lt=this.startLoc,ct=this.tsParseModifier(He.concat(Je??[]),Qe);if(!ct)break;if(Ec(ct))if(qe.accessibility)this.raise(this.start,Et.DuplicateAccessibilityModifier());else at(lt,ct,ct,"override"),at(lt,ct,ct,"static"),at(lt,ct,ct,"readonly"),at(lt,ct,ct,"accessor"),rt.accessibility=ct,qe.accessibility=ct;else if(Sf(ct))if(qe[ct])this.raise(this.start,Et.DuplicateModifier({modifier:ct}));else at(lt,ct,"in","out"),rt[ct]=ct,qe[ct]=!0;else if(vf(ct))if(qe[ct])this.raise(this.start,Et.DuplicateModifier({modifier:ct}));else pt(lt,ct,"accessor","readonly"),pt(lt,ct,"accessor","override"),rt[ct]=ct,qe[ct]=!0;else if(ct==="const")if(qe[ct])this.raise(this.start,Et.DuplicateModifier({modifier:ct}));else rt[ct]=ct,qe[ct]=!0;else if(Object.hasOwnProperty.call(qe,ct))this.raise(this.start,Et.DuplicateModifier({modifier:ct}));else at(lt,ct,"static","readonly"),at(lt,ct,"static","override"),at(lt,ct,"override","readonly"),at(lt,ct,"abstract","override"),pt(lt,ct,"declare","override"),pt(lt,ct,"static","abstract"),rt[ct]=ct,qe[ct]=!0;if(Je?.includes(ct))this.raise(this.start,tt)}return rt}tsParseInOutModifiers(qe){this.tsParseModifiers({modified:qe,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:Et.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(qe){this.tsParseModifiers({modified:qe,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:Et.InvalidModifierOnTypeParameter})}parseMaybeUnary(qe,He,Je,Qe){if(!i?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(qe,He,Je,Qe)}tsParseTypeAssertion(){if(Be)this.raise(this.start,Et.ReservedTypeAssertion);let qe=this.tryParse(()=>{let He=this.startNode(),Je=this.tsTryNextParseConstantContext();return He.typeAnnotation=Je||this.tsNextThenParseType(),this.expect(Ve.relational),He.expression=this.parseMaybeUnary(),this.finishNode(He,"TSTypeAssertion")});if(qe.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return qe.node}tsParseTypeArguments(qe=!1){let He=this.startNode();if(He.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(Ve.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),He.params.length===0)this.raise(this.start,Et.EmptyTypeArguments);if(qe&&this.curContext()!==nt.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode(He,"TSTypeParameterInstantiation")}tsParseHeritageClause(qe){let He=this.start,Je=this.tsParseDelimitedList("HeritageClauseElement",()=>{let Qe=this.startNode();if(Qe.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())Qe.typeParameters=this.tsParseTypeArguments();return this.finishNode(Qe,"TSExpressionWithTypeArguments")});if(!Je.length)this.raise(He,Et.EmptyHeritageClauseType({token:qe}));return Je}tsParseTypeMemberSemicolon(){if(!this.eat(Ve.comma)&&!this.isLineTerminator())this.expect(Ve.semi)}tsTryParseAndCatch(qe){let He=this.tryParse((Je)=>qe()||Je());if(He.aborted||!He.node)return;return He.node}tsParseSignatureMember(qe,He){return this.tsFillSignature(Ve.colon,He),this.tsParseTypeMemberSemicolon(),this.finishNode(He,qe)}tsParsePropertyOrMethodSignature(qe,He){if(this.eat(Ve.question))qe.optional=!0;let Je=qe;if(this.match(Ve.parenL)||this.tsMatchLeftRelational()){if(He)this.raise(qe.start,Et.ReadonlyForMethodSignature);let Qe=Je;if(Qe.kind&&this.tsMatchLeftRelational())this.raise(this.start,Et.AccesorCannotHaveTypeParameters);this.tsFillSignature(Ve.colon,Qe),this.tsParseTypeMemberSemicolon();let tt="parameters",rt="typeAnnotation";if(Qe.kind==="get"){if(Qe[tt].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(Qe[tt][0]))this.raise(this.start,Et.AccesorCannotDeclareThisParameter)}}else if(Qe.kind==="set"){if(Qe[tt].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let at=Qe[tt][0];if(this.isThisParam(at))this.raise(this.start,Et.AccesorCannotDeclareThisParameter);if(at.type==="Identifier"&&at.optional)this.raise(this.start,Et.SetAccesorCannotHaveOptionalParameter);if(at.type==="RestElement")this.raise(this.start,Et.SetAccesorCannotHaveRestParameter)}if(Qe[rt])this.raise(Qe[rt].start,Et.SetAccesorCannotHaveReturnType)}else Qe.kind="method";return this.finishNode(Qe,"TSMethodSignature")}else{let Qe=Je;if(He)Qe.readonly=!0;let tt=this.tsTryParseTypeAnnotation();if(tt)Qe.typeAnnotation=tt;return this.tsParseTypeMemberSemicolon(),this.finishNode(Qe,"TSPropertySignature")}}tsParseTypeMember(){let qe=this.startNode();if(this.match(Ve.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",qe);if(this.match(Ve._new)){let Je=this.startNode();if(this.next(),this.match(Ve.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",qe);else return qe.key=this.createIdentifier(Je,"new"),this.tsParsePropertyOrMethodSignature(qe,!1)}this.tsParseModifiers({modified:qe,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let He=this.tsTryParseIndexSignature(qe);if(He)return He;if(this.parsePropertyName(qe),!qe.computed&&qe.key.type==="Identifier"&&(qe.key.name==="get"||qe.key.name==="set")&&this.tsTokenCanFollowModifier())qe.kind=qe.key.name,this.parsePropertyName(qe);return this.tsParsePropertyOrMethodSignature(qe,!!qe.readonly)}tsParseList(qe,He){let Je=[];while(!this.tsIsListTerminator(qe))Je.push(He());return Je}tsParseObjectTypeMembers(){this.expect(Ve.braceL);let qe=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(Ve.braceR),qe}tsParseInterfaceDeclaration(qe,He={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),He.declare)qe.declare=!0;if(it(this.type)){qe.id=this.parseIdent(),this.checkLValSimple(qe.id,Dt.BIND_TS_INTERFACE);let Qe=this.currentScope();this.maybeExportDefined(Qe,qe.id.name)}else qe.id=null,this.raise(this.start,Et.MissingInterfaceName);if(qe.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(Ve._extends))qe.extends=this.tsParseHeritageClause("extends");let Je=this.startNode();return Je.body=this.tsParseInterfaceBody(),qe.body=this.finishNode(Je,"TSInterfaceBody"),this.finishNode(qe,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(Ve.braceL);let qe=this.inType;this.inType=!0;let He=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=qe,this.expect(Ve.braceR),He}tsParseAbstractDeclaration(qe){if(this.match(Ve._class))return qe.abstract=!0,this.parseClass(qe,!0);else if(this.ts_isContextual(et.interface)){if(!this.hasFollowingLineBreak())return qe.abstract=!0,this.tsParseInterfaceDeclaration(qe)}else this.unexpected(qe.start)}tsIsDeclarationStart(){return mt(this.type)}tsParseExpressionStatement(qe,He){switch(He.name){case"declare":{let Je=this.tsTryParseDeclare(qe);if(Je)return Je.declare=!0,Je;break}case"global":if(this.match(Ve.braceL)){this.enterScope(Br);let Je=qe;return Je.global=!0,Je.id=He,Je.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(Je,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(qe,He.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:qe}=this,He=this.isAsyncFunction(),Je=this.isLet();if(it(qe)){if(He&&!this.containsEsc||Je)return!1;if((qe===et.type||qe===et.interface)&&!this.containsEsc){let rt=this.lookahead();if(it(rt.type)&&!this.isContextualWithState("from",rt)||rt.type===Ve.braceL)return!1}}else if(!this.match(Ve._default))return!1;let Qe=this.nextTokenStart(),tt=this.isUnparsedContextual(Qe,"from");if(this.input.charCodeAt(Qe)===44||it(this.type)&&tt)return!0;if(this.match(Ve._default)&&tt){let rt=this.input.charCodeAt(this.nextTokenStartSince(Qe+4));return rt===34||rt===39}return!1}tsInAmbientContext(qe){let He=this.isAmbientContext;this.isAmbientContext=!0;try{return qe()}finally{this.isAmbientContext=He}}tsCheckLineTerminator(qe){if(qe){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(qe,He=!1){if(qe.id=this.parseIdent(),!He)this.checkLValSimple(qe.id,Dt.BIND_TS_NAMESPACE);if(this.eat(Ve.dot)){let Je=this.startNode();this.tsParseModuleOrNamespaceDeclaration(Je,!0),qe.body=Je}else this.enterScope(Br),qe.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(qe,"TSModuleDeclaration")}checkLValSimple(qe,He=Dt.BIND_NONE,Je){while(qe.type==="TSNonNullExpression"||qe.type==="TSAsExpression"||qe.type==="TSSatisfiesExpression"||qe.type==="TSTypeAssertion")qe=qe.expression;return super.checkLValSimple(qe,He,Je)}isSimpleAssignTarget(qe){while(qe.type==="TSNonNullExpression"||qe.type==="TSAsExpression"||qe.type==="TSSatisfiesExpression"||qe.type==="TSTypeAssertion")qe=qe.expression;return super.isSimpleAssignTarget(qe)}tsParseTypeAliasDeclaration(qe){qe.id=this.parseIdent(),this.checkLValSimple(qe.id,Dt.BIND_TS_TYPE);let He=this.currentScope();return this.maybeExportDefined(He,qe.id.name),qe.typeAnnotation=this.tsInType(()=>{if(qe.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(Ve.eq),this.ts_isContextual(et.interface)&&this.lookahead().type!==Ve.dot){let Je=this.startNode();return this.next(),this.finishNode(Je,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(qe,"TSTypeAliasDeclaration")}tsParseDeclaration(qe,He,Je){switch(He){case"abstract":if(this.tsCheckLineTerminator(Je)&&(this.match(Ve._class)||it(this.type)))return this.tsParseAbstractDeclaration(qe);break;case"module":if(this.tsCheckLineTerminator(Je)){if(this.match(Ve.string))return this.tsParseAmbientExternalModuleDeclaration(qe);else if(it(this.type))return this.tsParseModuleOrNamespaceDeclaration(qe)}break;case"namespace":if(this.tsCheckLineTerminator(Je)&&it(this.type))return this.tsParseModuleOrNamespaceDeclaration(qe);break;case"type":if(this.tsCheckLineTerminator(Je)&&it(this.type))return this.tsParseTypeAliasDeclaration(qe);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(qe,He){qe.isExport=He||!1,qe.id=this.parseIdent(),this.checkLValSimple(qe.id,Dt.BIND_LEXICAL),super.expect(Ve.eq);let Je=this.tsParseModuleReference();if(qe.importKind==="type"&&Je.type!=="TSExternalModuleReference")this.raise(Je.start,Et.ImportAliasHasImportType);return qe.moduleReference=Je,super.semicolon(),this.finishNode(qe,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:qe}=this;if(it(qe)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((qe===et.type||qe===et.interface)&&!this.containsEsc){let Qe=this.lookahead();if(it(Qe.type)&&!this.isContextualWithState("from",Qe)||Qe.type===Ve.braceL)return!1}}else if(!this.match(Ve._default))return!1;let He=this.nextTokenStart(),Je=this.isUnparsedContextual(He,"from");if(this.input.charCodeAt(He)===44||it(this.type)&&Je)return!0;if(this.match(Ve._default)&&Je){let Qe=this.input.charCodeAt(this.nextTokenStartSince(He+4));return Qe===34||Qe===39}return!1}parseTemplate({isTagged:qe=!1}={}){let He=this.startNode();this.next(),He.expressions=[];let Je=this.parseTemplateElement({isTagged:qe});He.quasis=[Je];while(!Je.tail){if(this.type===Ve.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Ve.dollarBraceL),He.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(Ve.braceR),He.quasis.push(Je=this.parseTemplateElement({isTagged:qe}))}return this.next(),this.finishNode(He,"TemplateLiteral")}parseFunction(qe,He,Je,Qe,tt){if(this.initFunction(qe),this.ecmaVersion>=9||this.ecmaVersion>=6&&!Qe){if(this.type===Ve.star&&He&bc)this.unexpected();qe.generator=this.eat(Ve.star)}if(this.ecmaVersion>=8)qe.async=!!Qe;if(He&xs)qe.id=He&Tf&&this.type!==Ve.name?null:this.parseIdent();let rt=this.yieldPos,at=this.awaitPos,pt=this.awaitIdentPos,lt=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(qi(qe.async,qe.generator)),!(He&xs))qe.id=this.type===Ve.name?this.parseIdent():null;this.parseFunctionParams(qe);let ct=He&xs;if(this.parseFunctionBody(qe,Je,!1,tt,{isFunctionDeclaration:ct}),ct&&this.isAmbientContext&&qe.id){if(this.currentScope().flags&Dt.SCOPE_TOP)this.declareName(qe.id.name,Dt.BIND_FLAGS_TS_EXPORT_ONLY,qe.id.start)}if(this.yieldPos=rt,this.awaitPos=at,this.awaitIdentPos=pt,He&xs&&qe.id&&!(He&bc))if(qe.body)this.checkLValSimple(qe.id,this.strict||qe.generator||qe.async?this.treatFunctionsAsVar?Dt.BIND_VAR:Dt.BIND_LEXICAL:Dt.BIND_FUNCTION);else this.checkLValSimple(qe.id,Dt.BIND_NONE);return this.maybeInArrowParameters=lt,this.finishNode(qe,ct?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(qe,He=!1,Je=!1,Qe=!1,tt){if(this.match(Ve.colon))qe.returnType=this.tsParseTypeOrTypePredicateAnnotation(Ve.colon);let rt=tt?.isFunctionDeclaration?"TSDeclareFunction":tt?.isClassMethod?"TSDeclareMethod":void 0;if(rt&&!this.match(Ve.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode(qe,rt);if(rt==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise(qe.start,Et.DeclareFunctionHasImplementation),qe.declare)return super.parseFunctionBody(qe,He,Je,!1),this.finishNode(qe,rt)}return super.parseFunctionBody(qe,He,Je,Qe),qe}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let qe=this.startNode(),He=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(Ve.dot)){qe.meta=He;let at=this.containsEsc;if(qe.property=this.parseIdent(!0),qe.property.name!=="target")this.raiseRecoverable(qe.property.start,"The only valid meta property for new is 'new.target'");if(at)this.raiseRecoverable(qe.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(qe.start,"'new.target' can only be used in functions and class static block");return this.finishNode(qe,"MetaProperty")}let Je=this.start,Qe=this.startLoc,tt=this.type===Ve._import;if(qe.callee=this.parseSubscripts(this.parseExprAtom(),Je,Qe,!0,!1),tt&&qe.callee.type==="ImportExpression")this.raise(Je,"Cannot use new with import()");let{callee:rt}=qe;if(rt.type==="TSInstantiationExpression"&&!rt.extra?.parenthesized)qe.typeArguments=rt.typeArguments,qe.callee=rt.expression;if(this.eat(Ve.parenL))qe.arguments=this.parseExprList(Ve.parenR,this.ecmaVersion>=8,!1);else qe.arguments=[];return this.finishNode(qe,"NewExpression")}parseExprOp(qe,He,Je,Qe,tt){if(Ve._in.binop>Qe&&!this.hasPrecedingLineBreak()){let rt;if(this.isContextual("as"))rt="TSAsExpression";if(this.isContextual("satisfies"))rt="TSSatisfiesExpression";if(rt){let at=this.startNodeAt(He,Je);at.expression=qe;let pt=this.tsTryNextParseConstantContext();if(pt)at.typeAnnotation=pt;else at.typeAnnotation=this.tsNextThenParseType();return this.finishNode(at,rt),this.reScan_lt_gt(),this.parseExprOp(at,He,Je,Qe,tt)}}return super.parseExprOp(qe,He,Je,Qe,tt)}parseImportSpecifiers(){let qe=[],He=!0;if(We.tokenIsIdentifier(this.type)){if(qe.push(this.parseImportDefaultSpecifier()),!this.eat(Ve.comma))return qe}if(this.type===Ve.star)return qe.push(this.parseImportNamespaceSpecifier()),qe;this.expect(Ve.braceL);while(!this.eat(Ve.braceR)){if(!He){if(this.expect(Ve.comma),this.afterTrailingComma(Ve.braceR))break}else He=!1;qe.push(this.parseImportSpecifier())}return qe}parseImport(qe){let He=this.lookahead();if(qe.importKind="value",this.importOrExportOuterKind="value",it(He.type)||this.match(Ve.star)||this.match(Ve.braceL)){let Je=this.lookahead(2);if(Je.type!==Ve.comma&&!this.isContextualWithState("from",Je)&&Je.type!==Ve.eq&&this.ts_eatContextualWithState("type",1,He))this.importOrExportOuterKind="type",qe.importKind="type",He=this.lookahead(),Je=this.lookahead(2);if(it(He.type)&&Je.type===Ve.eq){this.next();let Qe=this.tsParseImportEqualsDeclaration(qe);return this.importOrExportOuterKind="value",Qe}}if(this.next(),this.type===Ve.string)qe.specifiers=[],qe.source=this.parseExprAtom();else qe.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),qe.source=this.type===Ve.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes(qe),this.semicolon(),this.finishNode(qe,"ImportDeclaration"),this.importOrExportOuterKind="value",qe.importKind==="type"&&qe.specifiers.length>1&&qe.specifiers[0].type==="ImportDefaultSpecifier")this.raise(qe.start,Et.TypeImportCannotSpecifyDefaultAndNamed);return qe}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let qe=this.startNode();return this.next(),qe.abstract=!0,this.parseClass(qe,!0)}if(this.match(et.interface)){let qe=this.tsParseInterfaceDeclaration(this.startNode());if(qe)return qe}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(qe,He){if(this.ecmaVersion>=11)if(this.eatContextual("as"))qe.exported=this.parseModuleExportName(),this.checkExport(He,qe.exported,this.lastTokStart);else qe.exported=null;if(this.expectContextual("from"),this.type!==Ve.string)this.unexpected();return qe.source=this.parseExprAtom(),this.parseMaybeImportAttributes(qe),this.semicolon(),this.finishNode(qe,"ExportAllDeclaration")}parseDynamicImport(qe){if(this.next(),qe.source=this.parseMaybeAssign(),this.eat(Ve.comma)){let He=this.parseExpression();qe.arguments=[He]}if(!this.eat(Ve.parenR)){let He=this.start;if(this.eat(Ve.comma)&&this.eat(Ve.parenR))this.raiseRecoverable(He,"Trailing comma is not allowed in import()");else this.unexpected(He)}return this.finishNode(qe,"ImportExpression")}parseExport(qe,He){let Je=this.lookahead();if(this.ts_eatWithState(Ve._import,2,Je)){if(this.ts_isContextual(et.type)&&this.lookaheadCharCode()!==61)qe.importKind="type",this.importOrExportOuterKind="type",this.next();else qe.importKind="value",this.importOrExportOuterKind="value";let Qe=this.tsParseImportEqualsDeclaration(qe,!0);return this.importOrExportOuterKind=void 0,Qe}else if(this.ts_eatWithState(Ve.eq,2,Je)){let Qe=qe;return Qe.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(Qe,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,Je)){let Qe=qe;return this.expectContextual("namespace"),Qe.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(Qe,"TSNamespaceExportDeclaration")}else{let Qe=this.lookahead(2).type;if(this.ts_isContextualWithState(Je,et.type)&&(Qe===Ve.braceL||Qe===Ve.star))this.next(),this.importOrExportOuterKind="type",qe.exportKind="type";else this.importOrExportOuterKind="value",qe.exportKind="value";if(this.next(),this.eat(Ve.star))return this.parseExportAllDeclaration(qe,He);if(this.eat(Ve._default))return this.checkExport(He,"default",this.lastTokStart),qe.declaration=this.parseExportDefaultDeclaration(),this.finishNode(qe,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(qe.declaration=this.parseExportDeclaration(qe),qe.declaration.type==="VariableDeclaration")this.checkVariableExport(He,qe.declaration.declarations);else this.checkExport(He,qe.declaration.id,qe.declaration.id.start);qe.specifiers=[],qe.source=null}else{if(qe.declaration=null,qe.specifiers=this.parseExportSpecifiers(He),this.eatContextual("from")){if(this.type!==Ve.string)this.unexpected();qe.source=this.parseExprAtom(),this.parseMaybeImportAttributes(qe)}else{for(let tt of qe.specifiers)if(this.checkUnreserved(tt.local),this.checkLocalExport(tt.local),tt.local.type==="Literal")this.raise(tt.local.start,"A string literal cannot be used as an exported binding without `from`.");qe.source=null}this.semicolon()}return this.finishNode(qe,"ExportNamedDeclaration")}}checkExport(qe,He,Je){if(!qe)return;if(typeof He!=="string")He=He.type==="Identifier"?He.name:He.value;qe[He]=!0}parseMaybeDefault(qe,He,Je){let Qe=super.parseMaybeDefault(qe,He,Je);if(Qe.type==="AssignmentPattern"&&Qe.typeAnnotation&&Qe.right.start<Qe.typeAnnotation.start)this.raise(Qe.typeAnnotation.start,Et.TypeAnnotationAfterAssign);return Qe}typeCastToParameter(qe){return qe.expression.typeAnnotation=qe.typeAnnotation,this.resetEndLocation(qe.expression,qe.typeAnnotation.end,qe.typeAnnotation.loc?.end),qe.expression}toAssignableList(qe,He){if(!qe)qe=[];for(let Je=0;Je<qe.length;Je++){let Qe=qe[Je];if(Qe?.type==="TSTypeCastExpression")qe[Je]=this.typeCastToParameter(Qe)}return super.toAssignableList(qe,He)}reportReservedArrowTypeParam(qe){if(qe.params.length===1&&!qe.extra?.trailingComma&&Be)this.raise(qe.start,Et.ReservedArrowTypeParam)}parseExprAtom(qe,He,Je){if(this.type===et.jsxText)return this.jsx_parseText();else if(this.type===et.jsxTagStart)return this.jsx_parseElement();else if(this.type===et.at)return this.parseDecorators(),this.parseExprAtom();else if(it(this.type)){let Qe=this.potentialArrowAt===this.start,tt=this.start,rt=this.startLoc,at=this.containsEsc,pt=this.parseIdent(!1);if(this.ecmaVersion>=8&&!at&&pt.name==="async"&&!this.canInsertSemicolon()&&this.eat(Ve._function))return this.overrideContext(Xe.f_expr),this.parseFunction(this.startNodeAt(tt,rt),0,!1,!0,He);if(Qe&&!this.canInsertSemicolon()){if(this.eat(Ve.arrow))return this.parseArrowExpression(this.startNodeAt(tt,rt),[pt],!1,He);if(this.ecmaVersion>=8&&pt.name==="async"&&this.type===Ve.name&&!at&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(pt=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Ve.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(tt,rt),[pt],!0,He)}}return pt}else return super.parseExprAtom(qe,He,Je)}parseExprAtomDefault(){if(it(this.type)){let qe=this.potentialArrowAt===this.start,He=this.containsEsc,Je=this.parseIdent();if(!He&&Je.name==="async"&&!this.canInsertSemicolon()){let{type:Qe}=this;if(Qe===Ve._function)return this.next(),this.parseFunction(this.startNodeAtNode(Je),void 0,!0,!0);else if(it(Qe))if(this.lookaheadCharCode()===61){let tt=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(Ve.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(Je),[tt],!0)}else return Je}if(qe&&this.match(Ve.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(Je),[Je],!1);return Je}else this.unexpected()}parseIdentNode(){let qe=this.startNode();if(ft(this.type)&&!((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)))qe.name=this.value;else return super.parseIdentNode();return qe}parseVarStatement(qe,He,Je=!1){let{isAmbientContext:Qe}=this;this.next(),super.parseVar(qe,!1,He,Je||Qe),this.semicolon();let tt=this.finishNode(qe,"VariableDeclaration");if(!Qe)return tt;for(let{id:rt,init:at}of tt.declarations){if(!at)continue;if(He!=="const"||!!rt.typeAnnotation)this.raise(at.start,Et.InitializerNotAllowedInAmbientContext);else if(at.type!=="Literal"&&(at.type!=="TemplateLiteral"||at.expressions.length>0)&&!Af(at)&&!kf(at))this.raise(at.start,Et.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return tt}parseStatement(qe,He,Je){if(this.match(et.at))this.parseDecorators(!0);if(this.match(Ve._const)&&this.isLookaheadContextual("enum")){let Qe=this.startNode();return this.expect(Ve._const),this.tsParseEnumDeclaration(Qe,{const:!0})}if(this.ts_isContextual(et.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(et.interface)){let Qe=this.tsParseInterfaceDeclaration(this.startNode());if(Qe)return Qe}return super.parseStatement(qe,He,Je)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(qe){if(this.eat(Ve.question))qe.optional=!0;if(qe.readonly&&this.match(Ve.parenL))this.raise(qe.start,Et.ClassMethodHasReadonly);if(qe.declare&&this.match(Ve.parenL))this.raise(qe.start,Et.ClassMethodHasDeclare)}parseExpressionStatement(qe,He){return(He.type==="Identifier"?this.tsParseExpressionStatement(qe,He):void 0)||super.parseExpressionStatement(qe,He)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(et.at))return!0;return super.shouldParseExportStatement()}parseConditional(qe,He,Je,Qe,tt){if(this.eat(Ve.question)){let rt=this.startNodeAt(He,Je);return rt.test=qe,rt.consequent=this.parseMaybeAssign(),this.expect(Ve.colon),rt.alternate=this.parseMaybeAssign(Qe),this.finishNode(rt,"ConditionalExpression")}return qe}parseMaybeConditional(qe,He){let Je=this.start,Qe=this.startLoc,tt=this.parseExprOps(qe,He);if(this.checkExpressionErrors(He))return tt;if(!this.maybeInArrowParameters||!this.match(Ve.question))return this.parseConditional(tt,Je,Qe,qe,He);let rt=this.tryParse(()=>this.parseConditional(tt,Je,Qe,qe,He));if(!rt.node){if(rt.error)this.setOptionalParametersError(He,rt.error);return tt}return rt.node}parseParenItem(qe){let He=this.start,Je=this.startLoc;if(qe=super.parseParenItem(qe),this.eat(Ve.question))qe.optional=!0,this.resetEndLocation(qe);if(this.match(Ve.colon)){let Qe=this.startNodeAt(He,Je);return Qe.expression=qe,Qe.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(Qe,"TSTypeCastExpression")}return qe}parseExportDeclaration(qe){if(!this.isAmbientContext&&this.ts_isContextual(et.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(qe));let He=this.start,Je=this.startLoc,Qe=this.eatContextual("declare");if(Qe&&(this.ts_isContextual(et.declare)||!this.shouldParseExportStatement()))this.raise(this.start,Et.ExpectedAmbientAfterExportDeclare);let rt=it(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!rt)return null;if(rt.type==="TSInterfaceDeclaration"||rt.type==="TSTypeAliasDeclaration"||Qe)qe.exportKind="type";if(Qe)this.resetStartLocation(rt,He,Je),rt.declare=!0;return rt}parseClassId(qe,He){if(!He&&this.isContextual("implements"))return;super.parseClassId(qe,He);let Je=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if(Je)qe.typeParameters=Je}parseClassPropertyAnnotation(qe){if(!qe.optional){if(this.value==="!"&&this.eat(Ve.prefix))qe.definite=!0;else if(this.eat(Ve.question))qe.optional=!0}let He=this.tsTryParseTypeAnnotation();if(He)qe.typeAnnotation=He}parseClassField(qe){if(qe.key.type==="PrivateIdentifier"){if(qe.abstract)this.raise(qe.start,Et.PrivateElementHasAbstract);if(qe.accessibility)this.raise(qe.start,Et.PrivateElementHasAccessibility({modifier:qe.accessibility}));this.parseClassPropertyAnnotation(qe)}else{if(this.parseClassPropertyAnnotation(qe),this.isAmbientContext&&!(qe.readonly&&!qe.typeAnnotation)&&this.match(Ve.eq))this.raise(this.start,Et.DeclareClassFieldHasInitializer);if(qe.abstract&&this.match(Ve.eq)){let{key:Je}=qe;this.raise(this.start,Et.AbstractPropertyHasInitializer({propertyName:Je.type==="Identifier"&&!qe.computed?Je.name:`[${this.input.slice(Je.start,Je.end)}]`}))}}return super.parseClassField(qe)}parseClassMethod(qe,He,Je,Qe){let tt=qe.kind==="constructor",rt=qe.key.type==="PrivateIdentifier",at=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(rt){if(at)qe.typeParameters=at;if(qe.accessibility)this.raise(qe.start,Et.PrivateMethodsHasAccessibility({modifier:qe.accessibility}))}else if(at&&tt)this.raise(at.start,Et.ConstructorHasTypeParameters);let{declare:pt=!1,kind:lt}=qe;if(pt&&(lt==="get"||lt==="set"))this.raise(qe.start,Et.DeclareAccessor({kind:lt}));if(at)qe.typeParameters=at;let ct=qe.key;if(qe.kind==="constructor"){if(He)this.raise(ct.start,"Constructor can't be a generator");if(Je)this.raise(ct.start,"Constructor can't be an async method")}else if(qe.static&&mc(qe,"prototype"))this.raise(ct.start,"Classes may not have a static property named prototype");let dt=qe.value=this.parseMethod(He,Je,Qe,!0,qe);if(qe.kind==="get"&&dt.params.length!==0)this.raiseRecoverable(dt.start,"getter should have no params");if(qe.kind==="set"&&dt.params.length!==1)this.raiseRecoverable(dt.start,"setter should have exactly one param");if(qe.kind==="set"&&dt.params[0].type==="RestElement")this.raiseRecoverable(dt.params[0].start,"Setter cannot use rest params");return this.finishNode(qe,"MethodDefinition")}isClassMethod(){return this.match(Ve.relational)}parseClassElement(qe){if(this.eat(Ve.semi))return null;let He=this.startNode(),Je="",Qe=!1,tt=!1,rt="method",at=!1,pt=["declare","private","public","protected","accessor","override","abstract","readonly","static"],lt=this.tsParseModifiers({modified:He,allowedModifiers:pt,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:Et.InvalidModifierOnTypeParameterPositions});at=Boolean(lt.static);let ct=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(He,pt))this.raise(this.start,Et.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(He),He}else{let dt=this.tsTryParseIndexSignature(He);if(dt){if(He.abstract)this.raise(He.start,Et.IndexSignatureHasAbstract);if(He.accessibility)this.raise(He.start,Et.IndexSignatureHasAccessibility({modifier:He.accessibility}));if(He.declare)this.raise(He.start,Et.IndexSignatureHasDeclare);if(He.override)this.raise(He.start,Et.IndexSignatureHasOverride);return dt}if(!this.inAbstractClass&&He.abstract)this.raise(He.start,Et.NonAbstractClassHasAbstractMethod);if(He.override){if(!qe)this.raise(He.start,Et.OverrideNotInSubClass)}if(He.static=at,at){if(!(this.isClassElementNameStart()||this.type===Ve.star))Je="static"}if(!Je&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Ve.star)&&!this.canInsertSemicolon())tt=!0;else Je="async";if(!Je&&(this.ecmaVersion>=9||!tt)&&this.eat(Ve.star))Qe=!0;if(!Je&&!tt&&!Qe){let ht=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())rt=ht;else Je=ht}if(Je)He.computed=!1,He.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),He.key.name=Je,this.finishNode(He.key,"Identifier");else this.parseClassElementName(He);if(this.parsePostMemberNameModifiers(He),this.isClassMethod()||this.ecmaVersion<13||this.type===Ve.parenL||rt!=="method"||Qe||tt){let ht=!He.static&&mc(He,"constructor"),gt=ht&&qe;if(ht&&rt!=="method")this.raise(He.key.start,"Constructor can't have get/set modifier");He.kind=ht?"constructor":rt,this.parseClassMethod(He,Qe,tt,gt)}else this.parseClassField(He);return He}};if(He.declare)this.tsInAmbientContext(ct);else ct();return He}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper(qe){if(super.parseClassSuper(qe),qe.superClass&&(this.tsMatchLeftRelational()||this.match(Ve.bitShift)))qe.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))qe.implements=this.tsParseHeritageClause("implements")}parseFunctionParams(qe){let He=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(He)qe.typeParameters=He;super.parseFunctionParams(qe)}parseVarId(qe,He){if(super.parseVarId(qe,He),qe.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(Ve.prefix))qe.definite=!0;let Je=this.tsTryParseTypeAnnotation();if(Je)qe.id.typeAnnotation=Je,this.resetEndLocation(qe.id)}parseArrowExpression(qe,He,Je,Qe){if(this.match(Ve.colon))qe.returnType=this.tsParseTypeAnnotation();let tt=this.yieldPos,rt=this.awaitPos,at=this.awaitIdentPos;this.enterScope(qi(Je,!1)|Dt.SCOPE_ARROW),this.initFunction(qe);let pt=this.maybeInArrowParameters;if(this.ecmaVersion>=8)qe.async=!!Je;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,qe.params=this.toAssignableList(He,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(qe,!0,!1,Qe),this.yieldPos=tt,this.awaitPos=rt,this.awaitIdentPos=at,this.maybeInArrowParameters=pt,this.finishNode(qe,"ArrowFunctionExpression")}parseYield(qe){if(!this.yieldPos)this.yieldPos=this.start;let He=this.startNode();this.next();let Je=this.tsMatchLeftRelational();if(!(!this.match(Ve.semi)&&!this.canInsertSemicolon()&&(this.match(Ve.star)||this.type.startsExpr||Je)))return He.delegate=!1,He.argument=null,this.finishNode(He,"YieldExpression");return He.delegate=this.eat(Ve.star),He.argument=this.parseMaybeAssign(qe),this.finishNode(He,"YieldExpression")}parseMaybeAssignOrigin(qe,He,Je){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(qe);else this.exprAllowed=!1;let Qe=!1,tt=-1,rt=-1,at=-1;if(He)tt=He.parenthesizedAssign,rt=He.trailingComma,at=He.doubleProto,He.parenthesizedAssign=He.trailingComma=-1;else He=new Fr,Qe=!0;let pt=this.start,lt=this.startLoc;if(this.type===Ve.parenL||it(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=qe==="await";let ct=this.parseMaybeConditional(qe,He);if(Je)ct=Je.call(this,ct,pt,lt);if(this.type.isAssign){let dt=this.startNodeAt(pt,lt);if(dt.operator=this.value,this.type===Ve.eq)ct=this.toAssignable(ct,!0,He,!0);if(!Qe)He.parenthesizedAssign=He.trailingComma=He.doubleProto=-1;if(He.shorthandAssign>=ct.start)He.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===Ve.eq)this.checkLValPattern(ct);else this.checkLValSimple(ct);if(dt.left=ct,this.next(),dt.right=this.parseMaybeAssign(qe),at>-1)He.doubleProto=at;return this.finishNode(dt,"AssignmentExpression")}else if(Qe)this.checkExpressionErrors(He,!0);if(tt>-1)He.parenthesizedAssign=tt;if(rt>-1)He.trailingComma=rt;return ct}parseMaybeAssign(qe,He,Je){let Qe,tt;if(i?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(Qe=this.tryParse(()=>this.parseMaybeAssignOrigin(qe,He,Je)),!Qe.error)return Qe.node;let pt=this.context,lt=pt[pt.length-1],ct=pt[pt.length-2];if(lt===We.tokContexts.tc_oTag&&ct===We.tokContexts.tc_expr)this.parseEffects.pop(pt),this.parseEffects.pop(pt);else if(lt===We.tokContexts.tc_oTag||lt===We.tokContexts.tc_expr)this.parseEffects.pop(pt)}if(!Qe?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(qe,He,Je);let rt,at=this.tryParse((pt)=>{rt=this.tsParseTypeParameters(this.tsParseConstModifier);let lt=this.parseMaybeAssignOrigin(qe,He,Je);if(lt.type!=="ArrowFunctionExpression"||lt.extra?.parenthesized)pt();if(rt?.params.length!==0)this.resetStartLocationFromNode(lt,rt);return lt.typeParameters=rt,lt});if(!at.error&&!at.aborted){if(rt)this.reportReservedArrowTypeParam(rt);return at.node}if(!Qe){if(xc(!0),tt=this.tryParse(()=>this.parseMaybeAssignOrigin(qe,He,Je)),!tt.error)return tt.node}if(Qe?.thrown)throw this.selectTryParseResult(Qe),Qe.error;if(at.thrown)throw this.selectTryParseResult(at),at.error;if(tt?.thrown)throw this.selectTryParseResult(tt),tt.error;throw Qe?.error||at.error||tt?.error}parseAssignableListItem(qe){let He=[];while(this.match(et.at))He.push(this.parseDecorator());let Je=this.start,Qe=this.startLoc,tt,rt=!1,at=!1;if(qe!==void 0){let ct={};if(this.tsParseModifiers({modified:ct,allowedModifiers:["public","private","protected","override","readonly"]}),tt=ct.accessibility,at=ct.override,rt=ct.readonly,qe===!1&&(tt||rt||at))this.raise(Qe.column,Et.UnexpectedParameterModifier)}let pt=this.parseMaybeDefault(Je,Qe);this.parseBindingListItem(pt);let lt=this.parseMaybeDefault(pt.start,pt.loc.start,pt);if(He.length)lt.decorators=He;if(tt||rt||at){let ct=this.startNodeAt(Je,Qe);if(tt)ct.accessibility=tt;if(rt)ct.readonly=rt;if(at)ct.override=at;if(lt.type!=="Identifier"&&lt.type!=="AssignmentPattern")this.raise(ct.start,Et.UnsupportedParameterPropertyKind);return ct.parameter=lt,this.finishNode(ct,"TSParameterProperty")}return lt}checkLValInnerPattern(qe,He=Dt.BIND_NONE,Je){switch(qe.type){case"TSParameterProperty":this.checkLValInnerPattern(qe.parameter,He,Je);break;default:{super.checkLValInnerPattern(qe,He,Je);break}}}parseBindingListItem(qe){if(this.eat(Ve.question)){if(qe.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise(qe.start,Et.PatternIsOptional);qe.optional=!0}let He=this.tsTryParseTypeAnnotation();if(He)qe.typeAnnotation=He;return this.resetEndLocation(qe),qe}isAssignable(qe,He){switch(qe.type){case"TSTypeCastExpression":return this.isAssignable(qe.expression,He);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let Je=qe.properties.length-1;return qe.properties.every((Qe,tt)=>Qe.type!=="ObjectMethod"&&(tt===Je||Qe.type!=="SpreadElement")&&this.isAssignable(Qe))}case"Property":case"ObjectProperty":return this.isAssignable(qe.value);case"SpreadElement":return this.isAssignable(qe.argument);case"ArrayExpression":return qe.elements.every((Je)=>Je===null||this.isAssignable(Je));case"AssignmentExpression":return qe.operator==="=";case"ParenthesizedExpression":return this.isAssignable(qe.expression);case"MemberExpression":case"OptionalMemberExpression":return!He;default:return!1}}toAssignable(qe,He=!1,Je=new Fr,Qe=!1){switch(qe.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(qe,He,Je,Qe);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(He);else this.raise(qe.start,Et.UnexpectedTypeCastInParameter);let tt=this.toAssignable(qe.expression,He,Je,Qe);if(Qe)return qe.expression=tt,qe;return tt;case"MemberExpression":break;case"AssignmentExpression":if(!He&&qe.left.type==="TSTypeCastExpression")qe.left=this.typeCastToParameter(qe.left);return super.toAssignable(qe,He,Je);case"TSTypeCastExpression":return this.typeCastToParameter(qe);default:return super.toAssignable(qe,He,Je)}return qe}toAssignableParenthesizedExpression(qe,He,Je,Qe=!1){switch(qe.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let tt=this.toAssignable(qe.expression,He,Je,Qe);if(Qe)return qe.expression=tt,qe;return tt;default:return super.toAssignable(qe,He,Je)}}parseBindingAtom(){switch(this.type){case Ve._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(qe){let He;if(this.match(Ve.colon))He=qe.every((Je)=>this.isAssignable(Je,!0));else He=!this.canInsertSemicolon();if(He){if(this.match(Ve.colon)){let Je=this.tryParse((Qe)=>{let tt=this.tsParseTypeOrTypePredicateAnnotation(Ve.colon);if(this.canInsertSemicolon()||!this.match(Ve.arrow))Qe();return tt});if(Je.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!Je.thrown)this.shouldParseArrowReturnType=Je.node}if(!this.match(Ve.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,He}parseParenArrowList(qe,He,Je,Qe){let tt=this.startNodeAt(qe,He);return tt.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(tt,Je,!1,Qe)}parseParenAndDistinguishExpression(qe,He){let Je=this.start,Qe=this.startLoc,tt,rt=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let at=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let pt=this.start,lt=this.startLoc,ct=[],dt=!0,ht=!1,gt=new Fr,xt=this.yieldPos,St=this.awaitPos,Wt;this.yieldPos=0,this.awaitPos=0;while(this.type!==Ve.parenR)if(dt?dt=!1:this.expect(Ve.comma),rt&&this.afterTrailingComma(Ve.parenR,!0)){ht=!0;break}else if(this.type===Ve.ellipsis){if(Wt=this.start,ct.push(this.parseParenItem(this.parseRestBinding())),this.type===Ve.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else ct.push(this.parseMaybeAssign(!1,gt,this.parseParenItem));let Kt=this.lastTokEnd,Qt=this.lastTokEndLoc;if(this.expect(Ve.parenR),this.maybeInArrowParameters=at,qe&&this.shouldParseArrow(ct)&&this.eat(Ve.arrow))return this.checkPatternErrors(gt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=xt,this.awaitPos=St,this.parseParenArrowList(Je,Qe,ct,He);if(!ct.length||ht)this.unexpected(this.lastTokStart);if(Wt)this.unexpected(Wt);if(this.checkExpressionErrors(gt,!0),this.yieldPos=xt||this.yieldPos,this.awaitPos=St||this.awaitPos,ct.length>1)tt=this.startNodeAt(pt,lt),tt.expressions=ct,this.finishNodeAt(tt,"SequenceExpression",Kt,Qt);else tt=ct[0]}else tt=this.parseParenExpression();if(this.options.preserveParens){let at=this.startNodeAt(Je,Qe);return at.expression=tt,this.finishNode(at,"ParenthesizedExpression")}else return tt}parseTaggedTemplateExpression(qe,He,Je,Qe){let tt=this.startNodeAt(He,Je);if(tt.tag=qe,tt.quasi=this.parseTemplate({isTagged:!0}),Qe)this.raise(He,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(tt,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(Ve.colon)){let qe=this.tryParse((He)=>{let Je=this.tsParseTypeOrTypePredicateAnnotation(Ve.colon);if(this.canInsertSemicolon()||!this.match(Ve.arrow))He();return Je});if(qe.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!qe.thrown)return this.shouldParseAsyncArrowReturnType=qe.node,!this.canInsertSemicolon()&&this.eat(Ve.arrow)}else return!this.canInsertSemicolon()&&this.eat(Ve.arrow)}parseSubscriptAsyncArrow(qe,He,Je,Qe){let tt=this.startNodeAt(qe,He);return tt.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(tt,Je,!0,Qe)}parseExprList(qe,He,Je,Qe){let tt=[],rt=!0;while(!this.eat(qe)){if(!rt){if(this.expect(Ve.comma),He&&this.afterTrailingComma(qe))break}else rt=!1;let at;if(Je&&this.type===Ve.comma)at=null;else if(this.type===Ve.ellipsis){if(at=this.parseSpread(Qe),this.maybeInArrowParameters&&this.match(Ve.colon))at.typeAnnotation=this.tsParseTypeAnnotation();if(Qe&&this.type===Ve.comma&&Qe.trailingComma<0)Qe.trailingComma=this.start}else at=this.parseMaybeAssign(!1,Qe,this.parseParenItem);tt.push(at)}return tt}parseMaybeDecoratorArguments(qe){let He=this.tsMatchLeftRelational()||this.match(Ve.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(Ve.parenL)){let Je=this.startNodeAtNode(qe);if(Je.callee=qe,Je.arguments=this.parseExprList(Ve.parenR,!1),He)Je.typeArguments=He;return this.finishNode(Je,"CallExpression")}if(He){let Je=this.startNodeAtNode(qe);return Je.expression=qe,Je.typeArguments=He,this.finishNode(Je,"TSInstantiationExpression")}return qe}parseSubscript(qe,He,Je,Qe,tt,rt,at){let pt=rt;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(Ve.prefix)){this.exprAllowed=!1,this.next();let gt=this.startNodeAt(He,Je);return gt.expression=qe,qe=this.finishNode(gt,"TSNonNullExpression"),qe}let lt=!1;if(this.match(Ve.questionDot)&&this.lookaheadCharCode()===60){if(Qe)return qe;qe.optional=!0,pt=lt=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(Ve.bitShift)){let gt,xt=this.tsTryParseAndCatch(()=>{if(!Qe&&this.atPossibleAsyncArrow(qe)){let Qt=this.tsTryParseGenericAsyncArrowFunction(He,Je,at);if(Qt)return qe=Qt,qe}let St=this.tsParseTypeArgumentsInExpression();if(!St)return qe;if(lt&&!this.match(Ve.parenL))return gt=this.curPosition(),qe;if(ut(this.type)||this.type===Ve.backQuote){let Qt=this.parseTaggedTemplateExpression(qe,He,Je,pt);return Qt.typeArguments=St,Qt}if(!Qe&&this.eat(Ve.parenL)){let Qt=new Fr,zt=this.startNodeAt(He,Je);if(zt.callee=qe,zt.arguments=this.parseExprList(Ve.parenR,this.ecmaVersion>=8,!1,Qt),this.tsCheckForInvalidTypeCasts(zt.arguments),zt.typeArguments=St,pt)zt.optional=lt;return this.checkExpressionErrors(Qt,!0),qe=this.finishNode(zt,"CallExpression"),qe}let Wt=this.type;if(this.tsMatchRightRelational()||Wt===Ve.bitShift||Wt!==Ve.parenL&&wf(Wt)&&!this.hasPrecedingLineBreak())return;let Kt=this.startNodeAt(He,Je);return Kt.expression=qe,Kt.typeArguments=St,this.finishNode(Kt,"TSInstantiationExpression")});if(gt)this.unexpected(gt);if(xt){if(xt.type==="TSInstantiationExpression"&&(this.match(Ve.dot)||this.match(Ve.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,Et.InvalidPropertyAccessAfterInstantiationExpression);return qe=xt,qe}}let ct=this.ecmaVersion>=11,dt=ct&&this.eat(Ve.questionDot);if(Qe&&dt)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let ht=this.eat(Ve.bracketL);if(ht||dt&&this.type!==Ve.parenL&&this.type!==Ve.backQuote||this.eat(Ve.dot)){let gt=this.startNodeAt(He,Je);if(gt.object=qe,ht)gt.property=this.parseExpression(),this.expect(Ve.bracketR);else if(this.type===Ve.privateId&&qe.type!=="Super")gt.property=this.parsePrivateIdent();else gt.property=this.parseIdent(this.options.allowReserved!=="never");if(gt.computed=!!ht,ct)gt.optional=dt;qe=this.finishNode(gt,"MemberExpression")}else if(!Qe&&this.eat(Ve.parenL)){let gt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let xt=new Fr,St=this.yieldPos,Wt=this.awaitPos,Kt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let Qt=this.parseExprList(Ve.parenR,this.ecmaVersion>=8,!1,xt);if(tt&&!dt&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(xt,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=St,this.awaitPos=Wt,this.awaitIdentPos=Kt,qe=this.parseSubscriptAsyncArrow(He,Je,Qt,at)}else{this.checkExpressionErrors(xt,!0),this.yieldPos=St||this.yieldPos,this.awaitPos=Wt||this.awaitPos,this.awaitIdentPos=Kt||this.awaitIdentPos;let zt=this.startNodeAt(He,Je);if(zt.callee=qe,zt.arguments=Qt,ct)zt.optional=dt;qe=this.finishNode(zt,"CallExpression")}this.maybeInArrowParameters=gt}else if(this.type===Ve.backQuote){if(dt||pt)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let gt=this.startNodeAt(He,Je);gt.tag=qe,gt.quasi=this.parseTemplate({isTagged:!0}),qe=this.finishNode(gt,"TaggedTemplateExpression")}return qe}parseGetterSetter(qe){qe.kind=qe.key.name,this.parsePropertyName(qe);let He=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(qe.value=this.parseMethod(!1),He)qe.value.typeParameters=He;let Je=qe.kind==="get"?0:1,Qe=qe.value.params[0];if(Je=Qe&&this.isThisParam(Qe)?Je+1:Je,qe.value.params.length!==Je){let rt=qe.value.start;if(qe.kind==="get")this.raiseRecoverable(rt,"getter should have no params");else this.raiseRecoverable(rt,"setter should have exactly one param")}else if(qe.kind==="set"&&qe.value.params[0].type==="RestElement")this.raiseRecoverable(qe.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue(qe,He,Je,Qe,tt,rt,at,pt){if(this.tsMatchLeftRelational()){if(He)this.unexpected();qe.kind="init",qe.method=!0;let lt=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(qe.value=this.parseMethod(Je,Qe),lt)qe.value.typeParameters=lt;return}return super.parsePropertyValue(qe,He,Je,Qe,tt,rt,at,pt)}parseProperty(qe,He){if(!qe){let Je=[];if(this.match(et.at))while(this.match(et.at))Je.push(this.parseDecorator());let Qe=super.parseProperty(qe,He);if(Qe.type==="SpreadElement"){if(Je.length)this.raise(Qe.start,bs.SpreadElementDecorator)}if(Je.length)Qe.decorators=Je,Je=[];return Qe}return super.parseProperty(qe,He)}parseCatchClauseParam(){let qe=this.parseBindingAtom(),He=qe.type==="Identifier";this.enterScope(He?Dt.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(qe,He?Dt.BIND_SIMPLE_CATCH:Dt.BIND_LEXICAL);let Je=this.tsTryParseTypeAnnotation();if(Je)qe.typeAnnotation=Je,this.resetEndLocation(qe);return this.expect(Ve.parenR),qe}parseClass(qe,He){let Je=this.inAbstractClass;this.inAbstractClass=!!qe.abstract;try{this.next(),this.takeDecorators(qe);let Qe=this.strict;this.strict=!0,this.parseClassId(qe,He),this.parseClassSuper(qe);let tt=this.enterClassBody(),rt=this.startNode(),at=!1;rt.body=[];let pt=[];this.expect(Ve.braceL);while(this.type!==Ve.braceR){if(this.match(et.at)){pt.push(this.parseDecorator());continue}let lt=this.parseClassElement(qe.superClass!==null);if(pt.length)lt.decorators=pt,this.resetStartLocationFromNode(lt,pt[0]),pt=[];if(lt){if(rt.body.push(lt),lt.type==="MethodDefinition"&&lt.kind==="constructor"&&lt.value.type==="FunctionExpression"){if(at)this.raiseRecoverable(lt.start,"Duplicate constructor in the same class");if(at=!0,lt.decorators&&lt.decorators.length>0)this.raise(lt.start,bs.DecoratorConstructor)}else if(lt.key&&lt.key.type==="PrivateIdentifier"&&lt.value?.type!=="TSDeclareMethod"){let ct=lt.key.name;if(this.parseEffects.modify(tt,ct,(ht)=>pf(ht,lt)))this.raiseRecoverable(lt.key.start,`Identifier '#${ct}' has already been declared`)}}}if(this.strict=Qe,this.next(),pt.length)this.raise(this.start,bs.TrailingDecorator);return qe.body=this.finishNode(rt,"ClassBody"),this.exitClassBody(),this.finishNode(qe,He?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=Je}}parseClassFunctionParams(){let qe=this.tsTryParseTypeParameters(),He=this.parseBindingList(Ve.parenR,!1,this.ecmaVersion>=8,!0);if(qe)He.typeParameters=qe;return He}parseMethod(qe,He,Je,Qe,tt){let rt=this.startNode(),at=this.yieldPos,pt=this.awaitPos,lt=this.awaitIdentPos;if(this.initFunction(rt),this.ecmaVersion>=6)rt.generator=qe;if(this.ecmaVersion>=8)rt.async=!!He;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(qi(He,rt.generator)|Dt.SCOPE_SUPER|(Je?Dt.SCOPE_DIRECT_SUPER:0)),this.expect(Ve.parenL),rt.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(rt,!1,!0,!1,{isClassMethod:Qe}),this.yieldPos=at,this.awaitPos=pt,this.awaitIdentPos=lt,tt&&tt.abstract){if(!!rt.body){let{key:dt}=tt;this.raise(tt.start,Et.AbstractMethodHasImplementation({methodName:dt.type==="Identifier"&&!tt.computed?dt.name:`[${this.input.slice(dt.start,dt.end)}]`}))}}return this.finishNode(rt,"FunctionExpression")}static parse(qe,He){if(He.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else He.locations=!0;let Je=new this(He,qe);if($e)Je.isAmbientContext=!0;return Je.parse()}static parseExpressionAt(qe,He,Je){if(Je.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else Je.locations=!0;let Qe=new this(Je,qe,He);if($e)Qe.isAmbientContext=!0;return Qe.nextToken(),Qe.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(et.type)){let He=this.startNode();return He.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(He,!0,this.importOrExportOuterKind==="type"),this.finishNode(He,"ImportSpecifier")}else{let He=super.parseImportSpecifier();return He.importKind="value",He}}parseExportSpecifier(qe){let He=this.ts_isContextual(et.type);if(!this.match(Ve.string)&&He){let Qe=this.startNode();return Qe.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(Qe,!1,this.importOrExportOuterKind==="type"),this.finishNode(Qe,"ExportSpecifier"),this.checkExport(qe,Qe.exported,Qe.exported.start),Qe}else{let Qe=super.parseExportSpecifier(qe);return Qe.exportKind="value",Qe}}parseTypeOnlyImportExportSpecifier(qe,He,Je){let Qe=He?"imported":"local",tt=He?"local":"exported",rt=qe[Qe],at,pt=!1,lt=!0,ct=rt.start;if(this.isContextual("as")){let ht=this.parseIdent();if(this.isContextual("as")){let gt=this.parseIdent();if(ft(this.type))pt=!0,rt=ht,at=He?this.parseIdent():this.parseModuleExportName(),lt=!1;else at=gt,lt=!1}else if(ft(this.type))lt=!1,at=He?this.parseIdent():this.parseModuleExportName();else pt=!0,rt=ht}else if(ft(this.type))if(pt=!0,He){if(rt=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(rt)}else rt=this.parseModuleExportName();if(pt&&Je)this.raise(ct,He?Et.TypeModifierIsUsedInTypeImports:Et.TypeModifierIsUsedInTypeExports);qe[Qe]=rt,qe[tt]=at;let dt=He?"importKind":"exportKind";if(qe[dt]=pt?"type":"value",lt&&this.eatContextual("as"))qe[tt]=He?this.parseIdent():this.parseModuleExportName();if(!qe[tt])qe[tt]=this.copyNode(qe[Qe]);if(He)this.checkLValSimple(qe[tt],Dt.BIND_LEXICAL)}raiseCommonCheck(qe,He,Je){switch(He){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(Ve.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(qe,He)}return Je?super.raiseRecoverable(qe,He):super.raise(qe,He)}raiseRecoverable(qe,He){return this.raiseCommonCheck(qe,He,!0)}raise(qe,He){return this.raiseCommonCheck(qe,He,!0)}updateContext(qe){let{type:He}=this;if(He==Ve.braceL){var Je=this.curContext();if(Je==nt.tc_oTag)this.parseEffects.append(this.context,Xe.b_expr);else if(Je==nt.tc_expr)this.parseEffects.append(this.context,Xe.b_tmpl);else super.updateContext(qe);this.exprAllowed=!0}else if(He===Ve.slash&&qe===et.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,nt.tc_cTag),this.exprAllowed=!1;else return super.updateContext(qe)}jsx_parseOpeningElementAt(qe,He){let Je=this.startNodeAt(qe,He),Qe=this.jsx_parseElementName();if(Qe)Je.name=Qe;if(this.match(Ve.relational)||this.match(Ve.bitShift)){let tt=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(tt)Je.typeArguments=tt}Je.attributes=[];while(this.type!==Ve.slash&&this.type!==et.jsxTagEnd)Je.attributes.push(this.jsx_parseAttribute());return Je.selfClosing=this.eat(Ve.slash),this.expect(et.jsxTagEnd),this.finishNode(Je,Qe?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(qe){let He=qe===Br;if(He)this.parseEffects.append(this.importsStack,[]);let Je=He?qe|Dt.SCOPE_CLASS_STATIC_BLOCK:qe;super.enterScope(Je);let Qe=super.currentScope();Qe.types=[],Qe.enums=[],Qe.constEnums=[],Qe.classes=[],Qe.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&Br)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport(qe,He){let Je=this.importsStack.length;if(this.importsStack[Je-1].indexOf(qe)>-1)return!0;if(!He&&Je>1){for(let Qe=0;Qe<Je-1;Qe++)if(this.importsStack[Qe].indexOf(qe)>-1)return!0}return!1}maybeExportDefined(qe,He){if(this.inModule&&qe.flags&Dt.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,He)}declareName(qe,He,Je){if(He&Dt.BIND_FLAGS_TS_IMPORT){if(this.hasImport(qe,!0))this.raise(Je,`Identifier '${qe}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],qe);return}let Qe=this.currentScope();if(He&Dt.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(Qe,qe),this.parseEffects.append(Qe.exportOnlyBindings,qe);return}if(He===Dt.BIND_TS_TYPE||He===Dt.BIND_TS_INTERFACE){if(He===Dt.BIND_TS_TYPE&&Qe.types.includes(qe))this.raise(Je,`type '${qe}' has already been declared.`);this.parseEffects.append(Qe.types,qe)}else if(He&Dt.BIND_FLAGS_TS_ENUM){if(Qe.enums.includes(qe))return;super.declareName(qe,Dt.BIND_LEXICAL,Je)}else super.declareName(qe,He,Je);if(He&Dt.BIND_FLAGS_TS_ENUM)this.parseEffects.append(Qe.enums,qe);if(He&Dt.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(Qe.constEnums,qe);if(He&Dt.BIND_FLAGS_CLASS)this.parseEffects.append(Qe.classes,qe)}checkLocalExport(qe){let{name:He}=qe;if(this.hasImport(He))return;let Je=this.scopeStack.length;for(let Qe=Je-1;Qe>=0;Qe--){let tt=this.scopeStack[Qe];if(tt.types.indexOf(He)>-1||tt.exportOnlyBindings.indexOf(He)>-1)return}super.checkLocalExport(qe)}}return Pt}}var Df=/\n/,_f=/[ \t]/,If=/^[,) \t]*$/,Cs="",Dc=[];function vs(i,$e){Cs=i,Dc=$e}function Ss(i,$e,Be,Fe){let je=$e;if(i&&Df.test(je)){let We=Be;while(We>0&&Cs[We-1]!==`
12
- `)We-=1;let Ve=We;while(_f.test(Cs[Ve]))Ve+=1;let Ge=Cs.slice(We,Ve);je=Rf(je,Ge)}Dc.push({type:i?"Block":"Line",value:je,start:Be,end:Fe})}function Rf(i,$e){if($e==="")return i;return(i.startsWith($e)?i.slice($e.length):i).replaceAll(`
13
- ${$e}`,`
14
- `)}function Ki(i,$e,Be,Fe){let je=Lf(Be,Fe);if(je>=Be.length)return;Hi(i,void 0,Be,{index:je},$e)}function Lf(i,$e){let Be=0,Fe=i.length;while(Be<Fe){let je=Be+Fe>>>1;if(i[je].start<$e)Be=je+1;else Fe=je}return Be}function Hi(i,$e,Be,Fe,je){while(Fe.index<Be.length&&Be[Fe.index].start<(i.start??0))i.leadingComments??=[],i.leadingComments.push(Be[Fe.index]),Fe.index++;if(Fe.index>=Be.length)return;let We=Be[Fe.index].start,Ve=i.end,Ue=Ve===void 0||Ve>We?Object.keys(i):[];for(let ze=0;ze<Ue.length;ze++){let Ke=Ue[ze];if(Ke==="type"||Ke==="leadingComments")continue;let Xe=i[Ke];if(!Xe||typeof Xe!=="object")continue;if(Array.isArray(Xe)){for(let Ze of Xe)if(Ze&&typeof Ze==="object"&&typeof Ze.type==="string"){if(Hi(Ze,i,Be,Fe,je),Fe.index>=Be.length)return}}else if(typeof Xe.type==="string"){if(Hi(Xe,i,Be,Fe,je),Fe.index>=Be.length)return}}if(Fe.index<Be.length){let ze=Be[Fe.index];if($e===void 0||i.end!==$e.end){let Ke=je.slice(i.end??0,ze.start);if(($e?.type==="BlockStatement"||$e?.type==="Program")&&Ui($e.body,i)||$e?.type==="ArrayExpression"&&Ui($e.elements,i)||$e?.type==="ObjectExpression"&&Ui($e.properties,i))while(Fe.index<Be.length){if($e&&Be[Fe.index].start>=($e.end??Number.POSITIVE_INFINITY))break;Fe.index++}else if((i.end??0)<=ze.start&&If.test(Ke))Fe.index++}}}function Ui(i,$e){return!!i&&i.indexOf($e)===i.length-1}var Ts={sawParenthesized:!1},Rc=(i)=>class extends i{parseParenAndDistinguishExpression($e,Be){let Fe=super.parseParenAndDistinguishExpression($e,Be);if(Fe.type==="ParenthesizedExpression")Ts.sawParenthesized=!0;return Fe}parseDecorator(){return Ts.sawParenthesized=!0,super.parseDecorator()}},Of=jt.extend(Rc),Mf=jt.extend(Nc(),Rc);function Yi(i){return i?Mf:Of}var $f={onComment:Ss,sourceType:"module",ecmaVersion:16},Lc={onComment:Ss,sourceType:"module",ecmaVersion:16,preserveParens:!0},Bf={onComment:Ss,sourceType:"module",ecmaVersion:16},_c={...Lc,startLocation:null},zi=/\r\n?|\n|\u2028|\u2029/g;function Ff(i,$e){if($e?.breakEnds)return $e.breakEnds;let Be=[];zi.lastIndex=0;while(zi.test(i))Be.push(zi.lastIndex);if($e)$e.breakEnds=Be;return Be}function jf(i,$e,Be){let Fe=i.lastIndexOf(`
15
- `,$e-1)+1,je=Ff(i,Be),We=0,Ve=je.length;while(We<Ve){let Ge=We+Ve>>>1;if(je[Ge]<=Fe)We=Ge+1;else Ve=Ge}return{line:We+1,column:$e-Fe}}function Oc(i,$e,Be,Fe,je){if(Be.length===je)return;Ki(i,$e,Be,Fe)}function xr(i,$e,Be){let Fe=Be.length;vs(i,Be);let je=Yi($e).parse(i,$f);if(Be.length>0)Ki(je,i,Be,Fe);return je}var Vf={count:0};function br(i,$e,Be,Fe,je){Vf.count+=1;let We=Fe.length;vs(i,Fe),Ts.sawParenthesized=!1;let Ve=Lc;if(Be)_c.startLocation=jf(i,$e,je),Ve=_c;let Ge=Yi(Be).parseExpressionAt(i,$e,Ve);Oc(Ge,i,Fe,$e,We);let Ue=Fe.length>We?Fe.at(-1):void 0,ze=Ue&&Ue.end>(Ge.end??0)?Ue.end:Ge.end??0;return{node:Ts.sawParenthesized?Wf(Ge):Ge,end:ze}}function Mc(i,$e,Be,Fe){let je=Fe.length,We=Yi(Be);vs(i,Fe);let Ve=new We(Bf,i,$e);Ve.nextToken();let Ge=Ve.parseStatement(null,!0,Object.create(null));return Oc(Ge,i,Fe,$e,je),Ge}function Ic(i){return i!==null&&typeof i==="object"&&typeof i.type==="string"}function Xi(i){let $e=i;while($e.type==="ParenthesizedExpression"&&$e.expression)$e=$e.expression;return $e}function Wf(i){let $e=Xi(i);return Ji($e),$e}function Ji(i){for(let $e in i){let Be=i[$e];if(!Be||typeof Be!=="object")continue;if(Array.isArray(Be))for(let Fe=0;Fe<Be.length;Fe++){let je=Be[Fe];if(!Ic(je))continue;let We=Xi(je);if(We!==je)Be[Fe]=We;Ji(We)}else if(Ic(Be)){let Fe=Xi(Be);if(Fe!==Be)i[$e]=Fe;Ji(Fe)}}}function rr(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 Qi{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 $e=i.exec(this.source);if(!$e||$e.index!==this.index)return null;return $e[0]}eat(i,$e=!1){if(this.match(i))return this.index+=i.length,!0;if($e)throw new zn(`Expected token ${JSON.stringify(i)}`,this.index);return!1}read(i){let $e=this.matchRegex(i);if($e)this.index+=$e.length;return $e}readUntil(i){if(this.index>=this.source.length)throw new zn("Unexpected end of input",this.source.length);let $e=this.index;i.lastIndex=$e;let Be=i.exec(this.source);if(Be)return this.index=Be.index,this.source.slice($e,this.index);return this.index=this.source.length,this.source.slice($e)}readUntilString(i){if(this.index>=this.source.length)throw new zn("Unexpected end of input",this.source.length);let $e=this.source.indexOf(i,this.index),Be=$e===-1?this.source.length:$e,Fe=this.source.slice(this.index,Be);return this.index=Be,Fe}allowWhitespace(){while(this.index<this.source.length&&rr(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!rr(this.source.charCodeAt(this.index)))throw new zn("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let i=this.index,$e=i,Be="",Fe=this.source.codePointAt(this.index);if(Fe!==void 0&&sn(Fe,!0)){$e+=Fe<=65535?1:2;while($e<this.source.length){let je=this.source.codePointAt($e);if(je===void 0||!un(je,!0))break;$e+=je<=65535?1:2}Be=this.source.slice(i,$e),this.index=$e}return{type:"Identifier",name:Be,start:i,end:$e}}}class zn extends Error{position;constructor(i,$e){super(`${i} (at index ${$e})`);this.name="TemplateSyntaxError",this.position=$e}}function an(){return{type:"Fragment",nodes:[]}}var qf=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"]),Gf=["&&","||","??"],Uf=["===","!==","==","!="];function $c(i,$e){let Be=i.codePointAt($e);if(Be===void 0||!sn(Be,!0))return $e;let Fe=$e+(Be<=65535?1:2);while(Fe<i.length){let je=i.codePointAt(Fe);if(!un(je,!0))break;Fe+=je<=65535?1:2}return Fe}function Hf(i,$e){let Be=$e;while(Be<i.length){let Fe=i.charCodeAt(Be);if(Fe<48||Fe>57)break;Be++}return Be}function ks(i,$e){let Be=$e;while(Be<i.length&&rr(i.charCodeAt(Be)))Be++;return Be}function Bc(i,$e){let Be=Hf(i,$e);if(Be===$e)return null;if(i.charCodeAt($e)===48&&Be-$e>1)return null;if(Be<i.length){let je=i.codePointAt(Be);if(je===46||un(je,!0))return null}let Fe=i.slice($e,Be);return{type:"Literal",start:$e,end:Be,value:Number(Fe),raw:Fe}}function Fc(i,$e){let Be=i.charCodeAt($e),Fe=$e+1;while(Fe<i.length){let je=i.charCodeAt(Fe);if(je===Be){let We=i.slice($e,Fe+1);return{type:"Literal",start:$e,end:Fe+1,value:i.slice($e+1,Fe),raw:We}}if(je===92||je===10||je===13)return null;Fe++}return null}function Kf(i,$e){let Be=i.charCodeAt($e);if(Be===34||Be===39)return Fc(i,$e);let Fe=$c(i,$e);if(Fe===$e)return Bc(i,$e);let je=i.slice($e,Fe);if(je==="true"||je==="false")return{type:"Literal",start:$e,end:Fe,value:je==="true",raw:je};if(je==="null")return{type:"Literal",start:$e,end:Fe,value:null,raw:je};if(qf.has(je))return null;let We={type:"Identifier",start:$e,end:Fe,name:je},Ve=Fe;while(Ve<i.length){let Ge=i.charCodeAt(Ve);if(Ge===46){let Ue=Ve+1,ze=$c(i,Ue);if(ze===Ue)return null;let Ke={type:"Identifier",start:Ue,end:ze,name:i.slice(Ue,ze)};We={type:"MemberExpression",start:$e,end:ze,object:We,property:Ke,computed:!1,optional:!1},Ve=ze}else if(Ge===91){let Ue=Ve+1,ze=i.charCodeAt(Ue),Ke=ze===34||ze===39?Fc(i,Ue):Bc(i,Ue);if(!Ke||i.charCodeAt(Ke.end)!==93)return null;We={type:"MemberExpression",start:$e,end:Ke.end+1,object:We,property:Ke,computed:!0,optional:!1},Ve=Ke.end+1}else break}return We}function Zi(i,$e){if(i.charCodeAt($e)!==33||i.charCodeAt($e+1)===61)return Kf(i,$e);let Be=Zi(i,ks(i,$e+1));if(!Be)return null;return{type:"UnaryExpression",start:$e,end:Be.end,operator:"!",prefix:!0,argument:Be}}function zf(i,$e){for(let Be of Uf)if(i.startsWith(Be,$e))return{operator:Be,logical:!1};for(let Be of Gf)if(i.startsWith(Be,$e))return{operator:Be,logical:!0};return null}function jc(i,$e){let Be=ks(i,$e);if(Be>=i.length)return!1;let Fe=i.charCodeAt(Be);return Fe===125||Fe===41}function Xf(i){let $e=i.source,Be=Zi($e,i.index);if(!Be)return null;if(jc($e,Be.end))return i.index=Be.end,Be;let Fe=ks($e,Be.end),je=zf($e,Fe);if(!je)return null;let We=Zi($e,ks($e,Fe+je.operator.length));if(!We||!jc($e,We.end))return null;return i.index=We.end,{type:je.logical?"LogicalExpression":"BinaryExpression",start:Be.start,end:We.end,left:Be,operator:je.operator,right:We}}function Yt(i){let $e=Xf(i);if($e)return $e;let{node:Be,end:Fe}=br(i.source,i.index,i.isTypeScript,i.root.comments,i.lineTable);return i.index=Fe,Be}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},eo=Jf;var Yf=[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 Qf(i,$e){if($e&&!i.endsWith(";"))return`${i}\\b(?!=)`;return i}function Vc(i){let Be=Object.keys(eo).map((Fe)=>Qf(Fe,i));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${Be.join("|")})`,"g")}var to,no;function Zf(i){if(i){if(!no)no=Vc(!0);return no}if(!to)to=Vc(!1);return to}var Wc=0;function eh(i){if(i===10)return 32;if(i<128)return i;if(i<=159)return Yf[i-128];if(i<55296)return i;if(i<=57343)return Wc;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 Wc}function ro(i,$e){if(i.indexOf("&")===-1)return i;return i.replace(Zf($e),(Be,Fe)=>{let je;if(Fe[0]!=="#")je=eo[Fe];else if(Fe[1]==="x")je=Number.parseInt(Fe.substring(2),16);else je=Number.parseInt(Fe.substring(1),10);if(!je)return Be;return String.fromCodePoint(eh(je))})}class b extends Error{constructor(i){super(`sveld's template parser doesn't support ${i} yet.`);this.name="TemplateParseNotImplementedError"}}var th=/<\/script\s*>/g,nh=/<\/script\s*>/y,rh=/[^\n]/g,sh=new Set(["server","client","worker","test","default"]);function qc(i,$e,Be){let Fe=i.index,je=i.readUntil(th);if(i.index>=i.source.length)throw Error("sveld: unclosed <script> tag");let We=i.source.slice(0,Fe).replace(rh," ")+je;i.read(nh);let Ve=xr(We,i.isTypeScript,i.root.comments);Ve.start=Fe;let Ge="default";for(let Ue of Be){if(sh.has(Ue.name))throw Error(`sveld: "${Ue.name}" is a reserved <script> attribute name.`);if(Ue.name==="module"){if(Ue.value!==!0)throw Error("sveld: <script module> does not take a value.");Ge="module"}if(Ue.name==="context"){let ze=Ue.value;if(ze===!0||!Array.isArray(ze)||ze.length!==1||ze[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(ze[0].data!=="module")throw Error('sveld: only context="module" is valid.');Ge="module"}}return{type:"Script",start:$e,end:i.index,context:Ge,content:Ve,attributes:Be}}function Gc(i,$e,Be){let Fe=i.index,je=i.source.indexOf("</style",i.index),We=je===-1?i.source.length:je;return i.index=We,i.eat("</style",!0),i.read(/\s*>/y),{type:"StyleSheet",start:$e,end:i.index,attributes:Be,children:[],comments:[],content:{start:Fe,end:We,styles:i.source.slice(Fe,We),comment:null}}}var ih=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function so(i){return ih.has(i)||i.charCodeAt(0)===33&&i.toLowerCase()==="!doctype"}var oh="^[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}]*)?$",ah=new RegExp(oh,"u");function Uc(i){return ah.test(i)}var ch=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,Jc=/["']/y,lh=/(\/>|[\s"'=<>`])/y,io=/<\/textarea(\s[^>]*)?>/iy,ph=/^![a-zA-Z]+$/,uh=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,dh=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,Yc={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},Hc={...Yc,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function fh(i){let $e=i.charCodeAt(0);if($e<97||$e>122)return!1;for(let Be=1;Be<i.length;Be++){let Fe=i.charCodeAt(Be);if((Fe<97||Fe>122)&&(Fe<48||Fe>57))return!1}return!0}function hh(i){if(fh(i))return!0;if(ph.test(i))return!0;if(uh.test(i))return!0;return Uc(i)}function mh(i){let $e=i.charCodeAt(0);if($e>=97&&$e<=122&&!i.includes("."))return!1;return!0}function yh(i){return`Svelte${i.slice(7).split("-").map((Be)=>Be.charAt(0).toUpperCase()+Be.slice(1)).join("")}`}function gh(i){for(let $e=i.length-1;$e>=0;$e--){let Be=i[$e].type;if(Be==="SvelteHead")return!0;if(Be==="RegularElement"||Be==="Component")return!1}return!1}function xh(i){for(let $e=i.length-1;$e>=0;$e--){let Be=i[$e];if(Be.type==="RegularElement"&&Be.attributes?.some((Fe)=>Fe.type==="Attribute"&&Fe.name==="shadowrootmode"))return!0}return!1}function Kc(i){let{source:$e,index:Be}=i;if(Be>=$e.length)throw new zn("Unexpected end of input",$e.length);let Fe=Be;while(Fe<$e.length){let je=$e.charCodeAt(Fe);if(je===47||je===62||rr(je))break;Fe++}return i.index=Fe,{name:$e.slice(Be,Fe),start:Be,end:Fe}}function Qc(i){let{source:$e,index:Be}=i;if(Be>=$e.length)throw new zn("Unexpected end of input",$e.length);let Fe=Be;while(Fe<$e.length){let je=$e.charCodeAt(Fe);if(je===61||je===47||je===62||je===34||je===39||rr(je))break;Fe++}return i.index=Fe,{name:$e.slice(Be,Fe),start:Be,end:Fe}}function bh(i){let $e=i.index;if(i.eat("//")){let Be=i.readUntilString(`
16
- `),Fe=i.index;i.root.comments.push({type:"Line",value:Be,start:$e,end:Fe});return}if(i.eat("/*")){let Be=i.readUntilString("*/");i.eat("*/");let Fe=i.index;i.root.comments.push({type:"Block",value:Be,start:$e,end:Fe})}}function Eh(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 Zc(i,$e,Be){let Fe={start:i.index,end:-1,type:"Text",raw:"",data:""},je=[],We=(Ve)=>{if(Ve>Fe.start)Fe.raw=i.source.slice(Fe.start,Ve),Fe.data=ro(Fe.raw,!0),Fe.end=Ve,je.push(Fe)};while(i.index<i.source.length){if($e())return We(i.index),je;if(i.eat("{")){if(i.match("#")||i.match("@"))throw new b("blocks/tags inside attribute value sequences");let Ve=i.index-1;We(Ve),i.allowWhitespace();let Ge=Yt(i);i.allowWhitespace(),i.eat("}",!0),je.push({type:"ExpressionTag",start:Ve,end:i.index,expression:Ge}),Fe={start:i.index,end:-1,type:"Text",raw:"",data:""}}else{let Ve=i.index+1;if(Be!==void 0){let Ge=i.source;while(Ve<Ge.length){let Ue=Ge.charCodeAt(Ve);if(Ue===123||Ue===Be)break;Ve++}}i.index=Ve}}throw new b("unterminated attribute value / sequence (loose mode)")}function Ch(i){let $e=i.eat("'")?"'":i.eat('"')?'"':null;if($e&&i.eat($e))return[{start:i.index-1,end:i.index-1,type:"Text",raw:"",data:""}];let Be=Zc(i,()=>{if($e)return i.match($e);return!!i.matchRegex(lh)},$e===null?void 0:$e.charCodeAt(0));if(Be.length===0&&!$e)throw Error("sveld: expected attribute value");if($e)i.index+=1;if($e||Be.length>1||Be[0].type==="Text")return Be;return Be[0]}function oo(i,$e,Be,Fe){return{type:"Attribute",start:$e,end:Be,name:i,value:Fe}}function vh(i){let $e=i.index,Be=Qc(i);if(!Be.name)return null;let Fe=!0;if(i.eat("=")){i.allowWhitespace();let je=i.matchRegex(ch);if(!je)throw Error("sveld: expected attribute value");i.index+=je.length;let We=je[0]==='"'||je[0]==="'";if(We)je=je.slice(1,-1);Fe=[{start:i.index-je.length-(We?1:0),end:We?i.index-1:i.index,type:"Text",raw:je,data:ro(je,!0)}]}if(i.matchRegex(Jc))throw Error("sveld: expected '='");return oo(Be.name,$e,i.index,Fe)}function Sh(i){while(!0){let Ge=i.index;if(bh(i),i.index===Ge)break;i.allowWhitespace()}let $e=i.index;if(i.eat("{")){if(i.allowWhitespace(),i.eat("@attach")){i.requireWhitespace();let ze=Yt(i);return i.allowWhitespace(),i.eat("}",!0),{type:"AttachTag",start:$e,end:i.index,expression:ze}}if(i.eat("...")){let ze=Yt(i);return i.allowWhitespace(),i.eat("}",!0),{type:"SpreadAttribute",start:$e,end:i.index,expression:ze}}let Ge=i.readIdentifierName();if(Ge.name==="")throw Error("sveld: empty attribute shorthand");i.allowWhitespace(),i.eat("}",!0);let Ue={type:"ExpressionTag",start:Ge.start,end:Ge.end,expression:Ge};return oo(Ge.name,$e,i.index,Ue)}let Be=Qc(i);if(!Be.name)return null;let Fe=i.index;i.allowWhitespace();let je=Be.name.indexOf(":"),We=je!==-1&&Eh(Be.name.slice(0,je)),Ve=!0;if(i.eat("="))if(i.allowWhitespace(),i.source[i.index]==="/"&&i.source[i.index+1]===">"){let Ge=i.index;i.index++,Ve=[{start:Ge,end:Ge+1,type:"Text",raw:"/",data:"/"}],Fe=i.index}else Ve=Ch(i),Fe=i.index;else if(i.matchRegex(Jc))throw Error("sveld: expected '='");if(We){let Ge=Be.name.slice(je+1).split("|",1)[0];if(Ge==="")throw Error("sveld: directive missing a name");if(We==="StyleDirective")return{start:$e,end:Fe,type:We,name:Ge,value:Ve};let Ue=Ve===!0?void 0:Array.isArray(Ve)?Ve[0]:Ve,ze=null;if(Ue){if((Array.isArray(Ve)?Ve.length>1:!1)||Ue.type==="Text")throw Error("sveld: directive value must be a single expression");ze=Ue.expression}let Ke={start:$e,end:Fe,type:We,name:Ge,expression:ze};if((Ke.type==="BindDirective"||Ke.type==="ClassDirective")&&!Ke.expression)Ke.expression={start:$e+je+1,end:Fe,type:"Identifier",name:Ke.name};return Ke}return oo(Be.name,$e,Fe,Ve)}function el(i){let $e=i.index++,Be=i.current();if(i.eat("!--")){let Ze=i.readUntilString("-->");i.eat("-->",!0),i.append({type:"Comment",start:$e,end:i.index,data:Ze});return}if(i.eat("/")){let{name:Ze}=Kc(i);if(i.allowWhitespace(),i.eat(">",!0),so(Ze))throw Error(`sveld: <${Ze}> is a void element and cannot have a closing tag`);while(Be.name!==Ze){if(Be.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${Ze}>`);Be.end=$e,i.pop(),Be=i.current()}if(Be.end=i.index,i.pop(),i.lastAutoClosedTag&&i.stack.length<i.lastAutoClosedTag.depth)i.lastAutoClosedTag=void 0;return}let Fe=Kc(i),je=mh(Fe.name)&&dh.test(Fe.name);if(!hh(Fe.name)&&!je)throw Error(`sveld: "${Fe.name}" is not a valid element or component name`);if(Fe.name in Yc&&Be.type!=="Root")throw Error(`sveld: <${Fe.name}> must be a top-level element`);let We;if(Fe.name in Hc)We=Hc[Fe.name];else if(Fe.name.startsWith("svelte:"))We=yh(Fe.name);else if(je)We="Component";else if(Fe.name==="title"&&gh(i.stack))We="TitleElement";else if(Fe.name==="slot"&&!xh(i.stack))We="SlotElement";else We="RegularElement";let Ve={type:We,start:$e,end:-1,name:Fe.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(i.allowWhitespace(),Be.type==="RegularElement"&&Aa(Be.name,Fe.name))Be.end=$e,i.pop(),i.lastAutoClosedTag={tag:Be.name,reason:Fe.name,depth:i.stack.length},Be=i.current();let Ge=i.current(),Ue=(Fe.name==="script"||Fe.name==="style")&&Ge.type==="Root",ze=Ue?vh:Sh,Ke;while(Ke=ze(i))Ve.attributes.push(Ke),i.allowWhitespace();if(Ve.type==="SvelteComponent")Ve.expression=Xc(zc(Ve));if(Ve.type==="SvelteElement"){let Ze=zc(Ve);if(Ze.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(Th(Ze))Ve.tag=Xc(Ze);else{let et=Ze.value[0];Ve.tag=et.type==="Text"?{type:"Literal",value:et.data,raw:`'${et.raw}'`,start:et.start,end:et.end}:et.expression}}if(Ue){if(i.eat(">",!0),Fe.name==="script"){let Ze=qc(i,$e,Ve.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=Gc(i,$e,Ve.attributes)}return}i.append(Ve);let Xe=i.eat("/")||so(Fe.name);if(i.eat(">",!0),Xe)Ve.end=i.index;else if(Fe.name==="textarea")Ve.fragment.nodes=Zc(i,()=>(io.lastIndex=i.index,io.test(i.source))),i.read(io),Ve.end=i.index;else i.push(Ve,Ve.fragment)}function zc(i){let $e=i.attributes,Be=$e.findIndex((Fe)=>Fe.type==="Attribute"&&Fe.name==="this");if(Be===-1)throw Error(`sveld: <${i.name}> requires a \`this\` attribute`);return $e.splice(Be,1)[0]}function Xc(i){return Array.isArray(i.value)?i.value[0].expression:i.value.expression}function Th(i){return i.value!==!0&&!Array.isArray(i.value)||Array.isArray(i.value)&&i.value.length===1&&i.value[0].type==="ExpressionTag"}function tl(i){let $e={start:i.start,end:i.end,attributes:i.attributes};for(let Be of i.attributes){if(Be.type!=="Attribute")continue;if(Be.name==="runes"){let Fe=nl(Be);if(typeof Fe==="boolean")$e.runes=Fe}if(Be.name==="customElement"){let Fe=wh(Be);if(Fe!==void 0)$e.customElement=Fe}}return $e}function nl(i){let{value:$e}=i;if($e===!0)return!0;let Be=Array.isArray($e)?$e[0]:$e;if(!Be)return!0;if(Array.isArray($e)&&$e.length>1)return null;if(Be.type==="Text")return Be.data;if(Be.expression.type!=="Literal")return null;return Be.expression.value}var kh=new Set(["String","Boolean","Number","Array","Object"]);function ao(i){let $e=[];for(let Be of i.properties){if(!Be||typeof Be!=="object"||Be.type!=="Property"||Be.computed||Be.key?.type!=="Identifier")continue;let{key:Fe,value:je}=Be;$e.push([Fe.name,je])}return $e}function Ah(i){let $e={};if(!i||typeof i!=="object"||i.type!=="ObjectExpression")return $e;for(let[Be,Fe]of ao(i)){if(!Fe||typeof Fe!=="object"||Fe.type!=="Literal")continue;let je=Fe.value;if(Be==="attribute"&&typeof je==="string")$e.attribute=je;else if(Be==="reflect"&&typeof je==="boolean")$e.reflect=je;else if(Be==="type"&&typeof je==="string"&&kh.has(je))$e.type=je}return $e}function wh(i){let{value:$e}=i;if($e===!0)return;let Be=Array.isArray($e)?$e[0]:$e;if(!Be)return;if(Be.type==="Text"){let Ke=nl(i);return typeof Ke==="string"?{tag:Ke}:void 0}let Fe=Be.expression;if(Fe.type==="Literal"&&Fe.value===null)return;if(Fe.type!=="ObjectExpression")return;let je=ao(Fe),We={},Ve=je.find(([Ke])=>Ke==="tag")?.[1];if(Ve&&typeof Ve==="object"&&Ve.type==="Literal"&&typeof Ve.value==="string")We.tag=Ve.value;let Ge=je.find(([Ke])=>Ke==="props")?.[1];if(Ge&&typeof Ge==="object"&&Ge.type==="ObjectExpression"){We.props={};for(let[Ke,Xe]of ao(Ge))We.props[Ke]=Ah(Xe)}let Ue=je.find(([Ke])=>Ke==="shadow")?.[1];if(Ue&&typeof Ue==="object"){let Ke=Ue;if(Ke.type==="Literal"&&(Ke.value==="open"||Ke.value==="none"))We.shadow=Ke.value;else if(Ke.type==="ObjectExpression")We.shadow=Ue}let ze=je.find(([Ke])=>Ke==="extend")?.[1];if(ze!==void 0)We.extend=ze;return We}var Ph=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class co extends Qi{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(i,$e){super(i);this.isTypeScript=Ph.test(i);let Be=an();this.root={type:"Root",start:0,end:$e,css:null,js:[],options:null,fragment:Be,comments:[]},this.stack.push(this.root),this.fragments.push(Be)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(i,$e){this.stack.push(i),this.fragments.push($e)}pop(){return this.fragments.pop(),this.stack.pop()}append(i){return this.currentFragment().nodes.push(i),i}}var lo={"{":"}","(":")","[":"]"},Nh=new Set(Object.values(lo));function Vr(i,$e,Be=lo){let Fe=Be===lo?Nh:new Set(Object.values(Be)),je=[],We=$e;while(We<i.source.length){let Ve=i.source[We++];if(Ve==="'"||Ve==='"'||Ve==="`"){We=Dh(i,We,Ve);continue}if(Object.hasOwn(Be,Ve))je.push(Ve);else if(Fe.has(Ve)){let Ge=je.pop(),Ue=Ge?Be[Ge]:void 0;if(Ve!==Ue)throw Error(`sveld: expected "${Ue}"`);if(je.length===0)return We}}throw Error("sveld: unexpected end of input")}function Dh(i,$e,Be){let Fe=!1,je=$e;while(je<i.source.length){let We=i.source[je++];if(Fe){Fe=!1;continue}if(We===Be)return je;if(We==="\\")Fe=!0;if(Be==="`"&&We==="$"&&i.source[je]==="{")je=Vr(i,je)}throw Error("sveld: unterminated string constant")}var sl=/[^\n]/g,_h=/\?\s*:/g;function Xn(i){let $e=i.index,Be=i.readIdentifierName();if(Be.name!==""){let Ze=rl(i);return{...Be,typeAnnotation:Ze}}let Fe=i.source[i.index];if(Fe!=="{"&&Fe!=="[")throw Error("sveld: expected a binding pattern");let je=Vr(i,$e);i.index=je;let We=i.source.slice($e,je),Ve=i.source.slice(0,$e).replace(sl," "),Ge=Ve.indexOf(" ");Ve=Ve.slice(0,Ge)+Ve.slice(Ge+1);let Ue=`${Ve}(${We} = 1)`,{node:ze}=br(Ue,$e-1,i.isTypeScript,i.root.comments),Ke=ze.left,Xe=rl(i);if(Xe)Ke.typeAnnotation=Xe,Ke.end=Xe.end;return Ke}function rl(i){let $e=i.index;if(i.allowWhitespace(),!i.eat(":")){i.index=$e;return}let Be="_ as ",Fe=i.index-Be.length,je=i.source.slice(0,Fe).replace(sl," ")+Be+i.source.slice(i.index).replace(_h,":"),{node:We}=br(je,Fe,i.isTypeScript,i.root.comments),Ve=We;if(Ve.type==="AssignmentExpression"){let Ge=Ve.right.start;while(je[Ge]!=="=")Ge-=1;({node:We}=br(je.slice(0,Ge),Fe,i.isTypeScript,i.root.comments)),Ve=We}if(Ve.type==="SequenceExpression"&&Ve.expressions)Ve=Ve.expressions[0];return i.index=Ve.end,{type:"TSTypeAnnotation",start:$e,end:i.index,typeAnnotation:Ve.typeAnnotation}}var il=/\s*}/y,Ih={"<":">"};function ol(i){let $e=i.index-2;while(i.source[$e]!=="{")$e-=1;if(i.eat("if")){i.requireWhitespace();let Be={type:"IfBlock",elseif:!1,start:$e,end:-1,test:Yt(i),consequent:an(),alternate:null};i.append(Be),i.allowWhitespace(),i.eat("}",!0),i.push(Be,Be.consequent);return}if(i.eat("each")){i.requireWhitespace();let Be=Yt(i);if(i.allowWhitespace(),!i.match("as")){let Ge=Be;if(Ge.type==="SequenceExpression"&&Ge.expressions)Ge=Ge.expressions[0];if(Ge.type==="TSAsExpression"){let Ue=Ge;Be=Ue.expression;let ze=Ue.typeAnnotation.start-2;while(ze>=0&&!(i.source[ze]==="a"&&i.source[ze+1]==="s"))ze-=1;i.index=ze}}let Fe=null,je,We;if(i.eat("as"))i.requireWhitespace(),Fe=Xn(i);if(i.allowWhitespace(),i.eat(",")){i.allowWhitespace();let Ge=i.readIdentifierName();if(!Ge.name)throw Error("sveld: expected an identifier");je=Ge.name,i.allowWhitespace()}if(i.eat("("))i.allowWhitespace(),We=Yt(i),i.allowWhitespace(),i.eat(")",!0),i.allowWhitespace();i.eat("}",!0);let Ve={type:"EachBlock",start:$e,end:-1,expression:Be,body:an(),context:Fe,index:je,key:We};i.append(Ve),i.push(Ve,Ve.body);return}if(i.eat("await")){i.requireWhitespace();let Be=Yt(i);i.allowWhitespace();let Fe={type:"AwaitBlock",start:$e,end:-1,expression:Be,value:null,error:null,pending:null,then:null,catch:null};if(i.eat("then")){if(!i.matchRegex(il))i.requireWhitespace(),Fe.value=Xn(i),i.allowWhitespace();Fe.then=an()}else if(i.eat("catch")){if(!i.matchRegex(il))i.requireWhitespace(),Fe.error=Xn(i),i.allowWhitespace();Fe.catch=an()}else Fe.pending=an();i.eat("}",!0),i.append(Fe),i.push(Fe,Fe.then??Fe.catch??Fe.pending);return}if(i.eat("key")){i.requireWhitespace();let Be=Yt(i);i.allowWhitespace(),i.eat("}",!0);let Fe={type:"KeyBlock",start:$e,end:-1,expression:Be,fragment:an()};i.append(Fe),i.push(Fe,Fe.fragment);return}if(i.eat("snippet")){i.requireWhitespace();let Be=i.readIdentifierName();if(Be.name==="")throw Error("sveld: expected a snippet name");i.allowWhitespace();let Fe;if(i.isTypeScript&&i.match("<")){let We=i.index,Ve=Vr(i,We,Ih);Fe=i.source.slice(We+1,Ve-1),i.index=Ve}if(i.allowWhitespace(),i.eat("(")){let We=1;while(i.index<i.source.length&&(!i.match(")")||We!==1)){if(i.match("("))We++;if(i.match(")"))We--;i.index+=1}i.eat(")",!0)}i.allowWhitespace(),i.eat("}",!0);let je={type:"SnippetBlock",start:$e,end:-1,expression:Be,typeParams:Fe,parameters:[],body:an()};i.append(je),i.push(je,je.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function al(i){let $e=i.index-1,Be=i.current();if(Be.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(),Be.alternate=an(),i.fragments.push(Be.alternate),i.eat("if")){i.requireWhitespace();let Fe=Yt(i);i.allowWhitespace(),i.eat("}",!0);let je=$e-1;while(i.source[je]!=="{")je-=1;let We={type:"IfBlock",start:je,end:-1,elseif:!0,test:Fe,consequent:an(),alternate:null};i.append(We),i.stack.push(We),i.fragments.pop(),i.fragments.push(We.consequent)}else i.allowWhitespace(),i.eat("}",!0);return}if(Be.type==="EachBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else}");i.allowWhitespace(),i.eat("}",!0),Be.fallback=an(),i.fragments.pop(),i.fragments.push(Be.fallback);return}if(Be.type==="AwaitBlock"){if(i.eat("then")){if(Be.then)throw Error("sveld: duplicate {:then}");if(!i.eat("}"))i.requireWhitespace(),Be.value=Xn(i),i.allowWhitespace(),i.eat("}",!0);Be.then=an(),i.fragments.pop(),i.fragments.push(Be.then);return}if(i.eat("catch")){if(Be.catch)throw Error("sveld: duplicate {:catch}");if(!i.eat("}"))i.requireWhitespace(),Be.error=Xn(i),i.allowWhitespace(),i.eat("}",!0);Be.catch=an(),i.fragments.pop(),i.fragments.push(Be.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function cl(i){let $e=i.current();switch($e.type){case"IfBlock":{i.eat("if",!0),i.allowWhitespace(),i.eat("}",!0);while($e.type==="IfBlock"&&$e.elseif)$e.end=i.index,i.stack.pop(),$e=i.current();$e.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),$e.end=i.index,i.pop()}var Rh=/(?:let|const)\b/y,Lh=/(?:var|interface|enum)\b/y,Oh=/type\b/y;function ll(i){let $e=i.index;if(i.matchRegex(Lh))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!i.matchRegex(Rh)&&!i.matchRegex(Oh))return null;let Be=i.root.comments.length,Fe=Mc(i.source,$e,i.isTypeScript,i.root.comments);if(Fe.type!=="VariableDeclaration"){if(Fe.type==="ExpressionStatement")return i.root.comments.length=Be,null;throw Error("sveld: expected a `let`/`const` declaration")}if(Fe.kind!=="let"&&Fe.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return i.index=Fe.end,i.allowWhitespace(),i.eat("}",!0),Fe}var Mh=/\s*}/y;function pl(i){let $e=i.index;while(i.source[$e]!=="{")$e-=1;if(i.eat("html")){i.requireWhitespace();let Be=Yt(i);i.allowWhitespace(),i.eat("}",!0);let Fe={type:"HtmlTag",start:$e,end:i.index,expression:Be};i.append(Fe);return}if(i.eat("debug")){let Be;if(i.read(Mh))Be=[];else{let je=Yt(i);Be=je.type==="SequenceExpression"?je.expressions:[je];for(let We of Be)if(We.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");i.allowWhitespace(),i.eat("}",!0)}let Fe={type:"DebugTag",start:$e,end:i.index,identifiers:Be};i.append(Fe);return}if(i.eat("const")){i.requireWhitespace();let Be=Xn(i);i.allowWhitespace(),i.eat("=",!0),i.allowWhitespace();let Fe=Yt(i),je=i.index;i.allowWhitespace(),i.eat("}",!0);let We={type:"VariableDeclarator",id:Be,init:Fe,start:Be.start,end:je},Ve={type:"ConstTag",start:$e,end:i.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[We],start:$e+2,end:i.index-1}};i.append(Ve);return}if(i.eat("render")){i.requireWhitespace();let Be=Yt(i);if(!(Be.type==="CallExpression"||Be.type==="ChainExpression"&&Be.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");i.allowWhitespace(),i.eat("}",!0);let je={type:"RenderTag",start:$e,end:i.index,expression:Be};i.append(je);return}throw Error("sveld: expected html/debug/const/render")}function ul(i){let $e=i.index;if(i.index+=1,i.allowWhitespace(),i.eat("#")){ol(i);return}if(i.eat(":")){al(i);return}if(i.eat("@")){pl(i);return}if(i.match("/")&&!i.match("/*")&&!i.match("//")){i.eat("/"),cl(i);return}let Be=ll(i);if(Be){let We={type:"DeclarationTag",start:$e,end:i.index,declaration:Be};i.append(We);return}let Fe=Yt(i);i.allowWhitespace(),i.eat("}",!0);let je={type:"ExpressionTag",start:$e,end:i.index,expression:Fe};i.append(je)}function dl(i){let{index:$e,source:Be}=i,Fe=Be.indexOf("<",$e),je=Be.indexOf("{",$e),We;if(Fe===-1)We=je===-1?Be.length:je;else We=je===-1?Fe:Math.min(Fe,je);i.index=We;let Ve=Be.slice($e,We),Ge={type:"Text",start:$e,end:i.index,raw:Ve,data:Ve};i.append(Ge)}function D(i){let $e=i.trimEnd(),Be=new co($e,i.length);while(Be.index<Be.source.length)if(Be.match("<"))el(Be);else if(Be.match("{"))ul(Be);else dl(Be);let Fe=Be.root.fragment.nodes.findIndex((je)=>je.type==="SvelteOptions");if(Fe!==-1){let[je]=Be.root.fragment.nodes.splice(Fe,1);Be.root.options=tl(je)}return Be.root}function Vt(i){return typeof i==="object"&&i!==null}function le(i){return Vt(i)&&i.type==="VariableDeclaration"&&Array.isArray(i.declarations)}function m(i){return Vt(i)&&i.type==="Literal"}function r(i){return Vt(i)&&i.type==="Identifier"&&typeof i.name==="string"}function fe(i){return Vt(i)&&i.type==="MemberExpression"}function Dn(i){return Vt(i)&&i.type==="ObjectExpression"&&Array.isArray(i.properties)}function $h(i){return Vt(i)&&i.type==="CallExpression"}function p(i,$e){if(!$h(i))return!1;return!!i.callee&&Vt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===$e}function h(i){if(Vt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"expression"in i)return h(i.expression);return i}function de(i){if(Vt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"typeAnnotation"in i)return i.typeAnnotation;return}function Bh(i){return Vt(i)&&i.type==="NewExpression"}function po(i,$e){if(!Bh(i))return!1;return!!i.callee&&Vt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===$e}function _n(i){if(!Vt(i)||typeof i.type!=="string")return null;if(i.type==="Literal"){let $e=i.value;if(typeof $e==="string")return $e;return $e==null?null:String($e)}if(i.type==="TemplateLiteral"){let $e=i.quasis;if($e?.length===1){let Be=$e[0]?.value?.cooked;return Be==null?null:Be}}return null}var T=Symbol("sveld.parsedComponentTypeScriptMetadata");function An(i){return i[T]}function fl(i,$e){if($e.length===0)return;let Be=new Set(i.props.map((Fe)=>Fe.name));for(let Fe of $e){if(Be.has(Fe.name))continue;Be.add(Fe.name),i.props.push({name:Fe.name,kind:"let",constant:!1,type:Fe.type,typeSource:"typescript",...Fe.description?{description:Fe.description}:{},isFunction:Fe.type.includes("=>"),isFunctionDeclaration:!1,isRequired:Fe.isRequired,reactive:!1})}}var Fh=/\w/;function jh(i,$e){let Be=i.trim();if(!Be.startsWith("{")||!Be.endsWith("}"))return;let Fe=Be.slice(1,-1),je=[],We=0,Ve="";for(let Ge of Fe)if(Ge==="{"||Ge==="<"||Ge==="("||Ge==="[")We++,Ve+=Ge;else if(Ge==="}"||Ge===">"||Ge===")"||Ge==="]")We--,Ve+=Ge;else if((Ge===";"||Ge===",")&&We===0)je.push(Ve.trim()),Ve="";else Ve+=Ge;if(Ve.trim())je.push(Ve.trim());for(let Ge of je){if(!Ge.startsWith($e))continue;let Ue=Ge.slice($e.length);if(Ue.length>0&&Fh.test(Ue[0]))continue;let ze=Ue.trimStart();if(ze.startsWith("?"))ze=ze.slice(1).trimStart();if(ze.startsWith(":"))return ze.slice(1).trim()}return}function J(i,$e,Be){let Fe=Be;if(Fe.computed||Fe.object?.type!=="Identifier"||Fe.property?.type!=="Identifier")return;let je=Fe.object.name,We=Fe.property.name;if(!je||!We)return;if(i.wholePropsLocals.has(je))return $e.getPropTypeByLocalOrPublic(We);let Ve=$e.getPropTypeByLocalOrPublic(je)??$e.findVariableTypeAndDescription(je)?.type;if(!Ve)return;return jh(Ve,We)}function Vh(i){let $e="";for(let Be=0;Be<i.length;Be++){let Fe=i[Be];if(Fe==="*"&&i[Be+1]==="*"){if($e+=".*",Be++,i[Be+1]==="/")Be++;continue}if(Fe==="*"){$e+="[^/]*";continue}if(Fe==="?"){$e+="[^/]";continue}$e+=".+^$()[]{}|\\".includes(Fe)?`\\${Fe}`:Fe}return $e}function hl(i,$e){return new RegExp(`^${Vh(i)}$`).test($e)}var q={"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","dispatch-escapes":"sveld/dispatch-escapes","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","context-key-unresolved":"sveld/context-key-unresolved","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"},Wh={"prop-unknown-type":"warning","context-any-type":"warning","slot-missing-type":"warning","event-no-source":"warning","dispatch-escapes":"warning","example-compile-error":"error","example-syntax-error":"error","syntax-skipped":"error","rest-props-unresolved":"warning","context-duplicate-key":"warning","context-key-unresolved":"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 gn(i){return{...i,code:q[i.kind],severity:Wh[i.kind]}}function V(i,$e){if($e)return i;return i.filter((Be)=>Be.kind!=="jsdoc-unknown-tag")}function U(i,$e){if(!$e)return[];return i.filter((Be)=>!Be.ignored&&($e!=="errors"||Be.severity==="error"))}function qh(i,$e){if($e.code!==void 0&&$e.code!==i.code)return!1;if($e.name!==void 0&&$e.name!==i.name)return!1;if($e.component!==void 0&&!hl($e.component,i.component))return!1;return!0}function ml(i,$e){if(!$e||$e.length===0)return i;return i.map((Be)=>Be.ignored||$e.some((Fe)=>qh(Be,Fe))?{...Be,ignored:!0}:Be)}var Gh={"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","dispatch-escapes":"Dispatchers passed to functions sveld can't follow","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","context-key-unresolved":"setContext keys sveld couldn't resolve","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"},Uh=["prop-unknown-type","context-any-type","slot-missing-type","event-no-source","dispatch-escapes","example-compile-error","example-syntax-error","syntax-skipped","rest-props-unresolved","context-duplicate-key","context-key-unresolved","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 As(i){let $e=new Set,Be=[];for(let Fe of i){let je=`${Fe.component}:${Fe.kind}:${Fe.name}`;if($e.has(je))continue;$e.add(je),Be.push(Fe)}return Be}function W(i){let $e=i.filter((Ve)=>!Ve.ignored),Be=i.length-$e.length,Fe=Be>0?` (${Be} ignored)`:"";if($e.length===0)return`sveld: all types resolved${Fe}.`;let je=[],We=$e.length;je.push(`sveld: ${We} unresolved type${We===1?"":"s"} found${Fe}.`);for(let Ve of Uh){let Ge=$e.filter((ze)=>ze.kind===Ve);if(Ge.length===0)continue;je.push(""),je.push(`${Gh[Ve]} (${Ge.length}):`);let Ue=new Map;for(let ze of Ge){let Ke=Ue.get(ze.component)??[];Ke.push(ze),Ue.set(ze.component,Ke)}for(let[ze,Ke]of Ue){je.push(` ${ze}`);for(let Xe of Ke){let Ze=Xe.source?` (${ze}:${Xe.source.start.line}:${Xe.source.start.column})`:"";je.push(` - ${Xe.message}${Ze} [${Xe.code}]`)}}}return je.join(`
17
- `)}var me=1;function H(i){return`${JSON.stringify({kind:"diagnostics",schemaVersion:me,diagnostics:i},null,2)}
18
- `}function n(i,$e,Be,Fe,je){i.diagnosticRecords.push(K(i,$e,Be,Fe,je))}function K(i,$e,Be,Fe,je){return gn({component:i.componentFilePath,kind:$e,name:Be,message:Fe,...je?{source:je}:{},...ee(i,$e,Be)?{ignored:!0}:{}})}function yl(i,$e){return`${i}:${$e}`}function l(i,$e,Be,Fe){if(!Fe||Fe.length===0)return;let je=yl($e,Be),We=i.sveldIgnoreDirectives.get(je)??new Set;for(let Ve of Fe)We.add(Ve);i.sveldIgnoreDirectives.set(je,We)}function ee(i,$e,Be){let Fe=i.sveldIgnoreDirectives.get(yl($e,Be));if(!Fe)return!1;return Fe.has("")||Fe.has(q[$e])}var uo=/[\r\n]+/g;function Hh(i){if(i.sourceLineStartOffsetsCache)return i.sourceLineStartOffsetsCache;let $e=[0];if(i.source){let Be=i.source.indexOf(`
19
- `);while(Be!==-1)$e.push(Be+1),Be=i.source.indexOf(`
20
- `,Be+1)}return i.sourceLineStartOffsetsCache=$e,$e}function gl(i,$e){if(!i.source||$e<0||$e>i.source.length)return;let Be=Hh(i),Fe=i.sourceLineHint;if(Fe!==void 0)for(let Ve=Fe;Ve<=Fe+1&&Ve<Be.length;Ve++){let Ge=Be[Ve],Ue=Be[Ve+1]??Number.POSITIVE_INFINITY;if($e>=Ge&&$e<Ue)return i.sourceLineHint=Ve,{line:Ve+1,column:$e-Ge}}let je=0,We=Be.length-1;while(je<=We){let Ve=je+We>>>1,Ge=Be[Ve],Ue=Be[Ve+1]??Number.POSITIVE_INFINITY;if($e<Ge)We=Ve-1;else if($e>=Ue)je=Ve+1;else return i.sourceLineHint=Ve,{line:Ve+1,column:$e-Ge}}return}function G(i,$e,Be){if($e===void 0||Be===void 0||Be<$e)return;let Fe=gl(i,$e),je=gl(i,Be);if(!Fe||!je)return;return{start:Fe,end:je}}function t(i,$e){if(!$e||typeof $e!=="object")return;let Be="start"in $e&&typeof $e.start==="number"?$e.start:void 0,Fe="end"in $e&&typeof $e.end==="number"?$e.end:void 0;return G(i,Be,Fe)}function xn(i,$e){if(!$e||$e.length===0)return;let Be=[...$e];while(Be.length>1){let Ue=Be[Be.length-1];if(Ue.tag!==void 0||!Ue.raw.trim().endsWith("*/"))break;Be.pop()}let Fe=Be[0],je=Fe.raw.indexOf(`@${Fe.tag??""}`),We=Fe.start+Math.max(je,0),Ve=Be[Be.length-1],Ge=Ve.start+Ve.raw.length;return G(i,We,Ge)}function s(i,$e,Be){return i.source?.slice($e,Be)}function f(i,$e){if(!$e||typeof $e!=="object")return;let Be="start"in $e&&typeof $e.start==="number"?$e.start:void 0,Fe="end"in $e&&typeof $e.end==="number"?$e.end:void 0;if(Be===void 0||Fe===void 0)return;return s(i,Be,Fe)?.replace(uo," ")}function u(i){return i===void 0||i===""?void 0:i}function L(i,$e,Be,Fe){if(u(Be)===void 0)return;if(i.trackPropLocalName(Be),$e.props.has(Be)){let je=$e.props.get(Be);$e.props.set(Be,{...je,...Fe})}else $e.props.set(Be,Fe)}function O(i,$e,Be,Fe){if($e.pendingCallDefault)i.pendingCallDefaultCandidates.push({propName:Be,location:Fe,...$e.pendingCallDefault});if($e.pendingConstDefault)i.pendingConstDefaultCandidates.push({propName:Be,location:Fe,...$e.pendingConstDefault})}function g(i,$e,Be,Fe=0){let je,We,Ve=!1;if(!Be||typeof Be!=="object"||!("type"in Be))return{value:je,type:We,isFunction:Ve};let Ge=bl(i,$e,Be);if(Be.type==="ObjectExpression"||Be.type==="BinaryExpression"||Be.type==="ArrayExpression"||Be.type==="ArrowFunctionExpression"||Be.type==="FunctionExpression"){let Ue=Be;if("start"in Ue&&"end"in Ue&&typeof Ue.start==="number"&&typeof Ue.end==="number")je=s($e,Ue.start,Ue.end)?.replace(uo," ");if(We=je,Ve=Be.type==="ArrowFunctionExpression"||Be.type==="FunctionExpression",Be.type==="BinaryExpression"){let ze=Be;if(ze.left&&typeof ze.left==="object"&&"type"in ze.left&&ze.left.type==="Literal"&&"value"in ze.left&&typeof ze.left.value==="string")We="string"}if(Be.type==="ArrowFunctionExpression"||Be.type==="FunctionExpression")We=vl(Be),je=xl($e,Be)}else if(Be.type==="UnaryExpression"){let Ue=Be;if("start"in Ue&&"end"in Ue&&typeof Ue.start==="number"&&typeof Ue.end==="number")je=s($e,Ue.start,Ue.end);if(Ue.argument){if(typeof Ue.argument==="object"&&"type"in Ue.argument&&Ue.argument.type==="UnaryExpression")We=g(i,$e,Ue.argument).type;else if(typeof Ue.argument==="object"&&"value"in Ue.argument)We=typeof Ue.argument.value}}else if(Be.type==="NewExpression"){let Ue=Be;if("start"in Ue&&"end"in Ue&&typeof Ue.start==="number"&&typeof Ue.end==="number")je=s($e,Ue.start,Ue.end);if(Ue.callee&&typeof Ue.callee==="object"&&"type"in Ue.callee&&Ue.callee.type==="Identifier"){let ze=Ue.callee.name;if(ze==="Date")We="Date";else if(ze==="Map")We="Map<any, any>";else if(ze==="Set")We="Set<any>";else if(ze==="WeakMap")We="WeakMap<object, any>";else if(ze==="WeakSet")We="WeakSet<object>";else if(ze==="Array")We="any[]";else if(ze==="RegExp"||ze==="Regexp")We="RegExp";else if(ze==="Error")We="Error";else We=ze}}else if(Be.type==="CallExpression"){let Ue=Be;if("start"in Ue&&"end"in Ue&&typeof Ue.start==="number"&&typeof Ue.end==="number")je=s($e,Ue.start,Ue.end);let ze=Ue.callee,Ke=ze&&typeof ze==="object"&&"type"in ze&&ze.type==="Identifier"?ze.name:void 0;if((Ke==="$derived"||Ke==="$state")&&Ue.arguments.length===1&&Fe<5)return{...g(i,$e,Ue.arguments[0],Fe+1),value:je,defaultValue:Ge};if(Ke){let Xe=zh(i,$e,Ke);if(Xe)return{value:je,type:void 0,isFunction:!1,defaultValue:Ge,resolvedType:Xe};if($e.funcDecls.has(Ke)||Xh($e,Ke))return{value:je,type:void 0,isFunction:!1,defaultValue:Ge,pendingCallDefault:{calleeName:Ke}};let Ze=$e.valueImportBindingsByLocalName.get(Ke);if(Ze)return{value:je,type:void 0,isFunction:!1,defaultValue:Ge,pendingCallDefault:{calleeName:Ke,importSource:Ze.source,importedName:Ze.importedName}}}return{value:je,type:void 0,isFunction:!1,defaultValue:Ge,pendingCallDefault:{calleeName:Ke??Kh($e,ze)}}}else if(Be.type==="Identifier"){let Ue=Be;if(Fe<5){let Ke=El($e,Ue.name);if(Ke){let Xe=g(i,$e,Ke,Fe+1),Ze=i.resolveLocalVarJSDoc(Ue.name);return{...Xe,resolvedType:Ze?.type??Xe.resolvedType,resolvedDescription:Ze?.description??Xe.resolvedDescription,resolvedParams:Ze?.params??Xe.resolvedParams,resolvedReturnType:Ze?.returnType??Xe.resolvedReturnType}}if($e.funcDecls.has(Ue.name)){let Xe=i.resolveLocalVarJSDoc(Ue.name),Ze=$e.funcDecls.get(Ue.name);return{value:Ze?xl($e,Ze):void 0,type:void 0,isFunction:!0,defaultValue:Ze?bl(i,$e,Ze):void 0,resolvedType:Xe?.type??Zh(Xe,Ze),resolvedDescription:Xe?.description,resolvedParams:Xe?.params,resolvedReturnType:Xe?.returnType}}}if("start"in Ue&&"end"in Ue&&typeof Ue.start==="number"&&typeof Ue.end==="number")je=s($e,Ue.start,Ue.end);let ze=$e.valueImportBindingsByLocalName.get(Ue.name);if(ze)return{value:je,type:We,isFunction:Ve,defaultValue:Ge,pendingConstDefault:{importSource:ze.source,importedName:ze.importedName}}}else if(Be.type==="MemberExpression"){let Ue=Be;if("start"in Ue&&"end"in Ue&&typeof Ue.start==="number"&&typeof Ue.end==="number")je=s($e,Ue.start,Ue.end);if(i.isNumericConstant(Be))We="number"}else if(Be.type==="TemplateLiteral"){let Ue=Be;if("start"in Ue&&"end"in Ue&&typeof Ue.start==="number"&&typeof Ue.end==="number")je=s($e,Ue.start,Ue.end);We="string"}else if("raw"in Be&&typeof Be.raw==="string"){if(je=Be.raw,"value"in Be)We=Be.value==null?void 0:typeof Be.value}return{value:je,type:We,isFunction:Ve,defaultValue:Ge}}function El(i,$e){for(let Be of i.vars)for(let Fe of Be.declarations)if(Fe.id&&typeof Fe.id==="object"&&"type"in Fe.id&&Fe.id.type==="Identifier"&&"name"in Fe.id&&Fe.id.name===$e&&Fe.init)return Fe.init;return}function Wr(i,$e){for(let Be of i.vars){if(Be.kind!=="const")continue;for(let Fe of Be.declarations)if(Fe.id&&typeof Fe.id==="object"&&"type"in Fe.id&&Fe.id.type==="Identifier"&&"name"in Fe.id&&Fe.id.name===$e&&Fe.init)return Fe.init}return}function Kh(i,$e){if($e&&typeof $e==="object"&&"start"in $e&&"end"in $e&&typeof $e.start==="number"&&typeof $e.end==="number")return s(i,$e.start,$e.end)??"call";return"call"}function zh(i,$e,Be){let Fe=i.resolveLocalVarJSDoc(Be);if(Fe?.returnType)return Fe.returnType;let je=$e.funcDecls.get(Be)??Cl($e,Be);if(!je)return;let We=Qh($e,je);if(We)return We;let Ve=Jh($e,Be);if(Ve)return Ve;let Ge=Sl(je);return Ge==="any"?void 0:Ge}function Xh(i,$e){return Cl(i,$e)!==void 0}function Cl(i,$e){let Be=El(i,$e);if(!Be||typeof Be!=="object"||!("type"in Be))return;if(Be.type==="ArrowFunctionExpression"||Be.type==="FunctionExpression")return Be;return}function Jh(i,$e){for(let Be of i.vars)for(let Fe of Be.declarations){let je=Fe.id;if(!je||typeof je!=="object"||!("type"in je)||je.type!=="Identifier"||!("name"in je)||je.name!==$e)continue;let We=je.typeAnnotation;if(We?.type!=="TSTypeAnnotation")return;let Ve=We.typeAnnotation;if(!Ve||typeof Ve.start!=="number"||typeof Ve.end!=="number")return;return Yh(s(i,Ve.start,Ve.end))}return}function Yh(i){if(!i)return;let $e=i.lastIndexOf("=>");if($e===-1)return;return i.slice($e+2).trim()||void 0}function Qh(i,$e){let Be=$e.returnType;if(Be?.type!=="TSTypeAnnotation")return;let Fe=Be.typeAnnotation;if(!Fe||typeof Fe.start!=="number"||typeof Fe.end!=="number")return;return s(i,Fe.start,Fe.end)}function Zh(i,$e){let Be=i?.returnType??"any",Fe=i?.params;if(Fe&&Fe.length>0)return`(${Fe.map((We)=>`${We.name}${We.optional?"?":""}: ${We.type}`).join(", ")}) => ${Be}`;if(i?.returnType)return`() => ${Be}`;if($e)return vl($e);return"(...args: any[]) => any"}function vl(i){return`(${em(i)}) => ${Sl(i)}`}function em(i){let $e=i.params;if(!Array.isArray($e)||$e.length===0)return"...args: any[]";let Be=[];for(let Fe of $e)if(Fe&&typeof Fe==="object"&&"type"in Fe&&Fe.type==="Identifier"&&"name"in Fe&&typeof Fe.name==="string")Be.push(`${Fe.name}: any`);else return"...args: any[]";return Be.join(", ")}function Sl(i){if(i.async||i.generator)return"any";let $e=i.body,Be;if($e&&typeof $e==="object"&&"type"in $e&&$e.type==="BlockStatement"){if(Be=tm($e),Be.length===0)return"any"}else Be=[$e];let Fe=null;for(let je of Be){let We=nm(je);if(!We)return"any";if(Fe===null)Fe=We;else if(Fe!==We)return"any"}return Fe??"any"}function tm(i){let $e=[];return fo(i,$e),$e}function fo(i,$e){if(!i||typeof i!=="object")return;let Be=i;if(typeof Be.type!=="string")return;if(Be.type==="FunctionDeclaration"||Be.type==="FunctionExpression"||Be.type==="ArrowFunctionExpression")return;if(Be.type==="ReturnStatement")$e.push(Be.argument??null);for(let Fe in Be){if(Fe==="leadingComments")continue;let je=Be[Fe];if(!je||typeof je!=="object")continue;if(Array.isArray(je))for(let We=0;We<je.length;We++)fo(je[We],$e);else fo(je,$e)}}function nm(i){if(!i||typeof i!=="object"||!("type"in i))return null;switch(i.type){case"Literal":{let $e=i.value;if(typeof $e==="string")return"string";if(typeof $e==="number")return"number";if(typeof $e==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let $e=i.callee;if($e&&typeof $e==="object"&&"type"in $e&&$e.type==="Identifier"){let Be=$e.name;if(Be==="String")return"string";if(Be==="Number")return"number";if(Be==="Boolean")return"boolean"}return null}default:return null}}function he(i){if(p(i,"$bindable"))return{init:i.arguments[0],bindable:!0};return{init:i,bindable:!1}}function rm(i,$e){let Be=$e.params;if(!Array.isArray(Be)||Be.length===0)return"";let Fe=Be[0],je=Be[Be.length-1];if(typeof Fe.start!=="number"||typeof je.end!=="number")return"";return s(i,Fe.start,je.end)??""}function xl(i,$e){if($e.generator)return;let Be=$e.body;if(!Be||typeof Be!=="object"||!("type"in Be))return;let Fe=rm(i,$e),je=$e.async?"async ":"",We=(Ge,Ue)=>Ge&&typeof Ge==="object"&&("type"in Ge)&&Ge.type==="ObjectExpression"?`(${Ue})`:Ue;if(Be.type!=="BlockStatement"){let Ge=f(i,Be);return Ge===void 0?void 0:`${je}(${Fe}) => ${We(Be,Ge)}`}let Ve=Be.body;if(Ve.length===0)return`${je}(${Fe}) => {}`;if(Ve.length===1){let Ge=Ve[0];if(Ge&&typeof Ge==="object"&&"type"in Ge&&Ge.type==="ReturnStatement"){let Ue=Ge.argument;if(Ue){let ze=f(i,Ue);if(ze!==void 0)return`${je}(${Fe}) => ${We(Ue,ze)}`}}}return}function bl(i,$e,Be){let Fe=f($e,Be);if(!Fe||!Be||typeof Be!=="object"||!("type"in Be))return;let je="expression";if(Be.type==="Literal"||Be.type==="UnaryExpression")je="literal";else if(Be.type==="TemplateLiteral")je=Be.expressions.length===0?"literal":"expression";else if(Be.type==="ArrayExpression")je="array";else if(Be.type==="ObjectExpression")je="object";else if(Be.type==="ArrowFunctionExpression"||Be.type==="FunctionExpression"||Be.type==="FunctionDeclaration")je="function";let We={raw:Fe,kind:je};if(je==="literal"||je==="array"||je==="object"){let Ve=ho(i,Be);if(Ve.ok)We.value=Ve.value}return We}function ho(i,$e){if(!$e||typeof $e!=="object"||!("type"in $e))return{ok:!1};if($e.type==="Literal"){let Be=$e.value;return typeof Be==="bigint"?{ok:!1}:{ok:!0,value:Be}}if($e.type==="UnaryExpression"){let Be=$e,Fe=Be.argument;if(!Fe||typeof Fe!=="object"||!("type"in Fe)||Fe.type!=="Literal")return{ok:!1};let je=Fe.value;if(typeof je==="number"){if(Be.operator==="-")return{ok:!0,value:-je};if(Be.operator==="+")return{ok:!0,value:je}}if(typeof je==="boolean"&&Be.operator==="!")return{ok:!0,value:!je};return{ok:!1}}if($e.type==="TemplateLiteral"){let Be=$e;if(Be.expressions.length>0||Be.quasis.length!==1)return{ok:!1};return{ok:!0,value:Be.quasis[0].value.cooked??Be.quasis[0].value.raw}}if($e.type==="ArrayExpression"){let Be=$e,Fe=[];for(let je of Be.elements){if(!je)return{ok:!1};let We=ho(i,je);if(!We.ok)return{ok:!1};Fe.push(We.value)}return{ok:!0,value:Fe}}if($e.type==="ObjectExpression"){let Be=$e,Fe={};for(let je of Be.properties){if(je.type!=="Property"||je.computed)return{ok:!1};let We=i.getPropertyName(je.key);if(!We)return{ok:!1};let Ve=ho(i,je.value);if(!Ve.ok)return{ok:!1};Fe[We]=Ve.value}return{ok:!0,value:Fe}}return{ok:!1}}function sm(i){let $e=[],Be=0,Fe=0;for(let je=0;je<i.length;je++){let We=i[je];if(We==="<"||We==="("||We==="["||We==="{")Be++;else if(We===">"||We===")"||We==="]"||We==="}")Be=Math.max(Be-1,0);else if(Be===0&&(We===";"||We===","))$e.push(i.slice(Fe,je)),Fe=je+1}return $e.push(i.slice(Fe)),$e}function im(i){let $e=0;for(let Be=0;Be<i.length;Be++){let Fe=i[Be];if(Fe==="<"||Fe==="("||Fe==="["||Fe==="{")$e++;else if(Fe===">"||Fe===")"||Fe==="]"||Fe==="}")$e=Math.max($e-1,0);else if($e===0&&Fe===":")return Be}return-1}var om=/^\{([\s\S]*)\}$/,am=/^[A-Za-z_$][\w$]*$/;function ws(i){let $e=i.trim(),Be=om.exec($e);if(!Be)return null;let Fe=Be[1].trim();if(Fe==="")return[];let je=[];for(let We of sm(Fe)){let Ve=We.trim();if(!Ve)continue;let Ge=im(Ve);if(Ge===-1)return null;let Ue=Ve.slice(0,Ge).trim(),ze=Ve.slice(Ge+1).trim();if(!ze)return null;let Ke=!1;if(Ue.endsWith("?"))Ke=!0,Ue=Ue.slice(0,-1).trim();if(!am.test(Ue))return null;je.push({name:Ue,type:ze,optional:Ke})}return je}function cm(i,$e,Be,Fe){if(!r(Be))return null;let je=Wr(i,Be.name);if(Dn(je))return Al(i,$e,je,Fe).properties;let We=$e.findVariableTypeAndDescription(Be.name);if(!We)return null;let Ve=ws(We.type);if(!Ve)return null;return Ve.map((Ge)=>({name:Ge.name,type:Ge.type,optional:Ge.optional}))}function Al(i,$e,Be,Fe){let je=[],We=!1;for(let Ve of Be.properties){if(Ve.type==="SpreadElement"){let Xe=cm(i,$e,Ve.argument,Fe);if(Xe)je.push(...Xe);else We=!0,n(i,"spread-unresolved",Fe,`Context "${Fe}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,Ve));continue}if(Ve.type!=="Property")continue;let Ge=$e.getPropertyName(Ve.key);if(!Ge)continue;let Ue="any",ze,Ke;if(r(Ve.value)){let Xe=Ve.value.name,Ze=$e.findVariableTypeAndDescription(Xe);if(Ze)Ue=Ze.type,ze=Ze.description,Ke=Ze.internal;else n(i,"context-any-type",Ge,`Context "${Fe}" property "${Ge}" has no type annotation; defaulted to "any".`,t(i,Ve))}else if(Ve.value&&typeof Ve.value==="object"&&"type"in Ve.value&&(Ve.value.type==="ArrowFunctionExpression"||Ve.value.type==="FunctionExpression"))Ue=`(${Ve.value.params?.map((et)=>{if(r(et))return`${et.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(m(Ve.value))Ue=Ve.value.value==null?"null":typeof Ve.value.value;je.push({name:Ge,type:Ue,description:ze,optional:!1,...Ke?{internal:!0}:{}})}return{properties:je,hasUnresolvedSpread:We}}var lm=/[-_.:/\s]+/;function qr(i){return`${i.split(lm).map((Fe)=>Fe.charAt(0).toUpperCase()+Fe.slice(1)).join("")}Context`}function Tl(i,$e,Be,Fe){if(!Be||typeof Be!=="object"||!("type"in Be))return null;if(Be.type==="ObjectExpression"){if(!Dn(Be))return null;let{properties:je,hasUnresolvedSpread:We}=Al(i,$e,Be,Fe);return{key:Fe,typeName:qr(Fe),properties:je,description:void 0,...We?{hasUnresolvedSpread:We}:{}}}else if(r(Be)){let je=Be.name,We=$e.findVariableTypeAndDescription(je);if(We)return{key:Fe,typeName:qr(Fe),properties:[{name:je,type:We.type,description:We.description,optional:!1}],description:void 0,...We.internal?{internal:!0}:{}};return n(i,"context-any-type",je,`Context "${Fe}" variable "${je}" has no type annotation; defaulted to "any".`,t(i,Be)),{key:Fe,typeName:qr(Fe),properties:[{name:je,type:"any",description:void 0,optional:!1}]}}return null}function kl(i){let $e=i.callee;if(!$e||typeof $e!=="object"||!("type"in $e))return null;let Be=$e.type==="Identifier"&&$e.name==="Symbol",Fe=$e.type==="MemberExpression"&&!$e.computed&&$e.object.type==="Identifier"&&$e.object.name==="Symbol"&&$e.property.type==="Identifier"&&$e.property.name==="for";if(!Be&&!Fe)return null;let je=i.arguments[0];if(!je||typeof je!=="object"||!("type"in je))return"";if(je.type==="Literal"&&typeof je.value==="string")return je.value;if(je.type==="TemplateLiteral"&&je.quasis?.length===1)return je.quasis[0].value.cooked??"";return""}function wl(i,$e,Be=0){if(!$e||typeof $e!=="object"||!("type"in $e))return{kind:"unresolved"};let Fe=$e;if(Fe.type==="Literal"||Fe.type==="TemplateLiteral"){let je=_n(Fe);return je==null?{kind:"unresolved"}:{kind:"resolved",key:je}}if(Fe.type==="CallExpression"||Fe.type==="NewExpression"){let je=kl(Fe);return je==null?{kind:"unresolved"}:{kind:"resolved",key:je}}if(Fe.type==="Identifier"){if(Be>=5)return{kind:"unresolved"};let je=Wr(i,Fe.name);if(je&&typeof je==="object"&&"type"in je){let Ve=je;if((Ve.type==="CallExpression"||Ve.type==="NewExpression")&&kl(Ve)==="")return{kind:"resolved",key:Fe.name};return wl(i,Ve,Be+1)}let We=i.valueImportBindingsByLocalName.get(Fe.name);if(We)return{kind:"pending",importSource:We.source,importedName:We.importedName};return{kind:"unresolved"}}return{kind:"unresolved"}}function ge(i,$e,Be,Fe){if(!Be||typeof Be!=="object"||!("type"in Be)||Be.type!=="CallExpression")return;let je=Be,We=je.arguments[0];if(!We)return;let Ve=wl(i,We);if(Ve.kind==="unresolved"||Ve.kind==="resolved"&&!Ve.key){let Xe=f(i,We)??"";n(i,"context-key-unresolved",Xe,`setContext key \`${Xe}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,t(i,Be));return}let Ge=je.arguments[1];if(!Ge)return;let Ue=t(i,Be);if(Ve.kind==="pending"){let Xe=Tl(i,$e,Ge,Ve.importedName);if(Xe)i.pendingContextKeyCandidates.push({importSource:Ve.importSource,importedName:Ve.importedName,properties:Xe.properties,description:Xe.description,source:Ue});return}let ze=Ve.key,Ke=Tl(i,$e,Ge,ze);if(!Ke)return;if(i.contexts.has(ze)){n(i,"context-duplicate-key",ze,`setContext("${ze}", ...) was called more than once; only the first call's shape is used.`,Ue);return}i.contexts.set(ze,{...Ke,source:Ue})}var pm=/\n/g;function ye(i,$e){if(!$e||typeof $e!=="object"||!("type"in $e))return;if(Dn($e))return Nl(i,$e);if($e.type==="ArrayExpression")return Dl(i,$e);return}function Pl(i,$e){if(!$e||typeof $e!=="object"||!("type"in $e))return"any";if(r($e))return i.findVariableTypeAndDescription($e.name)?.type??"any";if(m($e)){let Be=$e.value;return Be===null?"null":typeof Be}if(Dn($e))return Nl(i,$e);if($e.type==="ArrayExpression")return Dl(i,$e);return"any"}function Nl(i,$e){let Be=[];for(let Fe of $e.properties){if(Fe.type!=="Property"||Fe.computed)continue;let je=i.getPropertyName(Fe.key);if(!je)continue;Be.push({name:je,type:Pl(i,Fe.value)})}return Ps(Be)}function Dl(i,$e){let Be=new Set($e.elements.filter((Fe)=>Fe!=null).map((Fe)=>Pl(i,Fe)));if(Be.size===0)return"any[]";if(Be.size===1)return`${[...Be][0]}[]`;return`(${[...Be].join(" | ")})[]`}function xe(i,$e){for(let[Be,Fe]of i.arguments.entries()){if(r(Fe)&&Fe.name===$e)return{argumentIndex:Be};if(!Dn(Fe))continue;for(let je of Fe.properties){if(je.type!=="Property"||!r(je.value))continue;if(je.value.name!==$e)continue;let We=!je.computed&&r(je.key)?je.key.name:void 0;return{argumentIndex:Be,property:We??""}}}return}function z(i,$e){let Be=i.name.localeCompare($e.name);if(Be!==0)return Be;let Fe=i.type.localeCompare($e.type);if(Fe!==0)return Fe;if(i.type==="forwarded"&&$e.type==="forwarded"){let je=i.element.localeCompare($e.element);if(je!==0)return je}return(i.detail??"").localeCompare($e.detail??"")}function M(i){return typeof i==="string"?JSON.stringify(i):String(i)}function y(i,{name:$e,detail:Be,has_argument:Fe,description:je,deprecated:We,tags:Ve,internal:Ge,source:Ue}){if($e===void 0)return;let ze=!Fe&&!Be?"null":u(Be),Ke=je,Xe=i.events.get($e);if(Xe?.type==="forwarded")i.events.set($e,{type:"dispatched",name:$e,detail:ze,description:Ke||Xe.description,deprecated:We??Xe.deprecated,tags:Ve??Xe.tags,...Ge||Xe.internal?{internal:!0}:{},source:Ue||Xe.source});else if(Xe){let Ze=Xe.tags??Ve;i.events.set($e,{...Xe,detail:Xe.detail===void 0?ze:Xe.detail,description:Xe.description||Ke,deprecated:Xe.deprecated??We,tags:Ze,...Xe.internal||Ge?{internal:!0}:{},source:Ue||Xe.source})}else i.events.set($e,{type:"dispatched",name:$e,detail:ze,description:Ke,deprecated:We,tags:Ve,...Ge?{internal:!0}:{},source:Ue})}function Te(i,$e){let Be=$e.arguments[0],Fe=po(Be,"CustomEvent");if(!Fe&&!po(Be,"Event"))return;let je=Be.arguments[0],We=m(je)?je.value:void 0;if(We==null)return;let Ve=Fe?Be.arguments[1]:void 0,Ge=!1,Ue;if(Dn(Ve)){let ze=Ve.properties.find((Ke)=>Ke.type==="Property"&&r(Ke.key)&&Ke.key.name==="detail");if(ze?.type==="Property")Ge=!0,Ue=m(ze.value)?ze.value.value:void 0}return y(i,{name:String(We),detail:Ue==null?"":M(Ue),has_argument:Ge,source:t(i,$e)}),String(We)}function Ps(i,$e,Be=!1){if(i.length===0)return"null";let Fe=i.map(({name:je,type:We,description:Ve,optional:Ge,default:Ue})=>{let ze=Ge?"?":"",Ke=Ve||"";if(Ue&&Ke)Ke=`${Ke} @default ${Ue}`;else if(Ue)Ke=`@default ${Ue}`;if(Ke){if(Be)return`${Ke.includes(`
21
- `)?`/**
22
- * ${Ke.split(`
23
- `).join(`
24
- * `)}
25
- */`:`/** ${Ke} */`}
26
- ${je}${ze}: ${We};`;return`/** ${Ke.replace(pm," ")} */ ${je}${ze}: ${We};`}return`${je}${ze}: ${We};`}).join(Be?`
27
- `:" ");return Be?`{
28
- ${Fe}
29
- }`:`{ ${Fe} }`}var um=/[A-Za-z_$][\w$]*/g;function dm(i,$e){if(!$e)return!1;let Be=new Set($e[0].split(",").map((Fe)=>Fe.trim()));for(let[Fe]of i.matchAll(um))if(Be.has(Fe))return!0;return!1}function te(i,$e){if($e===void 0)return;return i.runesPropsDeclarationMetadataByDeclaratorStart.get($e)}function Ee(i,$e,Be){return te(i,$e)?.props.get(Be)}function be(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 _l(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 _l(i.left);return}function E(i,$e){let Be=$e?.start,Fe=$e?.end;if(Be===void 0||Fe===void 0)return;return s(i,Be+1,Fe)?.trim()}function Se(i,$e){let Be=$e?.start,Fe=$e?.end;if(Be===void 0||Fe===void 0)return;return s(i,Be,Fe)?.trim()}function c(i,$e,Be,Fe,je=new Set){if(!$e?.type)return;switch($e.type){case"TSInterfaceDeclaration":c(i,{type:"TSTypeLiteral",members:$e.body?.body},Be,Fe,je);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":c(i,$e.typeAnnotation,Be,Fe,je);return;case"TSIntersectionType":case"TSUnionType":for(let We of $e.types??[])c(i,We,Be,Fe,je);return;case"TSTypeLiteral":for(let We of $e.members??[]){if(We?.type!=="TSPropertySignature")continue;c(i,We.typeAnnotation?.typeAnnotation,Be,Fe,je)}return;case"TSTypeReference":{let We=_l($e.typeName);if(We){if(i.typeImportBindingsByLocalName.has(We)||i.valueImportBindingsByLocalName.has(We))Be.add(We);let Ve=i.localTypeDeclarationsByName.get(We);if(Ve&&!je.has(We))Fe.add(We),je.add(We),c(i,Ve.node,Be,Fe,je),je.delete(We)}if("typeParameters"in $e&&$e.typeParameters&&typeof $e.typeParameters==="object"){let Ve=$e.typeParameters;for(let Ge of Ve.params??[])c(i,Ge,Be,Fe,je)}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 We in $e){let Ve=$e[We];if(!Ve||typeof Ve!=="object")continue;if(Array.isArray(Ve)){for(let Ge of Ve){if(!Ge||typeof Ge!=="object"||!("type"in Ge))continue;c(i,Ge,Be,Fe,je)}continue}if("type"in Ve)c(i,Ve,Be,Fe,je)}}function fm(i,$e){let Be=new Map;for(let Fe of Array.from($e).sort()){let je=i.typeImportBindingsByLocalName.get(Fe),We=je?void 0:i.valueImportBindingsByLocalName.get(Fe),Ve=je??(We?{importedName:We.importedName,localName:We.localName,source:We.source,specifierType:"named"}:void 0);if(!Ve)continue;let Ge=Be.get(Ve.source)??{default:[],named:[],namespace:[]};if(Ve.specifierType==="default")Ge.default.push(Ve.localName);else if(Ve.specifierType==="namespace")Ge.namespace.push(Ve.localName);else Ge.named.push({imported:Ve.importedName,local:Ve.localName});Be.set(Ve.source,Ge)}return Array.from(Be.entries()).sort(([Fe],[je])=>Fe.localeCompare(je)).map(([Fe,je])=>{if(je.namespace.length>0)return je.namespace.map((Ue)=>`import type * as ${Ue} from "${Fe}";`).join(`
30
- `);let We=je.named.map(({imported:Ue,local:ze})=>{if(!Ue||Ue===ze)return ze;return`${Ue} as ${ze}`}),Ve=je.default[0],Ge=We.length>0?`{ ${We.join(", ")} }`:"";if(Ve&&Ge)return`import type ${Ve}, ${Ge} from "${Fe}";`;if(Ve)return`import type ${Ve} from "${Fe}";`;return`import type ${Ge} from "${Fe}";`})}function A(i,$e){if($e)i.additionalTypeDependencyNodes.push($e)}function hm(i){if(!i.const)return;let $e=i.id?.name;if(!$e)return;let Be=[];for(let Fe of i.members??[]){let je=Fe.initializer;if(je?.type!=="Literal")return;let We=je.value;if(typeof We==="string")Be.push(JSON.stringify(We));else if(typeof We==="number")Be.push(String(We));else return}if(Be.length===0)return;return`type ${$e} = ${Be.join(" | ")};`}function ke(i,$e){let Be=hm($e);if(Be)return Be;if($e.start===void 0||$e.end===void 0)return;let Fe=s(i,$e.start,$e.end)?.trim();return Fe?`declare ${Fe}`:void 0}function re(i,$e){let Be=!1,Fe=[];for(let We of $e.params??[]){if(We.type==="RestElement"){let Xe=We.argument?.name??"rest",Ze=E(i,We.typeAnnotation);if(Ze)Be=!0;A(i,We.typeAnnotation?.typeAnnotation),Fe.push(`...${Xe}: ${Ze??"any[]"}`);continue}let Ve=We.type==="AssignmentPattern",Ge=Ve?We.left:We,Ue=Ge?.name??"arg",ze=E(i,Ge?.typeAnnotation);if(ze)Be=!0;A(i,Ge?.typeAnnotation?.typeAnnotation);let Ke=Ve||We.optional===!0;Fe.push(`${Ue}${Ke?"?":""}: ${ze??"any"}`)}let je=E(i,$e.returnType);if(je)Be=!0;return A(i,$e.returnType?.typeAnnotation),{signature:`(${Fe.join(", ")}) => ${je??"any"}`,hasAnnotations:Be}}function we(i){let $e=i.pendingCallDefaultCandidates.length>0?i.pendingCallDefaultCandidates.slice():void 0,Be=i.pendingConstDefaultCandidates.length>0?i.pendingConstDefaultCandidates.slice():void 0,Fe=i.pendingContextKeyCandidates.length>0?i.pendingContextKeyCandidates.slice():void 0,je=i.pendingDispatchEscapeCandidates.length>0?i.pendingDispatchEscapeCandidates.slice():void 0,We=i.deferredEventNoSourceDiagnostics.length>0?i.deferredEventNoSourceDiagnostics.slice():void 0,Ve={...$e?{pendingCallDefaultCandidates:$e}:{},...Be?{pendingConstDefaultCandidates:Be}:{},...Fe?{pendingContextKeyCandidates:Fe}:{},...je?{pendingDispatchEscapeCandidates:je}:{},...We?{deferredEventNoSourceDiagnostics:We}:{}},Ge=$e!==void 0||Be!==void 0||Fe!==void 0||je!==void 0,Ue=new Set,ze=new Set;for(let et of i.additionalTypeDependencyNodes)c(i,et,Ue,ze);let Ke=i.typedRunesPropsDeclarations.length===1?i.typedRunesPropsDeclarations[0]:void 0,Xe=Ke?.canonicalType;if(Ke&&Xe){for(let et of Ke.referencedImportedTypes)Ue.add(et);for(let et of Ke.referencedLocalTypes)ze.add(et)}if(!Xe&&Ue.size===0&&ze.size===0)return Ge?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],...Ve}:void 0;let Ze=Array.from(ze).map((et)=>i.localTypeDeclarationsByName.get(et)).filter((et)=>et!==void 0).sort((et,nt)=>et.start-nt.start).map((et)=>et.code);return{...Xe?{canonicalPropsType:Xe}:{},canonicalPropNames:Ke&&Xe?Array.from(Ke.props.keys()).sort():[],localTypeDeclarations:Ze,typeImportStatements:fm(i,Ue),referencesComponentGenerics:Xe?dm(Xe,i.generics):!1,...Ve}}var mm=/^[A-Za-z_$][\w$]*/,ym=/[A-Za-z_$][\w$]*/g,Il=/^(?:const|in|out)\s+/;function In(i){let $e=[],Be=0,Fe=0;for(let je=0;je<i.length;je++){let We=i[je];if(We==="<"||We==="("||We==="["||We==="{")Be++;else if(We===">"||We===")"||We==="]"||We==="}")Be=Math.max(Be-1,0);else if(We===","&&Be===0)$e.push(i.slice(Fe,je)),Fe=je+1}return $e.push(i.slice(Fe)),$e}function Ce(i){let $e=In(i).map((Fe)=>Fe.trim()).filter((Fe)=>Fe.length>0);if($e.length===0)return null;return[$e.map((Fe)=>{let je=Fe;while(Il.test(je))je=je.replace(Il,"");return je.match(mm)?.[0]??Fe}).join(", "),$e.join(", ")]}function Pe(i,$e,Be){let Fe=i.scriptGenericsAttribute?.value;if(!Fe)return;for(let[je]of Fe.matchAll(ym)){if(i.typeImportBindingsByLocalName.has(je))$e.add(je);if(Be.has(je))continue;let We=i.localTypeDeclarationsByName.get(je);if(!We)continue;Be.add(je),c(i,We.node,$e,Be)}}var gm=null;function xm(i,$e,Be){let Fe={value:void 0,replace:!1};if(!Be||typeof Be!=="object"||!("type"in Be))return Fe;if(Be.type==="Identifier")Fe.value=Be.name,Fe.replace=!0;else if(Be.type==="Literal")Fe.value=String(Be.value);else if(Be.type==="MemberExpression")Fe.value=J(i,$e,Be);else if((Be.type==="ObjectExpression"||Be.type==="TemplateLiteral")&&"start"in Be&&"end"in Be&&typeof Be.start==="number"&&typeof Be.end==="number")Fe.value=s(i,Be.start,Be.end);return Fe}function bm(i,$e,Be){if(!r(Be))return null;let Fe=Wr(i,Be.name);if(Dn(Fe))return ne(i,$e,Fe).slot_props;let je=$e.findVariableTypeAndDescription(Be.name);if(!je)return null;let We=ws(je.type);if(!We)return null;let Ve={};for(let Ge of We)Ve[Ge.name]={value:Ge.type,replace:!1};return Ve}function ne(i,$e,Be){let Fe={},je=!1;for(let We of Be.properties){if(We.type==="SpreadElement"){let Ge=bm(i,$e,We.argument);if(Ge)Object.assign(Fe,Ge);else je=!0,n(i,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,We));continue}if(We.type!=="Property"||We.computed)continue;let Ve=$e.getPropertyName(We.key);if(!Ve)continue;Fe[Ve]=xm(i,$e,We.value)}return{slot_props:Fe,hasUnresolvedSpread:je}}function Em(i,$e){if(!$e||typeof $e!=="object"||!("type"in $e))return null;if($e.type==="Identifier"){let We=$e,Ve=i.propLocalToPublicName.get(We.name);if(!Ve)return null;return{publicName:Ve,trackingName:We.name}}if($e.type!=="MemberExpression")return null;let Be=$e,Fe=Be.object&&typeof Be.object==="object"&&"type"in Be.object&&Be.object.type==="Identifier"?Be.object.name:void 0;if(!Fe||!i.wholePropsLocals.has(Fe))return null;let je;if(!Be.computed&&Be.property&&typeof Be.property==="object"&&"type"in Be.property){if(Be.property.type==="Identifier")je=Be.property.name;else if(Be.property.type==="Literal"&&Be.property.value!=null)je=String(Be.property.value)}else if(Be.computed&&Be.property&&typeof Be.property==="object"&&"type"in Be.property&&Be.property.type==="Literal"&&"value"in Be.property&&Be.property.value!=null)je=String(Be.property.value);if(!je)return null;return{publicName:je,trackingName:je}}function ve(i,$e){let Be=$e;if(Be&&typeof Be==="object"&&"type"in Be&&Be.type==="ChainExpression")Be=Be.expression;if(!Be||typeof Be!=="object"||!("type"in Be)||Be.type!=="CallExpression")return null;let Fe=Be;if(!Fe.callee||typeof Fe.callee!=="object"||!("type"in Fe.callee))return null;let je=Em(i,Fe.callee);if(!je)return null;return{...je,arguments:Fe.arguments}}function B(i,{slot_name:$e,slot_props:Be,slot_props_unresolved_spread:Fe,slot_fallback:je,slot_description:We,slot_deprecated:Ve,slot_tags:Ge,slot_internal:Ue,source:ze}){let Ke=$e===void 0||$e==="",Xe=Ke?gm:$e??"",Ze=u(je),et=Be===void 0||Be===""?void 0:Be,nt=We?.trim()||void 0;if(i.slots.has(Xe)){let st=i.slots.get(Xe);if(st)i.slots.set(Xe,{...st,default:st.default??Ke,fallback:Ze,slot_props:st.slot_props===void 0?et:st.slot_props,slot_props_unresolved_spread:st.slot_props_unresolved_spread||Fe,description:st.description||nt,deprecated:st.deprecated??Ve,tags:st.tags||Ge,...st.internal||Ue?{internal:!0}:{},source:ze||st.source})}else i.slots.set(Xe,{name:Xe,default:Ke,fallback:Ze,slot_props:et,slot_props_unresolved_spread:Fe,description:nt,deprecated:Ve,tags:Ge,...Ue?{internal:!0}:{},source:ze})}function X(i,$e){let Be=$e.source?.value;if(typeof Be!=="string"||$e.importKind==="type")return;for(let Fe of $e.specifiers??[]){if(Fe.type!=="ImportSpecifier"||Fe.importKind==="type")continue;let je=Fe.local?.name;if(!je)continue;let We=Fe.imported?.name??(typeof Fe.imported?.value==="string"?Fe.imported.value:je);i.valueImportBindingsByLocalName.set(je,{localName:je,importedName:We,source:Be})}}function Ns(i){let $e=i,Be=$e.type==="Program"?$e.body:$e.content?.body??$e.body;return Array.isArray(Be)?Be:void 0}function Ae(i){let $e=new Map,Be=i?Ns(i):void 0;if(!Be)return $e;for(let Fe of Be){let je=Fe;if(je.type!=="ImportDeclaration"||je.importKind==="type")continue;let We=je.source?.value;if(typeof We!=="string")continue;for(let Ve of je.specifiers??[]){let Ge=Ve.local?.name;if(!Ge||Ve.importKind==="type")continue;let Ue;if(Ve.type==="ImportDefaultSpecifier")Ue="default";else if(Ve.type==="ImportNamespaceSpecifier")Ue="*";else Ue=Ve.imported?.name??String(Ve.imported?.value??Ge);$e.set(Ge,{from:We,imported:Ue})}}return $e}function se(i,$e){if(!$e)return;let Be=Ns($e);if(!Be)return;for(let Fe of Be){let je=Fe;if(je.type==="ImportDeclaration"){X(i,je);continue}let We=je.type==="ExportNamedDeclaration"&&je.declaration?je.declaration:je;if(We.type==="FunctionDeclaration"){let Ve=We;if(Ve.id?.name)i.funcDecls.set(Ve.id.name,Ve)}}}var mo=/^\s+/,Ll=/\s/,Cm=/^@[^\s/]+(?=\s|$)/,vm=/^@(\S+)\s*/;function Rl(i){let $e=0;while($e<i.length){let Be=i.charCodeAt($e);if(Be!==32&&Be!==9&&Be!==13&&Be!==10&&!Ll.test(i[$e]))break;$e++}return $e}function Sm(i,$e){let Be=i.slice(Rl(i)),Fe=!1;if($e)Be=Be.slice(3),Fe=!0;else if(Be.startsWith("*")&&!Be.startsWith("*/"))Be=Be.slice(1),Fe=!0;let je=Be.slice(0,Rl(Be));Be=Be.slice(je.length);let We=Be.trimEnd(),Ve=We.endsWith("*/")?We.slice(0,-2):Be;return{indent:Fe?je.slice(1):je,separator:je,content:Ve}}function Tm(i,$e,Be){let Fe=Be>$e&&i.charCodeAt(Be-1)===13?Be-1:Be;return i.slice($e,Fe)}function km(i){let $e=[],Be=0;while(!0){let Fe=i.indexOf("/**",Be);if(Fe===-1)break;let je=i.lastIndexOf(`
31
- `,Fe-1)+1;if(i.charCodeAt(Fe+3)===42||i.slice(je,Fe).trim()!==""){Be=Fe+1;continue}let We=[],Ve=je,Ge=!1,Ue=0;while(Ve<=i.length){let ze=i.indexOf(`
32
- `,Ve),Ke=ze===-1?i.length:ze,Xe=Tm(i,Ve,Ke),{indent:Ze,separator:et,content:nt}=Sm(Xe,We.length===0);We.push({raw:Xe,start:Ve,number:We.length,indent:Ze,separator:et,content:nt});let st=Xe.trimEnd();if(st.endsWith("*/")){Ge=!0,Ue=Ve+st.length,Be=Ke;break}if(ze===-1)break;Ve=ze+1}if(!Ge)break;$e.push({start:Fe,end:Ue,lines:We})}return $e}function Am(i){let $e=i;if($e.length>0&&$e[0].content==="")$e=$e.slice(1);if($e.length>0&&$e[$e.length-1].content==="")$e=$e.slice(0,-1);return $e}function wm(i){let $e=[[]],Be=!1;for(let Fe of i){if(Cm.test(Fe.content)&&!Be)$e.push([Fe]);else $e[$e.length-1].push(Fe);if(Pm(Fe.content,"```")%2===1)Be=!Be}return $e}function Pm(i,$e){let Be=0,Fe=i.indexOf($e);while(Fe!==-1)Be++,Fe=i.indexOf($e,Fe+$e.length);return Be}function Ol(i){return i.map(($e)=>$e.indent+$e.content).join(`
33
- `)}function Nm(i,$e){let Be=$e;while(Be<i.length-1&&i[Be].content.trim()==="")Be++;if(i[Be].content[0]!=="{")return null;let Fe=0,je=[],We=Be;for(;We<i.length;We++){let Ue=i[We].content,ze=0;for(let Ke of Ue){if(Ke==="{")Fe++;else if(Ke==="}")Fe--;if(ze++,Fe===0)break}if(je.push(ze),Fe===0)break}if(Fe!==0)return null;let Ve=We;return{type:je.map((Ue,ze)=>{let Ke=Be+ze,Xe=i[Ke].content.slice(0,Ue);if(i[Ke].content=i[Ke].content.slice(Ue).replace(mo,""),Ke>0)i[Ke].continuesType=!0;return ze===0?Xe:i[Ke].indent+Xe}).join(`
34
- `).slice(1,-1),endIndex:Ve}}function Dm(i){let $e=i.content.match(mo)?.[0]??"",Be=i.content.slice($e.length),Fe=0,je=0;for(let ze of Be){if(Fe===0&&Ll.test(ze))break;if(ze==="[")Fe++;if(ze==="]")Fe--;je++}let We=Fe===0?Be.slice(0,je):"";if(!We)return null;let Ve=We,Ge=!1,Ue;if(We.startsWith("[")&&We.endsWith("]")){Ge=!0;let Ke=We.slice(1,-1).split("=");if(Ve=Ke[0].trim(),Ke.length>1)Ue=Ke.slice(1).join("=").trim();if(!Ve)return null}if(Ve.length>1&&(Ve[0]==='"'||Ve[0]==="'")&&Ve[Ve.length-1]===Ve[0])Ve=Ve.slice(1,-1);return i.content=Be.slice(je).replace(mo,""),{name:Ve,optional:Ge,default:Ue}}function _m(i){let $e=i[0],Be=$e.content.match(vm),Fe=Be?Be[1]:"",je=Be?$e.content.slice(Be[0].length):$e.content,We=je.trimEnd(),Ve=i.slice(1).map((et)=>et.separator+et.content),Ge=(We?[We,...Ve]:Ve).join(`
35
- `);$e.content=je,$e.tag=Fe;let Ue=Nm(i,0),ze=Ue?.type??"",Ke=0;if(Ue){Ke=Ue.endIndex;while(Ke<i.length-1&&i[Ke].content.trim()==="")Ke++}let Xe=Dm(i[Ke]),Ze=Ol(i.slice(Ue?Ue.endIndex:0));return{tag:Fe,name:Xe?.name??"",type:ze,optional:Xe?.optional??!1,default:Xe?.default,description:Ze,raw:Ge,lines:i}}function Im(i,$e,Be){let Fe=Am(i);Fe.forEach((Ve,Ge)=>{Ve.number=Ge});let je=wm(Fe),We=je.slice(1).map(_m);return{description:Ol(je[0]),tags:We,start:$e,end:Be,lines:Fe}}function Gr(i){return km(i).map(({start:$e,end:Be,lines:Fe})=>Im(Fe,$e,Be))}var Rm=/\s*=\s*/;function Ml(i){let $e=i.indexOf("<");if($e===-1||!i.endsWith(">"))return i;let Be=i.slice(0,$e),Fe=i.slice($e+1,-1),je=In(Fe).map((We)=>We.trim().replace(Rm," = ")).join(", ");return`${Be}<${je}>`}var ie=/^\s*$/,Lm=/;$/,Om=/^-\s*/;function Mm(i){return i.split(`
36
- `).map(($e)=>$e.trim()).join(`
37
- `)}function Er(i){if(i===void 0)return;let $e=i.replace(Om,"").trim();return $e===""?"":$e}var $l=new Set(["restProps","slot","snippet","event","typedef","callback"]),yo=new Set(["property","type"]);function Ds(i){if(!i||i.length===0)return;let $e=0;while(i[$e+1]?.continuesType)$e++;return i[$e].content}var Bl=new Set(["since","example","see"]),$m=new Set(["bindable","default","required"]);function Bm(i){let $e=i.trim();return $e===""?!0:$e}function Fl(i,$e){return Bm(`${i??""}${$e?` ${$e}`:""}`)}function Fm(i){let $e=i.trim().replace(Lm,"").trimEnd();if(!$e.startsWith("{")||!$e.endsWith("}"))return!1;let Be=0,Fe=null;for(let je=0;je<$e.length;je++){let We=$e[je];if(Fe!==null){if(We==="\\"){je++;continue}if(We===Fe)Fe=null;continue}if(We==='"'||We==="'"||We==="`"){Fe=We;continue}if(We==="{"||We==="["||We==="(")Be++;else if(We==="}"||We==="]"||We===")"){if(Be--,Be===0&&je<$e.length-1)return!1}}return Be===0}function go(i){let $e=i;if(!$e.startsWith("/*"))$e=`/*${$e}`;if(!$e.endsWith("*/"))$e+="*/";return $e}function jm(i){if(i==="*")return"any";return i.trim()}function jl(i){let $e=Gr(go(i)),{returns:Be}=j($e);return Be?jm(Be.type):void 0}function Vl(i){let $e=Gr(go(i)),{deprecated:Be,passthrough:Fe,internal:je}=j($e),We=Fe.length>0?Fe.map((Ve)=>({name:Ve.tag,body:Ve.raw})):void 0;return{deprecated:Be,tags:We,internal:je}}var Vm=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function oe(i,$e){let Be=i.parsedJsDocByText.get($e);if(Be===void 0)Be=Gr($e),i.parsedJsDocByText.set($e,Be);return Be}function j(i){let $e=i[0]?.tags??[],Be,Fe=[],je,We,Ve,Ge=!1,Ue=[],ze=[],Ke=[];for(let Xe of $e)if(Xe.tag==="type")Be=Xe;else if(Xe.tag==="param")Fe.push(Xe);else if(Xe.tag==="returns"||Xe.tag==="return")je=Xe;else if(Xe.tag==="deprecated")Ve??=Fl(Xe.name,Xe.description);else if(Xe.tag==="ignore"||Xe.tag==="internal")Ge=!0;else if(Xe.tag==="sveld-ignore")Ke.push(Xe.name);else if(Bl.has(Xe.tag))ze.push(Xe);else if(Xe.tag==="bindable"){if(Xe.type)continue;let Ze=`${Xe.name}${Xe.description?` ${Xe.description}`:""}`.trim();if(Ze==="readonly"||Ze==="writable")We??=Ze}else if(!Vm.has(Xe.tag))Ue.push(Xe);return{type:Be,param:Fe,returns:je,binding:We,deprecated:Ve,internal:Ge,additional:Ue,passthrough:ze,ignore:Ke,description:i[0]?.description}}function Wm(i,$e){if(typeof $e.start!=="number"||typeof $e.end!=="number")return;let Be=i.jsDocBlocksByStart.get($e.start);if(Be===void 0||Be.end!==$e.end)return;return[Be]}function qm(i){if(!i||i.length===0)return;let $e=i[i.length-1];return $e&&typeof $e==="object"&&"value"in $e?$e:void 0}function Wl(i,$e,Be){if(!$e||$e.length===0||Be===void 0||!i.source)return;for(let Fe=$e.length-1;Fe>=0;Fe--){let je=$e[Fe];if(!je||typeof je!=="object"||!("value"in je)||!("end"in je))continue;if(typeof je.end!=="number"||!("start"in je)||typeof je.start!=="number")continue;let We=i.source.slice(je.end,Be);if(ie.test(We))return je}return}function Gm(i){let $e=new Set,Be=(je)=>{let{leadingComments:We,start:Ve}=je,Ge=Wl(i,We,Ve);if(Ge)$e.add(Ge.start)};for(let je of i.funcDecls.values())Be(je);let Fe=[{root:i.parsed?.module,isModule:!0},{root:i.parsed?.instance,isModule:!1}];for(let{root:je,isModule:We}of Fe)for(let Ve of(je&&Ns(je))??[]){let Ge=Ve,Ue=Ge.type==="ExportNamedDeclaration",ze=Ue?Ge.declaration:Ge;if(ze?.type==="FunctionDeclaration"){if(Ue)Be(Ge)}else if(ze?.type==="VariableDeclaration"&&(We||!Ue)&&ze.declarations?.length===1&&Um.has(ze.declarations[0].init?.type??""))Be(Ge)}return $e}var Um=new Set(["ArrowFunctionExpression","FunctionExpression"]);function d(i,$e,Be){if(!Be?.leadingComments)return;let Fe=Wl(i,Be.leadingComments,Be.start);if(!Fe)return;return Hm(i,$e,[Fe])}function De(i,$e,Be){if(!Be?.leadingComments)return;return d(i,$e,Be)}function ql(i,$e,Be){let Fe=i;if($e)Fe=`${i} extends ${$e}`;if(Be)Fe+=` = ${Be}`;return Fe}function Hm(i,$e,Be){if(!Be)return;let Fe=qm(Be);if(!Fe)return;let je=Wm(i,Fe)??oe(i,go(Fe.value)),{type:We,param:Ve,returns:Ge,binding:Ue,deprecated:ze,internal:Ke,additional:Xe,passthrough:Ze,ignore:et,description:nt}=j(je),st,ot,ut,mt;if(We)st=$e.aliasType(We.type);if(Ve.length>0)ot=Ve.filter((wt)=>!wt.name.includes(".")).map((wt)=>({name:wt.name,type:$e.aliasType(wt.type),description:Er(Mm(wt.description)),optional:wt.optional||!1}));if(Ge)ut=$e.aliasType(Ge.type);let it,ft=Xe;if(typeof Fe.start==="number"&&i.functionDocCommentStarts.has(Fe.start)){let wt=Xe.filter((Pt)=>Pt.tag==="template"&&Pt.name);if(wt.length>0)it=wt.map((Pt)=>ql(Pt.name,$e.aliasType(Pt.type),Pt.default)).join(", "),ft=Xe.filter((Pt)=>Pt.tag!=="template")}let yt=u(nt?.trim());if(yt||ft.length>0){let wt=[];if(yt)wt.push(yt);for(let Pt of ft){let qe=`@${Pt.tag}${Pt.name?` ${Pt.name}`:""}${Pt.description?` ${Pt.description}`:""}`;wt.push(qe)}mt=wt.join(`
38
- `)}let kt=Ze.length>0?Ze.map((wt)=>({name:wt.tag,body:wt.raw})):void 0;return{type:st,params:ot,returnType:ut,description:mt,binding:Ue,deprecated:ze,tags:kt,sveldIgnore:et.length>0?et:void 0,internal:Ke,typeParameters:it}}function _e(i,$e,Be=i.source){if(!Be)return;let Fe=!1,je=!1,We=!1,Ve=new Set,Ge=()=>{if(Fe&&je&&!We){We=!0;let nt=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${nt}; their declarations are combined in the order encountered.`)}},Ue=(nt,st)=>{if(Ve.has(nt))n(i,"generics-conflict",nt,`Duplicate generic name "${nt}".`,st);else Ve.add(nt)},ze=(nt,st)=>{if(i.generics){let ut=In(i.generics[0]).map((mt)=>mt.trim()).indexOf(nt.trim());if(ut!==-1){let mt=In(i.generics[1]).map((it)=>it.trim());mt[ut]=st,i.generics=[i.generics[0],mt.join(", ")];return}}$e.accumulateGeneric(nt,st)},Ke=(nt,st)=>{if(i.typedefs.has(nt))n(i,"typedef-duplicate",nt,`Duplicate typedef/callback name "${nt}"; the later declaration overwrites the earlier one.`,st)},Xe=(nt,st,ot,ut)=>{let mt=nt.findIndex((it)=>it.name===st.name);if(mt===-1)nt.push(st);else{let it=ot?` of "${ot}"`:"";n(i,"property-duplicate",st.name,`Duplicate property "${st.name}"${it}; the later declaration overwrites the earlier one.`,ut),nt[mt]=st}},Ze=Be.includes("@template")?Gm(i):new Set;i.functionDocCommentStarts=Ze;let et=Gr(Be);for(let nt of et)i.jsDocBlocksByStart.set(nt.start,nt);for(let{tags:nt,description:st,lines:ot,start:ut}of et){let mt=Ze.has(ut),it,ft,yt,kt,wt=!1,Pt,qe,He=[],Je=[],Qe=[],tt,rt,at,pt,lt=[],ct=!1,dt=[],ht,gt,xt,St=[],Wt=!1,Kt=[],Qt,zt,Pn=!1,qt=!0,Zt=[],Ei,Qn=!1,Dr=new Map,Ci=new Set,_r=new Set;for(let Ct of nt)if(Ct.lines.length>0)Ci.add(Ct.lines[0].number);for(let Ct of ot)if(Ct.continuesType)Ci.add(Ct.number);let vi=new Set,Si=!1;for(let Ct of ot){if(!Ct.tag&&!Ct.continuesType&&Ct.content&&Ct.content.trim()!=="}")Dr.set(Ct.number,Ct.content);if(Ct.tag!==void 0||Ct.continuesType)Si=!0;else if(Si&&Ct.indent&&Ct.content.trim())vi.add(Ct.number);else Si=!1}let Zu=(Ct)=>{if(!Ct||Ct.length===0)return;let Mt=Ct[0].number,Xt=[],At=[],nn=!1;for(let Ot=Mt-1;Ot>=0;Ot--){if(Ci.has(Ot)||vi.has(Ot))break;let Gt=Dr.get(Ot);if(Gt)Xt.unshift(Gt),At.unshift(Ot),nn=!0;else if(nn){let rn=ot[Ot];if(!(!rn||!rn.tag&&(!rn.content||rn.content.trim()==="")))break}}if(Xt.length===0)return;for(let Ot of At)_r.add(Ot);return Xt.join(`
39
- `).trim()},pr=(Ct,Mt)=>{let Xt=Er(Ds(Ct)),At=Mt!==void 0&&$l.has(Mt.tag)&&!Er(Ds(Mt.lines)),nn=it!==void 0&&(Mt===void 0||!yo.has(Mt.tag)),Ot=[];for(let Gt=1;Gt<Ct.length;Gt++){let rn=Ct[Gt];if((At||nn)&&!vi.has(rn.number))continue;let $t=Dr.get(rn.number)?.trim();if(!$t||_r.has(rn.number))continue;Ot.push($t),_r.add(rn.number)}if(Ot.length===0)return Xt;return[Xt,...Ot].filter(Boolean).join(`
40
- `)},ed=(Ct,Mt,Xt,At)=>{if(it===void 0||yt)return;if(At?.tag!=="event"&&!yo.has(At?.tag??""))return;if(Er(Ds(Xt)))return;let nn=Mt?`@${Ct} "${Mt}"`:`@${Ct}`;n(i,"event-description-ambiguous",it,`Text after @event "${it}" was used as the description of ${nn}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,xn(i,Xt))},va=()=>{if(it!==void 0){let Ct=ft&&ft!=="object"&&ft!=="Object"?ft:void 0,Mt;if(Ct)Mt=Ct;else if(Qe.length>0)Mt=Ps(Qe,it,!0);else Mt=ft||"";if(qe!==void 0){let Xt;for(let Ot of nt){let Gt=Ot.lines[0]?.number;if(typeof Gt!=="number")continue;if(Gt<=qe)continue;if(yo.has(Ot.tag))continue;Xt=Gt;break}let At=[],nn=Array.from(Dr.keys()).sort((Ot,Gt)=>Ot-Gt);for(let Ot of nn){if(Ot<=qe)continue;if(Xt!==void 0&&Ot>=Xt)continue;if(_r.has(Ot))continue;let rn=Dr.get(Ot)?.trim();if(rn)At.push(rn),_r.add(Ot)}if(At.length>0){let Ot=At.join(`
41
- `);yt=yt?`${yt}
42
- ${Ot}`:Ot}}y(i,{name:it,detail:Mt,has_argument:!1,description:yt,deprecated:kt,tags:He.length>0?He:void 0,internal:wt||void 0,source:Pt}),i.eventDescriptions.set(it,yt),i.jsDocEventNames.add(it),i.jsDocEventSources.set(it,Pt),l(i,"event-no-source",it,Je),Qe.length=0,it=void 0,ft=void 0,yt=void 0,kt=void 0,wt=!1,Pt=void 0,qe=void 0,He=[],Je=[]}},Sa=()=>{if(tt!==void 0){let Ct,Mt;if(dt.length>0)Ct=Ps(dt,void 0,!0),Mt=`type ${tt} = ${Ct};`;else if(rt)Ct=rt,Mt=Fm(Ct)?`interface ${tt} ${Ct}`:`type ${tt} = ${Ct};`;else Ct="{}",Mt=`type ${tt} = ${Ct};`;Ke(tt,pt),i.typedefs.set(tt,{type:Ct,name:tt,description:u(at),ts:Mt,tags:lt.length>0?lt:void 0,...ct?{internal:!0}:{},source:pt}),dt.length=0,tt=void 0,rt=void 0,at=void 0,pt=void 0,lt=[],ct=!1}},Ta=()=>{if(ht!==void 0){let Xt=`(${Kt.map(({name:nn,type:Ot,optional:Gt})=>`${nn}${Gt?"?":""}: ${Ot}`).join(", ")}) => ${Qt||"void"}`,At=`type ${ht} = ${Xt};`;Ke(ht,xt),i.typedefs.set(ht,{type:Xt,name:ht,description:u(gt),ts:At,tags:St.length>0?St:void 0,...Wt?{internal:!0}:{},source:xt}),Kt.length=0,Qt=void 0,ht=void 0,gt=void 0,xt=void 0,St=[],Wt=!1}},td=nt.some((Ct)=>Ct.tag==="slot"||Ct.tag==="snippet"),nd=nt.some((Ct)=>Ct.tag==="extends"||Ct.tag==="extendProps"),rd=nt.some((Ct)=>Ct.tag==="slot"||Ct.tag==="snippet"||Ct.tag==="event"||Ct.tag==="typedef"||Ct.tag==="callback");for(let Ct=0;Ct<nt.length;Ct++){let{tag:Mt,type:Xt,name:At,description:nn,optional:Ot,default:Gt,raw:rn,lines:$t}=nt[Ct],ur=nt[Ct+1],mn=$e.aliasType(Xt),dr=$l.has(Mt)?Zu($t):void 0;if(dr)ed(Mt,At,$t,nt[Ct-1]);switch(Mt){case"extends":case"extendProps":if(i.extends!==void 0)n(i,"extend-props-duplicate",At,`A second @extends/@extendProps tag ("${At}") overwrote the first ("${i.extends.interface}"); only one is used.`,xn(i,$t));if(i.extends={interface:At,import:mn},qt)qt=!1;break;case"restProps":{let Bt=At?nn?`${At} ${nn}`:At:nn,Un=Er(Bt)||dr;if(!Un&&qt&&!Pn&&st)Un=st,Pn=!0;if(i.rest_props={type:"Element",name:mn,description:Un||void 0},qt)qt=!1;break}case"slot":case"snippet":{let ln=pr($t,ur);if(!ln&&qt&&!Pn&&st)ln=st,Pn=!0;if(!ln&&Zt.length===0)ln=dr;if(qt)qt=!1;let Un=mn;if(!Un)Un="Record<string, never>",n(i,"slot-missing-type",At||"default",`@${Mt}${At?` "${At}"`:""} is missing a required {Type} annotation; falling back to "${Un}".`,xn(i,$t));B(i,{slot_name:At,slot_props:Un,slot_description:ln||void 0,slot_deprecated:Ei,slot_tags:Zt.length>0?[...Zt]:void 0,slot_internal:Qn||void 0,source:xn(i,$t)}),Zt.length=0,Ei=void 0,Qn=!1;{let sd=At===void 0||At===""?null:At;zt=(id)=>{let Ti=i.slots.get(sd);if(Ti)Ti.tags=[...Ti.tags??[],id]}}break}case"csspart":{let Bt=pr($t,ur);i.cssParts.push({name:At,...Bt?{description:Bt}:{}});break}case"cssprop":case"cssproperty":{let Bt=pr($t,ur);i.cssProperties.push({name:At,...mn?{type:mn}:{},...Gt===void 0?{}:{default:Gt},...Bt?{description:Bt}:{}});break}case"event":{if(va(),it=At,ft=mn,qe=$t.length>0?$t[0].number:void 0,yt=Er(Ds($t))||dr,!yt&&qt&&!Pn&&st)yt=st,Pn=!0;if(Pt=xn(i,$t),Zt.length>0)He.push(...Zt),Zt.length=0;if(zt=(ln)=>He.push(ln),qt)qt=!1;break}case"type":if(it!==void 0)ft=mn;break;case"param":if(ht!==void 0)Kt.push({name:At,type:mn,optional:Ot||!1});break;case"returns":case"return":if(ht!==void 0)Qt=mn;break;case"property":{let Bt={name:At,type:mn,description:pr($t,ur),optional:Ot||!1,default:Gt};if(it!==void 0)Xe(Qe,Bt,it,xn(i,$t));else if(tt!==void 0)Xe(dt,Bt,tt,xn(i,$t));break}case"typedef":{if(Sa(),tt=Ml(At),rt=mn,pt=xn(i,$t),at=pr($t,ur)||dr,!at&&qt&&!Pn&&st)at=st,Pn=!0;if(Zt.length>0)lt.push(...Zt),Zt.length=0;if(ct=Qn,Qn=!1,zt=(ln)=>lt.push(ln),qt)qt=!1;break}case"callback":{if(Ta(),ht=Ml(At),xt=xn(i,$t),gt=pr($t,ur)||dr,!gt&&qt&&!Pn&&st)gt=st,Pn=!0;if(Zt.length>0)St.push(...Zt),Zt.length=0;if(Wt=Qn,Qn=!1,zt=(ln)=>St.push(ln),qt)qt=!1;break}case"generics":{let Bt=mn||At;for(let ln of In(At))Ue(ln.trim(),xn(i,$t));if(Fe=!0,Ge(),ze(At,Bt),qt)qt=!1;break}case"template":{let Bt=ql(At,mn,Gt);if(td&&!nd){i.deferredSlotBlockGenerics.push({name:At,constraint:Bt});break}if(mt)break;if(Ue(At,xn(i,$t)),je=!0,Ge(),ze(At,Bt),qt)qt=!1;break}case"deprecated":{let Bt=Fl(At,nn);if(it===void 0)Ei??=Bt;else kt??=Bt;break}case"ignore":case"internal":{if(it===void 0)Qn=!0;else wt=!0;break}case"sveld-ignore":if(it!==void 0)Je.push(At);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let Bt={name:Mt,body:rn};if(!Bl.has(Mt)&&!$m.has(Mt))n(i,"jsdoc-unknown-tag",Mt,`Unknown JSDoc tag "@${Mt}"; passed through unchanged. If this is a typo, fix the tag name.`,xn(i,$t));if(zt)zt(Bt);else Zt.push(Bt)}break}}if(va(),Sa(),Ta(),rd&&Zt.length>0){for(let Ct of Zt)n(i,"jsdoc-tag-dropped",Ct.name,`@${Ct.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);Zt.length=0}}}function ae(i){return i==="TSTypeAnnotation"||i==="TSTypeAliasDeclaration"||i==="TSInterfaceDeclaration"||i==="TSTypeParameterDeclaration"||i==="TSTypeParameterInstantiation"}function x(i,$e,Be,Fe){xo(i,null,null,$e,Be,Fe?.skipTypeOnlySubtrees===!0)}function xo(i,$e,Be,Fe,je,We){Fe(i,$e,Be);let Ve=i.type;if((Ve==="Identifier"||Ve==="Literal"||Ve==="Text")&&i.typeAnnotation===void 0){if(je)je(i);return}if(We&&Ve.charCodeAt(0)===84&&ae(Ve)){if(je)je(i);return}for(let Ge in i){if(Ge==="leadingComments")continue;let Ue=i[Ge];if(!Ue||typeof Ue!=="object")continue;if(Array.isArray(Ue))for(let ze=0;ze<Ue.length;ze++){let Ke=Ue[ze];if(Ke&&typeof Ke==="object"&&typeof Ke.type==="string")xo(Ke,i,Ge,Fe,je,We)}else if(typeof Ue.type==="string")xo(Ue,i,Ge,Fe,je,We)}if(je)je(i)}import Gl,{sep as bo}from"node:path";var Rn=/\.svelte$/,Ul=/\.(?:svelte|[mc]?ts|[mc]?js)$/;function _s(i){if(!i.endsWith(".svelte"))return!1;let $e=i.length-7;if($e===0)return!1;let Be=i.charCodeAt($e-1);return Be!==47&&(bo==="/"||Be!==92)}function e(i){return bo==="/"?i:i.split(bo).join("/")}function Is(i,$e){return e(Gl.join($e,Gl.normalize(i)))}function sr(i){return`${JSON.stringify(i,null,2)}
43
- `}var Hl="sveld",Rs="0.37.6";var Kl={name:Hl,version:Rs,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 Ur="5.57.0";var Ls=1,zl=new WeakMap;function Jn(i){return i.some(($e)=>$e.internal)?i.filter(($e)=>!$e.internal):i}function zm(i){return{...i,props:Jn(i.props),moduleExports:Jn(i.moduleExports),slots:Jn(i.slots),events:Jn(i.events),typedefs:Jn(i.typedefs),...i.contexts?{contexts:Jn(i.contexts).map(($e)=>({...$e,properties:Jn($e.properties)}))}:{}}}function o(i,$e={}){let Be=zl.get(i),Fe=Be?.get($e.entryExports);if(Fe)return Fe;let je=Array.from(i,([,Ge])=>{let{diagnostics:Ue,...ze}=Ge;return zm(ze)}).sort((Ge,Ue)=>Ge.moduleName.localeCompare(Ue.moduleName)),We={schemaVersion:Ls,generator:{name:Hl,version:Rs,svelteVersion:Ur},total:je.length,components:je},Ve=$e.entryExports?Jn($e.entryExports):void 0;if(Ve&&Ve.length>0)We.totalExports=Ve.length,We.exports=Ve;if(!Be)Be=new Map,zl.set(i,Be);return Be.set($e.entryExports,We),We}import{readFile as Xm}from"node:fs/promises";import Jm from"node:path";var Ym=/[:=]/,Os={none:0,patch:1,minor:2,major:3};function Qm(i,$e){return Os[$e]>Os[i]?$e:i}function Zm(i){return i.reduce(($e,Be)=>Qm($e,Be.bump),"none")}function $s(i,$e){return Os[i]>=Os[$e]}function ep(i,$e){let Be=[],Fe=0,je="",We=null;for(let Ve=0;Ve<i.length;Ve++){let Ge=i[Ve];if(We){if(je+=Ge,Ge==="\\")Ve++,je+=i[Ve]??"";else if(Ge===We)We=null;continue}if(Ge==='"'||Ge==="'"||Ge==="`"){We=Ge,je+=Ge;continue}if(Ge==="<"||Ge==="("||Ge==="{"||Ge==="[")Fe++;if(Ge===">"||Ge===")"||Ge==="}"||Ge==="]")Fe--;if(Ge===$e&&Fe===0){Be.push(je.trim()),je="";continue}je+=Ge}return Be.push(je.trim()),Be}function Xl(i){return new Set(ep(i,"|").filter(($e)=>$e.length>0))}function ey(i){let $e=0,Be=null;for(let Fe=0;Fe<i.length;Fe++){let je=i[Fe];if(Be){if(je==="\\")Fe++;else if(je===Be)Be=null;continue}if(je==='"'||je==="'"||je==="`"){Be=je;continue}if(je==="<"||je==="("||je==="{"||je==="[")$e++;if(je===">"||je===")"||je==="}"||je==="]")$e--;if($e===0&&je==="="&&i[Fe+1]===">")return Fe}return-1}function Jl(i){let $e=ey(i);if($e===-1)return;let Be=i.slice(0,$e).trim(),Fe=i.slice($e+2).trim();if(!Be.startsWith("(")||!Be.endsWith(")"))return;let je=Be.slice(1,-1).trim();return{params:je.length===0?[]:ep(je,","),returnType:Fe}}function ty(i){return(i.split(Ym,1)[0]??"").trimEnd().endsWith("?")}function ny(i,$e){if(i.returnType!==$e.returnType)return"major";if($e.params.length<i.params.length)return"major";for(let Fe=0;Fe<i.params.length;Fe++)if(i.params[Fe]!==$e.params[Fe])return"major";if($e.params.length===i.params.length)return"none";return $e.params.slice(i.params.length).every(ty)?"minor":"major"}function Co(i,$e){if(i===$e)return"none";if(i===void 0||$e===void 0)return"major";let Be=Jl(i),Fe=Jl($e);if(Be&&Fe)return ny(Be,Fe);let je=Xl(i),We=Xl($e),Ve=[...We].some((Ue)=>!je.has(Ue)),Ge=[...je].some((Ue)=>!We.has(Ue));if(!Ve&&!Ge)return"none";if(Ve&&!Ge)return"minor";if(Ge&&!Ve)return"major";return"major"}function Yl(i){return i.bindable===!0||i.binding==="writable"}function Ql(i,$e,Be,Fe){let je=$e==="prop"?"prop":"export",We=[],Ve=new Map(Be.map((Ue)=>[Ue.name,Ue])),Ge=new Map(Fe.map((Ue)=>[Ue.name,Ue]));for(let[Ue,ze]of Ge){if(Ve.has(Ue))continue;We.push({component:i,kind:$e,name:Ue,bump:ze.isRequired?"major":"minor",message:`${je} "${Ue}" added${ze.isRequired?" (required)":""}`})}for(let[Ue]of Ve){if(Ge.has(Ue))continue;We.push({component:i,kind:$e,name:Ue,bump:"major",message:`${je} "${Ue}" removed`})}for(let[Ue,ze]of Ve){let Ke=Ge.get(Ue);if(!Ke)continue;if(ze.isRequired!==Ke.isRequired)We.push({component:i,kind:$e,name:Ue,bump:Ke.isRequired?"major":"minor",message:`${je} "${Ue}" became ${Ke.isRequired?"required":"optional"}`});let Xe=Co(ze.type,Ke.type);if(Xe!=="none")We.push({component:i,kind:$e,name:Ue,bump:Xe,message:`${je} "${Ue}" type changed from \`${ze.type??"unknown"}\` to \`${Ke.type??"unknown"}\``});let Ze=Yl(ze),et=Yl(Ke);if(Ze!==et)We.push({component:i,kind:$e,name:Ue,bump:et?"minor":"major",message:`${je} "${Ue}" ${et?"gained a writable binding":"lost its writable binding"}`});if(ze.value!==Ke.value&&Xe==="none")We.push({component:i,kind:$e,name:Ue,bump:"patch",message:`${je} "${Ue}" default changed from \`${ze.value??"none"}\` to \`${Ke.value??"none"}\``});let nt=ze.deprecated!==void 0,st=Ke.deprecated!==void 0;if(nt!==st)We.push({component:i,kind:$e,name:Ue,bump:st?"minor":"patch",message:`${je} "${Ue}" ${st?"marked as deprecated":"no longer deprecated"}`});if(ze.constant!==Ke.constant)We.push({component:i,kind:$e,name:Ue,bump:"minor",message:`${je} "${Ue}" ${Ke.constant?"became constant":"became mutable"}`});if(ze.reactive!==Ke.reactive)We.push({component:i,kind:$e,name:Ue,bump:"minor",message:`${je} "${Ue}" ${Ke.reactive?"became reactive":"stopped being reactive"}`})}return We}function ry(i,$e,Be){let Fe=[],je=new Map($e.map((Ve)=>[Ve.name,Ve])),We=new Map(Be.map((Ve)=>[Ve.name,Ve]));for(let[Ve]of We){if(je.has(Ve))continue;Fe.push({component:i,kind:"event",name:Ve,bump:"minor",message:`event "${Ve}" added`})}for(let[Ve]of je){if(We.has(Ve))continue;Fe.push({component:i,kind:"event",name:Ve,bump:"major",message:`event "${Ve}" removed`})}for(let[Ve,Ge]of je){let Ue=We.get(Ve);if(!Ue)continue;if(Ge.type!==Ue.type){Fe.push({component:i,kind:"event",name:Ve,bump:"major",message:`event "${Ve}" changed from ${Ge.type} to ${Ue.type}`});continue}let ze=Ge.type==="dispatched"?Ge.detail:void 0,Ke=Ue.type==="dispatched"?Ue.detail:void 0,Xe=Co(ze,Ke);if(Xe!=="none")Fe.push({component:i,kind:"event",name:Ve,bump:Xe,message:`event "${Ve}" detail changed from \`${ze??"unknown"}\` to \`${Ke??"unknown"}\``})}return Fe}function Zl(i){return i.name??"default"}function sy(i,$e,Be){let Fe=[],je=new Map($e.map((Ve)=>[Zl(Ve),Ve])),We=new Map(Be.map((Ve)=>[Zl(Ve),Ve]));for(let[Ve]of We){if(je.has(Ve))continue;Fe.push({component:i,kind:"slot",name:Ve,bump:"minor",message:`slot "${Ve}" added`})}for(let[Ve]of je){if(We.has(Ve))continue;Fe.push({component:i,kind:"slot",name:Ve,bump:"major",message:`slot "${Ve}" removed`})}for(let[Ve,Ge]of je){let Ue=We.get(Ve);if(!Ue)continue;let ze=Co(Ge.slot_props,Ue.slot_props);if(ze!=="none")Fe.push({component:i,kind:"slot",name:Ve,bump:ze,message:`slot "${Ve}" props changed from \`${Ge.slot_props??"none"}\` to \`${Ue.slot_props??"none"}\``})}return Fe}var iy=new Set(["description","source","componentCommentSource","tags"]);function Ms(i){if(Array.isArray(i))return i.map(Ms);if(i!==null&&typeof i==="object"){let $e={};for(let[Be,Fe]of Object.entries(i)){if(iy.has(Be))continue;$e[Be]=Ms(Fe)}return $e}return i}var oy=["generics","rest_props","extends","contexts","typedefs"];function ay(i,$e,Be){let Fe=[];for(let je of oy){let We=JSON.stringify(Ms($e[je])),Ve=JSON.stringify(Ms(Be[je]));if(We!==Ve)Fe.push({component:i,kind:"shape",name:je,bump:"major",message:`"${je}" changed (breaking)`})}return Fe}function cy(i,$e){let Be=$e.moduleName;return[...Ql(Be,"prop",i.props,$e.props),...Ql(Be,"moduleExport",i.moduleExports,$e.moduleExports),...ry(Be,i.events,$e.events),...sy(Be,i.slots,$e.slots),...ay(Be,i,$e)]}function Ne(i,$e){let Be=[],Fe=new Map(i.components.map((We)=>[We.moduleName,We])),je=new Map($e.components.map((We)=>[We.moduleName,We]));for(let[We]of je){if(Fe.has(We))continue;Be.push({component:We,kind:"component",bump:"minor",message:`component "${We}" added`})}for(let[We]of Fe){if(je.has(We))continue;Be.push({component:We,kind:"component",bump:"major",message:`component "${We}" removed`})}for(let[We,Ve]of Fe){let Ge=je.get(We);if(!Ge)continue;Be.push(...cy(Ve,Ge))}return Be}async function ly(i){let $e;try{$e=await Xm(Jm.resolve(i),"utf-8")}catch(Be){if(Be.code==="ENOENT")return null;throw Be}try{return JSON.parse($e)}catch{throw Error(`sveld: could not parse "${i}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function Q(i){if(typeof i.check==="string")return i.check;return i.jsonOptions?.outFile??"COMPONENT_API.json"}async function F(i,$e,Be={}){let Fe=await ly($e);if(Fe===null)return{snapshotExists:!1,snapshotFile:$e,changes:[],bump:"none"};if(Fe.schemaVersion!==Ls)return{snapshotExists:!0,snapshotFile:$e,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${Fe.schemaVersion} differs from ${Ls}; regenerate the snapshot`}],bump:"none"};let je=o(i,{entryExports:Be.entryExports}),We=Ne(Fe,je);return{snapshotExists:!0,snapshotFile:$e,changes:We,bump:Zm(We)}}var py={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function ce(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 $e=[],Be=i.changes.length;$e.push(`sveld --check: ${Be} API change${Be===1?"":"s"} detected against "${i.snapshotFile}".`),$e.push(`Suggested semver bump: ${i.bump}.`);let Fe=new Map;for(let je of i.changes){let We=Fe.get(je.component)??[];We.push(je),Fe.set(je.component,We)}for(let[je,We]of Fe){$e.push(""),$e.push(` ${je}`);for(let Ve of We){let Ge=Ve.kind==="schema"?"schema":py[Ve.bump];$e.push(` [${Ge}] ${Ve.message}`)}}return $e.join(`
44
- `)}var Ie=1;function ue(i){let $e={kind:"check-report",schemaVersion:Ie,...i};return sr($e)}import{existsSync as dy}from"node:fs";import{join as fy}from"node:path";import{pathToFileURL as hy}from"node:url";function uy(i,$e){let Be=i.length+1,Fe=$e.length+1,je=Array.from({length:Be},()=>Array(Fe).fill(0));for(let We=0;We<Be;We++)je[We][0]=We;for(let We=0;We<Fe;We++)je[0][We]=We;for(let We=1;We<Be;We++)for(let Ve=1;Ve<Fe;Ve++){let Ge=i[We-1]===$e[Ve-1]?0:1;je[We][Ve]=Math.min(je[We-1][Ve]+1,je[We][Ve-1]+1,je[We-1][Ve-1]+Ge)}return je[Be-1][Fe-1]}function Bs(i,$e){let Be,Fe=Number.POSITIVE_INFINITY;for(let je of $e){let We=uy(i,je);if(We<Fe)Be=je,Fe=We}if(Be===void 0||Fe>3)return;return Be}var my=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function Oe(i){return i}function yy(i=process.cwd()){for(let $e of my){let Be=fy(i,$e);if(dy(Be))return Be}return null}async function vo(i){let $e;try{$e=await import(`${hy(i).href}?t=${Date.now()}`)}catch(Fe){let je=Fe instanceof Error?Fe.message:String(Fe);throw Error(`sveld: failed to load config file "${i}".
45
- ${je}`)}let Be=$e.default;if(!Vt(Be)||Array.isArray(Be))throw Error(`sveld: config file "${i}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return Be}async function N(i=process.cwd()){let $e=yy(i);if($e===null)return{};return vo($e)}function S(...i){let $e={};for(let Be of i){if(!Be)continue;for(let[Fe,je]of Object.entries(Be)){let We=$e[Fe];$e[Fe]=Vt(We)&&!Array.isArray(We)&&Vt(je)&&!Array.isArray(je)?{...We,...je}:je}}return $e}var gy={ci:{strict:!0,reportDiagnostics:!0,check:!0,checkExamples:!0},local:{reportDiagnostics:!0}};function Y(i){let{strict:$e,...Be}=i;if($e!=="ci"&&$e!=="local")return i;return{...gy[$e],...Be}}var tp=["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"],xy={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 np(i,$e,Be){let Fe=i===null?$e:`${i}.${$e}`,je=Bs($e,Be),We=je===void 0?void 0:i===null?je:`${i}.${je}`;console.warn(`sveld: unknown option "${Fe}".${We?` Did you mean "${We}"?`:""}`)}function I(i){for(let $e of Object.keys(i))if(!tp.includes($e))np(null,$e,tp);for(let[$e,Be]of Object.entries(xy)){let Fe=i[$e];if(!Vt(Fe))continue;for(let je of Object.keys(Fe))if(!Be.includes(je))np($e,je,Be)}}var Fs=new Map;function C(i,$e){if(!$e?.replace&&Fs.has(i.name))throw Error(`sveld: a writer named "${i.name}" is already registered. Pass { replace: true } to overwrite it.`);Fs.set(i.name,i)}function Z(i){return Fs.get(i)}function Me(){return Array.from(Fs.values())}import{dirname as ju,isAbsolute as Cb,resolve as vb}from"node:path";import{existsSync as lu,lstatSync as du,readFileSync as Ux,realpathSync as Hx,statSync as fu}from"node:fs";import{readFile as Kx}from"node:fs/promises";import{basename as zx,dirname as hu,extname as Xx,isAbsolute as Jx,join as pu,parse as Yx,relative as Qo,resolve as wr}from"node:path";function Hr(i){return i}function Vn(i){if(i==="")return i;return i.startsWith(".")?i:`./${i}`}import{dirname as sp,resolve as ip}from"node:path";var by=/^(['"])(.*)\1$/,op=/^[./]/,Ey=/import\(\s*(['"])((?:(?!\1).)+)\1\s*\)/g;function Cy(i,$e){let Be=i.extends?.import;if(Be===void 0)return null;let Fe=Be.replace(by,"$2");if(!op.test(Fe))return null;return ip(sp($e),Fe)}function rp(i,$e){let Be=[];for(let Fe of i.matchAll(Ey)){let je=Fe[2];if(!op.test(je))continue;Be.push(ip(sp($e),je))}return Be}function vy(i,$e){let Be=[],Fe=Cy(i,$e);if(Fe!==null)Be.push(Fe);for(let je of i.typedefs??[])Be.push(...rp(je.type,$e));for(let je of i.props)if(je.type)Be.push(...rp(je.type,$e));return Be}function Kr(i,$e){let Be=new Map;for(let Fe of i.values()){let je=$e(Fe.filePath);for(let We of vy(Fe,je)){let Ve=Be.get(We);if(Ve===void 0)Ve=new Set,Be.set(We,Ve);Ve.add(je)}}return Be}function js(i,$e){let Be=new Set,Fe=[];for(let je of i)if(!Be.has(je))Be.add(je),Fe.push(je);while(Fe.length>0){let je=Fe.shift(),We=$e.get(je);if(We===void 0)continue;for(let Ve of We)if(!Be.has(Ve))Be.add(Ve),Fe.push(Ve)}return Be}var Sy=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,Ty=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),ky=new Set(["svelte","html"]);function Ay(i){let $e=i.trim();if($e==="")return null;let Be=$e.match(Sy);if(Be){let Fe=Be[1].toLowerCase(),je=Be[2].trim();if(je==="")return null;if(Ty.has(Fe))return{kind:"compile",code:je};if(ky.has(Fe))return{kind:"syntax",code:je};return null}if($e.startsWith("<"))return null;return{kind:"compile",code:$e}}function ap(i){if(!i.isFunction)return"any";return`(${(i.params??[]).map((Be)=>`${Be.name}${Be.optional?"?":""}: any`).join(", ")}) => any`}function Vs(i,$e,Be,Fe,je){let We=(i??[]).filter((Ge)=>Ge.name==="example"),Ve=[];return We.forEach((Ge,Ue)=>{let ze=Ay(Ge.body);if(ze===null)return;let Ke=We.length>1;Ve.push({id:Ke?`${$e}#${Ue}`:$e,name:Ke?`${Be} (example ${Ue+1})`:Be,type:Fe,code:ze.code,kind:ze.kind,...je?{source:je}:{}})}),Ve}function cp(i){return i.name??"default"}function lp(i){let $e=[];for(let Be of i.props)$e.push(...Vs(Be.tags,`prop:${Be.name}`,Be.name,ap(Be),Be.source));for(let Be of i.moduleExports)$e.push(...Vs(Be.tags,`export:${Be.name}`,Be.name,ap(Be),Be.source));for(let Be of i.slots)$e.push(...Vs(Be.tags,`slot:${cp(Be)}`,cp(Be),"any",Be.source));for(let Be of i.events)$e.push(...Vs(Be.tags,`event:${Be.name}`,Be.name,"any",Be.source));return $e}import{existsSync as wy,readdirSync as Py}from"node:fs";import{join as Ny}from"node:path";var So=new Map;function Ws(){So.clear()}function qs(i){let $e=So.get(i);if($e!==void 0)return $e;try{let Be=Py(i,{withFileTypes:!0}),Fe=new Set;for(let je of Be)Fe.add(je.name);$e={entries:Be,names:Fe}}catch{$e=null}return So.set(i,$e),$e}function Gs(i,$e){let Be=qs(i);if(Be===null)return;if(Be.byName===void 0){Be.byName=new Map;for(let Fe of Be.entries)Be.byName.set(Fe.name,Fe)}return Be.byName.get($e)}function pp(i){return i.normalize("NFC").toLowerCase()}function Ln(i,$e){let Be=qs(i);if(Be===null)return!1;if(Be.names.has($e))return!0;if(Be.folded===void 0){Be.folded=new Map;for(let je of Be.names)Be.folded.set(pp(je),je)}let Fe=Be.folded.get(pp($e));return Fe!==void 0&&Fe!==$e&&wy(Ny(i,$e))}import{lstatSync as Vg,readFileSync as Wg}from"node:fs";import{basename as qg,dirname as Bo,join as Bp,resolve as Gg}from"node:path";import{existsSync as Ks,readFileSync as Dy}from"node:fs";import{dirname as To,isAbsolute as _y,join as Iy,relative as Ry,resolve as zs}from"node:path";function Us(i){if(!Vt(i))return{};let $e={};if(typeof i.svelte==="string")$e.svelte=i.svelte;if(typeof i.name==="string")$e.name=i.name;if(typeof i.description==="string")$e.description=i.description;return $e}function up(i){if(!Vt(i))return{};let $e={};if(typeof i.extends==="string")$e.extends=i.extends;if(Vt(i.compilerOptions)){let Be={};if(typeof i.compilerOptions.baseUrl==="string")Be.baseUrl=i.compilerOptions.baseUrl;if(Vt(i.compilerOptions.paths)){let Fe={};for(let[je,We]of Object.entries(i.compilerOptions.paths))if(Array.isArray(We)&&We.every((Ve)=>typeof Ve==="string"))Fe[je]=We;if(Object.keys(Fe).length>0)Be.paths=Fe}if(Object.keys(Be).length>0)$e.compilerOptions=Be}return $e}var Hs=new Map,dp=new Map,Ly=/\/\*[\s\S]*?\*\/|\/\/.*/g,Oy=/[.+?^${}()|[\]\\]/g,My=[".svelte",".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".d.ts"];class Cr extends Error{specifier;fromFile;searched;constructor(i,$e,Be){super(`cannot resolve "${i}" from ${$e||"."} (${Be})`);this.name="UnresolvedModuleError",this.specifier=i,this.fromFile=$e,this.searched=Be}}function $y(i){if(Ks(i))return!0;return My.some(($e)=>Ks(i+$e))}function fp(i){let $e=i.indexOf("*");return $e===-1?i.length:$e}function By(i){let $e=i,Be=zs($e,"/");while($e!==Be){for(let Fe of["tsconfig.json","jsconfig.json"]){let je=Iy($e,Fe);if(Ks(je))return je}$e=To($e)}return null}function hp(i){if(Hs.has(i))return Hs.get(i)??null;try{let $e=Dy(i,"utf-8"),Be;try{Be=JSON.parse($e)}catch{let je=$e.replace(Ly,"");Be=JSON.parse(je)}let Fe=up(Be);if(Fe.extends){let je=_y(Fe.extends)?Fe.extends:zs(To(i),Fe.extends),We=je.endsWith(".json")?je:`${je}.json`;if(Ks(We)){let Ve=hp(We);if(Ve)Fe.compilerOptions={...Ve.compilerOptions,...Fe.compilerOptions,paths:{...Ve.compilerOptions?.paths,...Fe.compilerOptions?.paths}}}}return Hs.set(i,Fe),Fe}catch{return Hs.set(i,null),null}}function Fy(i){let $e=dp.get(i);if(!$e){let Be=i.split("*").map((Fe)=>Fe.replace(Oy,"\\$&")).join("(.*)");$e=new RegExp(`^${Be}$`),dp.set(i,$e)}return $e}function vr(i,$e){if(i.startsWith(".")||i.startsWith("/"))return{resolved:i,unresolved:!1,searched:""};let Be=By($e);if(!Be)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let Fe=hp(Be);if(!Fe?.compilerOptions?.paths)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:je=".",paths:We}=Fe.compilerOptions,Ve=To(Be),Ge=zs(Ve,je),Ue=Object.entries(We).sort(([ze],[Ke])=>fp(Ke)-fp(ze));for(let[ze,Ke]of Ue){let Xe=i.match(Fy(ze));if(!Xe)continue;let Ze;for(let et of Ke){let nt=et;for(let ot=1;ot<Xe.length;ot++)nt=nt.replace("*",Xe[ot]);let st=zs(Ge,nt);if(Ze===void 0)Ze=st;if($y(st))return{resolved:st,unresolved:!1,searched:Be}}return{resolved:Ze??i,unresolved:!1,searched:Be}}return{resolved:i,unresolved:!0,searched:`tsconfig paths (${Be})`}}function ko(i,$e){return vr(i,$e).resolved}function Xs(i,$e){if(i.startsWith(".")||i.startsWith("/"))return i;let Be=ko(i,$e);if(Be===i)return i;let Fe=Ry($e,Be);return Fe=e(Fe),Fe.startsWith(".")?Fe:`./${Fe}`}var jy=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var gp=/\s/,Vy=/\s{2}|[^\S ]/,Wy=/["'`{}/]/g,qy=/["'`{};/]/g;function Gy(i){return jy.test(i.slice(-200))}var mp=[""];function Uy(i){let $e=mp[i];if($e===void 0)$e=" ".repeat(i),mp[i]=$e;return $e}function Hy(i,$e){let Be="";for(let Fe=i.length-1;Fe>=0&&Be.length<$e;Fe--)Be=i[Fe]+Be;return Be.length>$e?Be.slice(-$e):Be}function Ky(i){if(i.length===0)return!1;let $e=i[i.length-1];return $e.charCodeAt($e.length-1)===10}function zy(i){while(i.length>0){let $e=i[i.length-1],Be=$e.length;while(Be>0){let Fe=$e.charCodeAt(Be-1);if(Fe!==32&&Fe!==9)break;Be--}if(Be===$e.length)return;if(Be===0){i.pop();continue}i[i.length-1]=$e.slice(0,Be);return}}function Xy(i){while(i.length>0){let $e=i[i.length-1];if(!gp.test($e[$e.length-1]))return;let Be=$e.trimEnd();if(Be.length===$e.length)return;if(Be.length===0){i.pop();continue}i[i.length-1]=Be;return}}function Jy(i){if(i.includes("{"))return!1;let $e=0,Be=0;for(let Fe=0;Fe<i.length;Fe++){let je=i.charCodeAt(Fe);if($e!==0){if(je===$e&&i.charCodeAt(Fe-1)!==92)$e=0;continue}if(je===34||je===39||je===96){$e=je;continue}if(je===59&&++Be>=2)return!0}return!1}function Yy(i){if(!Vy.test(i))return i.trimEnd();let $e="",Be=null,Fe=!1;for(let je=0;je<i.length;je++){let We=i[je],Ve=i[je-1];if(Be){if($e+=We,Be==="double"&&We==='"'&&Ve!=="\\"||Be==="single"&&We==="'"&&Ve!=="\\"||Be==="template"&&We==="`"&&Ve!=="\\")Be=null;Fe=!1;continue}if(We==='"'||We==="'"||We==="`"){Be=We==='"'?"double":We==="'"?"single":"template",$e+=We,Fe=!1;continue}if(gp.test(We)){if(!Fe&&$e.length>0)$e+=" ",Fe=!0;continue}$e+=We,Fe=!1}return $e.trimEnd()}function xp(i,$e){let Be=i[$e],Fe=i.indexOf(Be,$e+1);while(Fe!==-1&&i.charCodeAt(Fe-1)===92)Fe=i.indexOf(Be,Fe+1);return Fe}function bp(i,$e){let Be=i.indexOf("*/",$e+1);return Be===-1?-1:Be+1}function Qy(i){let $e=new Map,Be=[],Fe=Wy,je=0;while(je<i.length){if(Fe.lastIndex=je,!Fe.test(i))break;je=Fe.lastIndex-1;let We=i.charCodeAt(je);if(We===47){if(i.charCodeAt(je+1)===42){let Ve=bp(i,je);if(Ve===-1)break;je=Ve}}else if(We===34||We===39||We===96){let Ve=xp(i,je);if(Ve===-1)break;je=Ve}else if(We===123)Be.push(je);else if(We===125&&Be.length>0)$e.set(Be.pop(),je);je++}return $e}function Zy(i,$e,Be){for(let Fe=$e;Fe<Be;Fe++)if(!Ao(i.charCodeAt(Fe)))return!1;return!0}function Ao(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 Ep(i,$e,Be,Fe){let je=[],We=qy,Ve=$e,Ge=$e;while(Ge<Be){if(We.lastIndex=Ge,!We.test(i))break;if(Ge=We.lastIndex-1,Ge>=Be)break;let Ue=i.charCodeAt(Ge);if(Ue===47){if(i.charCodeAt(Ge+1)===42){let ze=bp(i,Ge);if(ze===-1)break;Ge=ze}Ge++;continue}if(Ue===34||Ue===39||Ue===96){let ze=xp(i,Ge);if(ze===-1)break;Ge=ze+1;continue}if(Ue===123){let ze=Fe.get(Ge);if(ze===void 0||ze>=Be){Ge++;continue}if(Ve<Ge)je.push(i.slice(Ve,Ge));let Ke=Ge+1;if(Zy(i,Ke,ze)){je.push("{}"),Ge=ze+1,Ve=Ge;continue}let Xe=i.slice(Ke,ze),Ze=i.charCodeAt(Ke)===10;if(!Ze&&!Xe.includes("/*")&&!Jy(Xe)&&!Gy(Hy(je,200))){let et=Ep(i,Ke,ze,Fe),nt=et.trim();if(!nt.includes(`
46
- `)){let st=nt.endsWith(";")?nt.slice(0,-1):nt,ot=`{ ${Yy(st)} }`;if(ot.length<=120){je.push(ot),Ge=ze+1,Ve=Ge;continue}}if(je.push("{"),et.charCodeAt(0)!==59)je.push(`
47
- `);if(et.length>0)je.push(et);Ge=ze,Ve=ze;continue}if(je.push("{"),!Ze)je.push(`
48
- `);Ge=Ke,Ve=Ke;continue}if(Ue===125){if(Ve<Ge)je.push(i.slice(Ve,Ge));if(zy(je),!Ky(je))je.push(`
49
- `);je.push("}"),Ge++,Ve=Ge;continue}if(Ve<Ge)je.push(i.slice(Ve,Ge));if(Xy(je),je.push(";"),i.charCodeAt(Ge+1)!==10)je.push(`
50
- `);Ge++,Ve=Ge}if(Ve<Be)je.push(i.slice(Ve,Be));return je.join("")}function eg(i){return Ep(i,0,i.length,Qy(i))}function tg(i){if(!i.includes(" "))return i;let $e="",Be=0;for(let Fe=0;Fe<i.length;Fe++){let je=i.charCodeAt(Fe);if(Be!==0){if($e+=i[Fe],je===Be&&i.charCodeAt(Fe-1)!==92)Be=0;continue}if(je===34||je===39||je===96){Be=je,$e+=i[Fe];continue}if(je===32&&$e.charCodeAt($e.length-1)===32)continue;$e+=i[Fe]}return $e}function ng(i){return i===125||i===93||i===41||i===62}function rg(i,$e,Be){return Be-$e>=3&&i.charCodeAt($e)===47&&i.charCodeAt($e+1)===42&&i.charCodeAt($e+2)===42}function yp(i,$e,Be){let Fe=i.indexOf("*/",$e);return Fe!==-1&&Fe+2<=Be}function sg(i,$e,Be){let Fe=i.charCodeAt($e);if(Fe===124||Fe===38)return!0;return Fe===46&&$e+1<Be&&i.charCodeAt($e+1)!==46}function ig(i){let $e=[],Be=[],Fe=i.length,je=0,We=!1,Ve=0,Ge=0;while(Ge<=Fe){let Ke=i.indexOf(`
51
- `,Ge);if(Ke===-1)Ke=Fe;let Xe=Ke+1,Ze=Ge,et=Ke;while(Ze<et&&Ao(i.charCodeAt(Ze)))Ze++;while(et>Ze&&Ao(i.charCodeAt(et-1)))et--;if(Ze===et){let it=Be.length>0?Be[Be.length-1]:void 0;if(it!==void 0&&it!==""){let ft=it.charCodeAt(it.length-1);if(ft!==123&&ft!==40&&ft!==91)$e.push(0),Be.push("")}Ge=Xe;continue}if(We){if($e.push(Ve),Be.push(` ${i.slice(Ze,et)}`),yp(i,Ze,et))We=!1;Ge=Xe;continue}let nt=rg(i,Ze,et),st=nt&&yp(i,Ze,et);if(nt&&!st){$e.push(je),Be.push(i.slice(Ze,et)),We=!0,Ve=je,Ge=Xe;continue}let ot=ng(i.charCodeAt(Ze)),ut=Math.max(0,je-(ot?1:0))+(sg(i,Ze,et)?1:0);if(ot&&ut===0&&Be.length>0&&Be[Be.length-1]==="")$e.pop(),Be.pop();if($e.push(ut),Be.push(tg(i.slice(Ze,et))),Ge=Xe,st)continue;let mt=0;for(let it=Ze;it<et;it++){let ft=i.charCodeAt(it);if(mt!==0){if(ft===mt&&i.charCodeAt(it-1)!==92)mt=0;continue}if(ft===34||ft===39||ft===96)mt=ft;else if(ft===123||ft===40||ft===91||ft===60)je++;else if(ft===125||ft===41||ft===93)je=Math.max(0,je-1);else if(ft===62&&i.charCodeAt(it-1)!==61)je=Math.max(0,je-1)}}let Ue=Be.length;while(Ue>0&&Be[Ue-1]==="")Ue--;let ze=[];for(let Ke=0;Ke<Ue;Ke++){if(Ke>0)ze.push(`
52
- `);let Xe=$e[Ke];if(Xe>0)ze.push(Uy(Xe));ze.push(Be[Ke])}return ze.join("")}function Cp(i){return`${ig(eg(i))}
53
- `}var Wn="any",dn="",og="Record<string, any>",Po="Record<string, never>",No=/^[A-Za-z_$][A-Za-z0-9_$]*$/,ag=/CustomEvent/,cg=/^[A-Z]/,lg=/\n/,Ap=/=>/,pg=/(?:^|\n)@default\b/,Do=/\n/g,ug=/\s+/g,Sr=/(^|[^.\w])Snippet(?:\s*<|\b)/,dg=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,fg=/[.*+?^${}()|[\]\\]/g,hg=/^const\s+/,mg=/\{name\}/g;function _o(i){return i.replace(hg,"")}function yg(i){if(!i)return;return i.replace(Do,`
54
- * `)}function Js(i){if(!i)return"";return`/** ${i} */`}function Ys(i){if(!i)return"";return`/**
55
- * ${i.replace(Do,`
56
- * `)}
57
- */`}function wp(i){if(i===void 0)return;return i===!0?"@deprecated":`@deprecated ${i}`}function gg(i){let $e=wp(i);if($e===void 0)return;return`* ${$e.replace(Do,`
58
- * `)}
59
- `}function xg(i,$e){if(!$e)return[`@${i}`];if(!$e.includes(`
60
- `))return[`@${i} ${$e}`];return[`@${i}`,...$e.split(`
61
- `)]}function Io(i){let $e=[];for(let{name:Be,body:Fe}of i??[])$e.push(...xg(Be,Fe));return $e}function zr(i,$e,Be){let Fe=wp(Be),je=Io($e),We=je.length>0;if(!i&&!We&&!Fe)return"";if(!We&&!Fe)return i?.includes(`
62
- `)?Ys(i):Js(i);let Ve=[];if(i)Ve.push(...i.split(`
63
- `));if(Ve.push(...je),Fe)Ve.push(...Fe.split(`
64
- `));return`/**
65
- * ${Ve.join(`
66
- * `)}
67
- */`}function bg(i){let $e=Io(i);if($e.length===0)return"";return $e.map((Be)=>`* ${Be}
68
- `).join("")}function Qs(i){if(i===void 0)return Wn;return`${i}
69
- `}function kr(i,$e={export:!0},Be="all"){if(i.typedefs.length===0)return dn;let Fe=$e.export?"export ":"";return i.typedefs.map((je)=>{let We=dn;if(Be!=="none"){let Ve=Be==="all"?Io(je.tags):[];if(Ve.length===0)We=je.description?`${Ys(je.description)}
70
- `:"";else We=`/**
71
- * ${(je.description?[...je.description.split(`
72
- `),...Ve]:Ve).join(`
73
- * `)}
74
- */
75
- `}return`${We}${Fe}${je.ts}`}).join(`
76
-
77
- `)}var vp=new Map;function Pp(i,$e){let Be=vp.get($e);if(Be===void 0){let Fe=$e.replace(fg,"\\$&");Be=new RegExp(`\\b${Fe}\\b`),vp.set($e,Be)}return Be.test(i)}var Sp,Tp=[];function Ro(i){if(i!==Sp)Sp=i,Tp=In(i);return Tp}function Eg(i){if(i===null)return[];return i[0].split(",").map(($e,Be)=>({name:$e.trim(),constraint:(Ro(i[1]??"")[Be]??$e).trim()}))}function Cg(i,$e){let Be=Eg(i).filter(({name:Fe})=>Pp($e,Fe));if(Be.length===0)return{declSuffix:dn,refSuffix:dn};return{declSuffix:`<${Be.map(({constraint:Fe})=>_o(Fe)).join(", ")}>`,refSuffix:`<${Be.map(({name:Fe})=>Fe).join(", ")}>`}}function Np(i,$e={export:!0},Be="all"){if(!i.contexts||i.contexts.length===0)return dn;let Fe=$e.export?"export ":"",je=i.generics===null?[]:i.generics[0].split(",").map((We,Ve)=>({name:We.trim(),constraint:(Ro(i.generics?.[1]??"")[Ve]??We).trim()}));return i.contexts.map((We)=>{let Ve=We.properties.map((Xe)=>{let Ze=Be!=="none"&&Xe.description?`${Js(Xe.description)}
78
- `:"",et=Xe.optional?"?":"";return`${Ze}${Xe.name}${et}: ${Xe.type};`}).join(`
79
- `),Ge=Be!=="none"&&We.description?`${Ys(We.description)}
80
- `:"",Ue=je.filter(({name:Xe})=>We.properties.some((Ze)=>Pp(Ze.type,Xe))).map(({constraint:Xe})=>Xe),ze=Ue.length>0?`<${Ue.map(_o).join(", ")}>`:"";if(We.properties.length===0)return We.hasUnresolvedSpread?`${Ge}${Fe}type ${We.typeName} = Record<string, any>;`:`${Ge}${Fe}type ${We.typeName} = Record<string, never>;`;let Ke=We.hasUnresolvedSpread?" & Record<string, any>":"";return`${Ge}${Fe}type ${We.typeName}${ze} = {
81
- ${Ve}
82
- }${Ke};`}).join(`
83
-
84
- `)}function Tr(i){return No.test(i)?i:JSON.stringify(i)}function Dp(i,$e){if(!i)return;return`* ${$e||i}
85
- `}function Zs(i,$e,Be,Fe="all"){if(Fe==="none")return dn;return[Dp(yg(i)),gg($e),Fe==="all"?bg(Be):void 0].filter(Boolean).join("")}function Xr(i){return i.length>0?`/**
86
- ${i}*/`:dn}function vg(i,$e={export:!0},Be="all"){let Fe=$e.export?"export ":"",je=i.props.filter((it)=>!it.isFunctionDeclaration&&it.kind!=="const"),We=new Set([...je.map((it)=>it.name),...Array.from(i.canonicalPropNames??[])]),Ve=je.map((it)=>{let ft=typeof it.value==="string"?it.value.replace(ug," "):it.value,kt=pg.test(it.description??"")||it.value===void 0,wt=[Zs(it.description,it.deprecated,it.tags,Be),Be==="all"?Dp(it.constant,"@constant"):null,Be==="all"&&!kt?`* @default ${ft}
87
- `:null].filter(Boolean).join(""),Pt=it.constant&&!it.isFunction?it.value:it.type||Wn;return`
88
- ${Xr(wt)}
89
- ${Tr(it.name)}${it.isRequired?"":"?"}: ${Pt};`}),Ge=i.canonicalPropsType?Ve.filter((it,ft)=>{let yt=je[ft];return yt?!(i.canonicalPropNames?.has(yt.name)??!1):!0}):Ve,Ue=(i.slots||[]).filter((it)=>!it.default&&it.name!=null&&!We.has(it.name)).map((it)=>{let ft=it.name,yt=Tr(ft),kt=zr(it.description,it.tags,it.deprecated),wt=kt?`${kt}
90
- `:"",qe=it.slot_props&&it.slot_props!=="Record<string, never>"?`(this: void, ...args: [${it.slot_props}]) => void`:"(this: void) => void";return`
91
- ${wt}${yt}?: ${qe};`}),ze=(i.slots||[]).find((it)=>it.default||it.name===null),Ke=ze&&!We.has("children")?(()=>{let it=zr(ze.description,ze.tags,ze.deprecated),ft=it?`${it}
92
- `:"",kt=ze.slot_props&&ze.slot_props!=="Record<string, never>"?`(this: void, ...args: [${ze.slot_props}]) => void`:"(this: void) => void";return`
93
- ${ft}children?: ${kt};`})():"",Xe=i.events?Pg({events:i.events},We):[],Ze=[...Ue,Ke,...Xe].filter(Boolean),et=[...Ge,...Ze].join(`
94
- `),nt=qn(i.moduleName,$e.typeNames),st=dn,ot=i.generics?`<${Ro(i.generics[1]).map((it)=>_o(it.trim())).join(", ")}>`:"",ut=i.generics?`<${i.generics[0]}>`:"",mt=i.canonicalPropsType?`
95
- type $Props${ot} = ${i.canonicalPropsType}${et.trim()===""?"":` & {${et}
96
- }`};
97
- `:`
98
- type $Props${ot} = {
99
- ${et}
100
- };
101
- `;if(i.rest_props?.type==="Element"){let it;if(i.rest_props.name==="svelte:element")if(i.rest_props.thisValue)it=`SvelteHTMLElements["${i.rest_props.thisValue}"]`;else it="HTMLAttributes<HTMLElement>";else it=i.rest_props.name.split("|").map((kt)=>`SvelteHTMLElements["${kt.trim()}"]`).join(" & ");let ft="[key: `data-${string}`]: unknown;",yt=i.rest_props.description?i.rest_props.description.includes(`
102
- `)?`${Ys(i.rest_props.description)}
103
- `:`${Js(i.rest_props.description)}
104
- `:"";if(i.extends===void 0)st=`
105
- ${yt}${it?`type $RestProps = ${it};
106
- `:""}
107
- ${i.canonicalPropsType?`type $Props${ot} = (${i.canonicalPropsType}) & {${et}
108
-
109
- ${ft}
110
- };`:`type $Props${ot} = {
111
- ${et}
112
-
113
- ${ft}
114
- };`}
115
-
116
- ${Fe}type ${nt}${ot} = Omit<$RestProps, keyof $Props${ut}> & $Props${ut};
117
- `;else st=`
118
- ${yt}${it?`type $RestProps = ${it};
119
- `:""}
120
- ${i.canonicalPropsType?`type $Props${ot} = (${i.canonicalPropsType}) & {${et}
121
-
122
- ${ft}
123
- };`:`type $Props${ot} = {
124
- ${et}
125
-
126
- ${ft}
127
- };`}
128
-
129
- ${Fe}type ${nt}${ot} = Omit<$RestProps, keyof ($Props${ut} & ${i.extends.interface})> & Omit<${i.extends.interface}, keyof $Props${ut}> & $Props${ut};
130
- `}else if(et.trim()===""&&i.extends===void 0&&!i.canonicalPropsType)st=`
131
- ${Fe}type ${nt}${ot} = ${Po};
132
- `;else if(i.canonicalPropsType)st=`
133
- ${mt}
134
- ${Fe}type ${nt}${ot} = ${i.extends===void 0?"":`Omit<${i.extends.interface}, keyof $Props${ut}> & `}$Props${ut};
135
- `;else if(i.extends===void 0)st=$e.propsDeclaration==="interface"&&et.trim()!==""?`
136
- ${Fe}interface ${nt}${ot} {
137
- ${et}
138
- }
139
- `:`
140
- ${Fe}type ${nt}${ot} = {
141
- ${et}
142
- };
143
- `;else st=`
144
- type $Props${ot} = {
145
- ${et}
146
- };
147
-
148
- ${Fe}type ${nt}${ot} = Omit<${i.extends.interface}, keyof $Props${ut}> & $Props${ut};
149
- `;return{props_name:nt,prop_def:st}}function Sg(i){if(i.slots.length===0)return Po;let $e=i.slots.map(({name:Be,slot_props:Fe,...je})=>{let We=je.default||Be===null?"default":Tr(Be??""),Ve=zr(je.description,je.tags,je.deprecated);return`${Ve?`${Ve}
150
- `:""}${We}: ${Qs(Fe)};`}).join(`
151
- `);return i.slots.length===1?`{${$e}}`:`{
152
- ${$e}
153
- }`}var Tg=()=>"WindowEventMap",kg=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 wo(i=Wn){if(ag.test(i))return i;return`CustomEvent<${i}>`}function Ag(i){return kg.has(i)}function _p(i){switch(i.type){case"dispatched":return wo(i.detail);case"forwarded":{let $e=i.element,Fe=!($e&&cg.test($e))||Ag(i.name),je=i.detail!==void 0&&i.detail!=="undefined"&&!(i.detail==="null"&&Fe),We=i.detail==="null"&&!Fe;if(je||We)return wo(i.detail);else if(Fe)return`${Tg()}["${i.name}"]`;else return wo()}default:return i}}function wg(i){if(i.events.length===0)return og;let $e=i.events.map((Be)=>{let Fe="",je=zr(Be.description,Be.tags,Be.deprecated);if(je)Fe=`${je}
154
- `;return`${Fe}${Tr(Be.name)}: ${_p(Be)};
155
- `}).join("");return i.events.length===1?`{${$e}}`:`{
156
- ${$e}}`}function Pg(i,$e){return i.events.map((Be)=>{let Fe=`on${Be.name}`;if($e.has(Fe))return;let je="",We=zr(Be.description,Be.tags,Be.deprecated);if(We)je=`${We}
157
- `;return`
158
- ${je}${Tr(Fe)}?: (event: ${_p(Be)}) => void;`}).filter((Be)=>Be!==void 0)}function Ng(i){let $e=i.type==="() => any";if(i.type&&Ap.test(i.type)&&!$e)return i.type;else if(i.params&&i.params.length>0){let Fe=i.params.map((We)=>{let Ve=We.optional?"?":"";return`${We.name}${Ve}: ${We.type}`}).join(", "),je=i.returnType||Wn;return`(${Fe}) => ${je}`}else if(i.returnType)return`() => ${i.returnType}`;else return i.type||Wn}function Ip(i,$e="all"){return i.props.filter((Be)=>Be.isFunctionDeclaration||Be.kind==="const").map((Be)=>{let Fe=Zs(Be.description,Be.deprecated,Be.tags,$e),je=Ng(Be);return`
159
- ${Xr(Fe)}
160
- ${Tr(Be.name)}: ${je};`}).join(`
161
- `)}function Dg(i,$e={export:!0},Be="all"){let Fe=$e.export?"export ":"",je=ir(i.moduleName,$e.typeNames),We=Ip({props:i.props},Be);if(We.trim()==="")return{exports_name:je,exports_ref:je,exports_def:`${Fe}type ${je} = ${Po};`};let{declSuffix:Ve,refSuffix:Ge}=Cg(i.generics,We);return{exports_name:je,exports_ref:`${je}${Ge}`,exports_def:`${Fe}type ${je}${Ve} = {${We}
162
- };`}}function _g(i){let $e=i.props.filter((Be)=>Be.bindable===!0||Be.binding==="writable").map((Be)=>JSON.stringify(Be.name));return $e.length===0?dn:$e.join(" | ")}function Ig(i){let $e=i.moduleName==="default"?"$$Component":i.moduleName,Be=i.bindings===dn?'""':i.bindings;return`declare const ${$e}: Component<
163
- ${i.propsRef},
164
- ${i.exportsRef},
165
- ${Be}
166
- >;
167
- export default ${$e};`}function Rg(i){let $e=i.moduleName==="default"?"$$Component":i.moduleName,Be=`${$e}Component`,Fe=i.bindings===dn?'""':i.bindings;return`interface ${Be} {
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?: ${Fe};
181
- }
182
- declare const ${$e}: ${Be};
183
- export default ${$e};`}function Lg(i){if(i.extends===void 0)return"";return`import type { ${i.extends.interface} } from ${i.extends.import};`}function Og(i,$e="all"){if($e==="none"||!i.componentComment)return"";if(!lg.test(i.componentComment))return Js(i.componentComment.trim());return`/*${i.componentComment.split(`
184
- `).map((Be)=>`* ${Be}`).join(`
185
- `)}
186
- */`}function kp(i){return No.test(i)?i:JSON.stringify(i)}function Mg(i,$e){let Be=[],Fe=new Map;for(let je of i.moduleExports){if(je.kind!=="re-export"||!je.reExport)continue;let{from:We,imported:Ve}=je.reExport,Ge=Zs(je.description,je.deprecated,je.tags,$e),Ue=kp(je.name);if(Ve==="*"){let Xe=je.name==="*"?"*":`* as ${Ue}`;Be.push(`${Xr(Ge)}
187
- export ${Xe} from ${JSON.stringify(We)};`);continue}let ze=`${We}\x00${Ge}`,Ke=Fe.get(ze);if(!Ke)Ke={comments:Ge,from:We,specifiers:[]},Fe.set(ze,Ke),Be.push(ze);Ke.specifiers.push(Ve===je.name?Ue:`${kp(Ve)} as ${Ue}`)}return Be.map((je)=>{let We=Fe.get(je);if(!We)return je;return`${Xr(We.comments)}
188
- export { ${We.specifiers.join(", ")} } from ${JSON.stringify(We.from)};`}).join(`
189
-
190
- `)}function $g(i,$e="all"){let Be=Mg(i,$e),Fe=i.moduleExports.filter((je)=>je.kind!=="re-export").map((je)=>{let We=Zs(je.description,je.deprecated,je.tags,$e),Ve,Ge=je.type&&Ap.test(je.type),Ue=je.type==="() => any",ze=je.typeParameters?`<${je.typeParameters}>`:"";if(je.kind==="const"&&!Ge)Ve=`export declare const ${je.name}: ${je.type||Wn};
191
- `;else if(je.params&&je.params.length>0){let Xe=je.params.map((et)=>{let nt=et.optional?"?":"";return`${et.name}${nt}: ${et.type}`}).join(", "),Ze=je.returnType||Wn;Ve=`export declare function ${je.name}${ze}(${Xe}): ${Ze};`}else if(je.returnType)Ve=`export declare function ${je.name}${ze}(): ${je.returnType};`;else if(Ge&&je.type&&!Ue){let[Ke,Xe,...Ze]=je.type.split("=>"),et=Ze.map((nt)=>` => ${nt.trim()}`).join("");Ve=`export declare function ${je.name}${Ke.trimEnd()}: ${Xe.trim()}${et};`}else if(Ge&&je.type){let[Ke,Xe,...Ze]=je.type.split("=>"),et=Ze.map((nt)=>` => ${nt.trim()}`).join("");Ve=`export declare function ${je.name}${Ke.trimEnd()}: ${Xe.trim()}${et};`}else if(je.kind==="const")Ve=`export declare const ${je.name}: ${je.type||Wn};
192
- `;else Ve=`export type ${je.name} = ${je.type||Wn};`;return`
193
- ${Xr(We)}
194
- ${Ve}`}).join(`
195
- `);return[Be,Fe].filter(Boolean).join(`
196
-
197
- `)}var Bg=120;function Fg(i){let Be=`export default class ${i.moduleName==="default"?"":i.moduleName}${i.generic} extends SvelteComponentTyped<`,Fe=[i.genericProps,i.events,i.slots];if(i.accessors.trim()===""&&Fe.every((je)=>!je.includes(`
198
- `))){let je=`${Be}${Fe.join(", ")}> {}`;if(je.length<=Bg)return je}return`${Be}
199
- ${i.genericProps},
200
- ${i.events},
201
- ${i.slots}
202
- > {
203
- ${i.accessors}
204
- }`}function Rp(i,$e,Be){let Fe=Be.replace(mg,$e);if(!Be.includes("{name}")||!No.test(Fe))throw Error(`sveld: typesOptions.typeNames.${i} must contain "{name}" and produce a valid identifier; got "${Be}".`);return Fe}function qn(i,$e){return Rp("props",i,$e?.props??"{name}Props")}function ir(i,$e){return Rp("exports",i,$e?.exports??"{name}Exports")}function ei(i,$e,Be){if(i===void 0||i===!0)return{...$e};if(i===!1)return{props:!1,exports:!1,typedefs:!1,contexts:!1};return{props:i.props??Be,exports:i.exports??Be,typedefs:i.typedefs??Be,contexts:i.contexts??Be}}var Lo={props:!0,exports:!0,typedefs:!0,contexts:!0};function Oo(i){let $e=ei(i?.exportTypes,Lo,!0);if(i?.forceExportProps===!0)$e.props=!0;return $e}function Mo(i){return{format:i.format,exportTypes:i.exportTypes,forceExportProps:i.forceExportProps,typeNames:i.typeNames,comments:i.comments,propsDeclaration:i.propsDeclaration,inline:i.inline}}var jg={format:"class",exportTypes:!0,forceExportProps:!1,typeNames:null,comments:"all",propsDeclaration:"type",inline:!1};function Lp(i){let $e=Mo(i??{}),Be={};for(let[Fe,je]of Object.entries($e))Be[Fe]=je??jg[Fe];return JSON.stringify(Be)}function $o(i,$e){let Be=An(i),{moduleName:Fe,typedefs:je,generics:We,props:Ve,moduleExports:Ge,slots:Ue,events:ze,rest_props:Ke,extends:Xe,componentComment:Ze,contexts:et,syntaxMode:nt}=i,st=$e?.format==="component",ot=We!==null,ut=Oo($e),mt=$e?.comments??"all",{props_name:it,prop_def:ft}=vg({moduleName:Fe,props:Ve,rest_props:Ke,extends:Xe,generics:We,slots:Ue,canonicalPropNames:new Set(Be?.canonicalPropNames??[]),canonicalPropsType:Be?.canonicalPropsType,events:st&&nt==="legacy"?ze:void 0},{export:ut.props,typeNames:$e?.typeNames,propsDeclaration:$e?.propsDeclaration},mt),yt=We?`<${We[1]}>`:"",kt=We?`${it}<${We[0]}>`:it,wt=$g({moduleExports:Ge},mt),Pt=kr({typedefs:je},{export:ut.typedefs},mt),qe=Np({contexts:et,generics:We},{export:ut.contexts},mt),He=new Set($e?.inlined?.droppedImportStatements??[]),Je=(Be?.typeImportStatements??[]).filter((St)=>!He.has(St)).join(`
205
- `),Qe=[...$e?.inlined?.declarations??[],...Be?.localTypeDeclarations??[]].join(`
206
-
207
- `),{exports_ref:tt,exports_def:rt}=st?Dg({props:Ve,moduleName:Fe,generics:We},{export:ut.exports,typeNames:$e?.typeNames},mt):{exports_ref:dn,exports_def:dn},at=st?_g({props:Ve}):dn,pt=!dg.test(Je)&&(Sr.test(ft)||Sr.test(wt)||Sr.test(Pt)||Sr.test(qe)||Sr.test(Qe)||Sr.test(rt)),lt=Ke?.type==="Element"&&(Ke.name!=="svelte:element"||Ke.name==="svelte:element"&&Ke.thisValue),ct=Ke?.type==="Element"&&Ke.name==="svelte:element"&&!Ke.thisValue,ht=[st?ot?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${pt?", Snippet":""} } from "svelte";`:`import type { Component${pt?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${pt?", type Snippet":""} } from "svelte";`,lt?'import type { SvelteHTMLElements } from "svelte/elements";':"",ct?'import type { HTMLAttributes } from "svelte/elements";':"",Je,Lg({extends:Xe})].filter(Boolean).join(`
208
- `),gt=st?ot?Rg({moduleName:Fe,generic:yt,propsRef:kt,exportsRef:tt,bindings:at}):Ig({moduleName:Fe,propsRef:kt,exportsRef:tt,bindings:at}):Fg({moduleName:Fe,generic:yt,genericProps:kt,events:wg({events:ze}),slots:Sg({slots:Ue}),accessors:Ip({props:Ve},mt)}),xt=[wt,Pt,Qe,qe,ft,rt,[Og({componentComment:Ze},mt),gt].filter(Boolean).join(`
209
- `)].map((St)=>St.trim()).filter(Boolean).join(`
210
-
211
- `);return Cp([ht,xt].filter(Boolean).join(`
212
-
213
- `))}var Ug=[".ts",".d.ts",".mts",".cts"],Hg=["index.ts","index.d.ts"],Kg=10,zg=/^\s*(?:export\s+)?(?:declare\s+)?(?:type|interface)\s+([A-Za-z_$][\w$]*)/,Xg=new Set(["svelte","svelte/elements"]);function Fo(i){return Xg.has(i)}function Yr(i,$e){let Be=Bo($e),Fe;if(i.startsWith(".")||i.startsWith("/"))Fe=Gg(Be,i);else{let Ve=vr(i,Be);if(Ve.unresolved)return{kind:"bare"};Fe=Ve.resolved}let je=Bo(Fe),We=qg(Fe);if(Ln(je,We)){let Ve=Gs(je,We);if(Ve?Ve.isFile():Vg(Fe,{throwIfNoEntry:!1})?.isFile())return Fe.endsWith(".svelte")?{kind:"svelte"}:{kind:"resolved",path:Fe}}if(Ln(je,`${We}.svelte`))return{kind:"svelte"};for(let Ve of Ug)if(Ln(je,`${We}${Ve}`))return{kind:"resolved",path:`${Fe}${Ve}`};for(let Ve of Hg)if(Ln(Fe,Ve))return{kind:"resolved",path:Bp(Fe,Ve)};return{kind:"missing"}}function Rt(i){return Vt(i)&&typeof i.type==="string"?i:void 0}function or(i){if(!Array.isArray(i))return[];let $e=[];for(let Be of i){let Fe=Rt(Be);if(Fe)$e.push(Fe)}return $e}function Ht(i){if(!i)return;if(r(i))return i.name;return _n(i)??void 0}function Qr(i){return _n(i)??void 0}function jo(i,$e){let Be=i.files.get($e);if(Be!==void 0)return Be;let Fe;try{let je=Wg($e,"utf-8"),We=xr(je,!0,[]);Fe={source:je,program:We}}catch{Fe=null}return i.files.set($e,Fe),Fe}function Jg(i){let $e=i;while($e?.type==="TSQualifiedName")$e=Rt($e.left);return $e?Ht($e):void 0}function Yg(i){let $e=new Set,Be=[],Fe=(je)=>{if(je.type!=="TSTypeReference")return;let We=Jg(Rt(je.typeName));if(We&&!$e.has(We))$e.add(We),Be.push(We)};for(let je in i){if(je==="id"||je==="typeParameters")continue;let We=i[je];if(Array.isArray(We))for(let Ve of We){let Ge=Rt(Ve);if(Ge)x(Ge,Fe)}else{let Ve=Rt(We);if(Ve)x(Ve,Fe)}}return Be}function Qg(i){let $e=new Set,Be=Rt(i.typeParameters);for(let Fe of or(Be?.params)){let je=Ht(Rt(Fe.name));if(je)$e.add(je)}return $e}function Vo(i,$e){for(let Be of i.body){let Fe=Be.type==="ExportNamedDeclaration"?Rt(Be.declaration)??Be:Be;switch(Fe.type){case"TSTypeAliasDeclaration":if(Ht(Rt(Fe.id))===$e)return{kind:"type",node:Fe};break;case"TSInterfaceDeclaration":if(Ht(Rt(Fe.id))===$e)return{kind:"interface",node:Fe};break;case"TSEnumDeclaration":if(Ht(Rt(Fe.id))===$e)return{kind:"unsupported",reason:"enum"};break;case"ClassDeclaration":if(Ht(Rt(Fe.id))===$e)return{kind:"unsupported",reason:"class"};break;case"FunctionDeclaration":if(Ht(Rt(Fe.id))===$e)return{kind:"unsupported",reason:"function"};break;case"TSModuleDeclaration":if(Ht(Rt(Fe.id))===$e)return{kind:"unsupported",reason:"namespace"};break;case"VariableDeclaration":for(let je of or(Fe.declarations))if(Ht(Rt(je.id))===$e)return{kind:"unsupported",reason:"const"};break;default:break}}return}function Zg(i,$e){for(let Be of i.body){if(Be.type!=="ImportDeclaration")continue;let Fe=Qr(Rt(Be.source));if(Fe===void 0)continue;for(let je of or(Be.specifiers)){let We=Rt(je.local),Ve=Ht(We);if(Ve!==$e)continue;if(je.type==="ImportNamespaceSpecifier")return{kind:"namespace"};let Ge=typeof We?.start==="number"?We.start:void 0;if(je.type==="ImportDefaultSpecifier")return{kind:"named",source:Fe,importedName:"default",localNameStart:Ge};if(je.type==="ImportSpecifier")return{kind:"named",source:Fe,importedName:Ht(Rt(je.imported))??Ve,localNameStart:Ge}}}return}function Wo(i,$e){return`${i}\x00${$e}`}function ex(i,$e){let Be=new Set,Fe=[];for(let je of i){let We;try{We=xr(je,!0,[])}catch{continue}for(let Ve of We.body){if(Ve.type!=="ImportDeclaration")continue;let Ge=Qr(Rt(Ve.source));if(Ge===void 0||Fo(Ge))continue;if(Yr(Ge,$e).kind!=="bare")continue;for(let Ue of or(Ve.specifiers)){if(Ue.type==="ImportNamespaceSpecifier")continue;let ze=Ue.type==="ImportDefaultSpecifier"?"default":Ht(Rt(Ue.imported))??void 0;if(!ze)continue;let Ke=Wo(Ge,ze);if(Be.has(Ke))continue;Be.add(Ke),Fe.push({source:Ge,importedName:ze})}}}return Fe}function qo(i,$e){return e(Bp(Bo(i),`__sveld_inline_all_${$e}.ts`))}function Fp(i,$e,Be){let Fe=ex(Be,i);if(Fe.length===0)return null;let je=Fe.map(({source:Ue,importedName:ze},Ke)=>`import type { ${ze} as __sveld_bare_${Ke} } from ${JSON.stringify(Ue)};`),We=new Map,Ve=`${je.join(`
214
- `)}
215
- `;return Fe.forEach(({source:Ue,importedName:ze},Ke)=>{Ve+=`type __sveld_ref_${Ke} = `,We.set(Wo(Ue,ze),Ve.length),Ve+=`__sveld_bare_${Ke};
216
- `}),{virtualFile:qo(i,$e),content:Ve,positions:We}}function ni(i,$e){let Be=new Map;for(let Fe of i.values()){let je=An(Fe)?.typeImportStatements??[];if(je.length===0)continue;let We=Fp($e(Fe.filePath),Fe.moduleName,je);if(We)Be.set(We.virtualFile,We.content)}return Be}function Op(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 ti(i,$e,Be,Fe,je){let We=`${$e}#${Be}`;if(je>Kg||Fe.has(We))return{kind:"not-found"};Fe.add(We);let Ve=jo(i,$e);if(!Ve)return{kind:"not-found"};i.dependencies.add($e);for(let Ge of Ve.program.body){if(Ge.type==="ExportNamedDeclaration"){let Ue=Rt(Ge.declaration);if(!Ue)continue;if(Ue.type==="VariableDeclaration"){for(let Ke of or(Ue.declarations))if(Ht(Rt(Ke.id))===Be)return{kind:"unsupported",reason:"const"};continue}if(Ht(Rt(Ue.id))!==Be)continue;let ze=Op(Ue);return"reason"in ze?{kind:"unsupported",reason:ze.reason}:{kind:"found",node:Ue,filePath:$e,source:Ve.source}}if(Ge.type==="ExportDefaultDeclaration"&&Be==="default"){let Ue=Rt(Ge.declaration);if(!Ue)return{kind:"not-found"};let ze=Op(Ue);return"reason"in ze?{kind:"unsupported",reason:ze.reason}:{kind:"found",node:Ue,filePath:$e,source:Ve.source}}}for(let Ge of Ve.program.body){if(Ge.type!=="ExportNamedDeclaration"||Ge.declaration)continue;for(let Ue of or(Ge.specifiers)){if(Ht(Rt(Ue.exported))!==Be)continue;let ze=Ht(Rt(Ue.local));if(!ze)return{kind:"not-found"};if(!Ge.source){let Ze=Vo(Ve.program,ze);if(!Ze)return{kind:"not-found"};if(Ze.kind==="unsupported")return Ze;return{kind:"found",node:Ze.node,filePath:$e,source:Ve.source}}let Ke=Qr(Rt(Ge.source));if(Ke===void 0)return{kind:"not-found"};let Xe=Yr(Ke,$e);if(Xe.kind!=="resolved")return{kind:"not-found"};return ti(i,Xe.path,ze,Fe,je+1)}}for(let Ge of Ve.program.body){if(Ge.type!=="ExportAllDeclaration"||Rt(Ge.exported))continue;let Ue=Qr(Rt(Ge.source));if(Ue===void 0)continue;let ze=Yr(Ue,$e);if(ze.kind!=="resolved")continue;let Ke=ti(i,ze.path,Be,Fe,je+1);if(Ke.kind!=="not-found")return Ke}return{kind:"not-found"}}function Mp(i,$e,Be){if(Be===$e)return{ok:!0};let Fe=`alias#${Be}`;if(i.textByKey.has(Fe))return{ok:!0};let je=i.nameOwner.get(Be);if(je!==void 0&&je!==Fe)return{ok:!1,reason:`"${Be}" was already inlined from a different source`};if(i.reservedNames.has(Be))return{ok:!1,reason:`"${Be}" collides with an existing declaration in the component`};return i.nameOwner.set(Be,Fe),i.tx.keys.push(Fe),i.textByKey.set(Fe,`type ${Be} = ${$e};`),i.order.push(Fe),{ok:!0}}async function jp(i,$e,Be){let Fe=await i.bareSession.resolveAt($e,Be);if(Fe.kind==="default-lib")return{status:"left-alone"};if(Fe.kind==="unresolved")return{status:"unresolved"};let je=jo(i,Fe.filePath);if(!je)return{status:"unlocatable",filePath:Fe.filePath,declaredName:Fe.declaredName};let We=Vo(je.program,Fe.declaredName);if(!We)return{status:"unlocatable",filePath:Fe.filePath,declaredName:Fe.declaredName};if(We.kind==="unsupported")return{status:"unsupported",reason:We.reason};return{status:"found",node:We.node,filePath:Fe.filePath,source:je.source}}async function Jr(i,$e,Be,Fe,je){let We=Ht(Rt($e.id)),{start:Ve,end:Ge}=$e;if(!We||typeof Ve!=="number"||typeof Ge!=="number")return{ok:!1,reason:"has no name or source position"};let Ue=`${Be}#${We}`;if(i.pending.has(Ue)||i.textByKey.has(Ue))return Mp(i,We,je);let ze=i.nameOwner.get(We);if(ze!==void 0&&ze!==Ue)return{ok:!1,reason:`"${We}" was already inlined from a different source`};if(i.reservedNames.has(We))return{ok:!1,reason:`"${We}" collides with an existing declaration in the component`};i.pending.add(Ue),i.nameOwner.set(We,Ue),i.tx.keys.push(Ue),i.dependencies.add(Be);let Ke=Qg($e),Xe=jo(i,Be);for(let Ze of Yg($e)){if(Ke.has(Ze)||Ze===We)continue;if(!Xe)continue;let et=Vo(Xe.program,Ze);if(et){if(et.kind==="unsupported")return i.pending.delete(Ue),{ok:!1,reason:`references "${Ze}", a ${et.reason} that cannot be inlined`};let mt=await Jr(i,et.node,Be,Fe,Ze);if(!mt.ok)return i.pending.delete(Ue),mt;continue}let nt=Zg(Xe.program,Ze);if(!nt||nt.kind==="namespace")continue;let st=Yr(nt.source,Be);if(st.kind==="resolved"){let mt=ti(i,st.path,nt.importedName,new Set,0);if(mt.kind==="not-found")return i.pending.delete(Ue),{ok:!1,reason:`references "${Ze}", which is not exported from "${nt.source}"`};if(mt.kind==="unsupported")return i.pending.delete(Ue),{ok:!1,reason:`references "${Ze}", a ${mt.reason} that cannot be inlined`};let it=await Jr(i,mt.node,mt.filePath,mt.source,Ze);if(!it.ok)return i.pending.delete(Ue),it;continue}if(st.kind!=="bare"||Fo(nt.source)||!i.bareSession||nt.localNameStart===void 0)continue;let ot=await jp(i,Be,nt.localNameStart);if(ot.status==="left-alone")continue;if(ot.status!=="found"){i.pending.delete(Ue);let mt=ot.status==="unresolved"?`which could not be resolved from "${nt.source}"`:ot.status==="unlocatable"?`which resolves to "${ot.declaredName}" in "${ot.filePath}", where sveld could not locate that declaration`:`a ${ot.reason} that cannot be inlined`;return{ok:!1,reason:`references "${Ze}", ${mt}`}}let ut=await Jr(i,ot.node,ot.filePath,ot.source,Ze);if(!ut.ok)return i.pending.delete(Ue),ut}return i.pending.delete(Ue),i.textByKey.set(Ue,Fe.slice(Ve,Ge).trim()),i.order.push(Ue),Mp(i,We,je)}async function tx(i,$e,Be,Fe){let je=ti(i,$e,Be,new Set,0);if(je.kind==="not-found")return{ok:!1,reason:`"${Be}" is not exported from "${$e}"`};if(je.kind==="unsupported")return{ok:!1,reason:`"${Be}" is a ${je.reason}, which cannot be inlined`};return Jr(i,je.node,je.filePath,je.source,Fe)}async function nx(i,$e,Be,Fe){let je=i.barePlan?.positions.get(Wo($e,Be));if(!i.bareSession||!i.barePlan||je===void 0)return{ok:!1,reason:`"${Be}" is a package import that sveld could not verify`};let We=await jp(i,i.barePlan.virtualFile,je);switch(We.status){case"left-alone":return{ok:!1,reason:`"${Be}" resolves to a built-in TypeScript type, which cannot be inlined`};case"unresolved":return{ok:!1,reason:`"${Be}" could not be resolved from "${$e}"`};case"unlocatable":return{ok:!1,reason:`"${Be}" resolves to "${We.declaredName}" in "${We.filePath}", where sveld could not locate that declaration`};case"unsupported":return{ok:!1,reason:`"${Be}" is a ${We.reason}, which cannot be inlined`};case"found":return Jr(i,We.node,We.filePath,We.source,Fe);default:return We}}function $p(i){i.order.length=i.tx.orderStart;let $e=new Set(i.tx.keys);for(let Be of $e)i.textByKey.delete(Be);for(let[Be,Fe]of i.nameOwner)if($e.has(Fe))i.nameOwner.delete(Be)}async function rx(i,$e,Be){let Fe;try{Fe=xr($e,!0,[])}catch{return{status:"kept"}}let je=Fe.body.filter((Ke)=>Ke.type==="ImportDeclaration");if(je.length===0)return{status:"kept"};let We=je.flatMap((Ke)=>or(Ke.specifiers).map((Xe)=>({decl:Ke,spec:Xe})));if(We.some(({spec:Ke})=>Ke.type==="ImportNamespaceSpecifier"))return{status:"kept"};let Ve=Qr(Rt(je[0]?.source));if(Ve===void 0)return{status:"kept"};let Ge=Yr(Ve,Be);if(Ge.kind==="svelte")return{status:"kept"};let Ue=[];for(let{spec:Ke}of We){let Xe=Ht(Rt(Ke.local));if(!Xe)continue;let Ze=Ke.type==="ImportDefaultSpecifier"?"default":Ht(Rt(Ke.imported))??Xe;Ue.push({importedName:Ze,localName:Xe})}if(Ge.kind==="missing")return{status:"refused",failures:Ue.map(({localName:Ke})=>({name:Ke,reason:`"${Ve}" was not found on disk`}))};if(Ge.kind==="bare"){if(Fo(Ve)||!i.bareSession)return{status:"kept"};i.tx={orderStart:i.order.length,keys:[]};let Ke=[];for(let{importedName:Xe,localName:Ze}of Ue){let et=await nx(i,Ve,Xe,Ze);if(!et.ok)Ke.push({name:Ze,reason:et.reason})}if(Ke.length>0)return $p(i),{status:"refused",failures:Ke};return{status:"inlined"}}i.tx={orderStart:i.order.length,keys:[]};let ze=[];for(let{importedName:Ke,localName:Xe}of Ue){let Ze=await tx(i,Ge.path,Ke,Xe);if(!Ze.ok)ze.push({name:Xe,reason:Ze.reason})}if(ze.length>0)return $p(i),{status:"refused",failures:ze};return{status:"inlined"}}function sx(i,$e){let Be=new Set;for(let je of i.typedefs)Be.add(je.name);for(let je of i.contexts??[])Be.add(je.typeName);let Fe=An(i);for(let je of Fe?.localTypeDeclarations??[]){let We=zg.exec(je);if(We)Be.add(We[1])}return Be.add(qn(i.moduleName,$e)),Be.add(ir(i.moduleName,$e)),Be}async function ri(i,$e,Be,Fe){let je=new Map;return await Promise.all(Array.from(i.values()).map(async(We)=>{let Ge=An(We)?.typeImportStatements??[];if(Ge.length===0)return;let Ue=$e(We.filePath),ze=Fe?Fp(Ue,We.moduleName,Ge):null,Ke={files:new Map,reservedNames:sx(We,Be),nameOwner:new Map,textByKey:new Map,order:[],pending:new Set,dependencies:new Set,tx:{orderStart:0,keys:[]},bareSession:Fe,barePlan:ze},Xe=[],Ze=(We.diagnostics??[]).filter((et)=>et.kind!=="types-inline-unresolved");for(let et of Ge){let nt=await rx(Ke,et,Ue);if(nt.status==="inlined")Xe.push(et);else if(nt.status==="refused")for(let st of nt.failures)Ze.push(gn({component:We.filePath,kind:"types-inline-unresolved",name:st.name,message:`Cannot inline "${st.name}": ${st.reason}.`}))}if(We.diagnostics=Ze,Xe.length===0&&Ke.order.length===0)return;je.set(We.filePath,{droppedImportStatements:Xe,declarations:Ke.order.map((et)=>Ke.textByKey.get(et)??""),dependencies:Array.from(Ke.dependencies)})})),je}import{hash as ix}from"node:crypto";import{mkdirSync as ox,readFileSync as ax,renameSync as cx,writeFileSync as Vp}from"node:fs";import{dirname as lx,isAbsolute as px,join as ux,resolve as Wp}from"node:path";var Go=3,dx=ux("node_modules",".cache","sveld","parse-cache.json");function Uo(){return`${Rs}+svelte@${Ur}`}function Gp(i,$e){if(typeof $e==="string")return px($e)?$e:Wp(i,$e);return Wp(i,dx)}function Up(i){return ix("sha256",i,"hex")}function qp(){return{formatVersion:Go,toolchainVersion:Uo(),entries:{}}}function fx(i){try{let $e=ax(i,"utf-8"),Be=JSON.parse($e);if(Be.formatVersion!==Go||Be.toolchainVersion!==Uo())return qp();return Be}catch{return qp()}}class Ho{cacheFilePath;file;next=new Map;blocked=new Set;constructor(i){this.cacheFilePath=i,this.file=fx(i)}has(i,$e){if(this.blocked.has(i))return!1;let Be=this.file.entries[i];return Be!==void 0&&Be.hash===$e}get(i,$e){if(this.blocked.has(i))return null;let Be=this.file.entries[i];if(Be===void 0||Be.hash!==$e)return null;if(this.next.set(i,Be),Be.typeScriptMetadata!==void 0)Be.parsed[T]=Be.typeScriptMetadata;return Be.parsed}set(i,$e,Be){this.next.set(i,{hash:$e,parsed:Be,typeScriptMetadata:Be[T]})}invalidate(i){this.blocked.add(i)}getGeneratedText(i,$e){let Be=this.next.get(i);if(Be?.generatedText===void 0||Be.generatedText.key!==$e)return;return Be.generatedText.text}setGeneratedText(i,$e,Be){let Fe=this.next.get(i);if(Fe===void 0)return;Fe.generatedText={key:$e,text:Be}}save(){ox(lx(this.cacheFilePath),{recursive:!0});let i={formatVersion:Go,toolchainVersion:Uo(),entries:Object.fromEntries(this.next)},$e=JSON.stringify(i),Be=`${this.cacheFilePath}.${process.pid}.tmp`;try{Vp(Be,$e),cx(Be,this.cacheFilePath)}catch{try{Vp(this.cacheFilePath,$e)}catch{}}}}import{lstatSync as hx,readFileSync as mx}from"node:fs";import{basename as yx,dirname as Jo,join as gx,relative as xx,resolve as Xp}from"node:path";var Ar=null,Ko=null;function ar(){if(Ar)return Promise.resolve(Ar);if(!Ko)Ko=Promise.all([import("./chunk-v0hbw81y.js"),import("./chunk-9a8zmdck.js")]).then(([i,$e])=>(Ar={ComponentParser:i.default,parseSvelte:$e.parse},Ar));return Ko}function si(){if(!Ar)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return Ar}var zo=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],bx=/\r?\n/,Ex=/^\s*\*+/;function Lt(i){return i&&typeof i==="object"?i:void 0}function lr(i){return Array.isArray(i)?i:[]}function On(i){return r(i)?i.name:void 0}function fn(i,$e){let Be=ko(i,$e),Fe=Xp($e,Be),je=Jo(Fe),We=yx(Fe);if(Ln(je,We)){let Ge=Gs(je,We)??hx(Fe,{throwIfNoEntry:!1});if(Ge?.isFile())return Fe;for(let Ue of zo)if(Ln(je,We+Ue))return Fe+Ue;if(Ge?.isDirectory()){for(let Ue of zo)if(Ln(Fe,`index${Ue}`))return gx(Fe,`index${Ue}`)}return null}for(let Ve of zo)if(Ln(je,We+Ve))return Fe+Ve;return null}function Cx(i,$e){let Be=i.slice(0,$e).trimEnd();if(!Be.endsWith("*/"))return;let Fe=Be.length-2,je=Be.lastIndexOf("/**",Fe);if(je===-1)return;let We=[];for(let Ve of Be.slice(je+3,Fe).split(bx)){let Ge=Ve.replace(Ex,"").trim();if(Ge.startsWith("@"))break;if(Ge)We.push(Ge)}return We.join(" ")||void 0}function vx(i,$e){let Be=i.slice(0,$e).trimEnd();if(!Be.endsWith("*/"))return;let Fe=Be.length-2,je=Be.lastIndexOf("/**",Fe);if(je===-1)return;return Be.slice(je,Fe+2)}function cr(i,$e){if(!$e)return;return i.text.slice($e.start,$e.end)}function Sx(i,$e){let Be=Lt($e?.typeAnnotation);if(Be?.type!=="TSTypeAnnotation")return;return cr(i,Lt(Be.typeAnnotation))}function Xo(i,$e){let Be=Lt($e.returnType);return Be?.type==="TSTypeAnnotation"?cr(i,Lt(Be.typeAnnotation)):void 0}function Hp(i,$e){let Be=lr($e.params).map((je)=>cr(i,je)??"").join(", "),Fe=Xo(i,$e);return`(${Be})${Fe?` => ${Fe}`:""}`}function Jp(i){if(i.type==="Literal"){let $e=i.value;if(typeof $e==="string")return"string";if(typeof $e==="number")return"number";if(typeof $e==="boolean")return"boolean"}if(i.type==="TemplateLiteral")return"string";return}function Tx(i,$e){let Be=cr(i,$e);if(Be===void 0)return;if($e.type==="Literal"){let je=$e.value;if(typeof je==="string"||typeof je==="number"||typeof je==="boolean")return{raw:Be,value:je,type:typeof je};return}if($e.type==="UnaryExpression"&&$e.operator==="-"){let je=Lt($e.argument);if(je?.type==="Literal"&&typeof je.value==="number")return{raw:Be,value:-je.value,type:"number"};return}let Fe=$e.type==="TemplateLiteral"?_n($e):null;return Fe===null?void 0:{raw:Be,value:Fe,type:"string"}}function kx(i){if(!i)return;let $e=i.lastIndexOf("=>");if($e===-1)return;return i.slice($e+2).trim()||void 0}function Kp(i){if(i.async||i.generator)return;let $e=Lt(i.body);if(!$e)return;let Be=[];if($e.type==="BlockStatement"){if(Zr($e,Be),Be.length===0)return}else Be.push($e);let Fe;for(let je of Be){if(!je)return;let We=Jp(je);if(!We)return;if(Fe===void 0)Fe=We;else if(Fe!==We)return}return Fe}function Zr(i,$e){for(let Be of lr(i.body)){if(Be.type==="FunctionDeclaration"||Be.type==="FunctionExpression"||Be.type==="ArrowFunctionExpression")continue;if(Be.type==="ReturnStatement"){$e.push(Lt(Be.argument)??null);continue}if(Be.type==="BlockStatement"){Zr(Be,$e);continue}let Fe=Lt(Be.consequent);if(Fe?.type==="BlockStatement")Zr(Fe,$e);else if(Fe?.type==="ReturnStatement")$e.push(Lt(Fe.argument)??null);let je=Lt(Be.alternate);if(je?.type==="BlockStatement")Zr(je,$e);else if(je?.type==="ReturnStatement")$e.push(Lt(je.argument)??null);let We=Lt(Be.body);if(We?.type==="BlockStatement")Zr(We,$e)}}function Ax(i){let $e=Lt(i.initializer);if(!$e)return;if($e.type==="Literal"){let Be=$e.value;return typeof Be==="string"||typeof Be==="number"?Be:void 0}if($e.type==="UnaryExpression"){let Be=Lt($e.argument);if($e.operator==="-"&&Be?.type==="Literal"){let je=Be.value;if(typeof je==="number")return-je}}return}function wx(i){let $e=lr(i.members);if($e.length===0)return;let Be=[],Fe=0;for(let je of $e){if(!Lt(je.initializer)){Be.push(String(Fe)),Fe+=1;continue}let Ve=Ax(je);if(Ve===void 0)return;Be.push(typeof Ve==="string"?JSON.stringify(Ve):String(Ve)),Fe=typeof Ve==="number"?Ve+1:Fe}return Be.join(" | ")}function zp(i,$e,Be){let Fe=i.filePath,je=Cx(i.text,Be),We=vx(i.text,Be),Ve=We?jl(We):void 0,{deprecated:Ge,tags:Ue,internal:ze}=We?Vl(We):{deprecated:void 0,tags:void 0,internal:!1},Ke=ze?{internal:!0}:{};if($e.type==="VariableDeclaration"){let Xe=$e.kind??"const",Ze=[];for(let et of lr($e.declarations)){let nt=Lt(et.id),st=On(nt);if(!st)continue;let ot=Sx(i,nt),ut,mt,it,ft,yt,kt=Lt(et.init);if(kt)if(kt.type==="ArrowFunctionExpression"||kt.type==="FunctionExpression"){if(yt=kt,!ot)ot=Hp(i,kt);mt=Xo(i,kt)??Ve??kx(ot)??Kp(kt)}else{if(ut=cr(i,kt),!ot)ot=Jp(kt);if(it=_n(kt)??void 0,Xe==="const")ft=Tx(i,kt)}Ze.push({name:st,kind:Xe,type:ot,value:ut,returnType:mt,literalValue:it,primitiveLiteral:ft,functionNode:yt,description:je,deprecated:Ge,tags:Ue,...Ke,declFile:Fe,isTypeOnly:!1})}return Ze}if($e.type==="FunctionDeclaration"||$e.type==="TSDeclareFunction"){let Xe=On(Lt($e.id));if(!Xe)return[];return[{name:Xe,kind:"function",type:Hp(i,$e),returnType:Xo(i,$e)??Ve??Kp($e),...$e.type==="FunctionDeclaration"?{functionNode:$e}:{},description:je,deprecated:Ge,tags:Ue,...Ke,declFile:Fe,isTypeOnly:!1}]}if($e.type==="ClassDeclaration"){let Xe=On(Lt($e.id));if(!Xe)return[];return[{name:Xe,kind:"class",type:Xe,description:je,deprecated:Ge,tags:Ue,...Ke,declFile:Fe,isTypeOnly:!1}]}if($e.type==="TSTypeAliasDeclaration"){let Xe=On(Lt($e.id));if(!Xe)return[];return[{name:Xe,kind:"type",type:cr(i,Lt($e.typeAnnotation)),description:je,deprecated:Ge,tags:Ue,...Ke,declFile:Fe,isTypeOnly:!0}]}if($e.type==="TSInterfaceDeclaration"){let Xe=On(Lt($e.id));if(!Xe)return[];return[{name:Xe,kind:"interface",type:cr(i,Lt($e.body)),description:je,deprecated:Ge,tags:Ue,...Ke,declFile:Fe,isTypeOnly:!0}]}if($e.type==="TSEnumDeclaration"){let Xe=On(Lt($e.id));if(!Xe)return[];return[{name:Xe,kind:"enum",type:wx($e)??Xe,description:je,deprecated:Ge,tags:Ue,...Ke,declFile:Fe,isTypeOnly:!1}]}return[]}function Px(i){let $e;try{$e=mx(i,"utf-8")}catch{return null}let Be=`<script lang="ts">
217
- ${$e}
218
- </script>`;try{let Fe=si().parseSvelte(Be),je=lr(Fe.instance?.content?.body);return{source:{text:Be,filePath:i,dir:Jo(i)},body:je}}catch(Fe){let je=Fe instanceof Error?Fe.message:String(Fe);return console.warn(`Warning: Failed to parse entry export module ${i}: ${je}`),null}}function Nx(i,$e){for(let Be of i){if(Be.type!=="ImportDeclaration")continue;let Fe=Lt(Be.source)?.value;if(typeof Fe!=="string")continue;for(let je of lr(Be.specifiers)){if(je.type!=="ImportSpecifier")continue;if(On(Lt(je.local))===$e){let We=On(Lt(je.imported))??$e;return{specifier:Fe,importedName:We}}}}return null}function bn(i,$e){let Be=$e.cache.get(i);if(Be)return Be;if($e.computing.has(i))return[];$e.computing.add(i);let Fe=Px(i);if(!Fe)return $e.computing.delete(i),$e.cache.set(i,[]),[];let{source:je,body:We}=Fe,Ve=[],Ge=new Map;for(let ze of We){let Ke=ze.type==="ExportNamedDeclaration"?Lt(ze.declaration):ze;if(!Ke)continue;for(let Xe of zp(je,Ke,Ke.start))Ge.set(Xe.name,Xe)}let Ue=(ze)=>{let Ke=Ge.get(ze);if(Ke)return Ke;let Xe=Nx(We,ze);if(!Xe||Xe.specifier.endsWith(".svelte"))return null;let Ze=fn(Xe.specifier,je.dir);if(!Ze)return null;return bn(Ze,$e).findLast((et)=>et.name===Xe.importedName)??null};for(let ze of We){if(ze.type==="ExportAllDeclaration"){let nt=Lt(ze.source)?.value;if(typeof nt!=="string"||nt.endsWith(".svelte"))continue;let st=fn(nt,je.dir);if(!st)continue;let ot=ze.exportKind==="type";for(let ut of bn(st,$e))Ve.push(ot?{...ut,isTypeOnly:!0}:ut);continue}if(ze.type!=="ExportNamedDeclaration")continue;let Ke=Lt(ze.declaration);if(Ke){Ve.push(...zp(je,Ke,ze.start));continue}let Xe=Lt(ze.source)?.value,Ze=typeof Xe==="string"?Xe:void 0;if(Ze?.endsWith(".svelte"))continue;let et=ze.exportKind==="type";for(let nt of lr(ze.specifiers)){if(nt.type!=="ExportSpecifier")continue;let st=On(Lt(nt.exported)),ot=On(Lt(nt.local));if(!st||!ot||ot==="default"||st==="default")continue;let ut=et||nt.exportKind==="type",mt=null;if(Ze){let it=fn(Ze,je.dir);if(it)mt=bn(it,$e).findLast((ft)=>ft.name===ot)??null}else mt=Ue(ot);if(mt?.declFile.endsWith(".svelte"))continue;if(mt)Ve.push({...mt,name:st,isTypeOnly:mt.isTypeOnly||ut});else Ve.push({name:st,kind:ut?"type":"const",declFile:i,isTypeOnly:ut})}}return $e.computing.delete(i),$e.cache.set(i,Ve),Ve}async function es(i){await ar();let $e=Xp(i),Be=Jo($e),Fe=bn($e,{cache:new Map,computing:new Set}),je=(Ge)=>e(`./${xx(Be,Ge)}`),We=new Map,Ve=new Map;for(let Ge of Fe){let Ue=Ve.get(Ge.name);if(Ue!==void 0&&Ue!==Ge.declFile){console.warn(`Warning: "${Ge.name}" is exported from both "${je(Ue)}" and "${je(Ge.declFile)}"; keeping the first and dropping the rest.`);continue}Ve.set(Ge.name,Ge.declFile);let{declFile:ze,returnType:Ke,literalValue:Xe,primitiveLiteral:Ze,functionNode:et,...nt}=Ge;We.set(Ge.name,{...nt,source:je(ze)})}return Array.from(We.values()).sort((Ge,Ue)=>Ge.name.localeCompare(Ue.name))}import{readFileSync as Qp}from"node:fs";import{dirname as Zp,join as Dx,relative as _x,resolve as Ix}from"node:path";var Yp=new Map;function Rx(i){return Fi(i,{ecmaVersion:"latest",sourceType:"module"})}function Lx(i,$e,Be){let Fe=fn(i,$e);if(!Fe)return null;let je=Zp(Fe);if(Be.has(Fe))return{dir:je,exports:{}};Be.add(Fe);try{return{dir:je,exports:ii(Qp(Fe,"utf-8"),je,Be,Fe)}}catch{return{dir:je,exports:{}}}finally{Be.delete(Fe)}}function ii(i,$e,Be=new Set,Fe=$e){let je=Yp.get(i);if(!je)je=Rx(i),Yp.set(i,je);let We={};for(let Ve of je.body)if(Ve.type==="ExportDefaultDeclaration"){let Ge=Ve.declaration.name;if(Ge in We)We[Ge].default=!0;else We[Ge]={source:Vn(""),default:!0}}else if(Ve.type==="ExportAllDeclaration"){if(!Ve.source)continue;let Ge=Ve.source.value,Ue=fn(Ge,$e);if(!Ue){let Xe=vr(Ge,$e);throw new Cr(Ge,Fe,Xe.unresolved?Xe.searched:"no matching file or index found")}if(Be.has(Ue))continue;Be.add(Ue);let ze=Qp(Ue,"utf-8"),Ke=ii(ze,Zp(Ue),Be,Ue);Be.delete(Ue);for(let[Xe,Ze]of Object.entries(Ke)){let et=Vn(e(`./${Dx(Ge,Ze.source)}`));We[Xe]={...Ze,source:et}}}else if(Ve.type==="ExportNamedDeclaration"){let Ge=Ve.source?.value,Ue=Ge!==void 0&&Rn.test(Ge);if(Ue){let Xe=vr(Ge,$e);if(Xe.unresolved)throw new Cr(Ge,Fe,Xe.searched)}let Ke=Ge!==void 0&&!Ue?Lx(Ge,$e,Be):void 0;if(Ke===null)console.warn(`sveld: could not resolve re-exported module "${Ge}" from barrel "${$e||"."}"; skipping.`);for(let Xe of Ve.specifiers){let Ze=Xe.exported.name,et=Xe.local.name,nt=Ze||et;if(Ke===null)continue;let st=Ke?.exports[et],ot=st?Vn(e(`./${_x($e,Ix(Ke.dir,st.source))}`)):Vn(Xs(Ge??"",$e)),ut=st?st.default:et==="default";if(nt in We){if(We[nt].mixed=!0,!We[nt].source)We[nt].source=ot}else We[nt]={source:ot,default:ut}}}else if(Ve.type==="ImportDeclaration"){let Ge=Ve.specifiers[0].local.name;if(Ge in We){if(!We[Ge].source)We[Ge].source=Vn(Xs(Ve.source?.value??"",$e))}else We[Ge]={source:Vn(Xs(Ve.source?.value??"",$e)),default:Ge==="default"}}return We}import{existsSync as Ox}from"node:fs";import{dirname as Mx}from"node:path";function eu(){return{cache:new Map,computing:new Set}}var $x=/\.[^./\\]+$/;function Bx(i){if(i.endsWith(".d.ts"))return null;let $e=i.replace($x,".d.ts");return Ox($e)?$e:null}function tu(i,$e,Be){let Fe=Mx(i);return $e.map((je)=>{if(!je.importSource||!je.importedName)return{candidate:je};let We=fn(je.importSource,Fe);if(!We)return{candidate:je,failureReason:"module-not-found"};let Ve=bn(We,Be).find((Ue)=>Ue.name===je.importedName);if(!Ve)return{candidate:je,failureReason:"export-not-found"};if(Ve.returnType)return{candidate:je,type:Ve.returnType};let Ge=Bx(We);if(Ge){let Ue=bn(Ge,Be).find((ze)=>ze.name===je.importedName);if(Ue?.returnType)return{candidate:je,type:Ue.returnType}}return{candidate:je,failureReason:"return-type-unresolved"}})}function nu(i,$e){switch($e){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 Fx}from"node:path";function ru(i,$e,Be){let Fe=Fx(i);return $e.map((je)=>{let We=fn(je.importSource,Fe);if(!We)return{candidate:je};let Ve=bn(We,Be).find((Ge)=>Ge.name===je.importedName);if(!Ve?.primitiveLiteral)return{candidate:je};return{candidate:je,literal:Ve.primitiveLiteral}})}import{dirname as jx}from"node:path";function su(i,$e,Be){let Fe=jx(i);return $e.map((je)=>{let We=fn(je.importSource,Fe);if(!We)return{candidate:je};let Ve=bn(We,Be).find((Ge)=>Ge.name===je.importedName);if(Ve?.kind!=="const"||Ve.literalValue===void 0)return{candidate:je};return{candidate:je,key:Ve.literalValue}})}import{dirname as Vx}from"node:path";function au(i,$e,Be){let Fe=Vx(i);return $e.map((je)=>{let We=fn(je.importSource,Fe);if(!We)return{candidate:je,failureReason:"module-not-found"};let Ve=bn(We,Be).findLast((Ue)=>Ue.name===je.importedName)?.functionNode;if(!Ve)return{candidate:je,failureReason:"not-a-function"};let Ge=Wx(Ve,je);if(!Ge)return{candidate:je,failureReason:"parameter-not-found"};return Gx(Ve,Ge,je)})}function Mn(i){return i&&typeof i==="object"?i:void 0}function iu(i){return i?.type==="AssignmentPattern"?Mn(i.left):i}function Wx(i,$e){let Be=Array.isArray(i.params)?i.params:[],Fe=iu(Mn(Be[$e.argumentIndex]));if($e.property===void 0)return r(Fe)?{name:Fe.name}:void 0;if(!$e.property)return;if(r(Fe))return{object:Fe.name,property:$e.property};if(Fe?.type!=="ObjectPattern"||!Array.isArray(Fe.properties))return;for(let je of Fe.properties){if(je.type!=="Property"||je.computed)continue;let We=Mn(je.key);if(!r(We)||We.name!==$e.property)continue;let Ve=iu(Mn(je.value));return r(Ve)?{name:Ve.name}:void 0}return}function Yo(i){if(!i)return null;if(i.type==="ConditionalExpression"){let Be=Yo(Mn(i.consequent)),Fe=Yo(Mn(i.alternate));return Be&&Fe?[...Be,...Fe]:null}let $e=_n(i);return $e?[$e]:null}function qx(i){if(!i)return"null";if(i.type==="Literal")return M(i.value);return"any"}function ou(i,$e){if("name"in $e)return i.type==="Identifier"&&i.name===$e.name;if(i.type!=="MemberExpression"||i.computed)return!1;let Be=Mn(i.object),Fe=Mn(i.property);return r(Be)&&Be.name===$e.object&&r(Fe)&&Fe.name===$e.property}function Gx(i,$e,Be){let Fe=Mn(i.body);if(!Fe)return{candidate:Be,events:[]};let je=new Map,We="name"in $e?$e.name:$e.object,Ve;if(x(Fe,(Ue,ze,Ke)=>{if(Ve)return;if(Ue.type==="CallExpression"){let Ze=Mn(Ue.callee);if(!Ze||!ou(Ze,$e))return;let et=Array.isArray(Ue.arguments)?Ue.arguments:[],nt=Yo(et[0]);if(!nt){Ve="dynamic-event-name";return}for(let st of nt){let ot=je.get(st)??new Set;ot.add(qx(et[1])),je.set(st,ot)}return}let Xe=ze?.type==="CallExpression"&&Ke==="callee";if(Ue.type==="MemberExpression"&&ou(Ue,$e)&&!Xe){Ve="passed-on";return}if(Ue.type!=="Identifier"||Ue.name!==We)return;if(Xe)return;if(!("name"in $e)&&ze?.type==="MemberExpression"&&Ke==="object")return;if(ze?.type==="MemberExpression"&&Ke==="property"&&!ze.computed)return;if(ze?.type==="Property"&&Ke==="key"&&!ze.computed)return;Ve="passed-on"}),Ve)return{candidate:Be,failureReason:Ve};let Ge=Array.from(je,([Ue,ze])=>{let Ke=Array.from(ze);return{name:Ue,detail:Ke.includes("any")?"any":Ke.join(" | ")}});return{candidate:Be,events:Ge}}function cu(i,$e){switch($e){case"module-not-found":return`"${i.importSource}" isn't a local module sveld can read`;case"not-a-function":return`"${i.importedName}" isn't a function declared in "${i.importSource}"`;case"parameter-not-found":return`no parameter of "${i.importedName}" receives it`;case"dynamic-event-name":return"an event name isn't a string literal";case"passed-on":return`"${i.importedName}" passes it on`}}function k(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 Qx=/-/g,Zx=/[^A-Za-z0-9_$]/g,e0=/^[0-9]/;function t0(i){let $e=i.replace(Zx,""),Be=e0.test($e)?`_${$e}`:$e;if(Be!==i)console.warn(`Warning: "${i}" is not a valid identifier; using "${Be}" instead.`);return Be}function mu(i,$e=[],Be=new Set,Fe){let je;try{je=Fe??Hx(i)}catch{return $e}if(Be.has(je))return $e;Be.add(je);let We=qs(i);if(We===null)return $e;let Ve=We.entries;for(let Ge of Ve){if(Ge.name.startsWith("."))continue;let Ue=pu(i,Ge.name),ze=Ge.isSymbolicLink(),Ke=ze?fu(Ue,{throwIfNoEntry:!1}):Ge;if(!Ke)continue;if(Ke.isDirectory())mu(Ue,$e,Be,ze?void 0:pu(je,Ge.name));else if(Ke.isFile()&&Ge.name.endsWith(".svelte"))$e.push(Ue)}return $e}function n0(i){return mu(i).map(($e)=>{let Be=t0(zx($e,".svelte").replace(Qx,"")),Fe=Vn(e(`./${Qo(i,$e)}`));return{moduleName:Be,source:Fe}}).sort(($e,Be)=>$e.source.localeCompare(Be.source))}function r0(i){return!_s(i)}function s0(i,$e){let Be=i.endsWith("/")?i:`${i}/`;return $e.startsWith(Be)}function oi(i,$e){return{seenPaths:new Set(i.map(([,Be])=>$e(Be.source))),seenModuleNamePaths:new Map(i.map(([Be,Fe])=>[Be,$e(Fe.source)])),warnedModuleNames:new Set}}function Zo(i,$e,Be,Fe,je){for(let{moduleName:We,source:Ve}of n0(i)){let Ge=Fe(Ve),Ue=$e[We];if(Ue&&r0(Ue.source)&&s0(Ue.source,Ve)){je.seenPaths.delete(Fe(Ue.source)),Ue.source=Ve,je.seenPaths.add(Ge),je.seenModuleNamePaths.set(We,Ge);continue}if(je.seenPaths.has(Ge))continue;je.seenPaths.add(Ge);let ze=je.seenModuleNamePaths.get(We);if(ze===void 0)je.seenModuleNamePaths.set(We,Ge);else if(ze!==Ge&&!je.warnedModuleNames.has(We))je.warnedModuleNames.add(We),console.warn(`Warning: multiple components named "${We}" found (${e(Qo(i,ze))} and ${e(Qo(i,Ge))}). Both are included in TypeScript definitions, but only one can be the named export.`);Be.push([We,{source:Ve,default:!1}])}}function ai(i,$e,Be=!1){Ws();let Fe=du(i).isFile(),je=Fe?hu(i):i,We=wr(je),Ve=new Map,Ge=(Ke)=>{let Xe=Ve.get(Ke);if(Xe===void 0)Xe=Jx(Ke)?wr(Ke):wr(We,Ke),Ve.set(Ke,Xe);return Xe},Ue={};if(Fe){let Ke=Ux(i,"utf-8");try{Ue=ii(Ke,We,new Set([wr(i)]))}catch(Xe){if(!Be)throw Xe;let Ze=Xe instanceof Error?Xe.message:String(Xe);console.warn(`Warning: Failed to parse component exports from ${i}: ${Ze}`)}}let ze=Object.entries(Ue);if($e){let Ke=oi(ze,Ge);if(Zo(We,Ue,ze,Ge,Ke),!Fe)Ue=Object.fromEntries(ze.map(([Xe,Ze])=>[Xe,{...Ze,default:!0}]))}return{exports:Ue,allComponentEntries:ze,rootDir:We,resolveComponentFilePath:Ge}}async function ci(i){let $e=await Promise.all(Array.from(i).map(async(Be)=>{try{let Fe=await Kx(Be,"utf-8");return{path:Be,content:Fe}}catch(Fe){return console.warn(`Warning: Failed to read file ${Be}:`,Fe),{path:Be,content:null}}}));return new Map($e.map(({path:Be,content:Fe})=>[Be,Fe]))}function Yn([i,$e],Be,Fe,je,We={}){let Ve=$e.source,Ge=i;if(Be.length===1&&i==="default")Ge=Yx(Ve).name;if(_s(Ve)){let Ue=je(Ve),ze=Fe.get(Ue);if(ze===null||ze===void 0)return null;let Ke=e(Ve),Xe=We.memo?.get(Ue),Ze=We.hashes?.get(Ue),et=Xe===void 0?Ze===void 0?null:We.cache?.get(Ue,Ze):null,nt;if(Xe!==void 0)nt=Xe;else if(et)nt=et;else{let st=new(si()).ComponentParser;try{nt=st.parseSvelteComponent(ze,{moduleName:Ge,filePath:Ke})}catch(ot){if(We.failFast)throw ot;let ut=ot instanceof Error?ot.message:String(ot),mt=ot instanceof Error?ot.stack:void 0;return We.onParseError?.({filePath:Ke,moduleName:Ge,message:ut,stack:mt}),null}if(Ze!==void 0)We.cache?.set(Ue,Ze,nt);We.memo?.set(Ue,nt)}return{moduleName:Ge,filePath:Ke,...nt}}return null}function ea(i,$e){let Be=new Set;for(let Fe of i)for(let[,je]of Fe)if(_s(je.source))Be.add($e(je.source));return Be}function li(i){if(i.length===0)return;console.error(`sveld: failed to parse ${i.length} component(s):`);for(let{filePath:$e,message:Be}of i)console.error(` - ${$e}: ${Be}`)}async function w(i,$e,Be={}){let Fe=Be.documentExports===!0,{exports:je,allComponentEntries:We,rootDir:Ve,resolveComponentFilePath:Ge}=ai(i,$e,Fe),Ue=Fe&&du(i).isFile()?await es(wr(i)):[],ze=Object.entries(je),Ke=ea([ze,We],Ge),Xe=await ci(Ke),Ze=new Map,et=new Map,nt=Be.cache===!1?void 0:new Ho(Gp(Ve,Be.cache??!0)),st=nt?new Map:void 0,ot=new Set,ut=new Map;if(nt)for(let dt of Ke){let ht=Xe.get(dt);if(ht===null||ht===void 0)continue;let gt=Up(ht);if(ut.set(dt,gt),!nt.has(dt,gt))ot.add(dt)}if(Ke.size>0&&(!nt||ot.size>0))await ar();let mt=new Map,it=new Map,ft={failFast:Be.failFast===!0,onParseError:(dt)=>mt.set(dt.filePath,dt),cache:nt,hashes:ut,memo:it};for(let dt of ze){let ht=Yn(dt,ze,Xe,Ge,ft);if(ht)Ze.set(ht.moduleName,ht)}for(let dt of We){let ht=Yn(dt,We,Xe,Ge,ft);if(ht)et.set(ht.filePath,ht),st?.set(ht.filePath,Ge(dt[1].source))}if(nt&&ot.size>0){let dt=Kr(et,Ge),ht=js(ot,dt);for(let gt of ht){if(ot.has(gt))continue;nt.invalidate(gt),it.delete(gt)}for(let gt of ze){let xt=Ge(gt[1].source);if(!ht.has(xt)||ot.has(xt))continue;let St=Yn(gt,ze,Xe,Ge,ft);if(St)Ze.set(St.moduleName,St)}for(let gt of We){let xt=Ge(gt[1].source);if(!ht.has(xt)||ot.has(xt))continue;let St=Yn(gt,We,Xe,Ge,ft);if(St)et.set(St.filePath,St),st?.set(St.filePath,xt)}}let yt=Array.from(mt.values());if(li(yt),!Be.dryRun)nt?.save();let kt=Be.resolveTypes?m0(Ze):[],wt=Be.checkExamples?g0(et):[],Pt=Be.checkExamples===!0?uu(wt,"compile"):[],qe=Be.checkExamples?uu(wt,"syntax"):[];if(qe.length>0)x0(qe);let He=Be.typesInline==="all"?ni(et,Ge):new Map,Je,Qe;if(kt.length>0||Pt.length>0||He.size>0){let{TypeResolver:dt}=await import("./chunk-yqc5m8nm.js"),ht=await dt.create(Ve);if(!ht.ok){let xt=[kt.length>0?"resolveTypes":null,Pt.length>0?"checkExamples":null,He.size>0?'typesOptions.inline: "all"':null].filter((St)=>St!==null).join(" and ");throw Error(`sveld: \`${xt}\` ${ht.message}.`)}let gt=ht.resolver;try{if(kt.length>0)await y0(kt,gt,Ge);if(Pt.length>0)await b0(Pt,gt,Ge);if(He.size>0)Je=await gt.openBareTypeSession(He),Qe=gt;else await gt.dispose()}catch(xt){throw await gt.dispose(),xt}}let tt=i0(et),rt=a0(et),at=l0(et),pt=d0(et);if(tt.length>0||rt.length>0||at.length>0||pt.length>0){await ar();let dt=eu();for(let{component:ht,candidates:gt}of tt){let xt=tu(Ge(ht.filePath),gt,dt);o0(ht,xt)}for(let{component:ht,candidates:gt}of rt){let xt=ru(Ge(ht.filePath),gt,dt);c0(ht,xt)}for(let{component:ht,candidates:gt}of at){let xt=su(Ge(ht.filePath),gt,dt);p0(ht,xt)}for(let{component:ht,candidates:gt,deferredEventNoSource:xt}of pt){let St=au(Ge(ht.filePath),gt,dt);f0(ht,St,xt)}h0(Ze,et)}T0(et,Ge,Be.typesTypeNames),S0(et,Be.typesTypeNames);let lt;try{lt=Be.typesInline==="local"||Be.typesInline==="all"?await ri(et,Ge,Be.typesTypeNames,Je):void 0}finally{if(Je)await Je.dispose();if(Qe)await Qe.dispose()}let ct=ml(As(Array.from(et.values()).flatMap((dt)=>dt.diagnostics??[])),Be.diagnostics?.ignore);return{exports:je,entryExports:Ue,components:Ze,allComponentsForTypes:et,errors:yt,diagnostics:ct,cache:nt,resolvedPathByFilePath:st,inlinedTypesByFilePath:lt}}function i0(i){let $e=[];for(let Be of i.values()){let Fe=An(Be)?.pendingCallDefaultCandidates?.filter((je)=>je.importSource!==void 0);if(!Fe||Fe.length===0)continue;$e.push({component:Be,candidates:Fe})}return $e}function o0(i,$e){for(let{candidate:Be,type:Fe,failureReason:je}of $e){let Ve=(Be.location==="props"?i.props:i.moduleExports).find((Ge)=>Ge.name===Be.propName);if(Ve?.typeSource!=="unknown")continue;if(Fe){if(Ve.type=Fe,Ve.typeSource="typescript",Be.location==="props")i.diagnostics=(i.diagnostics??[]).filter((Ge)=>!(Ge.kind==="prop-unknown-type"&&Ge.name===Be.propName));continue}if(Be.location==="props"&&je){let Ge=i.diagnostics?.find((Ue)=>Ue.kind==="prop-unknown-type"&&Ue.name===Be.propName);if(Ge)Ge.message=nu(Be,je)}}}function a0(i){let $e=[];for(let Be of i.values()){let Fe=An(Be)?.pendingConstDefaultCandidates;if(!Fe||Fe.length===0)continue;$e.push({component:Be,candidates:Fe})}return $e}function c0(i,$e){for(let{candidate:Be,literal:Fe}of $e){if(!Fe)continue;let We=(Be.location==="props"?i.props:i.moduleExports).find((Ve)=>Ve.name===Be.propName);if(!We)continue;if(We.value=Fe.raw,We.defaultValue={raw:Fe.raw,kind:"literal",value:Fe.value},We.typeSource!=="unknown")continue;if(We.type=Fe.type,We.typeSource="default",Be.location==="props")i.diagnostics=(i.diagnostics??[]).filter((Ve)=>!(Ve.kind==="prop-unknown-type"&&Ve.name===Be.propName))}}function l0(i){let $e=[];for(let Be of i.values()){let Fe=An(Be)?.pendingContextKeyCandidates;if(!Fe||Fe.length===0)continue;$e.push({component:Be,candidates:Fe})}return $e}function p0(i,$e){for(let{candidate:Be,key:Fe}of $e){if(!Fe){i.diagnostics=[...i.diagnostics??[],gn({component:i.filePath,kind:"context-key-unresolved",name:Be.importedName,message:`setContext key \`${Be.importedName}\` from "${Be.importSource}" isn't an \`export const\` string sveld can read; the context is skipped.`,...Be.source?{source:Be.source}:{}})];continue}if(i.contexts?.some((Ve)=>Ve.key===Fe))continue;let je=[...i.contexts??[]],We=je.findIndex((Ve)=>u0(Ve.source,Be.source));je.splice(We===-1?je.length:We,0,{key:Fe,typeName:qr(Fe),description:Be.description,properties:Be.properties,source:Be.source}),i.contexts=je}}function u0(i,$e){if(!i||!$e)return!1;let{line:Be,column:Fe}=i.start;return Be>$e.start.line||Be===$e.start.line&&Fe>$e.start.column}function d0(i){let $e=[];for(let Be of i.values()){let Fe=An(Be),je=Fe?.pendingDispatchEscapeCandidates;if(!je||je.length===0)continue;$e.push({component:Be,candidates:je,deferredEventNoSource:Fe.deferredEventNoSourceDiagnostics??[]})}return $e}function f0(i,$e,Be){let Fe=new Map,je=[...i.diagnostics??[]],We=!0;for(let{candidate:Ue,events:ze,failureReason:Ke}of $e){if(Ke){We=!1,je.push(gn({component:i.filePath,kind:"dispatch-escapes",name:Ue.dispatcherName,message:`\`${Ue.dispatcherName}\` is passed to \`${Ue.calleeText}\`, but sveld couldn't read the events it dispatches: ${cu(Ue,Ke)}. Document them with @event tags.`,...Ue.source?{source:Ue.source}:{},...Ue.ignored?{ignored:!0}:{}}));continue}for(let Xe of ze??[]){if(Fe.has(Xe.name))continue;Fe.set(Xe.name,{type:"dispatched",name:Xe.name,detail:Xe.detail,...Ue.source?{source:Ue.source}:{}})}}if(We){for(let Ue of Be)if(!Fe.has(Ue.name))je.push(Ue)}i.diagnostics=je;let Ve=new Set(i.events.map((Ue)=>Ue.name)),Ge=Array.from(Fe.values()).filter((Ue)=>!Ve.has(Ue.name));if(Ge.length>0)i.events=[...i.events,...Ge].sort(z)}function h0(i,$e){for(let Be of i.values()){let Fe=$e.get(Be.filePath);if(!Fe||Fe===Be)continue;Be.contexts=Fe.contexts,Be.events=Fe.events,Be.diagnostics=Fe.diagnostics}}function m0(i){let $e=[];for(let Be of i.values()){let Fe=An(Be);if(!Fe?.canonicalPropsType||Be.props.length>0)continue;$e.push({component:Be,metadata:Fe})}return $e}async function y0(i,$e,Be){let Fe=await $e.expandAll(i.map(({component:je,metadata:We})=>({moduleName:je.moduleName,metadata:We,filePath:Be(je.filePath)})));for(let{component:je}of i){let We=Fe.get(Be(je.filePath));if(We)fl(je,We)}}function g0(i){let $e=[];for(let Be of i.values()){let Fe=lp(Be);if(Fe.length===0)continue;$e.push({component:Be,sources:Fe})}return $e}function uu(i,$e){let Be=[];for(let{component:Fe,sources:je}of i){let We=je.filter((Ve)=>Ve.kind===$e);if(We.length===0)continue;Be.push({component:Fe,sources:We})}return Be}function x0(i){for(let{component:$e,sources:Be}of i){let Fe=$e.diagnostics??[];for(let je of Be)try{D(je.code)}catch(We){if(We instanceof b)continue;Fe.push(gn({component:$e.filePath,kind:"example-syntax-error",name:je.name,message:We instanceof Error?We.message:String(We),...je.source?{source:je.source}:{}}))}$e.diagnostics=Fe}}async function b0(i,$e,Be){let Fe=await $e.checkExamples(i.map(({component:je,sources:We})=>({moduleName:je.moduleName,filePath:Be(je.filePath),sources:We})));for(let{component:je,sources:We}of i){let Ve=Fe.get(Be(je.filePath));if(!Ve||Ve.length===0)continue;let Ge=new Map(We.map((ze)=>[ze.id,ze.source])),Ue=je.diagnostics??[];for(let ze of Ve){let Ke=Ge.get(ze.id);Ue.push(gn({component:je.filePath,kind:"example-compile-error",name:ze.name,message:ze.message,...Ke?{source:Ke}:{}}))}je.diagnostics=Ue}}var E0=[".ts",".tsx",".d.ts",".svelte"];function C0(i){let $e=i.trim();if($e.length<2)return;let Be=$e[0],Fe=$e[$e.length-1];if((Be==='"'||Be==="'"||Be==="`")&&Be===Fe)return $e.slice(1,-1);return}function v0(i,$e){let Be=wr(hu(i),$e);if(lu(Be)&&fu(Be).isFile())return Be;if(Xx($e)!=="")return;for(let Fe of E0){let je=`${Be}${Fe}`;if(lu(je))return je}return}function S0(i,$e){for(let Be of i.values()){let Fe=Be.moduleExports.filter((Ve)=>Ve.kind==="re-export");if(Fe.length===0)continue;let je=new Set([qn(Be.moduleName,$e),ir(Be.moduleName,$e)]),We=Be.diagnostics??[];for(let Ve of Fe){if(!je.has(Ve.name))continue;We.push(gn({component:Be.filePath,kind:"module-export-conflict",name:Ve.name,message:`Re-export "${Ve.name}" has the same name as the generated "${Ve.name}" type; the .d.ts won't type-check if "${Ve.reExport?.from}" exports a type by that name.`,source:Ve.source}))}Be.diagnostics=We}}function T0(i,$e,Be){let Fe=new Map(Array.from(i.values()).map((je)=>[$e(je.filePath),je]));for(let je of i.values()){let We=je.extends;if(!We)continue;let Ve=C0(We.import);if(Ve===void 0||!Ve.startsWith(".")&&!Ve.startsWith("/"))continue;let Ge=$e(je.filePath),Ue=v0(Ge,Ve),ze=je.diagnostics??[];if(Ue===void 0){ze.push(gn({component:je.filePath,kind:"extend-props-target-missing",name:We.interface,message:`@extends/@extendProps target "${Ve}" was not found on disk.`})),je.diagnostics=ze;continue}let Ke=Fe.get(Ue);if(!Ke)continue;let Xe=qn(Ke.moduleName,Be);if(We.interface!==Xe){ze.push(gn({component:je.filePath,kind:"extend-props-target-missing",name:We.interface,message:`@extends/@extendProps names "${We.interface}", but "${Ve}" generates "${Xe}".`})),je.diagnostics=ze;continue}for(let Ze of je.props){let et=Ke.props.find((nt)=>nt.name===Ze.name);if(et&&et.type!==Ze.type)ze.push(gn({component:je.filePath,kind:"extend-props-override",name:Ze.name,message:`Own prop "${Ze.name}" (${Ze.type}) overrides "${Xe}"'s "${Ze.name}" (${et.type}).`}))}je.diagnostics=ze}}import{existsSync as yu,readFileSync as k0}from"node:fs";import{join as gu}from"node:path";function _(i){if(i){let Be=gu(process.cwd(),i);if(yu(Be))return Hr(i);return console.error(`Invalid entry point: ${Be}. Pass a valid --entry (or "entry" option), or unset it and`),console.error('set the "svelte" field in your package.json instead.'),null}let $e=gu(process.cwd(),"package.json");if(!yu($e))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 Be=Us(JSON.parse(k0($e,"utf-8")));if(Be.svelte?.trim())return Hr(Be.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(Be){throw console.error("Error reading package.json:",Be),Be}}var ta=!1;function R(i){ta=i}function hn(i){if(!ta)console.error(i)}function xu(i){if(!ta)console.error(i)}import{lstatSync as A0}from"node:fs";import{resolve as pi}from"node:path";async function bu(i,$e,Be=!1,Fe,je){let We=A0(i).isFile(),Ve=We?pi(i):null,Ge=ai(i,$e,Be),{rootDir:Ue,exports:ze,allComponentEntries:Ke,resolveComponentFilePath:Xe}=Ge,Ze;if(Fe==="all"){let{TypeResolver:Je}=await import("./chunk-yqc5m8nm.js"),Qe=await Je.create(Ue);if(!Qe.ok)throw Error(`sveld: \`typesOptions.inline: "all"\` ${Qe.message}.`);Ze=Qe.resolver}let et=Be&&We?await es(pi(i)):[],nt=Object.entries(ze),st=oi(Ke,Xe),ot=new Map,ut=new Map;await ar();let mt=new Map,it={onParseError:(Je)=>mt.set(Je.filePath,Je)},ft=new Map,yt=new Map,kt=async(Je)=>{if(Fe!=="local"&&Fe!=="all")return;for(let rt of Je.values()){ft.delete(rt.filePath);for(let at of yt.values())at.delete(rt.filePath)}let Qe=new Map;if(Fe==="all"&&Ze)Ze.forgetOverlayFiles(Array.from(Je.values(),(rt)=>qo(Xe(rt.filePath),rt.moduleName))),Qe=ni(Je,Xe);let tt;try{if(Ze&&Qe.size>0)tt=await Ze.openBareTypeSession(Qe);let rt=await ri(Je,Xe,je,tt);for(let[at,pt]of rt){ft.set(at,pt);for(let lt of pt.dependencies){let ct=yt.get(lt);if(!ct)ct=new Set,yt.set(lt,ct);ct.add(at)}}}finally{if(tt)await tt.dispose()}},wt=()=>({exports:ze,entryExports:et,components:ot,allComponentsForTypes:ut,errors:Array.from(mt.values()),diagnostics:As(Array.from(ut.values()).flatMap((Je)=>Je.diagnostics??[])),inlinedTypesByFilePath:Fe==="local"||Fe==="all"?ft:void 0});{let Je=ea([nt,Ke],Xe),Qe=await ci(Je);for(let tt of nt){let rt=Yn(tt,nt,Qe,Xe,it);if(rt)ot.set(rt.moduleName,rt)}for(let tt of Ke){let rt=Yn(tt,Ke,Qe,Xe,it);if(rt)ut.set(rt.filePath,rt)}await kt(ut),li(Array.from(mt.values()))}let Pt=Kr(ut,Xe),qe=(Je,Qe,tt,rt,at)=>{let pt=new Set;for(let lt of tt){let ct=Xe(lt[1].source);if(!rt.has(ct))continue;let dt=Yn(lt,tt,at,Xe,it);if(dt)Je.set(Qe(dt),dt),pt.add(ct);else for(let[ht,gt]of Je)if(Xe(gt.filePath)===ct)Je.delete(ht)}return pt};return{get result(){return Promise.resolve(wt())},update:async(Je)=>{let Qe=Je.map((xt)=>pi(xt));if(Ws(),Qe.length===0)return{result:wt(),reparsed:[]};let tt=new Set;for(let xt of Qe){let St=yt.get(xt);if(St)for(let Wt of St)tt.add(Wt)}let rt=Ve!==null&&Qe.includes(Ve),at=[];if(rt){let xt=ai(i,$e,Be),St=new Set(Object.keys(ze)),Wt=new Set(Object.keys(xt.exports));for(let Kt of St)if(!Wt.has(Kt))ot.delete(Kt);for(let Kt of Wt)if(!St.has(Kt))at.push(xt.resolveComponentFilePath(xt.exports[Kt].source));if(ze=xt.exports,Ke=xt.allComponentEntries,Xe=xt.resolveComponentFilePath,nt=Object.entries(ze),st=oi(Ke,Xe),Be&&We)et=await es(pi(i))}if($e)Zo(Ue,ze,Ke,Xe,st);let pt=Qe.filter((xt)=>Rn.test(xt)||Pt.has(xt));if(pt.length===0&&at.length===0){if(tt.size>0){let xt=new Map;for(let[St,Wt]of ut)if(tt.has(Wt.filePath))xt.set(St,Wt);await kt(xt)}return{result:wt(),reparsed:[]}}let lt=js([...pt,...at],Pt);for(let[xt,St]of mt)if(lt.has(Xe(St.filePath)))mt.delete(xt);let ct=await ci(lt),dt=new Set;for(let xt of qe(ot,(St)=>St.moduleName,nt,lt,ct))dt.add(xt);for(let xt of qe(ut,(St)=>St.filePath,Ke,lt,ct))dt.add(xt);Pt=Kr(ut,Xe);let ht=new Map;for(let[xt,St]of ut)if(dt.has(Xe(St.filePath))||tt.has(St.filePath))ht.set(xt,St);await kt(ht);for(let xt of ft.keys())if(!ut.has(xt))ft.delete(xt);let gt=wt();return li(gt.errors),{result:gt,reparsed:Array.from(dt)}}}}import W0 from"node:path";import{mkdir as w0,readFile as P0,writeFile as N0}from"node:fs/promises";import{parse as D0}from"node:path";class tn{dryRun;ensuredDirs=new Set;constructor(i){this.dryRun=i?.dryRun===!0}async write(i,$e){if(this.dryRun)return console.log(`would write "${e(i)}"`),!0;try{if(await P0(i,"utf-8")===$e)return!1}catch{}let Be=D0(i).dir;if(!this.ensuredDirs.has(Be))await w0(Be,{recursive:!0}),this.ensuredDirs.add(Be);return await N0(i,$e),!0}}var _0=/^=>\s*/;function I0(i){let $e=i.trim();if(!$e.startsWith("("))return{parameters:[],returnTypeText:$e||"any"};let Be=0,Fe=-1;for(let Ge=0;Ge<$e.length;Ge++)if($e[Ge]==="(")Be++;else if($e[Ge]===")"){if(Be--,Be===0){Fe=Ge;break}}if(Fe===-1)return{parameters:[],returnTypeText:"any"};let je=$e.slice(1,Fe).trim(),We=$e.slice(Fe+1).trim().replace(_0,"");return{parameters:je===""?[]:In(je).map((Ge)=>{let Ue=Ge.trim(),ze=Ue.startsWith("..."),Ke=ze?Ue.slice(3):Ue,Xe=Ke.indexOf(":"),Ze=(Xe===-1?Ke:Ke.slice(0,Xe)).trim(),et=Xe===-1?void 0:Ke.slice(Xe+1).trim(),nt=Ze.endsWith("?"),st={name:nt?Ze.slice(0,-1):Ze};if(et)st.type={text:et};if(nt)st.optional=!0;if(ze)st.rest=!0;return st}),returnTypeText:We||"any"}}function R0(i){if(i.params!==void 0||i.returnType!==void 0)return{parameters:(i.params??[]).map((Be)=>{let Fe={name:Be.name};if(Be.type)Fe.type={text:Be.type};if(Be.optional)Fe.optional=!0;return Fe}),returnTypeText:i.returnType??"any"};return i.type?I0(i.type):{parameters:[],returnTypeText:"any"}}function L0(i){return i.map(($e)=>{if($e.isFunctionDeclaration){let{parameters:Fe,returnTypeText:je}=R0($e),We={kind:"method",name:$e.name,static:!1};if(Fe.length>0)We.parameters=Fe;if(We.return={type:{text:je}},$e.description)We.description=$e.description;if($e.deprecated!==void 0)We.deprecated=$e.deprecated;return We}let Be={kind:"field",name:$e.name};if($e.type)Be.type={text:$e.type};if($e.value!==void 0)Be.default=$e.value;if($e.description)Be.description=$e.description;if($e.deprecated!==void 0)Be.deprecated=$e.deprecated;if($e.kind==="const")Be.readonly=!0;return Be})}function O0(i){let $e=i.customElement?.props,Be=new Map,Fe=[];for(let je of i.props){if(je.isFunctionDeclaration)continue;let We=$e?.[je.name];if(We?.attribute===!1)continue;let Ve=We?.attribute||je.name.toLowerCase(),Ge=Be.get(Ve);if(Ge!==void 0){console.warn(`sveld: props "${Ge}" and "${je.name}" of component "${i.moduleName}" both map to the custom-element attribute "${Ve}"; only "${Ge}" is included.`);continue}Be.set(Ve,je.name);let ze=We?.type==="Array"||We?.type==="Object"?[je.description,"Serialized to/from JSON for the attribute."].filter(Boolean).join(" "):je.description,Ke={name:Ve,fieldName:je.name};if(je.type)Ke.type={text:je.type};if(je.value!==void 0)Ke.default=je.value;if(ze)Ke.description=ze;if(We?.reflect)Ke.reflects=!0;Fe.push(Ke)}return Fe}function M0(i){if(!i||i.length===0)return;return i.map(($e)=>{let Be={name:$e.name};if($e.description)Be.description=$e.description;return Be})}function $0(i){if(!i||i.length===0)return;return i.map(($e)=>{let Be={name:$e.name};if($e.type)Be.type={text:$e.type};if($e.default!==void 0)Be.default=$e.default;if($e.description)Be.description=$e.description;return Be})}function B0(i){return i.filter(($e)=>$e.type==="dispatched").map(($e)=>{let Be={name:$e.name,type:{text:`CustomEvent<${$e.detail??"unknown"}>`}};if($e.description)Be.description=$e.description;if($e.deprecated!==void 0)Be.deprecated=$e.deprecated;return Be})}function F0(i){return i.map(($e)=>{let Be={name:$e.default?"":$e.name??""};if($e.description)Be.description=$e.description;if($e.deprecated!==void 0)Be.deprecated=$e.deprecated;return Be})}function j0(i){let $e=M0(i.cssParts),Be=$0(i.cssProperties),Fe=L0(i.props),je=O0(i),We=B0(i.events),Ve=F0(i.slots),Ge=i.moduleName,Ue=i.componentComment?{kind:"class",name:Ge,description:i.componentComment,members:Fe,attributes:je,events:We,slots:Ve}:{kind:"class",name:Ge,members:Fe,attributes:je,events:We,slots:Ve};if($e)Ue.cssParts=$e;if(Be)Ue.cssProperties=Be;if(i.customElementTag)Ue.tagName=i.customElementTag,Ue.customElement=!0;return Ue}function V0(i,$e){let Be=[{kind:"js",name:i.moduleName,declaration:{name:i.moduleName,module:$e}}];if(i.customElementTag)Be.push({kind:"custom-element-definition",name:i.customElementTag,declaration:{name:i.moduleName,module:$e}});return Be}function Eu(i,$e={}){let Be=o(i),Fe=$e.resolveModulePath??((We)=>We.filePath);return{schemaVersion:"1.0.0",modules:Be.components.map((We)=>{let Ve=Fe(We);return{kind:"javascript-module",path:Ve,declarations:[j0(We)],exports:V0(We,Ve)}})}}function na(i,$e){let Be=Eu(i,{resolveModulePath:(Fe)=>Is(Fe.filePath,$e.inputDir)});return sr(Be)}async function ra(i,$e){let Be=na(i,$e),Fe=W0.join(process.cwd(),$e.outFile),We=await new tn({dryRun:$e.dryRun}).write(Fe,Be);if(!$e.dryRun)hn(`${We?"created":"unchanged"} "${$e.outFile}".`)}import ia from"node:path";function Cu(i){let $e=new Map;for(let[Fe,je]of Object.entries(i)){let We=$e.get(je.source)||[];We.push({id:Fe,exportee:je}),$e.set(je.source,We)}let Be=[];for(let[Fe,je]of $e){let We=Rn.test(Fe),Ve=je.some(({id:Ze,exportee:et})=>Ze!=="default"&&et.default),Ge=je.some(({exportee:Ze})=>!Ze.default),Ue=We&&Ve&&Ge,ze=[],Ke=[],Xe=[];for(let{id:Ze,exportee:et}of je){if(Ze==="default"){Ke.push(`export { default } from "${Fe}";`);continue}if(et.default)if(et.mixed)Ke.push(`export { default as ${Ze} } from "${Fe}";`),Ke.push(`export { default } from "${Fe}";`);else Xe.push(`default as ${Ze}`);else if(We&&!Ue)Xe.push(`default as ${Ze}`);else ze.push(Ze)}if(Xe.length>0&&ze.length>0)Be.push(`export { ${[...Xe,...ze].join(", ")} } from "${Fe}";`);else{if(ze.length>0)Be.push(`export { ${ze.join(", ")} } from "${Fe}";`);if(Xe.length>0)Be.push(`export { ${Xe.join(", ")} } from "${Fe}";`)}Be.push(...Ke)}return Be.join(`
222
- `)}function vu(i){return i.filter(($e)=>$e.names.length>0).map(($e)=>`export type { ${$e.names.join(", ")} } from "${$e.source}";`).join(`
223
- `)}function Su(i){return i.replace(Rn,"")}function sa(i){return i.replace(Rn,".svelte.d.ts")}function q0(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)&&"start"in i&&"end"in i}function ts(i){if(Array.isArray(i))return i.map(($e)=>ts($e));if(i!==null&&typeof i==="object"){let $e={};for(let[Be,Fe]of Object.entries(i)){if((Be==="source"||Be==="componentCommentSource")&&q0(Fe))continue;$e[Be]=ts(Fe)}return $e}return i}function oa(i,$e){return i.map((Be)=>({...Be,filePath:Is(Be.filePath,$e)}))}function G0(i,$e,Be){if(!$e)return`${i.moduleName}.api.json`;if(!Be.has(i.moduleName))Be.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`${Su(i.filePath)}.api.json`}async function U0(i,$e){let Be=o(i),Fe=oa(Be.components,$e.inputDir);if($e.source===!1)Fe=ts(Fe);let je=new Map;for(let Ve of Fe)je.set(Ve.moduleName,(je.get(Ve.moduleName)??0)+1);let We=new Set;await Promise.all(Fe.map(async(Ve)=>{let Ge=(je.get(Ve.moduleName)??0)>1,Ue=G0(Ve,Ge,We),ze=ia.resolve(ia.join($e.outDir||"",Ue)),Xe=await new tn({dryRun:$e.dryRun}).write(ze,sr(Ve));if(!$e.dryRun)hn(`${Xe?"created":"unchanged"} "${ze}".`)}))}function aa(i,$e){let Be=o(i,{entryExports:$e.entryExports}),Fe={...Be,components:oa(Be.components,$e.inputDir)};if($e.source===!1)Fe=ts(Fe);return sr(Fe)}function Tu(i,$e){let Be=o(i,{entryExports:$e.entryExports}),Fe=oa(Be.components,$e.inputDir);if($e.source===!1)Fe=ts(Fe);return`${Fe.map((je)=>JSON.stringify(je)).join(`
224
- `)}
225
- `}async function H0(i,$e){let Be=aa(i,$e),Fe=ia.join(process.cwd(),$e.outFile),We=await new tn({dryRun:$e.dryRun}).write(Fe,Be);if(!$e.dryRun)hn(`${We?"created":"unchanged"} "${$e.outFile}".`)}async function ca(i,$e){if($e.outDir)await U0(i,$e);else await H0(i,$e)}import xi from"node:path";import{readFileSync as K0}from"node:fs";import{join as z0}from"node:path";function ku(){try{let{name:i,description:$e}=Us(JSON.parse(K0(z0(process.cwd(),"package.json"),"utf-8")));return{name:i,description:$e}}catch{return{}}}var pa=/`/g,Au=/\s+/g,cn="--",wu=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
226
- | :- | :- | :- | :- | :- | :- | :- | :- |
227
- `,ui=`| Slot name | Default | Props | Fallback | Description |
228
- | :- | :- | :- | :- | :- |
229
- `,di=`| Event name | Type | Detail | Description |
230
- | :- | :- | :- | :- |
231
- `,ua=`| Name | Kind | Type | Description |
232
- | :- | :- | :- | :- |
233
- `,Pu=`| Part name | Description |
234
- | :- | :- |
235
- `,Nu=`| Property name | Type | Default value | Description |
236
- | :- | :- | :- | :- |
237
- `,rs=/\|/g,X0=/</g,J0=/>/g,Pr=/\n/g,Y0=/^[A-Za-z_$][\w$]*$/,Q0=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function la(i){return i.replace(Q0,($e,Be,Fe)=>`[${Fe===void 0?Be:Fe.trim()}](${Be})`)}function wn(i){if(i===void 0)return cn;return`<code>${i.replace(rs,"&#124;")}</code>`}function fi(i){if(!i.reExport)return wn(i.type);let{from:$e,imported:Be}=i.reExport,Fe=Be==="*"?"":Y0.test(Be)?`.${Be}`:`[${JSON.stringify(Be)}]`;return wn(`typeof import(${JSON.stringify($e)})${Fe}`)}function ns(i){return i.replace(X0,"&lt;").replace(J0,"&gt;")}function ss(i){if(i===void 0)return cn;return`<code>${i.replace(pa,"\\`").replace(rs,"&#124;")}</code>`}function $n(i,$e){if($e===void 0)return i;let Be=typeof $e==="string"&&$e.trim().length>0?`: ${ns($e).replace(Pr," ").replace(rs,"&#124;")}`:"";return`<s>${i}</s><br />**Deprecated**${Be}`}function hi(i){if(i===void 0||i.trim().length===0)return cn;return ns(la(i)).replace(rs,"&#124;").replace(Pr,"<br />")}function mi(i){if(i===void 0||i==="{}")return cn;return wn(Qs(i).replace(Pr," "))}function yi(i){if(i===void 0)return cn;return wn(ns(i).replace(Pr,"<br />"))}function Gn(i,$e){let Be=[];if(i!==void 0&&i.trim().length>0)Be.push(ns(la(i)));for(let{name:Fe,body:je}of $e??[]){let We=je?.trim();Be.push(We?`@${Fe} ${ns(la(We))}`:`@${Fe}`)}if(Be.length===0)return cn;return Be.join(`
238
- `).replace(rs,"&#124;").replace(Pr,"<br />")}function gi(i){if(i===void 0)return cn;return wn(i.replace(Pr," "))}var Z0=/[^\w\- ]+/g,eb=/\s+/g;function tb(i,$e){let Be=i.toLowerCase().replace(pa,"").replace(Z0,"").replace(eb,"-"),Fe=$e.get(Be)??0;return $e.set(Be,Fe+1),Fe===0?Be:`${Be}-${Fe}`}class Nr{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
239
-
240
- `),this}append(i,$e){switch(i){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let Be=Number(i.slice(-1));if(this.sourceParts.push(`${"#".repeat(Be)} ${$e}`),this.hasToC&&i==="h2")this.toc.push({indent:0,raw:$e??""});break}case"quote":this.sourceParts.push(`> ${$e}`);break;case"p":this.sourceParts.push($e??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push($e??"");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 $e="<!-- __TOC__ -->",Be=i.indexOf($e);if(Be===-1)return i;let Fe=new Map,je=this.toc.map(({indent:We,raw:Ve})=>`${" ".repeat(We)}- [${Ve}](#${tb(Ve,Fe)})`).join(`
241
- `);return i.slice(0,Be)+je+i.slice(Be+$e.length)}}var nb=`| Name | Type | Default | Required | Description |
242
- | :- | :- | :- | :- | :- |
243
- `,rb=/[.!?](?:\s|$)/,sb=/\r?\n[ \t]*\r?\n/,ib=/\s+/g;function Du(i,$e){if(!i)return $e;let Be=i.trim().split(sb)[0]?.replace(ib," ").trim();if(!Be)return $e;let Fe=rb.exec(Be);return Fe?Be.slice(0,Fe.index+1):Be}function da(i,$e,Be){if(Be.length===0)return;i.append("h3",$e),i.append("raw",nb);for(let Fe of Be)i.append("raw",`| ${$n(Fe.name,Fe.deprecated)} | ${fi(Fe)} | ${ss(Fe.value)} | ${Fe.isRequired?"Yes":"No"} | ${Gn(Fe.description,Fe.tags)} |
244
- `);i.append("raw",`
245
- `)}function ob(i,$e){if($e.length===0)return;i.append("h3","Events"),i.append("raw",di);for(let Be of $e)i.append("raw",`| ${$n(Be.name,Be.deprecated)} | ${Be.type} | ${Be.type==="dispatched"?gi(Be.detail):cn} | ${Gn(Be.description,Be.tags)} |
246
- `);i.append("raw",`
247
- `)}function ab(i,$e,Be){if(Be.length===0)return;i.append("h3",$e),i.append("raw",ui);for(let Fe of Be)i.append("raw",`| ${$n(Fe.default?cn:Fe.name??cn,Fe.deprecated)} | ${Fe.default?"Yes":"No"} | ${mi(Fe.slot_props)} | ${yi(Fe.fallback)} | ${Gn(Fe.description,Fe.tags)} |
248
- `);i.append("raw",`
249
- `)}function cb(i,$e){if($e.typedefs.length===0)return;i.append("h3","Typedefs"),i.append("raw",`\`\`\`ts
250
- ${kr({typedefs:$e.typedefs})}
251
- \`\`\`
252
-
253
- `)}function lb(i,$e){if(i.append("h2",$e.moduleName),$e.generics)i.append("p",`Type parameters: ${wn(`<${$e.generics[1]}>`)}`);if($e.componentComment?.trim())i.append("p",$e.componentComment.trim());da(i,"Props",$e.props),da(i,"Bindings",$e.props.filter((Be)=>Be.reactive)),ob(i,$e.events),ab(i,$e.syntaxMode==="runes"?"Snippets":"Slots",$e.slots),cb(i,$e),da(i,"Module exports",$e.moduleExports)}function pb(i,$e,Be,Fe){let je=new Nr,We=Fe.linkBase??"";if(je.append("h1",$e),Be)je.append("quote",Be);je.append("h2","Components");for(let Ve of i)je.append("raw",`- [${Ve.moduleName}](${We}/${Ve.moduleName}): ${Du(Ve.componentComment,"Component")}
254
- `);if(je.append("raw",`
255
- `),Fe.entryExports&&Fe.entryExports.length>0){je.append("h2","Exports");for(let Ve of Fe.entryExports)je.append("raw",`- \`${Ve.name}\`: ${Du(Ve.description,Ve.kind)}
256
- `);je.append("raw",`
257
- `)}return je.end()}function ub(i,$e,Be){let Fe=new Nr;if(Fe.append("h1",$e),Be)Fe.append("quote",Be);for(let je of i)lb(Fe,je);return Fe.end()}function db(i,$e){let Be=o(i,{entryExports:$e.entryExports}),Fe=ku(),je=$e.title??Fe.name??"Components",We=$e.summary??Fe.description;return{llmsTxt:pb(Be.components,je,We,$e),llmsFullTxt:ub(Be.components,je,We)}}async function fa(i,$e){let{llmsTxt:Be,llmsFullTxt:Fe}=db(i,$e),je=new tn({dryRun:$e.dryRun}),We=e(xi.join($e.outDir??"","llms.txt")),Ve=e(xi.join($e.outDir??"","llms-full.txt")),[Ge,Ue]=await Promise.all([je.write(xi.join(process.cwd(),We),Be),je.write(xi.join(process.cwd(),Ve),Fe)]);if(!$e.dryRun)hn(`${Ge?"created":"unchanged"} "${We}".`),hn(`${Ue?"created":"unchanged"} "${Ve}".`)}import{join as ma,resolve as Mu}from"node:path";function _u(i,$e,Be){if(i.append("h1","Component Index"),i.append("h2","Components").tableOfContents(),i.append("divider"),Be&&Be.length>0)Ru(i,Be);let Fe=o($e);for(let je of Fe.components)Ou(i,je)}function Iu(i,$e,Be){i.append("h1","Component Index"),i.append("h2","Components");for(let Fe of $e)i.append("raw",`- [${Fe.moduleName}](./${Fe.moduleName}.md)
258
- `);if(i.append("raw",`
259
- `),i.append("divider"),Be&&Be.length>0)Ru(i,Be)}function Ru(i,$e){i.append("h2","Exports"),i.append("raw",ua);for(let Be of $e){let Fe=(Be.type??Be.value)?.replace(Au," ").trim();i.append("raw",`| ${$n(Be.name,Be.deprecated)} | ${`<code>${Be.kind}</code>`} | ${wn(Fe)} | ${hi(Be.description)} |
260
- `)}i.append("raw",`
261
- `),i.append("divider")}function fb(i){return i.kind==="const"||i.isFunctionDeclaration}function hb(i,$e){i.append("h3","Module exports"),i.append("raw",ua);for(let Be of $e)i.append("raw",`| ${$n(Be.name,Be.deprecated)} | ${`<code>${Be.kind}</code>`} | ${fi(Be)} | ${Gn(Be.description,Be.tags)} |
262
- `);i.append("raw",`
263
- `)}function ha(i,$e,Be,Fe){if($e.length>0)Be(),i.append("raw",`
264
- `);else i.append("p",Fe??"None.")}function Lu(i,$e){Ou(i,$e)}function Ou(i,$e){if(i.append("h2",`\`${$e.moduleName}\``),$e.generics)i.append("p",`**Type parameters:** ${wn(`<${$e.generics[1]}>`)}`);if($e.typedefs.length>0)i.append("h3","Types").append("raw",`\`\`\`ts
265
- ${kr({typedefs:$e.typedefs})}
266
- \`\`\`
267
-
268
- `);if(i.append("h3","Props"),ha(i,$e.props,()=>{i.append("raw",wu);let Be=(je)=>je.reactive?0:je.constant?2:1,Fe=$e.props.map((je,We)=>({prop:je,index:We})).sort((je,We)=>Be(je.prop)-Be(We.prop)||je.index-We.index).map(({prop:je})=>je);for(let je of Fe){let We=fb(je)?"accessor":je.kind;i.append("raw",`| ${$n(je.name,je.deprecated)} | ${je.isRequired?"Yes":"No"} | ${`<code>${We}</code>`} | ${je.reactive?"Yes":"No"} | ${je.binding??"--"} | ${wn(je.type)} | ${ss(je.value)} | ${Gn(je.description,je.tags)} |
269
- `)}}),$e.moduleExports.length>0)hb(i,$e.moduleExports);if(i.append("h3","Slots"),ha(i,$e.slots,()=>{i.append("raw",ui);for(let Be of $e.slots)i.append("raw",`| ${$n(Be.default?cn:Be.name??cn,Be.deprecated)} | ${Be.default?"Yes":"No"} | ${mi(Be.slot_props)} | ${yi(Be.fallback)} | ${Gn(Be.description,Be.tags)} |
270
- `)}),i.append("h3","Events"),ha(i,$e.events,()=>{i.append("raw",di);for(let Be of $e.events)i.append("raw",`| ${$n(Be.name,Be.deprecated)} | ${Be.type} | ${Be.type==="dispatched"?gi(Be.detail):cn} | ${Gn(Be.description,Be.tags)} |
271
- `)}),$e.cssParts&&$e.cssParts.length>0){i.append("h3","CSS Parts"),i.append("raw",Pu);for(let Be of $e.cssParts)i.append("raw",`| ${Be.name} | ${hi(Be.description)} |
272
- `);i.append("raw",`
273
- `)}if($e.cssProperties&&$e.cssProperties.length>0){i.append("h3","CSS Custom Properties"),i.append("raw",Nu);for(let Be of $e.cssProperties)i.append("raw",`| ${Be.name} | ${wn(Be.type)} | ${ss(Be.default)} | ${hi(Be.description)} |
274
- `);i.append("raw",`
275
- `)}}class bi extends tn{onAppend;markdownBase;constructor(i){super();this.onAppend=i.onAppend,this.markdownBase=new Nr}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,$e){return this.markdownBase.append(i,$e),this.onAppend?.call(this,i,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function ya(i,$e){return new bi({onAppend:(Be,Fe)=>{i.onAppend?.call(null,Be,Fe,$e)}})}async function mb(i,$e){let Be=$e.outDir,Fe=o(i,{entryExports:$e.entryExports}),je=new tn({dryRun:$e.dryRun}),We=ya($e,i);Iu(We,Fe.components,$e.entryExports);let Ve=Mu(ma(Be,"README.md")),Ge=await je.write(Ve,We.end());if(!$e.dryRun)hn(`${Ge?"created":"unchanged"} "${Ve}".`);await Promise.all(Fe.components.map(async(Ue)=>{let ze=ya($e,i);Lu(ze,Ue);let Ke=Mu(ma(Be,`${Ue.moduleName}.md`)),Xe=await je.write(Ke,ze.end());if(!$e.dryRun)hn(`${Xe?"created":"unchanged"} "${Ke}".`)}))}function ga(i,$e){let Be=ya($e,i);return _u(Be,i,$e.entryExports),Be.end()}async function xa(i,$e){if($e.outDir){if($e.write!==!1)await mb(i,$e);return}let Be=$e?.write!==!1,Fe=ga(i,$e);if(Be){let je=ma(process.cwd(),$e.outFile),We=await new tn({dryRun:$e.dryRun}).write(je,Fe);if(!$e.dryRun)hn(`${We?"created":"unchanged"} "${$e.outFile}".`)}return Fe}import{join as $u}from"node:path";function yb(i){let $e=new Set;for(let Be of i)if(Be.extends)$e.add(Be.extends.interface);return $e}function gb(i){return ei(i,Lo,!0).props}var xb={props:!0,exports:!0,typedefs:!1,contexts:!1};function bb(i){if(!i)return;return ei(i,xb,!1)}function Eb(i,$e,Be){let Fe=bb($e.indexTypes);if(!Fe)return[];let je=Oo($e),We=$e.format==="component",Ve=new Map,Ge=new Set,Ue=[];for(let[,ze]of Object.entries($e.exports)){if(!ze.default||!Rn.test(ze.source))continue;let Ke=e(ze.source);if(Ge.has(Ke))continue;Ge.add(Ke);let Xe=i.components.find((ot)=>ot.filePath===Ke);if(!Xe)continue;let Ze=qn(Xe.moduleName,$e.typeNames),et=Be.has(Ze),nt=[];if(Fe.props&&(je.props||et))nt.push(Ze);if(Fe.exports&&We&&je.exports)nt.push(ir(Xe.moduleName,$e.typeNames));if(Fe.typedefs&&je.typedefs)for(let ot of Xe.typedefs)nt.push(ot.name);if(Fe.contexts&&je.contexts)for(let ot of Xe.contexts??[])nt.push(ot.typeName);let st=[];for(let ot of nt){let ut=Ve.get(ot);if(ut!==void 0){xu(`sveld: index.d.ts skips duplicate type export "${ot}" from "${ze.source}" (already exported from "${ut}").`);continue}Ve.set(ot,ze.source),st.push(ot)}if(st.length>0)Ue.push({source:ze.source,names:st})}return Ue}async function Bu(i,$e,Be){if(!i)return $e;try{let Fe=await i($e,Be);if(typeof Fe!=="string")throw TypeError(`must return a string, got ${typeof Fe}`);return Fe}catch(Fe){let je=Fe instanceof Error?Fe.message:String(Fe);throw Error(`sveld: typesOptions.transform failed for "${Be.filePath}": ${je}`,{cause:Fe})}}async function ba(i,$e){let Be=$u(process.cwd(),$e.outDir,"index.d.ts"),Fe=new tn({dryRun:$e.dryRun}),je=o(i),We=yb(je.components),Ve=vu(Eb(je,$e,We)),Ge=$e.preamble+[Cu($e.exports),Ve].filter((Xe)=>Xe!=="").join(`
276
-
277
- `),Ue=Mo($e),ze=je.components.map(async(Xe)=>{let Ze=sa($u($e.outDir,Xe.filePath)),et=e(sa(Xe.filePath)),nt=$e.resolvedPathByFilePath?.get(Xe.filePath),st=$e.inlinedTypesByFilePath?.get(Xe.filePath),ot=We.has(qn(Xe.moduleName,$e.typeNames))&&!gb(Ue.exportTypes)?{...Ue,forceExportProps:!0}:Ue,ut=st?{...ot,inlined:st}:ot,mt=(st?.declarations.length??0)>0,it=Lp(ut),ft=!mt&&nt?$e.cache?.getGeneratedText(nt,it):void 0;if(ft===void 0){if(ft=$o(Xe,ut),!mt&&nt)$e.cache?.setGeneratedText(nt,it,ft)}let yt=await Bu($e.transform,ft,{kind:"component",component:Xe,filePath:et});await Fe.write(Ze,yt)}),Ke=(async()=>{let Xe=await Bu($e.transform,Ge,{kind:"index",filePath:"index.d.ts"});await Fe.write(Be,`${Xe}
278
- `)})();if(await Promise.all([...ze,Ke]),!$e.dryRun)hn("created TypeScript definitions.")}C({name:"json",componentSet:"exported",write:ca});C({name:"markdown",componentSet:"exported",write:xa});C({name:"types",componentSet:"all",write:ba});C({name:"custom-elements",componentSet:"exported",write:ra});C({name:"llms",componentSet:"exported",write:fa});var Fu='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',Sb=50;function Tb(i){let $e=Promise.resolve();return()=>{$e=$e.then(i,i)}}function Re(i){let $e=i?.watch===!0,Be,Fe,je=i??{},We,Ve=null,Ge,Ue=new Set,Ke=Tb(async()=>{if(Ve==null||Fe==null||Ue.size===0)return;let Ze=Array.from(Ue);Ue.clear();try{let{result:et}=await Ve.update(Ze);await P(et,je,Fe)}catch(et){console.error("sveld: failed to regenerate types in watch mode:",et)}}),Xe=(Ze)=>{if(!$e||Ve==null||!Ul.test(Ze))return;Ue.add(Ze),clearTimeout(Ge),Ge=setTimeout(Ke,Sb)};return{name:"vite-plugin-sveld",apply:$e?void 0:"build",enforce:"post",configResolved(Ze){We=Ze.root},async buildStart(){if(i?.config){let Ze=We??process.cwd(),et=typeof i.config==="string"?await vo(Cb(i.config)?i.config:vb(Ze,i.config)):await N(Ze);je=S(et,i)}if(I(je),R(je.quiet===!0),Fe=_(je.entry),$e&&Fe!=null)try{Ve=await bu(Fe,je.glob===!0,je.documentExports===!0,je.typesOptions?.inline,je.typesOptions?.typeNames),await P(await Ve.result,je,Fe)}catch(Ze){console.error("sveld: failed to generate initial types in watch mode:",Ze)}},async generateBundle(){if($e)return;if(Fe==null)this.error(Fu);Be=await w(Fe,je.glob===!0,k(je))},async writeBundle(){if($e)return;if(Fe==null)this.error(Fu);await P(Be,je,Fe),Be.cache?.save()},handleHotUpdate(Ze){Xe(Ze.file)},watchChange(Ze){Xe(Ze)}}}function is(i,$e,Be){let Fe=Z(i);if(!Fe)throw Error(`sveld: built-in writer "${i}" is not registered.`);return Fe.write($e,Be)}async function P(i,$e,Be){let Fe=ju(Be),je=$e?.dryRun===!0;if($e?.types!==!1)await is("types",i.allComponentsForTypes,{outDir:"types",preamble:"",...$e?.typesOptions,exports:i.exports,inputDir:Fe,dryRun:je,cache:i.cache,resolvedPathByFilePath:i.resolvedPathByFilePath,inlinedTypesByFilePath:i.inlinedTypesByFilePath});if($e?.json)await is("json",i.components,{outFile:"COMPONENT_API.json",...$e?.jsonOptions,input:Be,inputDir:Fe,entryExports:i.entryExports,dryRun:je});if($e?.markdown)await is("markdown",i.components,{outFile:"COMPONENT_INDEX.md",...$e?.markdownOptions,entryExports:i.entryExports,dryRun:je});if($e?.customElements)await is("custom-elements",i.components,{outFile:"custom-elements.json",...$e?.customElementsOptions,inputDir:Fe,dryRun:je});if($e?.llms)await is("llms",i.components,{...$e?.llmsOptions,entryExports:i.entryExports,dryRun:je});let We=Object.entries($e?.additionalWriters??{}).map(([Ve,Ge])=>{let Ue=Z(Ve);if(!Ue){console.warn(`sveld: no writer registered with name "${Ve}"; skipping.`);return}let ze=Ue.componentSet==="all"?i.allComponentsForTypes:i.components,Ke={...Ge,dryRun:je};return kb(Ve,Ue,ze,Ke)});await Promise.all(We)}async function kb(i,$e,Be,Fe){try{return await $e.write(Be,Fe)}catch(je){let We=je instanceof Error?je.message:String(je);throw Error(`sveld: writer "${i}" failed: ${We}`,{cause:je})}}async function Vu(i,$e,Be){let Fe=ju(Be);if($e?.json){let je={...$e?.jsonOptions,inputDir:Fe,entryExports:i.entryExports},We=$e.stdout==="ndjson"?Tu(i.components,je):aa(i.components,je);process.stdout.write(We);return}if($e?.markdown){let je=ga(i.components,{...$e?.markdownOptions,entryExports:i.entryExports});process.stdout.write(je);return}if($e?.customElements){let je=na(i.components,{...$e?.customElementsOptions,inputDir:Fe});process.stdout.write(je)}}import{appendFileSync as Nb,existsSync as Db}from"node:fs";import{join as _b}from"node:path";var qu=/%/g,Gu=/\r/g,Uu=/\n/g,Ab=/,/g,wb=/:/g,Hu=/\|/g;function Wu(i){return i.replace(qu,"%25").replace(Gu,"%0D").replace(Uu,"%0A").replace(Ab,"%2C").replace(wb,"%3A")}function Pb(i){return i.replace(qu,"%25").replace(Gu,"%0D").replace(Uu,"%0A")}function Ku(i,$e,Be,Fe,je,We){let Ve=i==="error"?"error":"warning",Ge=[];if(Fe!==void 0)Ge.push(`file=${Wu(Fe)}`);if(je!==void 0)Ge.push(`line=${je}`);if(We!==void 0)Ge.push(`col=${We}`);return Ge.push(`title=${Wu($e)}`),`::${Ve} ${Ge.join(",")}::${Pb(Be)}`}function zu(i){return i.filter(($e)=>!$e.ignored).map(($e)=>Ku($e.severity,`sveld ${$e.code}`,$e.message,$e.component,$e.source?.start.line,$e.source?.start.column)).join(`
279
- `)}function Xu(i){let $e=i.filter((Fe)=>!Fe.ignored);if($e.length===0)return"";return["### sveld diagnostics","","| Severity | Code | Location | Message |","| --- | --- | --- | --- |",...$e.map((Fe)=>{let je=Fe.source?`${Fe.component}:${Fe.source.start.line}`:Fe.component;return`| ${Fe.severity} | ${Fe.code} | ${je} | ${Fe.message.replace(Hu,"\\|")} |`})].join(`
280
- `)}function Ju(i,$e){return i.changes.filter((Be)=>$s(Be.bump,$e))}function Yu(i,$e){return Ju(i,$e).map((Be)=>Ku("error","sveld breaking change",Be.message,Be.component==="*"?void 0:Be.component)).join(`
281
- `)}function Qu(i,$e){let Be=Ju(i,$e);if(Be.length===0)return"";return["### sveld breaking changes","","| Component | Kind | Message |","| --- | --- | --- |",...Be.map((je)=>`| ${je.component} | ${je.kind} | ${je.message.replace(Hu,"\\|")} |`)].join(`
282
- `)}var Ea="src/index.js",Ut={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},Ib=`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
- `,Ca={resolveTypes:"resolve-types",checkExamples:"check-examples"},Rb=["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"],Lb=[...Rb,...Object.keys(Ca)],Ob=new Set(["glob","types","json","markdown","quiet","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","types-index-types"]),Mb=new Set(["entry","cache","check","types-format","types-export","types-comments","types-inline","types-props-declaration"]),$b=new Set(["entry","types-format","types-export","types-comments","types-inline","types-props-declaration"]);function Bb(i){let $e=Bs(i,Lb);return $e===void 0?void 0:Ca[$e]??$e}function Fb(i,$e){let Be=i.indexOf("="),Fe=Be===-1?i.slice(2):i.slice(2,Be),je=Ca[Fe]??Fe,We=Be===-1?!0:i.slice(Be+1),Ve=!1;if(Be===-1&&Mb.has(je)){if($e!==void 0&&!$e.startsWith("--"))We=$e,Ve=!0;else if($b.has(je))return{result:{kind:"usage-error",message:`sveld: --${je} requires a value (pass --${je}=<value> or --${je} <value>).`},consumedNext:!1,flag:je}}return{result:jb(je,We,i,Fe),consumedNext:Ve,flag:je}}function jb(i,$e,Be,Fe){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]:$e===!0||$e==="true"}};case"stdout":if($e===!0||$e==="true")return{kind:"option",option:{stdout:!0}};if($e==="false")return{kind:"option",option:{stdout:!1}};return{kind:"option",option:{stdout:$e}};case"custom-elements":return{kind:"option",option:{customElements:$e===!0||$e==="true"}};case"llms":return{kind:"option",option:{llms:$e===!0||$e==="true"}};case"strict":if($e===!0||$e==="true")return{kind:"option",option:{strict:!0}};if($e==="false")return{kind:"option",option:{strict:!1}};return{kind:"option",option:{strict:$e}};case"report-diagnostics":return{kind:"option",option:{reportDiagnostics:$e===!0||$e==="true"}};case"resolve-types":return{kind:"option",option:{resolveTypes:$e===!0||$e==="true"}};case"check-examples":if($e===!0||$e==="true")return{kind:"option",option:{checkExamples:!0}};if($e==="false")return{kind:"option",option:{checkExamples:!1}};return{kind:"option",option:{checkExamples:$e}};case"fail-fast":return{kind:"option",option:{failFast:$e===!0||$e==="true"}};case"dry-run":return{kind:"option",option:{dryRun:$e===!0||$e==="true"}};case"entry":return typeof $e==="string"?{kind:"option",option:{entry:$e}}:{kind:"option",option:{}};case"cache":if($e==="false")return{kind:"option",option:{cache:!1}};return{kind:"option",option:{cache:typeof $e==="string"?$e:!0}};case"check":if($e==="false")return{kind:"option",option:{check:!1}};return{kind:"option",option:{check:typeof $e==="string"?$e:!0}};case"types-format":return typeof $e==="string"?{kind:"option",option:{typesOptions:{format:$e}}}:{kind:"option",option:{}};case"types-export":return typeof $e==="string"?{kind:"option",option:{typesOptions:{exportTypes:$e}}}:{kind:"option",option:{}};case"types-comments":return typeof $e==="string"?{kind:"option",option:{typesOptions:{comments:$e}}}:{kind:"option",option:{}};case"types-inline":if($e==="false")return{kind:"option",option:{typesOptions:{inline:!1}}};return typeof $e==="string"?{kind:"option",option:{typesOptions:{inline:$e}}}:{kind:"option",option:{}};case"types-index-types":return{kind:"option",option:{typesOptions:{indexTypes:$e===!0||$e==="true"}}};case"types-props-declaration":return typeof $e==="string"?{kind:"option",option:{typesOptions:{propsDeclaration:$e}}}:{kind:"option",option:{}};case"format":return typeof $e==="string"?{kind:"option",option:{format:$e}}:{kind:"option",option:{}};case"check-level":return typeof $e==="string"?{kind:"option",option:{checkLevel:$e}}:{kind:"option",option:{}};default:return{kind:"unknown",arg:Be,suggestion:Bb(Fe)}}}function Vb(i){let $e={},Be=!1;for(let Fe=0;Fe<i.length;Fe++){let je=i[Fe];if(!je.startsWith("--"))return{kind:"unknown",arg:je,positionalHint:Be?!0:void 0};let{result:We,consumedNext:Ve,flag:Ge}=Fb(je,i[Fe+1]);if(We.kind!=="option")return We;if($e=S($e,We.option),Be=Ob.has(Ge),Ve)Fe++}return{kind:"options",options:$e}}var Wb=[{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 qb(i){let $e=i.map((Be)=>`"${Be}"`);return $e.length<=2?$e.join(" or "):`${$e.slice(0,-1).join(", ")}, or ${$e.at(-1)}`}async function pe(i){let $e=Vb(i.argv.slice(2));if($e.kind==="help"){console.log(Ib);return}if($e.kind==="version"){console.log(Kl.version);return}if($e.kind==="usage-error"){console.error($e.message),i.exitCode=Ut.USAGE_ERROR;return}if($e.kind==="unknown"){let st=`Unknown flag: ${$e.arg}`;if($e.suggestion)st+=` Did you mean --${$e.suggestion}?`;if($e.positionalHint)st+=" (values are passed as --flag=value or --flag value)";console.error(st),console.error("Run sveld --help for a list of available flags."),i.exitCode=Ut.USAGE_ERROR;return}let Be=$e.options,Fe=await N(),je=Y(S(Fe,Be));if(I(je),je.stdout){if(je.stdout!==!0&&je.stdout!=="json"&&je.stdout!=="ndjson"){console.error(`sveld: --stdout must be "json" or "ndjson"; got "${je.stdout}".`),i.exitCode=Ut.USAGE_ERROR;return}if([je.json,je.markdown,je.customElements].filter(Boolean).length!==1){console.error("sveld: --stdout requires exactly one of --json, --markdown, or --custom-elements."),i.exitCode=Ut.USAGE_ERROR;return}if(je.stdout==="ndjson"&&!je.json){console.error("sveld: --stdout=ndjson is only valid with --json."),i.exitCode=Ut.USAGE_ERROR;return}if(je.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),i.exitCode=Ut.USAGE_ERROR;return}if(je.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),i.exitCode=Ut.USAGE_ERROR;return}}if(je.format!==void 0&&je.format!=="text"&&je.format!=="json"&&je.format!=="github"){console.error(`sveld: --format must be "text", "json", or "github"; got "${je.format}".`),i.exitCode=Ut.USAGE_ERROR;return}if(je.strict!==void 0&&je.strict!==!0&&je.strict!==!1&&je.strict!=="errors"){console.error(`sveld: --strict must be "errors", "ci", or "local" when given a value; got "${je.strict}".`),i.exitCode=Ut.USAGE_ERROR;return}if(je.checkLevel!==void 0&&je.checkLevel!=="major"&&je.checkLevel!=="minor"&&je.checkLevel!=="patch"){console.error(`sveld: --check-level must be "major", "minor", or "patch"; got "${je.checkLevel}".`),i.exitCode=Ut.USAGE_ERROR;return}if(je.checkExamples!==void 0&&je.checkExamples!==!0&&je.checkExamples!==!1&&je.checkExamples!=="syntax"){console.error(`sveld: --check-examples must be "syntax" when given a value; got "${je.checkExamples}".`),i.exitCode=Ut.USAGE_ERROR;return}let We=je.typesOptions?.exportTypes;if(typeof We==="string"){if(We!=="all"&&We!=="none"){console.error(`sveld: --types-export must be "all" or "none"; got "${We}".`),i.exitCode=Ut.USAGE_ERROR;return}je.typesOptions={...je.typesOptions,exportTypes:We==="all"}}for(let{flagName:st,key:ot,values:ut}of Wb){let mt=je.typesOptions?.[ot];if(mt===void 0||mt===!1)continue;if(!ut.includes(mt)){console.error(`sveld: --${st} must be ${qb(ut)}; got "${mt}".`),i.exitCode=Ut.USAGE_ERROR;return}}R(je.quiet===!0);let Ve=_(je.entry),Ge;if(Ve!==null)Ge=Ve;else if(Db(_b(i.cwd(),Ea)))console.error(`sveld: could not resolve an entry point; falling back to "${Ea}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),Ge=Hr(e(Ea));else{i.exitCode=Ut.USAGE_ERROR;return}let Ue,ze;try{if(Ue=await w(Ge,je.glob===!0,k(je)),je.check)ze=await F(Ue.components,Q(je),{entryExports:Ue.entryExports});if(je.stdout)await Vu(Ue,je,Ge);else if(await P(Ue,je,Ge),!je.dryRun)Ue.cache?.save()}catch(st){if(st instanceof Cr){console.error(`sveld: ${st.message}`),i.exitCode=Ut.USAGE_ERROR;return}console.error(st instanceof Error?st.message:String(st)),i.exitCode=Ut.GENERATION_FAILURE;return}let Ke=je.reportDiagnostics||je.strict,Xe=V(Ue.diagnostics,Ke),Ze=[];if(Ke&&Xe.length>0)if(je.format==="json")i.stderr.write(H(Xe));else if(je.format==="github"){let st=zu(Xe);if(st)console.error(st);let ot=Xu(Xe);if(ot)Ze.push(ot)}else console.error(W(Xe));if(ze)if(je.format==="json")i.stdout.write(ue(ze));else if(je.format==="github"){let st=Yu(ze,je.checkLevel??"major");if(st)console.log(st);let ot=Qu(ze,je.checkLevel??"major");if(ot)Ze.push(ot)}else console.log(ce(ze));if(je.format==="github"&&Ze.length>0&&i.env.GITHUB_STEP_SUMMARY)Nb(i.env.GITHUB_STEP_SUMMARY,`${Ze.join(`
328
-
329
- `)}
330
- `);let et;if(ze?.changes.some((st)=>st.kind==="schema")??!1)et=Ut.USAGE_ERROR;else if(ze&&$s(ze.bump,je.checkLevel??"major"))et=Ut.BREAKING_CHANGE;if(U(Xe,je.strict).length>0)et=et===void 0?Ut.DIAGNOSTICS:Math.min(et,Ut.DIAGNOSTICS);if(et!==void 0)i.exitCode=et}
331
- export{Le,a,v,le,m,r,fe,p,h,de,T,J,q,V,U,W,me,H,n,K,l,ee,G,t,s,f,u,L,O,g,he,ge,ye,xe,z,M,y,Te,te,Ee,be,E,Se,c,A,ke,re,we,Ce,Pe,ne,ve,B,X,Ae,se,ie,oe,j,d,De,_e,ae,x,b,D,e,o,Ne,Q,F,ce,Ie,ue,_,Oe,N,S,Y,I,R,k,w,C,Z,Me,Re,P,pe};