sveld 0.37.6 → 0.37.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -26
- package/lib/browser.d.ts +116 -7
- package/lib/browser.js +184 -156
- package/lib/{chunk-c2vdpk5t.js → chunk-0r8vwqdc.js} +8 -8
- package/lib/chunk-7w571557.js +1 -0
- package/lib/chunk-8xbe5qy3.js +356 -0
- package/lib/chunk-95xn5q1p.js +1 -0
- package/lib/chunk-aw6a570w.js +6 -0
- package/lib/chunk-mxv2ftxe.js +6 -0
- package/lib/cli-entry.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/schema/component-api.schema.json +59 -3
- package/lib/chunk-9a8zmdck.js +0 -1
- package/lib/chunk-escdydzn.js +0 -6
- package/lib/chunk-jsp9b7b6.js +0 -331
- package/lib/chunk-v0hbw81y.js +0 -1
- package/lib/chunk-yqc5m8nm.js +0 -6
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import{createRequire as Bf}from"node:module";var Nf=Object.create;var{getPrototypeOf:Df,defineProperty:yo,getOwnPropertyNames:_f}=Object;var Bc=Object.prototype.hasOwnProperty;function If(o){return this[o]}var Rf,Lf,Ye=(o,et,tt)=>{var nt=o!=null&&typeof o==="object";if(nt){var rt=et?Rf??=new WeakMap:Lf??=new WeakMap,it=rt.get(o);if(it)return it}tt=o!=null?Nf(Df(o)):{};let st=et||!o||!o.__esModule||!Bc.call(o,"default")?yo(tt,"default",{value:o,enumerable:!0}):tt;if(o&&typeof o==="object"||typeof o==="function"){for(let at of _f(o))if(!Bc.call(st,at))yo(st,at,{get:If.bind(o,at),enumerable:!0})}if(nt)rt.set(o,st);return st};var p=(o,et)=>()=>(et||o((et={exports:{}}).exports,et),et.exports);var Of=(o)=>o;function Mf(o,et){this[o]=Of.bind(null,et)}var $f=(o,et)=>{for(var tt in et)yo(o,tt,{get:et[tt],enumerable:!0,configurable:!0,set:Mf.bind(et,tt)})};var L=Bf(import.meta.url);var Ff={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 Fc(o,et){let tt=Ff[o];if(!tt)return!1;if(!et)return!0;return(tt.direct??tt.descendant??[]).includes(et)}var _o={};$f(_o,{Node:()=>ls,Parser:()=>pn,Position:()=>jr,SourceLocation:()=>cs,TokContext:()=>qn,Token:()=>Ys,TokenType:()=>Zt,defaultOptions:()=>Vs,getLineInfo:()=>To,isIdentifierChar:()=>_n,isIdentifierStart:()=>Pn,isNewLine:()=>Tr,keywordTypes:()=>Hs,lineBreak:()=>wn,lineBreakG:()=>Kc,nonASCIIwhitespace:()=>So,parse:()=>Do,parseExpressionAt:()=>Ch,tokContexts:()=>cn,tokTypes:()=>mt,tokenizer:()=>vh,version:()=>Pp});var jf=[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],Gc=[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],Vf="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Uc="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",go={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"},xo="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",Wf={5:xo,"5module":xo+" export import",6:xo+" const class extends export import super"},Hc=/^in(stanceof)?$/,qf=new RegExp("["+Uc+"]"),Gf=new RegExp("["+Uc+Vf+"]");function bo(o,et){var tt=65536;for(var nt=0;nt<et.length;nt+=2){if(tt+=et[nt],tt>o)return!1;if(tt+=et[nt+1],tt>=o)return!0}return!1}function Pn(o,et){if(o<65)return o===36;if(o<91)return!0;if(o<97)return o===95;if(o<123)return!0;if(o<=65535)return o>=170&&qf.test(String.fromCharCode(o));if(et===!1)return!1;return bo(o,Gc)}function _n(o,et){if(o<48)return o===36;if(o<58)return!0;if(o<65)return!1;if(o<91)return!0;if(o<97)return o===95;if(o<123)return!0;if(o<=65535)return o>=170&&Gf.test(String.fromCharCode(o));if(et===!1)return!1;return bo(o,Gc)||bo(o,jf)}var Zt=function(et,tt){if(tt===void 0)tt={};this.label=et,this.keyword=tt.keyword,this.beforeExpr=!!tt.beforeExpr,this.startsExpr=!!tt.startsExpr,this.isLoop=!!tt.isLoop,this.isAssign=!!tt.isAssign,this.prefix=!!tt.prefix,this.postfix=!!tt.postfix,this.binop=tt.binop||null,this.updateContext=null};function Vn(o,et){return new Zt(o,{beforeExpr:!0,binop:et})}var Wn={beforeExpr:!0},Dn={startsExpr:!0},Hs={};function Yt(o,et){if(et===void 0)et={};return et.keyword=o,Hs[o]=new Zt(o,et)}var mt={num:new Zt("num",Dn),regexp:new Zt("regexp",Dn),string:new Zt("string",Dn),name:new Zt("name",Dn),privateId:new Zt("privateId",Dn),eof:new Zt("eof"),bracketL:new Zt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new Zt("]"),braceL:new Zt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new Zt("}"),parenL:new Zt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new Zt(")"),comma:new Zt(",",Wn),semi:new Zt(";",Wn),colon:new Zt(":",Wn),dot:new Zt("."),question:new Zt("?",Wn),questionDot:new Zt("?."),arrow:new Zt("=>",Wn),template:new Zt("template"),invalidTemplate:new Zt("invalidTemplate"),ellipsis:new Zt("...",Wn),backQuote:new Zt("`",Dn),dollarBraceL:new Zt("${",{beforeExpr:!0,startsExpr:!0}),eq:new Zt("=",{beforeExpr:!0,isAssign:!0}),assign:new Zt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new Zt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Zt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Vn("||",1),logicalAND:Vn("&&",2),bitwiseOR:Vn("|",3),bitwiseXOR:Vn("^",4),bitwiseAND:Vn("&",5),equality:Vn("==/!=/===/!==",6),relational:Vn("</>/<=/>=",7),bitShift:Vn("<</>>/>>>",8),plusMin:new Zt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Vn("%",10),star:Vn("*",10),slash:Vn("/",10),starstar:new Zt("**",{beforeExpr:!0}),coalesce:Vn("??",1),_break:Yt("break"),_case:Yt("case",Wn),_catch:Yt("catch"),_continue:Yt("continue"),_debugger:Yt("debugger"),_default:Yt("default",Wn),_do:Yt("do",{isLoop:!0,beforeExpr:!0}),_else:Yt("else",Wn),_finally:Yt("finally"),_for:Yt("for",{isLoop:!0}),_function:Yt("function",Dn),_if:Yt("if"),_return:Yt("return",Wn),_switch:Yt("switch"),_throw:Yt("throw",Wn),_try:Yt("try"),_var:Yt("var"),_const:Yt("const"),_while:Yt("while",{isLoop:!0}),_with:Yt("with"),_new:Yt("new",{beforeExpr:!0,startsExpr:!0}),_this:Yt("this",Dn),_super:Yt("super",Dn),_class:Yt("class",Dn),_extends:Yt("extends",Wn),_export:Yt("export"),_import:Yt("import",Dn),_null:Yt("null",Dn),_true:Yt("true",Dn),_false:Yt("false",Dn),_in:Yt("in",{beforeExpr:!0,binop:7}),_instanceof:Yt("instanceof",{beforeExpr:!0,binop:7}),_typeof:Yt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Yt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Yt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},wn=/\r\n?|\n|\u2028|\u2029/,Kc=new RegExp(wn.source,"g");function Tr(o){return o===10||o===13||o===8232||o===8233}function zc(o,et,tt){if(tt===void 0)tt=o.length;for(var nt=et;nt<tt;nt++){var rt=o.charCodeAt(nt);if(Tr(rt))return nt<tt-1&&rt===13&&o.charCodeAt(nt+1)===10?nt+2:nt+1}return-1}var So=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,bn=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Xc=Object.prototype,{hasOwnProperty:Uf,toString:Hf}=Xc,Vr=Object.hasOwn||function(o,et){return Uf.call(o,et)},jc=Array.isArray||function(o){return Hf.call(o)==="[object Array]"},Vc=Object.create(null);function fr(o){return Vc[o]||(Vc[o]=new RegExp("^(?:"+o.replace(/ /g,"|")+")$"))}function or(o){if(o<=65535)return String.fromCharCode(o);return o-=65536,String.fromCharCode((o>>10)+55296,(o&1023)+56320)}var Kf=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,jr=function(et,tt){this.line=et,this.column=tt};jr.prototype.offset=function(et){return new jr(this.line,this.column+et)};var cs=function(et,tt,nt){if(this.start=tt,this.end=nt,et.sourceFile!==null)this.source=et.sourceFile};function To(o,et){for(var tt=1,nt=0;;){var rt=zc(o,nt,et);if(rt<0)return new jr(tt,et-nt);++tt,nt=rt}}var Vs={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},Wc=!1;function zf(o){var et={};for(var tt in Vs)et[tt]=o&&Vr(o,tt)?o[tt]:Vs[tt];if(et.ecmaVersion==="latest")et.ecmaVersion=1e8;else if(et.ecmaVersion==null){if(!Wc&&typeof console==="object"&&console.warn)Wc=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
+
Defaulting to 2020, but this will stop working in the future.`);et.ecmaVersion=11}else if(et.ecmaVersion>=2015)et.ecmaVersion-=2009;if(et.allowReserved==null)et.allowReserved=et.ecmaVersion<5;if(!o||o.allowHashBang==null)et.allowHashBang=et.ecmaVersion>=14;if(jc(et.onToken)){var nt=et.onToken;et.onToken=function(rt){return nt.push(rt)}}if(jc(et.onComment))et.onComment=Xf(et,et.onComment);if(et.sourceType==="commonjs"&&et.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return et}function Xf(o,et){return function(tt,nt,rt,it,st,at){var ct={type:tt?"Block":"Line",value:nt,start:rt,end:it};if(o.locations)ct.loc=new cs(this,st,at);if(o.ranges)ct.range=[rt,it];et.push(ct)}}var Sr=1,kr=2,ko=4,Jc=8,Po=16,Yc=32,Ks=64,Qc=128,Pr=256,ps=512,Zc=1024,zs=Sr|kr|Pr;function wo(o,et){return kr|(o?ko:0)|(et?Jc:0)}var Ws=0,Ao=1,cr=2,ep=3,tp=4,np=5,pn=function(et,tt,nt){this.options=et=zf(et),this.sourceFile=et.sourceFile,this.keywords=fr(Wf[et.ecmaVersion>=6?6:et.sourceType==="module"?"5module":5]);var rt="";if(et.allowReserved!==!0){if(rt=go[et.ecmaVersion>=6?6:et.ecmaVersion===5?5:3],et.sourceType==="module")rt+=" await"}this.reservedWords=fr(rt);var it=(rt?rt+" ":"")+go.strict;if(this.reservedWordsStrict=fr(it),this.reservedWordsStrictBind=fr(it+" "+go.strictBind),this.input=String(tt),this.containsEsc=!1,this.pos=nt||0,this.curLine=1,et.startLocation)this.lineStart=this.pos-et.startLocation.column,this.curLine=et.startLocation.line;else if(nt){if(this.lineStart=this.input.lastIndexOf(`
|
|
3
|
+
`,nt-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(wn).length}else this.lineStart=0;if(this.type=mt.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=et.sourceType==="module",this.strict=this.inModule||et.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&&et.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?kr:Sr),this.regexpState=null,this.privateNameStack=[]},Un={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}};pn.prototype.parse=function(){var et=this,tt=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return et.parseTopLevel(tt)})};Un.inFunction.get=function(){return(this.currentVarScope().flags&kr)>0};Un.inGenerator.get=function(){return(this.currentVarScope().flags&Jc)>0};Un.inAsync.get=function(){return(this.currentVarScope().flags&ko)>0};Un.canAwait.get=function(){for(var o=this.scopeStack.length-1;o>=0;o--){var et=this.scopeStack[o],tt=et.flags;if(tt&(Pr|ps))return!1;if(tt&kr)return(tt&ko)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Un.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Sr)return!0;return!1};Un.allowSuper.get=function(){var o=this.currentThisScope(),et=o.flags;return(et&Ks)>0||this.options.allowSuperOutsideMethod};Un.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Qc)>0};Un.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Un.allowNewDotTarget.get=function(){for(var o=this.scopeStack.length-1;o>=0;o--){var et=this.scopeStack[o],tt=et.flags;if(tt&(Pr|ps)||tt&kr&&!(tt&Po))return!0}return!1};Un.allowUsing.get=function(){var o=this.currentScope(),et=o.flags;if(et&Zc)return!1;if(!this.inModule&&et&Sr)return!1;return!0};Un.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Pr)>0};pn.extend=function(){var et=[],tt=arguments.length;while(tt--)et[tt]=arguments[tt];var nt=this;for(var rt=0;rt<et.length;rt++)nt=et[rt](nt);return nt};pn.parse=function(et,tt){return new this(tt,et).parse()};pn.parseExpressionAt=function(et,tt,nt){var rt=new this(nt,et,tt);return rt.nextToken(),rt.parseExpression()};pn.tokenizer=function(et,tt){return new this(tt,et)};Object.defineProperties(pn.prototype,Un);var Cn=pn.prototype,Jf=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Cn.strictDirective=function(o){if(this.options.ecmaVersion<5)return!1;for(;;){bn.lastIndex=o,o+=bn.exec(this.input)[0].length;var et=Jf.exec(this.input.slice(o));if(!et)return!1;if((et[1]||et[2])==="use strict"){bn.lastIndex=o+et[0].length;var tt=bn.exec(this.input),nt=tt.index+tt[0].length,rt=this.input.charAt(nt);return rt===";"||rt==="}"||wn.test(tt[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(rt)||rt==="!"&&this.input.charAt(nt+1)==="=")}if(o+=et[0].length,bn.lastIndex=o,o+=bn.exec(this.input)[0].length,this.input[o]===";")o++}};Cn.eat=function(o){if(this.type===o)return this.next(),!0;else return!1};Cn.isContextual=function(o){return this.type===mt.name&&this.value===o&&!this.containsEsc};Cn.eatContextual=function(o){if(!this.isContextual(o))return!1;return this.next(),!0};Cn.catchStackOverflow=function(o){try{return o()}catch(et){if(et instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(et.message)||/\btoo much recursion\b/i.test(et.message)))this.raise(this.start,"Not enough stack space to parse input");else throw et}};Cn.expectContextual=function(o){if(!this.eatContextual(o))this.unexpected()};Cn.canInsertSemicolon=function(){return this.type===mt.eof||this.type===mt.braceR||wn.test(this.input.slice(this.lastTokEnd,this.start))};Cn.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};Cn.semicolon=function(){if(!this.eat(mt.semi)&&!this.insertSemicolon())this.unexpected()};Cn.afterTrailingComma=function(o,et){if(this.type===o){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!et)this.next();return!0}};Cn.expect=function(o){this.eat(o)||this.unexpected()};Cn.unexpected=function(o){this.raise(o!=null?o:this.start,"Unexpected token")};var Xs=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Cn.checkPatternErrors=function(o,et){if(!o)return;if(o.trailingComma>-1)this.raiseRecoverable(o.trailingComma,"Comma is not permitted after the rest element");var tt=et?o.parenthesizedAssign:o.parenthesizedBind;if(tt>-1)this.raiseRecoverable(tt,et?"Assigning to rvalue":"Parenthesized pattern")};Cn.checkExpressionErrors=function(o,et){if(!o)return!1;var{shorthandAssign:tt,doubleProto:nt}=o;if(!et)return tt>=0||nt>=0;if(tt>=0)this.raise(tt,"Shorthand property assignments are valid only in destructuring patterns");if(nt>=0)this.raiseRecoverable(nt,"Redefinition of __proto__ property")};Cn.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")};Cn.isSimpleAssignTarget=function(o){if(o.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(o.expression);return o.type==="Identifier"||o.type==="MemberExpression"};var Bt=pn.prototype;Bt.parseTopLevel=function(o){var et=Object.create(null);if(!o.body)o.body=[];while(this.type!==mt.eof){var tt=this.parseStatement(null,!0,et);o.body.push(tt)}if(this.inModule)for(var nt=0,rt=Object.keys(this.undefinedExports);nt<rt.length;nt+=1){var it=rt[nt];this.raiseRecoverable(this.undefinedExports[it].start,"Export '"+it+"' is not defined")}return this.adaptDirectivePrologue(o.body),this.next(),o.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(o,"Program")};var No={kind:"loop"},Yf={kind:"switch"};Bt.isLet=function(o){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;bn.lastIndex=this.pos;var et=bn.exec(this.input),tt=this.pos+et[0].length,nt=this.fullCharCodeAt(tt);if(nt===91||nt===92)return!0;if(o)return!1;if(nt===123)return!0;if(Pn(nt)){var rt=tt;do tt+=nt<=65535?1:2;while(_n(nt=this.fullCharCodeAt(tt)));if(nt===92)return!0;var it=this.input.slice(rt,tt);if(!Hc.test(it))return!0}return!1};Bt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;bn.lastIndex=this.pos;var o=bn.exec(this.input),et=this.pos+o[0].length,tt;return!wn.test(this.input.slice(this.pos,et))&&this.input.slice(et,et+8)==="function"&&(et+8===this.input.length||!(_n(tt=this.fullCharCodeAt(et+8))||tt===92))};Bt.isUsingKeyword=function(o,et){if(this.options.ecmaVersion<17||!this.isContextual(o?"await":"using"))return!1;bn.lastIndex=this.pos;var tt=bn.exec(this.input),nt=this.pos+tt[0].length;if(wn.test(this.input.slice(this.pos,nt)))return!1;if(o){var rt=nt+5,it;if(this.input.slice(nt,rt)!=="using"||rt===this.input.length||_n(it=this.fullCharCodeAt(rt))||it===92)return!1;bn.lastIndex=rt;var st=bn.exec(this.input);if(nt=rt+st[0].length,st&&wn.test(this.input.slice(rt,nt)))return!1}var at=this.fullCharCodeAt(nt);if(!Pn(at)&&at!==92)return!1;var ct=nt;do nt+=at<=65535?1:2;while(_n(at=this.fullCharCodeAt(nt)));if(at===92)return!0;var lt=this.input.slice(ct,nt);if(Hc.test(lt))return!1;if(et&&!o&<==="of"){bn.lastIndex=nt;var ut=bn.exec(this.input);if(nt=nt+ut[0].length,this.input.charCodeAt(nt)!==61||(at=this.input.charCodeAt(nt+1))===61||at===62)return!1}return!0};Bt.isAwaitUsing=function(o){return this.isUsingKeyword(!0,o)};Bt.isUsing=function(o){return this.isUsingKeyword(!1,o)};Bt.parseStatement=function(o,et,tt){var nt=this.type,rt=this.startNode(),it;if(this.isLet(o))nt=mt._var,it="let";switch(nt){case mt._break:case mt._continue:return this.parseBreakContinueStatement(rt,nt.keyword);case mt._debugger:return this.parseDebuggerStatement(rt);case mt._do:return this.parseDoStatement(rt);case mt._for:return this.parseForStatement(rt);case mt._function:if(o&&(this.strict||o!=="if"&&o!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(rt,!1,!o);case mt._class:if(o)this.unexpected();return this.parseClass(rt,!0);case mt._if:return this.parseIfStatement(rt);case mt._return:return this.parseReturnStatement(rt);case mt._switch:return this.parseSwitchStatement(rt);case mt._throw:return this.parseThrowStatement(rt);case mt._try:return this.parseTryStatement(rt);case mt._const:case mt._var:if(it=it||this.value,o&&it!=="var")this.unexpected();return this.parseVarStatement(rt,it);case mt._while:return this.parseWhileStatement(rt);case mt._with:return this.parseWithStatement(rt);case mt.braceL:return this.parseBlock(!0,rt);case mt.semi:return this.parseEmptyStatement(rt);case mt._export:case mt._import:if(this.options.ecmaVersion>10&&nt===mt._import){bn.lastIndex=this.pos;var st=bn.exec(this.input),at=this.pos+st[0].length,ct=this.input.charCodeAt(at);if(ct===40||ct===46)return this.parseExpressionStatement(rt,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!et)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 nt===mt._import?this.parseImport(rt):this.parseExport(rt,tt);default:if(this.isAsyncFunction()){if(o)this.unexpected();return this.next(),this.parseFunctionStatement(rt,!0,!o)}var lt=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(lt){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(o)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(lt==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(rt,!1,lt),this.semicolon(),this.finishNode(rt,"VariableDeclaration")}var ut=this.value,dt=this.parseExpression();if(nt===mt.name&&dt.type==="Identifier"&&this.eat(mt.colon))return this.parseLabeledStatement(rt,ut,dt,o);else return this.parseExpressionStatement(rt,dt)}};Bt.parseBreakContinueStatement=function(o,et){var tt=et==="break";if(this.next(),this.eat(mt.semi)||this.insertSemicolon())o.label=null;else if(this.type!==mt.name)this.unexpected();else o.label=this.parseIdent(),this.semicolon();var nt=0;for(;nt<this.labels.length;++nt){var rt=this.labels[nt];if(o.label==null||rt.name===o.label.name){if(rt.kind!=null&&(tt||rt.kind==="loop"))break;if(o.label&&tt)break}}if(nt===this.labels.length)this.raise(o.start,"Unsyntactic "+et);return this.finishNode(o,tt?"BreakStatement":"ContinueStatement")};Bt.parseDebuggerStatement=function(o){return this.next(),this.semicolon(),this.finishNode(o,"DebuggerStatement")};Bt.parseDoStatement=function(o){if(this.next(),this.labels.push(No),o.body=this.parseStatement("do"),this.labels.pop(),this.expect(mt._while),o.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(mt.semi);else this.semicolon();return this.finishNode(o,"DoWhileStatement")};Bt.parseForStatement=function(o){this.next();var et=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(No),this.enterScope(0),this.expect(mt.parenL),this.type===mt.semi){if(et>-1)this.unexpected(et);return this.parseFor(o,null)}var tt=this.isLet();if(this.type===mt._var||this.type===mt._const||tt){var nt=this.startNode(),rt=tt?"let":this.value;return this.next(),this.parseVar(nt,!0,rt),this.finishNode(nt,"VariableDeclaration"),this.parseForAfterInit(o,nt,et)}var it=this.isContextual("let"),st=!1,at=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(at){var ct=this.startNode();if(this.next(),at==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(ct,!0,at),this.finishNode(ct,"VariableDeclaration"),this.parseForAfterInit(o,ct,et)}var lt=this.containsEsc,ut=new Xs,dt=this.start,ht=et>-1?this.parseExprSubscripts(ut,"await"):this.parseExpression(!0,ut);if(this.type===mt._in||(st=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(et>-1){if(this.type===mt._in)this.unexpected(et);o.await=!0}else if(st&&this.options.ecmaVersion>=8){if(ht.start===dt&&!lt&&ht.type==="Identifier"&&ht.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)o.await=!1}if(it&&st)this.raise(ht.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(ht,!1,ut),this.checkLValPattern(ht),this.parseForIn(o,ht)}else this.checkExpressionErrors(ut,!0);if(et>-1)this.unexpected(et);return this.parseFor(o,ht)};Bt.parseForAfterInit=function(o,et,tt){if((this.type===mt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&et.declarations.length===1){if(this.type===mt._in){if((et.kind==="using"||et.kind==="await using")&&!et.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&tt>-1)this.unexpected(tt)}else if(this.options.ecmaVersion>=9)o.await=tt>-1;return this.parseForIn(o,et)}if(tt>-1)this.unexpected(tt);return this.parseFor(o,et)};Bt.parseFunctionStatement=function(o,et,tt){return this.next(),this.parseFunction(o,as|(tt?0:Eo),!1,et)};Bt.parseIfStatement=function(o){return this.next(),o.test=this.parseParenExpression(),o.consequent=this.parseStatement("if"),o.alternate=this.eat(mt._else)?this.parseStatement("if"):null,this.finishNode(o,"IfStatement")};Bt.parseReturnStatement=function(o){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(mt.semi)||this.insertSemicolon())o.argument=null;else o.argument=this.parseExpression(),this.semicolon();return this.finishNode(o,"ReturnStatement")};Bt.parseSwitchStatement=function(o){this.next(),o.discriminant=this.parseParenExpression(),o.cases=[],this.expect(mt.braceL),this.labels.push(Yf),this.enterScope(Zc);var et;for(var tt=!1;this.type!==mt.braceR;)if(this.type===mt._case||this.type===mt._default){var nt=this.type===mt._case;if(et)this.finishNode(et,"SwitchCase");if(o.cases.push(et=this.startNode()),et.consequent=[],this.next(),nt)et.test=this.parseExpression();else{if(tt)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");tt=!0,et.test=null}this.expect(mt.colon)}else{if(!et)this.unexpected();et.consequent.push(this.parseStatement(null))}if(this.exitScope(),et)this.finishNode(et,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(o,"SwitchStatement")};Bt.parseThrowStatement=function(o){if(this.next(),wn.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return o.argument=this.parseExpression(),this.semicolon(),this.finishNode(o,"ThrowStatement")};var Qf=[];Bt.parseCatchClauseParam=function(){var o=this.parseBindingAtom(),et=o.type==="Identifier";return this.enterScope(et?Yc:0),this.checkLValPattern(o,et?tp:cr),this.expect(mt.parenR),o};Bt.parseTryStatement=function(o){if(this.next(),o.block=this.parseBlock(),o.handler=null,this.type===mt._catch){var et=this.startNode();if(this.next(),this.eat(mt.parenL))et.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();et.param=null,this.enterScope(0)}et.body=this.parseBlock(!1),this.exitScope(),o.handler=this.finishNode(et,"CatchClause")}if(o.finalizer=this.eat(mt._finally)?this.parseBlock():null,!o.handler&&!o.finalizer)this.raise(o.start,"Missing catch or finally clause");return this.finishNode(o,"TryStatement")};Bt.parseVarStatement=function(o,et,tt){return this.next(),this.parseVar(o,!1,et,tt),this.semicolon(),this.finishNode(o,"VariableDeclaration")};Bt.parseWhileStatement=function(o){return this.next(),o.test=this.parseParenExpression(),this.labels.push(No),o.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(o,"WhileStatement")};Bt.parseWithStatement=function(o){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),o.object=this.parseParenExpression(),o.body=this.parseStatement("with"),this.finishNode(o,"WithStatement")};Bt.parseEmptyStatement=function(o){return this.next(),this.finishNode(o,"EmptyStatement")};Bt.parseLabeledStatement=function(o,et,tt,nt){for(var rt=0,it=this.labels;rt<it.length;rt+=1){var st=it[rt];if(st.name===et)this.raise(tt.start,"Label '"+et+"' is already declared")}var at=this.type.isLoop?"loop":this.type===mt._switch?"switch":null;for(var ct=this.labels.length-1;ct>=0;ct--){var lt=this.labels[ct];if(lt.statementStart===o.start)lt.statementStart=this.start,lt.kind=at;else break}return this.labels.push({name:et,kind:at,statementStart:this.start}),o.body=this.parseStatement(nt?nt.indexOf("label")===-1?nt+"label":nt:"label"),this.labels.pop(),o.label=tt,this.finishNode(o,"LabeledStatement")};Bt.parseExpressionStatement=function(o,et){return o.expression=et,this.semicolon(),this.finishNode(o,"ExpressionStatement")};Bt.parseBlock=function(o,et,tt){if(o===void 0)o=!0;if(et===void 0)et=this.startNode();if(et.body=[],this.expect(mt.braceL),o)this.enterScope(0);while(this.type!==mt.braceR){var nt=this.parseStatement(null);et.body.push(nt)}if(tt)this.strict=!1;if(this.next(),o)this.exitScope();return this.finishNode(et,"BlockStatement")};Bt.parseFor=function(o,et){return o.init=et,this.expect(mt.semi),o.test=this.type===mt.semi?null:this.parseExpression(),this.expect(mt.semi),o.update=this.type===mt.parenR?null:this.parseExpression(),this.expect(mt.parenR),o.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(o,"ForStatement")};Bt.parseForIn=function(o,et){var tt=this.type===mt._in;if(this.next(),et.type==="VariableDeclaration"&&et.declarations[0].init!=null&&(!tt||this.options.ecmaVersion<8||this.strict||et.kind!=="var"||et.declarations[0].id.type!=="Identifier"))this.raise(et.start,(tt?"for-in":"for-of")+" loop variable declaration may not have an initializer");return o.left=et,o.right=tt?this.parseExpression():this.parseMaybeAssign(),this.expect(mt.parenR),o.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(o,tt?"ForInStatement":"ForOfStatement")};Bt.parseVar=function(o,et,tt,nt){o.declarations=[],o.kind=tt;for(;;){var rt=this.startNode();if(this.parseVarId(rt,tt),this.eat(mt.eq))rt.init=this.parseMaybeAssign(et);else if(!nt&&tt==="const"&&!(this.type===mt._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!nt&&(tt==="using"||tt==="await using")&&this.options.ecmaVersion>=17&&this.type!==mt._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+tt+" declaration");else if(!nt&&rt.id.type!=="Identifier"&&!(et&&(this.type===mt._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else rt.init=null;if(o.declarations.push(this.finishNode(rt,"VariableDeclarator")),!this.eat(mt.comma))break}return o};Bt.parseVarId=function(o,et){o.id=et==="using"||et==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(o.id,et==="var"?Ao:cr,!1)};var as=1,Eo=2,rp=4;Bt.parseFunction=function(o,et,tt,nt,rt){if(this.initFunction(o),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!nt){if(this.type===mt.star&&et&Eo)this.unexpected();o.generator=this.eat(mt.star)}if(this.options.ecmaVersion>=8)o.async=!!nt;if(et&as){if(o.id=et&rp&&this.type!==mt.name?null:this.parseIdent(),o.id&&!(et&Eo))this.checkLValSimple(o.id,this.strict||o.generator||o.async?this.treatFunctionsAsVar?Ao:cr:ep)}var it=this.yieldPos,st=this.awaitPos,at=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(wo(o.async,o.generator)),!(et&as))o.id=this.type===mt.name?this.parseIdent():null;return this.parseFunctionParams(o),this.parseFunctionBody(o,tt,!1,rt),this.yieldPos=it,this.awaitPos=st,this.awaitIdentPos=at,this.finishNode(o,et&as?"FunctionDeclaration":"FunctionExpression")};Bt.parseFunctionParams=function(o){this.expect(mt.parenL),o.params=this.parseBindingList(mt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};Bt.parseClass=function(o,et){this.next();var tt=this.strict;this.strict=!0,this.parseClassId(o,et),this.parseClassSuper(o);var nt=this.enterClassBody(),rt=this.startNode(),it=!1;rt.body=[],this.expect(mt.braceL);while(this.type!==mt.braceR){var st=this.parseClassElement(o.superClass!==null);if(st){if(rt.body.push(st),st.type==="MethodDefinition"&&st.kind==="constructor"){if(it)this.raiseRecoverable(st.start,"Duplicate constructor in the same class");it=!0}else if(st.key&&st.key.type==="PrivateIdentifier"&&Zf(nt,st))this.raiseRecoverable(st.key.start,"Identifier '#"+st.key.name+"' has already been declared")}}return this.strict=tt,this.next(),o.body=this.finishNode(rt,"ClassBody"),this.exitClassBody(),this.finishNode(o,et?"ClassDeclaration":"ClassExpression")};Bt.parseClassElement=function(o){if(this.eat(mt.semi))return null;var et=this.options.ecmaVersion,tt=this.startNode(),nt="",rt=!1,it=!1,st="method",at=!1;if(this.eatContextual("static")){if(et>=13&&this.eat(mt.braceL))return this.parseClassStaticBlock(tt),tt;if(this.isClassElementNameStart()||this.type===mt.star)at=!0;else nt="static"}if(tt.static=at,!nt&&et>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===mt.star)&&!this.canInsertSemicolon())it=!0;else nt="async";if(!nt&&(et>=9||!it)&&this.eat(mt.star))rt=!0;if(!nt&&!it&&!rt){var ct=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())st=ct;else nt=ct}if(nt)tt.computed=!1,tt.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),tt.key.name=nt,this.finishNode(tt.key,"Identifier");else this.parseClassElementName(tt);if(et<13||this.type===mt.parenL||st!=="method"||rt||it){var lt=!tt.static&&qs(tt,"constructor"),ut=lt&&o;if(lt&&st!=="method")this.raise(tt.key.start,"Constructor can't have get/set modifier");tt.kind=lt?"constructor":st,this.parseClassMethod(tt,rt,it,ut)}else this.parseClassField(tt);return tt};Bt.isClassElementNameStart=function(){return this.type===mt.name||this.type===mt.privateId||this.type===mt.num||this.type===mt.string||this.type===mt.bracketL||this.type.keyword};Bt.parseClassElementName=function(o){if(this.type===mt.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");o.computed=!1,o.key=this.parsePrivateIdent()}else this.parsePropertyName(o)};Bt.parseClassMethod=function(o,et,tt,nt){var rt=o.key;if(o.kind==="constructor"){if(et)this.raise(rt.start,"Constructor can't be a generator");if(tt)this.raise(rt.start,"Constructor can't be an async method")}else if(o.static&&qs(o,"prototype"))this.raise(rt.start,"Classes may not have a static property named prototype");var it=o.value=this.parseMethod(et,tt,nt);if(o.kind==="get"&&it.params.length!==0)this.raiseRecoverable(it.start,"getter should have no params");if(o.kind==="set"&&it.params.length!==1)this.raiseRecoverable(it.start,"setter should have exactly one param");if(o.kind==="set"&&it.params[0].type==="RestElement")this.raiseRecoverable(it.params[0].start,"Setter cannot use rest params");return this.finishNode(o,"MethodDefinition")};Bt.parseClassField=function(o){if(qs(o,"constructor"))this.raise(o.key.start,"Classes can't have a field named 'constructor'");else if(o.static&&qs(o,"prototype"))this.raise(o.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(mt.eq))this.enterScope(ps|Ks),o.value=this.parseMaybeAssign(),this.exitScope();else o.value=null;return this.semicolon(),this.finishNode(o,"PropertyDefinition")};Bt.parseClassStaticBlock=function(o){o.body=[];var et=this.labels;this.labels=[],this.enterScope(Pr|Ks);while(this.type!==mt.braceR){var tt=this.parseStatement(null);o.body.push(tt)}return this.next(),this.exitScope(),this.labels=et,this.finishNode(o,"StaticBlock")};Bt.parseClassId=function(o,et){if(this.type===mt.name){if(o.id=this.parseIdent(),et)this.checkLValSimple(o.id,cr,!1)}else{if(et===!0)this.unexpected();o.id=null}};Bt.parseClassSuper=function(o){o.superClass=this.eat(mt._extends)?this.parseExprSubscripts(null,!1):null};Bt.enterClassBody=function(){var o={declared:Object.create(null),used:[]};return this.privateNameStack.push(o),o.declared};Bt.exitClassBody=function(){var o=this.privateNameStack.pop(),{declared:et,used:tt}=o;if(!this.options.checkPrivateFields)return;var nt=this.privateNameStack.length,rt=nt===0?null:this.privateNameStack[nt-1];for(var it=0;it<tt.length;++it){var st=tt[it];if(!Vr(et,st.name))if(rt)rt.used.push(st);else this.raiseRecoverable(st.start,"Private field '#"+st.name+"' must be declared in an enclosing class")}};function Zf(o,et){var tt=et.key.name,nt=o[tt],rt="true";if(et.type==="MethodDefinition"&&(et.kind==="get"||et.kind==="set"))rt=(et.static?"s":"i")+et.kind;if(nt==="iget"&&rt==="iset"||nt==="iset"&&rt==="iget"||nt==="sget"&&rt==="sset"||nt==="sset"&&rt==="sget")return o[tt]="true",!1;else if(!nt)return o[tt]=rt,!1;else return!0}function qs(o,et){var{computed:tt,key:nt}=o;return!tt&&(nt.type==="Identifier"&&nt.name===et||nt.type==="Literal"&&nt.value===et)}Bt.parseExportAllDeclaration=function(o,et){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))o.exported=this.parseModuleExportName(),this.checkExport(et,o.exported,this.lastTokStart);else o.exported=null;if(this.expectContextual("from"),this.type!==mt.string)this.unexpected();if(o.source=this.parseExprAtom(),this.options.ecmaVersion>=16)o.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(o,"ExportAllDeclaration")};Bt.parseExport=function(o,et){if(this.next(),this.eat(mt.star))return this.parseExportAllDeclaration(o,et);if(this.eat(mt._default))return this.checkExport(et,"default",this.lastTokStart),o.declaration=this.parseExportDefaultDeclaration(),this.finishNode(o,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(o.declaration=this.parseExportDeclaration(o),o.declaration.type==="VariableDeclaration")this.checkVariableExport(et,o.declaration.declarations);else this.checkExport(et,o.declaration.id,o.declaration.id.start);if(o.specifiers=[],o.source=null,this.options.ecmaVersion>=16)o.attributes=[]}else{if(o.declaration=null,o.specifiers=this.parseExportSpecifiers(et),this.eatContextual("from")){if(this.type!==mt.string)this.unexpected();if(o.source=this.parseExprAtom(),this.options.ecmaVersion>=16)o.attributes=this.parseWithClause()}else{for(var tt=0,nt=o.specifiers;tt<nt.length;tt+=1){var rt=nt[tt];if(this.checkUnreserved(rt.local),this.checkLocalExport(rt.local),rt.local.type==="Literal")this.raise(rt.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(o.source=null,this.options.ecmaVersion>=16)o.attributes=[]}this.semicolon()}return this.finishNode(o,"ExportNamedDeclaration")};Bt.parseExportDeclaration=function(o){return this.parseStatement(null)};Bt.parseExportDefaultDeclaration=function(){var o;if(this.type===mt._function||(o=this.isAsyncFunction())){var et=this.startNode();if(this.next(),o)this.next();return this.parseFunction(et,as|rp,!1,o)}else if(this.type===mt._class){var tt=this.startNode();return this.parseClass(tt,"nullableID")}else{var nt=this.parseMaybeAssign();return this.semicolon(),nt}};Bt.checkExport=function(o,et,tt){if(!o)return;if(typeof et!=="string")et=et.type==="Identifier"?et.name:et.value;if(Vr(o,et))this.raiseRecoverable(tt,"Duplicate export '"+et+"'");o[et]=!0};Bt.checkPatternExport=function(o,et){var tt=et.type;if(tt==="Identifier")this.checkExport(o,et,et.start);else if(tt==="ObjectPattern")for(var nt=0,rt=et.properties;nt<rt.length;nt+=1){var it=rt[nt];this.checkPatternExport(o,it)}else if(tt==="ArrayPattern")for(var st=0,at=et.elements;st<at.length;st+=1){var ct=at[st];if(ct)this.checkPatternExport(o,ct)}else if(tt==="Property")this.checkPatternExport(o,et.value);else if(tt==="AssignmentPattern")this.checkPatternExport(o,et.left);else if(tt==="RestElement")this.checkPatternExport(o,et.argument)};Bt.checkVariableExport=function(o,et){if(!o)return;for(var tt=0,nt=et;tt<nt.length;tt+=1){var rt=nt[tt];this.checkPatternExport(o,rt.id)}};Bt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};Bt.parseExportSpecifier=function(o){var et=this.startNode();return et.local=this.parseModuleExportName(),et.exported=this.eatContextual("as")?this.parseModuleExportName():et.local,this.checkExport(o,et.exported,et.exported.start),this.finishNode(et,"ExportSpecifier")};Bt.parseExportSpecifiers=function(o){var et=[],tt=!0;this.expect(mt.braceL);while(!this.eat(mt.braceR)){if(!tt){if(this.expect(mt.comma),this.afterTrailingComma(mt.braceR))break}else tt=!1;et.push(this.parseExportSpecifier(o))}return et};Bt.parseImport=function(o){if(this.next(),this.type===mt.string)o.specifiers=Qf,o.source=this.parseExprAtom();else o.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),o.source=this.type===mt.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)o.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(o,"ImportDeclaration")};Bt.parseImportSpecifier=function(){var o=this.startNode();if(o.imported=this.parseModuleExportName(),this.eatContextual("as"))o.local=this.parseIdent();else this.checkUnreserved(o.imported),o.local=o.imported;return this.checkLValSimple(o.local,cr),this.finishNode(o,"ImportSpecifier")};Bt.parseImportDefaultSpecifier=function(){var o=this.startNode();return o.local=this.parseIdent(),this.checkLValSimple(o.local,cr),this.finishNode(o,"ImportDefaultSpecifier")};Bt.parseImportNamespaceSpecifier=function(){var o=this.startNode();return this.next(),this.expectContextual("as"),o.local=this.parseIdent(),this.checkLValSimple(o.local,cr),this.finishNode(o,"ImportNamespaceSpecifier")};Bt.parseImportSpecifiers=function(){var o=[],et=!0;if(this.type===mt.name){if(o.push(this.parseImportDefaultSpecifier()),!this.eat(mt.comma))return o}if(this.type===mt.star)return o.push(this.parseImportNamespaceSpecifier()),o;this.expect(mt.braceL);while(!this.eat(mt.braceR)){if(!et){if(this.expect(mt.comma),this.afterTrailingComma(mt.braceR))break}else et=!1;o.push(this.parseImportSpecifier())}return o};Bt.parseWithClause=function(){var o=[];if(!this.eat(mt._with))return o;this.expect(mt.braceL);var et={},tt=!0;while(!this.eat(mt.braceR)){if(!tt){if(this.expect(mt.comma),this.afterTrailingComma(mt.braceR))break}else tt=!1;var nt=this.parseImportAttribute(),rt=nt.key.type==="Identifier"?nt.key.name:nt.key.value;if(Vr(et,rt))this.raiseRecoverable(nt.key.start,"Duplicate attribute key '"+rt+"'");et[rt]=!0,o.push(nt)}return o};Bt.parseImportAttribute=function(){var o=this.startNode();if(o.key=this.type===mt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(mt.colon),this.type!==mt.string)this.unexpected();return o.value=this.parseExprAtom(),this.finishNode(o,"ImportAttribute")};Bt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===mt.string){var o=this.parseLiteral(this.value);if(Kf.test(o.value))this.raise(o.start,"An export name cannot include a lone surrogate.");return o}return this.parseIdent(!0)};Bt.adaptDirectivePrologue=function(o){for(var et=0;et<o.length&&this.isDirectiveCandidate(o[et]);++et)o[et].directive=o[et].expression.raw.slice(1,-1)};Bt.isDirectiveCandidate=function(o){return this.options.ecmaVersion>=5&&o.type==="ExpressionStatement"&&o.expression.type==="Literal"&&typeof o.expression.value==="string"&&(this.input[o.start]==='"'||this.input[o.start]==="'")};var Hn=pn.prototype;Hn.toAssignable=function(o,et,tt){if(this.options.ecmaVersion>=6&&o)switch(o.type){case"Identifier":if(this.inAsync&&o.name==="await")this.raise(o.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(o.type="ObjectPattern",tt)this.checkPatternErrors(tt,!0);for(var nt=0,rt=o.properties;nt<rt.length;nt+=1){var it=rt[nt];if(this.toAssignable(it,et),it.type==="RestElement"&&(it.argument.type==="ArrayPattern"||it.argument.type==="ObjectPattern"))this.raise(it.argument.start,"Unexpected token")}break;case"Property":if(o.kind!=="init")this.raise(o.key.start,"Object pattern can't contain getter or setter");this.toAssignable(o.value,et);break;case"ArrayExpression":if(o.type="ArrayPattern",tt)this.checkPatternErrors(tt,!0);this.toAssignableList(o.elements,et);break;case"SpreadElement":if(o.type="RestElement",this.toAssignable(o.argument,et),o.argument.type==="AssignmentPattern")this.raise(o.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(o.operator!=="=")this.raise(o.left.end,"Only '=' operator can be used for specifying default value.");o.type="AssignmentPattern",delete o.operator,this.toAssignable(o.left,et);break;case"ParenthesizedExpression":this.toAssignable(o.expression,et,tt);break;case"ChainExpression":this.raiseRecoverable(o.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!et)break;default:this.raise(o.start,"Assigning to rvalue")}else if(tt)this.checkPatternErrors(tt,!0);return o};Hn.toAssignableList=function(o,et){var tt=o.length;for(var nt=0;nt<tt;nt++){var rt=o[nt];if(rt)this.toAssignable(rt,et)}if(tt){var it=o[tt-1];if(this.options.ecmaVersion===6&&et&&it&&it.type==="RestElement"&&it.argument.type!=="Identifier")this.unexpected(it.argument.start)}return o};Hn.parseSpread=function(o){var et=this.startNode();return this.next(),et.argument=this.parseMaybeAssign(!1,o),this.finishNode(et,"SpreadElement")};Hn.parseRestBinding=function(){var o=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==mt.name)this.unexpected();return o.argument=this.parseBindingAtom(),this.finishNode(o,"RestElement")};Hn.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case mt.bracketL:var o=this.startNode();return this.next(),o.elements=this.parseBindingList(mt.bracketR,!0,!0),this.finishNode(o,"ArrayPattern");case mt.braceL:return this.parseObj(!0)}return this.parseIdent()};Hn.parseBindingList=function(o,et,tt,nt){var rt=[],it=!0;while(!this.eat(o)){if(it)it=!1;else this.expect(mt.comma);if(et&&this.type===mt.comma)rt.push(null);else if(tt&&this.afterTrailingComma(o))break;else if(this.type===mt.ellipsis){var st=this.parseRestBinding();if(this.parseBindingListItem(st),rt.push(st),this.type===mt.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(o);break}else rt.push(this.parseAssignableListItem(nt))}return rt};Hn.parseAssignableListItem=function(o){var et=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(et),et};Hn.parseBindingListItem=function(o){return o};Hn.parseMaybeDefault=function(o,et,tt){if(tt=tt||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(mt.eq))return tt;var nt=this.startNodeAt(o,et);return nt.left=tt,nt.right=this.parseMaybeAssign(),this.finishNode(nt,"AssignmentPattern")};Hn.checkLValSimple=function(o,et,tt){if(et===void 0)et=Ws;var nt=et!==Ws;switch(o.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(o.name))this.raiseRecoverable(o.start,(nt?"Binding ":"Assigning to ")+o.name+" in strict mode");if(nt){if(et===cr&&o.name==="let")this.raiseRecoverable(o.start,"let is disallowed as a lexically bound name");if(tt){if(Vr(tt,o.name))this.raiseRecoverable(o.start,"Argument name clash");tt[o.name]=!0}if(et!==np)this.declareName(o.name,et,o.start)}break;case"ChainExpression":this.raiseRecoverable(o.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(nt)this.raiseRecoverable(o.start,"Binding member expression");break;case"ParenthesizedExpression":if(nt)this.raiseRecoverable(o.start,"Binding parenthesized expression");return this.checkLValSimple(o.expression,et,tt);default:this.raise(o.start,(nt?"Binding":"Assigning to")+" rvalue")}};Hn.checkLValPattern=function(o,et,tt){if(et===void 0)et=Ws;switch(o.type){case"ObjectPattern":for(var nt=0,rt=o.properties;nt<rt.length;nt+=1){var it=rt[nt];this.checkLValInnerPattern(it,et,tt)}break;case"ArrayPattern":for(var st=0,at=o.elements;st<at.length;st+=1){var ct=at[st];if(ct)this.checkLValInnerPattern(ct,et,tt)}break;default:this.checkLValSimple(o,et,tt)}};Hn.checkLValInnerPattern=function(o,et,tt){if(et===void 0)et=Ws;switch(o.type){case"Property":this.checkLValInnerPattern(o.value,et,tt);break;case"AssignmentPattern":this.checkLValPattern(o.left,et,tt);break;case"RestElement":this.checkLValPattern(o.argument,et,tt);break;default:this.checkLValPattern(o,et,tt)}};var qn=function(et,tt,nt,rt,it){this.token=et,this.isExpr=!!tt,this.preserveSpace=!!nt,this.override=rt,this.generator=!!it},cn={b_stat:new qn("{",!1),b_expr:new qn("{",!0),b_tmpl:new qn("${",!1),p_stat:new qn("(",!1),p_expr:new qn("(",!0),q_tmpl:new qn("`",!0,!0,function(o){return o.tryReadTemplateToken()}),f_stat:new qn("function",!1),f_expr:new qn("function",!0),f_expr_gen:new qn("function",!0,!1,null,!0),f_gen:new qn("function",!1,!1,null,!0)},Wr=pn.prototype;Wr.initialContext=function(){return[cn.b_stat]};Wr.curContext=function(){return this.context[this.context.length-1]};Wr.braceIsBlock=function(o){var et=this.curContext();if(et===cn.f_expr||et===cn.f_stat)return!0;if(o===mt.colon&&(et===cn.b_stat||et===cn.b_expr))return!et.isExpr;if(o===mt._return||o===mt.name&&this.exprAllowed)return wn.test(this.input.slice(this.lastTokEnd,this.start));if(o===mt._else||o===mt.semi||o===mt.eof||o===mt.parenR||o===mt.arrow)return!0;if(o===mt.braceL)return et===cn.b_stat;if(o===mt._var||o===mt._const||o===mt.name)return!1;return!this.exprAllowed};Wr.inGeneratorContext=function(){for(var o=this.context.length-1;o>=1;o--){var et=this.context[o];if(et.token==="function")return et.generator}return!1};Wr.updateContext=function(o){var et,tt=this.type;if(tt.keyword&&o===mt.dot)this.exprAllowed=!1;else if(et=tt.updateContext)et.call(this,o);else this.exprAllowed=tt.beforeExpr};Wr.overrideContext=function(o){if(this.curContext()!==o)this.context[this.context.length-1]=o};mt.parenR.updateContext=mt.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var o=this.context.pop();if(o===cn.b_stat&&this.curContext().token==="function")o=this.context.pop();this.exprAllowed=!o.isExpr};mt.braceL.updateContext=function(o){this.context.push(this.braceIsBlock(o)?cn.b_stat:cn.b_expr),this.exprAllowed=!0};mt.dollarBraceL.updateContext=function(){this.context.push(cn.b_tmpl),this.exprAllowed=!0};mt.parenL.updateContext=function(o){var et=o===mt._if||o===mt._for||o===mt._with||o===mt._while;this.context.push(et?cn.p_stat:cn.p_expr),this.exprAllowed=!0};mt.incDec.updateContext=function(){};mt._function.updateContext=mt._class.updateContext=function(o){if(o.beforeExpr&&o!==mt._else&&!(o===mt.semi&&this.curContext()!==cn.p_stat)&&!(o===mt._return&&wn.test(this.input.slice(this.lastTokEnd,this.start)))&&!((o===mt.colon||o===mt.braceL)&&this.curContext()===cn.b_stat))this.context.push(cn.f_expr);else this.context.push(cn.f_stat);this.exprAllowed=!1};mt.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};mt.backQuote.updateContext=function(){if(this.curContext()===cn.q_tmpl)this.context.pop();else this.context.push(cn.q_tmpl);this.exprAllowed=!1};mt.star.updateContext=function(o){if(o===mt._function){var et=this.context.length-1;if(this.context[et]===cn.f_expr)this.context[et]=cn.f_expr_gen;else this.context[et]=cn.f_gen}this.exprAllowed=!0};mt.name.updateContext=function(o){var et=!1;if(this.options.ecmaVersion>=6&&o!==mt.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())et=!0}this.exprAllowed=et};var qt=pn.prototype;qt.checkPropClash=function(o,et,tt){if(this.options.ecmaVersion>=9&&o.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(o.computed||o.method||o.shorthand))return;var nt=o.key,rt;switch(nt.type){case"Identifier":rt=nt.name;break;case"Literal":rt=String(nt.value);break;default:return}var it=o.kind;if(this.options.ecmaVersion>=6){if(rt==="__proto__"&&it==="init"){if(et.proto)if(tt){if(tt.doubleProto<0)tt.doubleProto=nt.start}else this.raiseRecoverable(nt.start,"Redefinition of __proto__ property");et.proto=!0}return}rt="$"+rt;var st=et[rt];if(st){var at;if(it==="init")at=this.strict&&st.init||st.get||st.set;else at=st.init||st[it];if(at)this.raiseRecoverable(nt.start,"Redefinition of property")}else st=et[rt]={init:!1,get:!1,set:!1};st[it]=!0};qt.parseExpression=function(o,et){var tt=this;return this.catchStackOverflow(function(){var{start:nt,startLoc:rt}=tt,it=tt.parseMaybeAssign(o,et);if(tt.type===mt.comma){var st=tt.startNodeAt(nt,rt);st.expressions=[it];while(tt.eat(mt.comma))st.expressions.push(tt.parseMaybeAssign(o,et));return tt.finishNode(st,"SequenceExpression")}return it})};qt.parseMaybeAssign=function(o,et,tt){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(o);else this.exprAllowed=!1;var nt=!1,rt=-1,it=-1,st=-1;if(et)rt=et.parenthesizedAssign,it=et.trailingComma,st=et.doubleProto,et.parenthesizedAssign=et.trailingComma=-1;else et=new Xs,nt=!0;var at=this.start,ct=this.startLoc;if(this.type===mt.parenL||this.type===mt.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=o==="await";var lt=this.parseMaybeConditional(o,et);if(tt)lt=tt.call(this,lt,at,ct);if(this.type.isAssign){var ut=this.startNodeAt(at,ct);if(ut.operator=this.value,this.type===mt.eq)lt=this.toAssignable(lt,!1,et);if(!nt)et.parenthesizedAssign=et.trailingComma=et.doubleProto=-1;if(et.shorthandAssign>=lt.start)et.shorthandAssign=-1;if(this.type===mt.eq)this.checkLValPattern(lt);else this.checkLValSimple(lt);if(ut.left=lt,this.next(),ut.right=this.parseMaybeAssign(o),st>-1)et.doubleProto=st;return this.finishNode(ut,"AssignmentExpression")}else if(nt)this.checkExpressionErrors(et,!0);if(rt>-1)et.parenthesizedAssign=rt;if(it>-1)et.trailingComma=it;return lt};qt.parseMaybeConditional=function(o,et){var tt=this.start,nt=this.startLoc,rt=this.parseExprOps(o,et);if(this.checkExpressionErrors(et))return rt;if(!(rt.type==="ArrowFunctionExpression"&&rt.start===tt)&&this.eat(mt.question)){var it=this.startNodeAt(tt,nt);return it.test=rt,it.consequent=this.parseMaybeAssign(),this.expect(mt.colon),it.alternate=this.parseMaybeAssign(o),this.finishNode(it,"ConditionalExpression")}return rt};qt.parseExprOps=function(o,et){var tt=this.start,nt=this.startLoc,rt=this.parseMaybeUnary(et,!1,!1,o);if(this.checkExpressionErrors(et))return rt;return rt.start===tt&&rt.type==="ArrowFunctionExpression"?rt:this.parseExprOp(rt,tt,nt,-1,o)};qt.parseExprOp=function(o,et,tt,nt,rt){var it=this.type.binop;if(it!=null&&(!rt||this.type!==mt._in)){if(it>nt){var st=this.type===mt.logicalOR||this.type===mt.logicalAND,at=this.type===mt.coalesce;if(at)it=mt.logicalAND.binop;var ct=this.value;this.next();var lt=this.start,ut=this.startLoc,dt=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,rt),lt,ut,it,rt),ht=this.buildBinary(et,tt,o,dt,ct,st||at);if(st&&this.type===mt.coalesce||at&&(this.type===mt.logicalOR||this.type===mt.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(ht,et,tt,nt,rt)}}return o};qt.buildBinary=function(o,et,tt,nt,rt,it){if(nt.type==="PrivateIdentifier")this.raise(nt.start,"Private identifier can only be left side of binary expression");var st=this.startNodeAt(o,et);return st.left=tt,st.operator=rt,st.right=nt,this.finishNode(st,it?"LogicalExpression":"BinaryExpression")};qt.parseMaybeUnary=function(o,et,tt,nt){var rt=this.start,it=this.startLoc,st;if(this.isContextual("await")&&this.canAwait)st=this.parseAwait(nt),et=!0;else if(this.type.prefix){var at=this.startNode(),ct=this.type===mt.incDec;if(at.operator=this.value,at.prefix=!0,this.next(),at.argument=this.parseMaybeUnary(null,!0,ct,nt),this.checkExpressionErrors(o,!0),ct)this.checkLValSimple(at.argument);else if(this.strict&&at.operator==="delete"&&sp(at.argument))this.raiseRecoverable(at.start,"Deleting local variable in strict mode");else if(at.operator==="delete"&&Co(at.argument))this.raiseRecoverable(at.start,"Private fields can not be deleted");else et=!0;st=this.finishNode(at,ct?"UpdateExpression":"UnaryExpression")}else if(!et&&this.type===mt.privateId){if((nt||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(st=this.parsePrivateIdent(),this.type!==mt._in)this.unexpected()}else{if(st=this.parseExprSubscripts(o,nt),this.checkExpressionErrors(o))return st;while(this.type.postfix&&!this.canInsertSemicolon()){var lt=this.startNodeAt(rt,it);lt.operator=this.value,lt.prefix=!1,lt.argument=st,this.checkLValSimple(st),this.next(),st=this.finishNode(lt,"UpdateExpression")}}if(!tt&&!(st.type==="ArrowFunctionExpression"&&st.start===rt)&&this.eat(mt.starstar))if(et)this.unexpected(this.lastTokStart);else return this.buildBinary(rt,it,st,this.parseMaybeUnary(null,!1,!1,nt),"**",!1);else return st};function sp(o){return o.type==="Identifier"||o.type==="ParenthesizedExpression"&&sp(o.expression)}function Co(o){return o.type==="MemberExpression"&&o.property.type==="PrivateIdentifier"||o.type==="ChainExpression"&&Co(o.expression)||o.type==="ParenthesizedExpression"&&Co(o.expression)}qt.parseExprSubscripts=function(o,et){var tt=this.start,nt=this.startLoc,rt=this.parseExprAtom(o,et);if(rt.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return rt;var it=this.parseSubscripts(rt,tt,nt,!1,et);if(o&&it.type==="MemberExpression"){if(o.parenthesizedAssign>=it.start)o.parenthesizedAssign=-1;if(o.parenthesizedBind>=it.start)o.parenthesizedBind=-1;if(o.trailingComma>=it.start)o.trailingComma=-1}return it};qt.parseSubscripts=function(o,et,tt,nt,rt){var it=this.options.ecmaVersion>=8&&o.type==="Identifier"&&o.name==="async"&&this.lastTokEnd===o.end&&!this.canInsertSemicolon()&&o.end-o.start===5&&this.potentialArrowAt===o.start,st=!1;while(!0){var at=this.parseSubscript(o,et,tt,nt,it,st,rt);if(at.optional)st=!0;if(at===o||at.type==="ArrowFunctionExpression"){if(st){var ct=this.startNodeAt(et,tt);ct.expression=at,at=this.finishNode(ct,"ChainExpression")}return at}o=at}};qt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(mt.arrow)};qt.parseSubscriptAsyncArrow=function(o,et,tt,nt){return this.parseArrowExpression(this.startNodeAt(o,et),tt,!0,nt)};qt.parseSubscript=function(o,et,tt,nt,rt,it,st){var at=this.options.ecmaVersion>=11,ct=at&&this.eat(mt.questionDot);if(nt&&ct)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var lt=this.eat(mt.bracketL);if(lt||ct&&this.type!==mt.parenL&&this.type!==mt.backQuote||this.eat(mt.dot)){var ut=this.startNodeAt(et,tt);if(ut.object=o,lt)ut.property=this.parseExpression(),this.expect(mt.bracketR);else if(this.type===mt.privateId&&o.type!=="Super")ut.property=this.parsePrivateIdent();else ut.property=this.parseIdent(this.options.allowReserved!=="never");if(ut.computed=!!lt,at)ut.optional=ct;o=this.finishNode(ut,"MemberExpression")}else if(!nt&&this.eat(mt.parenL)){var dt=new Xs,ht=this.yieldPos,yt=this.awaitPos,xt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Et=this.parseExprList(mt.parenR,this.options.ecmaVersion>=8,!1,dt);if(rt&&!ct&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(dt,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=ht,this.awaitPos=yt,this.awaitIdentPos=xt,this.parseSubscriptAsyncArrow(et,tt,Et,st)}this.checkExpressionErrors(dt,!0),this.yieldPos=ht||this.yieldPos,this.awaitPos=yt||this.awaitPos,this.awaitIdentPos=xt||this.awaitIdentPos;var Ct=this.startNodeAt(et,tt);if(Ct.callee=o,Ct.arguments=Et,at)Ct.optional=ct;o=this.finishNode(Ct,"CallExpression")}else if(this.type===mt.backQuote){if(ct||it)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var At=this.startNodeAt(et,tt);At.tag=o,At.quasi=this.parseTemplate({isTagged:!0}),o=this.finishNode(At,"TaggedTemplateExpression")}return o};qt.parseExprAtom=function(o,et,tt){if(this.type===mt.slash)this.readRegexp();var nt,rt=this.potentialArrowAt===this.start;switch(this.type){case mt._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(nt=this.startNode(),this.next(),this.type===mt.parenL&&!this.allowDirectSuper)this.raise(nt.start,"super() call outside constructor of a subclass");if(this.type!==mt.dot&&this.type!==mt.bracketL&&this.type!==mt.parenL)this.unexpected();return this.finishNode(nt,"Super");case mt._this:return nt=this.startNode(),this.next(),this.finishNode(nt,"ThisExpression");case mt.name:var it=this.start,st=this.startLoc,at=this.containsEsc,ct=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!at&&ct.name==="async"&&!this.canInsertSemicolon()&&this.eat(mt._function))return this.overrideContext(cn.f_expr),this.parseFunction(this.startNodeAt(it,st),0,!1,!0,et);if(rt&&!this.canInsertSemicolon()){if(this.eat(mt.arrow))return this.parseArrowExpression(this.startNodeAt(it,st),[ct],!1,et);if(this.options.ecmaVersion>=8&&ct.name==="async"&&this.type===mt.name&&!at&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(ct=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(mt.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(it,st),[ct],!0,et)}}return ct;case mt.regexp:var lt=this.value;return nt=this.parseLiteral(lt.value),nt.regex={pattern:lt.pattern,flags:lt.flags},nt;case mt.num:case mt.string:return this.parseLiteral(this.value);case mt._null:case mt._true:case mt._false:return nt=this.startNode(),nt.value=this.type===mt._null?null:this.type===mt._true,nt.raw=this.type.keyword,this.next(),this.finishNode(nt,"Literal");case mt.parenL:var ut=this.start,dt=this.parseParenAndDistinguishExpression(rt,et);if(o){if(o.parenthesizedAssign<0&&!this.isSimpleAssignTarget(dt))o.parenthesizedAssign=ut;if(o.parenthesizedBind<0)o.parenthesizedBind=ut}return dt;case mt.bracketL:return nt=this.startNode(),this.next(),nt.elements=this.parseExprList(mt.bracketR,!0,!0,o),this.finishNode(nt,"ArrayExpression");case mt.braceL:return this.overrideContext(cn.b_expr),this.parseObj(!1,o);case mt._function:return nt=this.startNode(),this.next(),this.parseFunction(nt,0);case mt._class:return this.parseClass(this.startNode(),!1);case mt._new:return this.parseNew();case mt.backQuote:return this.parseTemplate();case mt._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(tt);else return this.unexpected();default:return this.parseExprAtomDefault()}};qt.parseExprAtomDefault=function(){this.unexpected()};qt.parseExprImport=function(o){var et=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===mt.parenL&&!o)return this.parseDynamicImport(et);else if(this.type===mt.dot){var tt=this.startNodeAt(et.start,et.loc&&et.loc.start);return tt.name="import",et.meta=this.finishNode(tt,"Identifier"),this.parseImportMeta(et)}else this.unexpected()};qt.parseDynamicImport=function(o){if(this.next(),o.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(mt.parenR))if(this.expect(mt.comma),!this.afterTrailingComma(mt.parenR)){if(o.options=this.parseMaybeAssign(),!this.eat(mt.parenR)){if(this.expect(mt.comma),!this.afterTrailingComma(mt.parenR))this.unexpected()}}else o.options=null;else o.options=null;else if(!this.eat(mt.parenR)){var et=this.start;if(this.eat(mt.comma)&&this.eat(mt.parenR))this.raiseRecoverable(et,"Trailing comma is not allowed in import()");else this.unexpected(et)}return this.finishNode(o,"ImportExpression")};qt.parseImportMeta=function(o){this.next();var et=this.containsEsc;if(o.property=this.parseIdent(!0),o.property.name!=="meta")this.raiseRecoverable(o.property.start,"The only valid meta property for import is 'import.meta'");if(et)this.raiseRecoverable(o.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(o.start,"Cannot use 'import.meta' outside a module");return this.finishNode(o,"MetaProperty")};qt.parseLiteral=function(o){var et=this.startNode();if(et.value=o,et.raw=this.input.slice(this.start,this.end),et.raw.charCodeAt(et.raw.length-1)===110)et.bigint=et.value!=null?et.value.toString():et.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(et,"Literal")};qt.parseParenExpression=function(){this.expect(mt.parenL);var o=this.parseExpression();return this.expect(mt.parenR),o};qt.shouldParseArrow=function(o){return!this.canInsertSemicolon()};qt.parseParenAndDistinguishExpression=function(o,et){var tt=this.start,nt=this.startLoc,rt,it=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var st=this.start,at=this.startLoc,ct=[],lt=!0,ut=!1,dt=new Xs,ht=this.yieldPos,yt=this.awaitPos,xt;this.yieldPos=0,this.awaitPos=0;while(this.type!==mt.parenR)if(lt?lt=!1:this.expect(mt.comma),it&&this.afterTrailingComma(mt.parenR,!0)){ut=!0;break}else if(this.type===mt.ellipsis){if(xt=this.start,ct.push(this.parseParenItem(this.parseRestBinding())),this.type===mt.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else ct.push(this.parseMaybeAssign(!1,dt,this.parseParenItem));var Et=this.lastTokEnd,Ct=this.lastTokEndLoc;if(this.expect(mt.parenR),o&&this.shouldParseArrow(ct)&&this.eat(mt.arrow))return this.checkPatternErrors(dt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=ht,this.awaitPos=yt,this.parseParenArrowList(tt,nt,ct,et);if(!ct.length||ut)this.unexpected(this.lastTokStart);if(xt)this.unexpected(xt);if(this.checkExpressionErrors(dt,!0),this.yieldPos=ht||this.yieldPos,this.awaitPos=yt||this.awaitPos,ct.length>1)rt=this.startNodeAt(st,at),rt.expressions=ct,this.finishNodeAt(rt,"SequenceExpression",Et,Ct);else rt=ct[0]}else rt=this.parseParenExpression();if(this.options.preserveParens){var At=this.startNodeAt(tt,nt);return At.expression=rt,this.finishNode(At,"ParenthesizedExpression")}else return rt};qt.parseParenItem=function(o){return o};qt.parseParenArrowList=function(o,et,tt,nt){return this.parseArrowExpression(this.startNodeAt(o,et),tt,!1,nt)};var eh=[];qt.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var o=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===mt.dot){var et=this.startNodeAt(o.start,o.loc&&o.loc.start);et.name="new",o.meta=this.finishNode(et,"Identifier"),this.next();var tt=this.containsEsc;if(o.property=this.parseIdent(!0),o.property.name!=="target")this.raiseRecoverable(o.property.start,"The only valid meta property for new is 'new.target'");if(tt)this.raiseRecoverable(o.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(o.start,"'new.target' can only be used in functions and class static block");return this.finishNode(o,"MetaProperty")}var nt=this.start,rt=this.startLoc;if(o.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),nt,rt,!0,!1),o.callee.type==="Super")this.raiseRecoverable(nt,"Invalid use of 'super'");if(this.eat(mt.parenL))o.arguments=this.parseExprList(mt.parenR,this.options.ecmaVersion>=8,!1);else o.arguments=eh;return this.finishNode(o,"NewExpression")};qt.parseTemplateElement=function(o){var et=o.isTagged,tt=this.startNode();if(this.type===mt.invalidTemplate){if(!et)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");tt.value={raw:this.value.replace(/\r\n?/g,`
|
|
4
|
+
`),cooked:null}}else tt.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
5
|
+
`),cooked:this.value};return this.next(),tt.tail=this.type===mt.backQuote,this.finishNode(tt,"TemplateElement")};qt.parseTemplate=function(o){if(o===void 0)o={};var et=o.isTagged;if(et===void 0)et=!1;var tt=this.startNode();this.next(),tt.expressions=[];var nt=this.parseTemplateElement({isTagged:et});tt.quasis=[nt];while(!nt.tail){if(this.type===mt.eof)this.raise(this.pos,"Unterminated template literal");this.expect(mt.dollarBraceL),tt.expressions.push(this.parseExpression()),this.expect(mt.braceR),tt.quasis.push(nt=this.parseTemplateElement({isTagged:et}))}return this.next(),this.finishNode(tt,"TemplateLiteral")};qt.isAsyncProp=function(o){return!o.computed&&o.key.type==="Identifier"&&o.key.name==="async"&&(this.type===mt.name||this.type===mt.num||this.type===mt.string||this.type===mt.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===mt.star)&&!wn.test(this.input.slice(this.lastTokEnd,this.start))};qt.parseObj=function(o,et){var tt=this.startNode(),nt=!0,rt={};tt.properties=[],this.next();while(!this.eat(mt.braceR)){if(!nt){if(this.expect(mt.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(mt.braceR))break}else nt=!1;var it=this.parseProperty(o,et);if(!o)this.checkPropClash(it,rt,et);tt.properties.push(it)}return this.finishNode(tt,o?"ObjectPattern":"ObjectExpression")};qt.parseProperty=function(o,et){var tt=this.startNode(),nt,rt,it,st;if(this.options.ecmaVersion>=9&&this.eat(mt.ellipsis)){if(o){if(tt.argument=this.parseIdent(!1),this.type===mt.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(tt,"RestElement")}if(tt.argument=this.parseMaybeAssign(!1,et),this.type===mt.comma&&et&&et.trailingComma<0)et.trailingComma=this.start;return this.finishNode(tt,"SpreadElement")}if(this.options.ecmaVersion>=6){if(tt.method=!1,tt.shorthand=!1,o||et)it=this.start,st=this.startLoc;if(!o)nt=this.eat(mt.star)}var at=this.containsEsc;if(this.parsePropertyName(tt),!o&&!at&&this.options.ecmaVersion>=8&&!nt&&this.isAsyncProp(tt))rt=!0,nt=this.options.ecmaVersion>=9&&this.eat(mt.star),this.parsePropertyName(tt);else rt=!1;return this.parsePropertyValue(tt,o,nt,rt,it,st,et,at),this.finishNode(tt,"Property")};qt.parseGetterSetter=function(o){var et=o.key.name;this.parsePropertyName(o),o.value=this.parseMethod(!1),o.kind=et;var tt=o.kind==="get"?0:1;if(o.value.params.length!==tt){var nt=o.value.start;if(o.kind==="get")this.raiseRecoverable(nt,"getter should have no params");else this.raiseRecoverable(nt,"setter should have exactly one param")}else if(o.kind==="set"&&o.value.params[0].type==="RestElement")this.raiseRecoverable(o.value.params[0].start,"Setter cannot use rest params")};qt.parsePropertyValue=function(o,et,tt,nt,rt,it,st,at){if((tt||nt)&&this.type===mt.colon)this.unexpected();if(this.eat(mt.colon))o.value=et?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,st),o.kind="init";else if(this.options.ecmaVersion>=6&&this.type===mt.parenL){if(et)this.unexpected();o.method=!0,o.value=this.parseMethod(tt,nt),o.kind="init"}else if(!et&&!at&&this.options.ecmaVersion>=5&&!o.computed&&o.key.type==="Identifier"&&(o.key.name==="get"||o.key.name==="set")&&(this.type!==mt.comma&&this.type!==mt.braceR&&this.type!==mt.eq)){if(tt||nt)this.unexpected();this.parseGetterSetter(o)}else if(this.options.ecmaVersion>=6&&!o.computed&&o.key.type==="Identifier"){if(tt||nt)this.unexpected();if(this.checkUnreserved(o.key),o.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=rt;if(et)o.value=this.parseMaybeDefault(rt,it,this.copyNode(o.key));else if(this.type===mt.eq&&st){if(st.shorthandAssign<0)st.shorthandAssign=this.start;o.value=this.parseMaybeDefault(rt,it,this.copyNode(o.key))}else o.value=this.copyNode(o.key);o.kind="init",o.shorthand=!0}else this.unexpected()};qt.parsePropertyName=function(o){if(this.options.ecmaVersion>=6)if(this.eat(mt.bracketL))return o.computed=!0,o.key=this.parseMaybeAssign(),this.expect(mt.bracketR),o.key;else o.computed=!1;return o.key=this.type===mt.num||this.type===mt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};qt.initFunction=function(o){if(o.id=null,this.options.ecmaVersion>=6)o.generator=o.expression=!1;if(this.options.ecmaVersion>=8)o.async=!1};qt.parseMethod=function(o,et,tt){var nt=this.startNode(),rt=this.yieldPos,it=this.awaitPos,st=this.awaitIdentPos;if(this.initFunction(nt),this.options.ecmaVersion>=6)nt.generator=o;if(this.options.ecmaVersion>=8)nt.async=!!et;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(wo(et,nt.generator)|Ks|(tt?Qc:0)),this.expect(mt.parenL),nt.params=this.parseBindingList(mt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(nt,!1,!0,!1),this.yieldPos=rt,this.awaitPos=it,this.awaitIdentPos=st,this.finishNode(nt,"FunctionExpression")};qt.parseArrowExpression=function(o,et,tt,nt){var rt=this.yieldPos,it=this.awaitPos,st=this.awaitIdentPos;if(this.enterScope(wo(tt,!1)|Po),this.initFunction(o),this.options.ecmaVersion>=8)o.async=!!tt;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,o.params=this.toAssignableList(et,!0),this.parseFunctionBody(o,!0,!1,nt),this.yieldPos=rt,this.awaitPos=it,this.awaitIdentPos=st,this.finishNode(o,"ArrowFunctionExpression")};qt.parseFunctionBody=function(o,et,tt,nt){var rt=et&&this.type!==mt.braceL,it=this.strict,st=!1;if(rt)o.body=this.parseMaybeAssign(nt),o.expression=!0,this.checkParams(o,!1);else{var at=this.options.ecmaVersion>=7&&!this.isSimpleParamList(o.params);if(!it||at){if(st=this.strictDirective(this.end),st&&at)this.raiseRecoverable(o.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var ct=this.labels;if(this.labels=[],st)this.strict=!0;if(this.checkParams(o,!it&&!st&&!et&&!tt&&this.isSimpleParamList(o.params)),this.strict&&o.id)this.checkLValSimple(o.id,np);o.body=this.parseBlock(!1,void 0,st&&!it),o.expression=!1,this.adaptDirectivePrologue(o.body.body),this.labels=ct}this.exitScope()};qt.isSimpleParamList=function(o){for(var et=0,tt=o;et<tt.length;et+=1){var nt=tt[et];if(nt.type!=="Identifier")return!1}return!0};qt.checkParams=function(o,et){var tt=Object.create(null);for(var nt=0,rt=o.params;nt<rt.length;nt+=1){var it=rt[nt];this.checkLValInnerPattern(it,Ao,et?null:tt)}};qt.parseExprList=function(o,et,tt,nt){var rt=[],it=!0;while(!this.eat(o)){if(!it){if(this.expect(mt.comma),et&&this.afterTrailingComma(o))break}else it=!1;var st=void 0;if(tt&&this.type===mt.comma)st=null;else if(this.type===mt.ellipsis){if(st=this.parseSpread(nt),nt&&this.type===mt.comma&&nt.trailingComma<0)nt.trailingComma=this.start}else st=this.parseMaybeAssign(!1,nt);rt.push(st)}return rt};qt.checkUnreserved=function(o){var{start:et,end:tt,name:nt}=o;if(this.inGenerator&&nt==="yield")this.raiseRecoverable(et,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&nt==="await")this.raiseRecoverable(et,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&zs)&&nt==="arguments")this.raiseRecoverable(et,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(nt==="arguments"||nt==="await"))this.raise(et,"Cannot use "+nt+" in class static initialization block");if(this.keywords.test(nt))this.raise(et,"Unexpected keyword '"+nt+"'");if(this.options.ecmaVersion<6&&this.input.slice(et,tt).indexOf("\\")!==-1)return;var rt=this.strict?this.reservedWordsStrict:this.reservedWords;if(rt.test(nt)){if(!this.inAsync&&nt==="await")this.raiseRecoverable(et,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(et,"The keyword '"+nt+"' is reserved")}};qt.parseIdent=function(o){var et=this.parseIdentNode();if(this.next(!!o),this.finishNode(et,"Identifier"),!o){if(this.checkUnreserved(et),et.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=et.start}return et};qt.parseIdentNode=function(){var o=this.startNode();if(this.type===mt.name)o.name=this.value;else if(this.type.keyword){if(o.name=this.type.keyword,(o.name==="class"||o.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=mt.name}else this.unexpected();return o};qt.parsePrivateIdent=function(){var o=this.startNode();if(this.type===mt.privateId)o.name=this.value;else this.unexpected();if(this.next(),this.finishNode(o,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(o);return o};qt.parseYield=function(o){if(!this.yieldPos)this.yieldPos=this.start;var et=this.startNode();if(this.next(),this.type===mt.semi||this.canInsertSemicolon()||this.type!==mt.star&&!this.type.startsExpr)et.delegate=!1,et.argument=null;else et.delegate=this.eat(mt.star),et.argument=this.parseMaybeAssign(o);return this.finishNode(et,"YieldExpression")};qt.parseAwait=function(o){if(!this.awaitPos)this.awaitPos=this.start;var et=this.startNode();return this.next(),et.argument=this.parseMaybeUnary(null,!0,!1,o),this.finishNode(et,"AwaitExpression")};var Gs=pn.prototype;Gs.raise=function(o,et){var tt=To(this.input,o);if(et+=" ("+tt.line+":"+tt.column+")",this.sourceFile)et+=" in "+this.sourceFile;var nt=SyntaxError(et);throw nt.pos=o,nt.loc=tt,nt.raisedAt=this.pos,nt};Gs.raiseRecoverable=Gs.raise;Gs.curPosition=function(){if(this.options.locations)return new jr(this.curLine,this.pos-this.lineStart)};var hr=pn.prototype,th=function(et){this.flags=et,this.var=[],this.lexical=[],this.functions=[]};hr.enterScope=function(o){this.scopeStack.push(new th(o))};hr.exitScope=function(){this.scopeStack.pop()};hr.treatFunctionsAsVarInScope=function(o){return o.flags&kr||!this.inModule&&o.flags&Sr};hr.declareName=function(o,et,tt){var nt=!1;if(et===cr){var rt=this.currentScope();if(nt=rt.lexical.indexOf(o)>-1||rt.functions.indexOf(o)>-1||rt.var.indexOf(o)>-1,rt.lexical.push(o),this.inModule&&rt.flags&Sr)delete this.undefinedExports[o]}else if(et===tp){var it=this.currentScope();it.lexical.push(o)}else if(et===ep){var st=this.currentScope();if(this.treatFunctionsAsVar)nt=st.lexical.indexOf(o)>-1;else nt=st.lexical.indexOf(o)>-1||st.var.indexOf(o)>-1;st.functions.push(o)}else for(var at=this.scopeStack.length-1;at>=0;--at){var ct=this.scopeStack[at];if(ct.lexical.indexOf(o)>-1&&!(ct.flags&Yc&&ct.lexical[0]===o)||!this.treatFunctionsAsVarInScope(ct)&&ct.functions.indexOf(o)>-1){nt=!0;break}if(ct.var.push(o),this.inModule&&ct.flags&Sr)delete this.undefinedExports[o];if(ct.flags&zs)break}if(nt)this.raiseRecoverable(tt,"Identifier '"+o+"' has already been declared")};hr.checkLocalExport=function(o){if(this.scopeStack[0].lexical.indexOf(o.name)===-1&&this.scopeStack[0].var.indexOf(o.name)===-1)this.undefinedExports[o.name]=o};hr.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};hr.currentVarScope=function(){for(var o=this.scopeStack.length-1;;o--){var et=this.scopeStack[o];if(et.flags&(zs|ps|Pr))return et}};hr.currentThisScope=function(){for(var o=this.scopeStack.length-1;;o--){var et=this.scopeStack[o];if(et.flags&(zs|ps|Pr)&&!(et.flags&Po))return et}};var ls=function(et,tt,nt){if(this.type="",this.start=tt,this.end=0,et.options.locations)this.loc=new cs(et,nt);if(et.options.directSourceFile)this.sourceFile=et.options.directSourceFile;if(et.options.ranges)this.range=[tt,0]},us=pn.prototype;us.startNode=function(){return new ls(this,this.start,this.startLoc)};us.startNodeAt=function(o,et){return new ls(this,o,et)};function ip(o,et,tt,nt){if(o.type=et,o.end=tt,this.options.locations)o.loc.end=nt;if(this.options.ranges)o.range[1]=tt;return o}us.finishNode=function(o,et){return ip.call(this,o,et,this.lastTokEnd,this.lastTokEndLoc)};us.finishNodeAt=function(o,et,tt,nt){return ip.call(this,o,et,tt,nt)};us.copyNode=function(o){var et=new ls(this,o.start,this.startLoc);for(var tt in o)et[tt]=o[tt];return et};var nh="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",op="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",ap=op+" Extended_Pictographic",cp=ap,pp=cp+" EBase EComp EMod EPres ExtPict",lp=pp,rh=lp,sh={9:op,10:ap,11:cp,12:pp,13:lp,14:rh},ih="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",oh={9:"",10:"",11:"",12:"",13:"",14:ih},qc="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",up="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",dp=up+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",fp=dp+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",hp=fp+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",mp=hp+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ah=mp+" "+nh,ch={9:up,10:dp,11:fp,12:hp,13:mp,14:ah},yp={};function ph(o){var et=yp[o]={binary:fr(sh[o]+" "+qc),binaryOfStrings:fr(oh[o]),nonBinary:{General_Category:fr(qc),Script:fr(ch[o])}};et.nonBinary.Script_Extensions=et.nonBinary.Script,et.nonBinary.gc=et.nonBinary.General_Category,et.nonBinary.sc=et.nonBinary.Script,et.nonBinary.scx=et.nonBinary.Script_Extensions}for(os=0,js=[9,10,11,12,13,14];os<js.length;os+=1)vo=js[os],ph(vo);var vo,os,js,Mt=pn.prototype,Us=function(et,tt){this.parent=et,this.base=tt||this};Us.prototype.separatedFrom=function(et){for(var tt=this;tt;tt=tt.parent)for(var nt=et;nt;nt=nt.parent)if(tt.base===nt.base&&tt!==nt)return!0;return!1};Us.prototype.sibling=function(){return new Us(this.parent,this.base)};var nr=function(et){this.parser=et,this.validFlags="gim"+(et.options.ecmaVersion>=6?"uy":"")+(et.options.ecmaVersion>=9?"s":"")+(et.options.ecmaVersion>=13?"d":"")+(et.options.ecmaVersion>=15?"v":""),this.unicodeProperties=yp[et.options.ecmaVersion>=14?14:et.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};nr.prototype.reset=function(et,tt,nt){var rt=nt.indexOf("v")!==-1,it=nt.indexOf("u")!==-1;if(this.start=et|0,this.source=tt+"",this.flags=nt,rt&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=it&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=it&&this.parser.options.ecmaVersion>=9};nr.prototype.raise=function(et){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+et)};nr.prototype.at=function(et,tt){if(tt===void 0)tt=!1;var nt=this.source,rt=nt.length;if(et>=rt)return-1;var it=nt.charCodeAt(et);if(!(tt||this.switchU)||it<=55295||it>=57344||et+1>=rt)return it;var st=nt.charCodeAt(et+1);return st>=56320&&st<=57343?(it<<10)+st-56613888:it};nr.prototype.nextIndex=function(et,tt){if(tt===void 0)tt=!1;var nt=this.source,rt=nt.length;if(et>=rt)return rt;var it=nt.charCodeAt(et),st;if(!(tt||this.switchU)||it<=55295||it>=57344||et+1>=rt||(st=nt.charCodeAt(et+1))<56320||st>57343)return et+1;return et+2};nr.prototype.current=function(et){if(et===void 0)et=!1;return this.at(this.pos,et)};nr.prototype.lookahead=function(et){if(et===void 0)et=!1;return this.at(this.nextIndex(this.pos,et),et)};nr.prototype.advance=function(et){if(et===void 0)et=!1;this.pos=this.nextIndex(this.pos,et)};nr.prototype.eat=function(et,tt){if(tt===void 0)tt=!1;if(this.current(tt)===et)return this.advance(tt),!0;return!1};nr.prototype.eatChars=function(et,tt){if(tt===void 0)tt=!1;var nt=this.pos;for(var rt=0,it=et;rt<it.length;rt+=1){var st=it[rt],at=this.at(nt,tt);if(at===-1||at!==st)return!1;nt=this.nextIndex(nt,tt)}return this.pos=nt,!0};Mt.validateRegExpFlags=function(o){var{validFlags:et,flags:tt}=o,nt=!1,rt=!1;for(var it=0;it<tt.length;it++){var st=tt.charAt(it);if(et.indexOf(st)===-1)this.raise(o.start,"Invalid regular expression flag");if(tt.indexOf(st,it+1)>-1)this.raise(o.start,"Duplicate regular expression flag");if(st==="u")nt=!0;if(st==="v")rt=!0}if(this.options.ecmaVersion>=15&&nt&&rt)this.raise(o.start,"Invalid regular expression flag")};function lh(o){for(var et in o)return!0;return!1}Mt.validateRegExpPattern=function(o){if(this.regexp_pattern(o),!o.switchN&&this.options.ecmaVersion>=9&&lh(o.groupNames))o.switchN=!0,this.regexp_pattern(o)};Mt.regexp_pattern=function(o){if(o.pos=0,o.lastIntValue=0,o.lastStringValue="",o.lastAssertionIsQuantifiable=!1,o.numCapturingParens=0,o.maxBackReference=0,o.groupNames=Object.create(null),o.backReferenceNames.length=0,o.branchID=null,this.regexp_disjunction(o),o.pos!==o.source.length){if(o.eat(41))o.raise("Unmatched ')'");if(o.eat(93)||o.eat(125))o.raise("Lone quantifier brackets")}if(o.maxBackReference>o.numCapturingParens)o.raise("Invalid escape");for(var et=0,tt=o.backReferenceNames;et<tt.length;et+=1){var nt=tt[et];if(!o.groupNames[nt])o.raise("Invalid named capture referenced")}};Mt.regexp_disjunction=function(o){var et=this.options.ecmaVersion>=16;if(et)o.branchID=new Us(o.branchID,null);this.regexp_alternative(o);while(o.eat(124)){if(et)o.branchID=o.branchID.sibling();this.regexp_alternative(o)}if(et)o.branchID=o.branchID.parent;if(this.regexp_eatQuantifier(o,!0))o.raise("Nothing to repeat");if(o.eat(123))o.raise("Lone quantifier brackets")};Mt.regexp_alternative=function(o){while(o.pos<o.source.length&&this.regexp_eatTerm(o));};Mt.regexp_eatTerm=function(o){if(this.regexp_eatAssertion(o)){if(o.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(o)){if(o.switchU)o.raise("Invalid quantifier")}return!0}if(o.switchU?this.regexp_eatAtom(o):this.regexp_eatExtendedAtom(o))return this.regexp_eatQuantifier(o),!0;return!1};Mt.regexp_eatAssertion=function(o){var et=o.pos;if(o.lastAssertionIsQuantifiable=!1,o.eat(94)||o.eat(36))return!0;if(o.eat(92)){if(o.eat(66)||o.eat(98))return!0;o.pos=et}if(o.eat(40)&&o.eat(63)){var tt=!1;if(this.options.ecmaVersion>=9)tt=o.eat(60);if(o.eat(61)||o.eat(33)){if(this.regexp_disjunction(o),!o.eat(41))o.raise("Unterminated group");return o.lastAssertionIsQuantifiable=!tt,!0}}return o.pos=et,!1};Mt.regexp_eatQuantifier=function(o,et){if(et===void 0)et=!1;if(this.regexp_eatQuantifierPrefix(o,et))return o.eat(63),!0;return!1};Mt.regexp_eatQuantifierPrefix=function(o,et){return o.eat(42)||o.eat(43)||o.eat(63)||this.regexp_eatBracedQuantifier(o,et)};Mt.regexp_eatBracedQuantifier=function(o,et){var tt=o.pos;if(o.eat(123)){var nt=0,rt=-1;if(this.regexp_eatDecimalDigits(o)){if(nt=o.lastIntValue,o.eat(44)&&this.regexp_eatDecimalDigits(o))rt=o.lastIntValue;if(o.eat(125)){if(rt!==-1&&rt<nt&&!et)o.raise("numbers out of order in {} quantifier");return!0}}if(o.switchU&&!et)o.raise("Incomplete quantifier");o.pos=tt}return!1};Mt.regexp_eatAtom=function(o){return this.regexp_eatPatternCharacters(o)||o.eat(46)||this.regexp_eatReverseSolidusAtomEscape(o)||this.regexp_eatCharacterClass(o)||this.regexp_eatUncapturingGroup(o)||this.regexp_eatCapturingGroup(o)};Mt.regexp_eatReverseSolidusAtomEscape=function(o){var et=o.pos;if(o.eat(92)){if(this.regexp_eatAtomEscape(o))return!0;o.pos=et}return!1};Mt.regexp_eatUncapturingGroup=function(o){var et=o.pos;if(o.eat(40)){if(o.eat(63)){if(this.options.ecmaVersion>=16){var tt=this.regexp_eatModifiers(o),nt=o.eat(45);if(tt||nt){for(var rt=0;rt<tt.length;rt++){var it=tt.charAt(rt);if(tt.indexOf(it,rt+1)>-1)o.raise("Duplicate regular expression modifiers")}if(nt){var st=this.regexp_eatModifiers(o);if(!tt&&!st&&o.current()===58)o.raise("Invalid regular expression modifiers");for(var at=0;at<st.length;at++){var ct=st.charAt(at);if(st.indexOf(ct,at+1)>-1||tt.indexOf(ct)>-1)o.raise("Duplicate regular expression modifiers")}}}}if(o.eat(58)){if(this.regexp_disjunction(o),o.eat(41))return!0;o.raise("Unterminated group")}}o.pos=et}return!1};Mt.regexp_eatCapturingGroup=function(o){if(o.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(o);else if(o.current()===63)o.raise("Invalid group");if(this.regexp_disjunction(o),o.eat(41))return o.numCapturingParens+=1,!0;o.raise("Unterminated group")}return!1};Mt.regexp_eatModifiers=function(o){var et="",tt=0;while((tt=o.current())!==-1&&uh(tt))et+=or(tt),o.advance();return et};function uh(o){return o===105||o===109||o===115}Mt.regexp_eatExtendedAtom=function(o){return o.eat(46)||this.regexp_eatReverseSolidusAtomEscape(o)||this.regexp_eatCharacterClass(o)||this.regexp_eatUncapturingGroup(o)||this.regexp_eatCapturingGroup(o)||this.regexp_eatInvalidBracedQuantifier(o)||this.regexp_eatExtendedPatternCharacter(o)};Mt.regexp_eatInvalidBracedQuantifier=function(o){if(this.regexp_eatBracedQuantifier(o,!0))o.raise("Nothing to repeat");return!1};Mt.regexp_eatSyntaxCharacter=function(o){var et=o.current();if(gp(et))return o.lastIntValue=et,o.advance(),!0;return!1};function gp(o){return o===36||o>=40&&o<=43||o===46||o===63||o>=91&&o<=94||o>=123&&o<=125}Mt.regexp_eatPatternCharacters=function(o){var et=o.pos,tt=0;while((tt=o.current())!==-1&&!gp(tt))o.advance();return o.pos!==et};Mt.regexp_eatExtendedPatternCharacter=function(o){var et=o.current();if(et!==-1&&et!==36&&!(et>=40&&et<=43)&&et!==46&&et!==63&&et!==91&&et!==94&&et!==124)return o.advance(),!0;return!1};Mt.regexp_groupSpecifier=function(o){if(o.eat(63)){if(!this.regexp_eatGroupName(o))o.raise("Invalid group");var et=this.options.ecmaVersion>=16,tt=o.groupNames[o.lastStringValue];if(tt)if(et)for(var nt=0,rt=tt;nt<rt.length;nt+=1){var it=rt[nt];if(!it.separatedFrom(o.branchID))o.raise("Duplicate capture group name")}else o.raise("Duplicate capture group name");if(et)(tt||(o.groupNames[o.lastStringValue]=[])).push(o.branchID);else o.groupNames[o.lastStringValue]=!0}};Mt.regexp_eatGroupName=function(o){if(o.lastStringValue="",o.eat(60)){if(this.regexp_eatRegExpIdentifierName(o)&&o.eat(62))return!0;o.raise("Invalid capture group name")}return!1};Mt.regexp_eatRegExpIdentifierName=function(o){if(o.lastStringValue="",this.regexp_eatRegExpIdentifierStart(o)){o.lastStringValue+=or(o.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(o))o.lastStringValue+=or(o.lastIntValue);return!0}return!1};Mt.regexp_eatRegExpIdentifierStart=function(o){var et=o.pos,tt=this.options.ecmaVersion>=11,nt=o.current(tt);if(o.advance(tt),nt===92&&this.regexp_eatRegExpUnicodeEscapeSequence(o,tt))nt=o.lastIntValue;if(dh(nt))return o.lastIntValue=nt,!0;return o.pos=et,!1};function dh(o){return Pn(o,!0)||o===36||o===95}Mt.regexp_eatRegExpIdentifierPart=function(o){var et=o.pos,tt=this.options.ecmaVersion>=11,nt=o.current(tt);if(o.advance(tt),nt===92&&this.regexp_eatRegExpUnicodeEscapeSequence(o,tt))nt=o.lastIntValue;if(fh(nt))return o.lastIntValue=nt,!0;return o.pos=et,!1};function fh(o){return _n(o,!0)||o===36||o===95||o===8204||o===8205}Mt.regexp_eatAtomEscape=function(o){if(this.regexp_eatBackReference(o)||this.regexp_eatCharacterClassEscape(o)||this.regexp_eatCharacterEscape(o)||o.switchN&&this.regexp_eatKGroupName(o))return!0;if(o.switchU){if(o.current()===99)o.raise("Invalid unicode escape");o.raise("Invalid escape")}return!1};Mt.regexp_eatBackReference=function(o){var et=o.pos;if(this.regexp_eatDecimalEscape(o)){var tt=o.lastIntValue;if(o.switchU){if(tt>o.maxBackReference)o.maxBackReference=tt;return!0}if(tt<=o.numCapturingParens)return!0;o.pos=et}return!1};Mt.regexp_eatKGroupName=function(o){if(o.eat(107)){if(this.regexp_eatGroupName(o))return o.backReferenceNames.push(o.lastStringValue),!0;o.raise("Invalid named reference")}return!1};Mt.regexp_eatCharacterEscape=function(o){return this.regexp_eatControlEscape(o)||this.regexp_eatCControlLetter(o)||this.regexp_eatZero(o)||this.regexp_eatHexEscapeSequence(o)||this.regexp_eatRegExpUnicodeEscapeSequence(o,!1)||!o.switchU&&this.regexp_eatLegacyOctalEscapeSequence(o)||this.regexp_eatIdentityEscape(o)};Mt.regexp_eatCControlLetter=function(o){var et=o.pos;if(o.eat(99)){if(this.regexp_eatControlLetter(o))return!0;o.pos=et}return!1};Mt.regexp_eatZero=function(o){if(o.current()===48&&!Js(o.lookahead()))return o.lastIntValue=0,o.advance(),!0;return!1};Mt.regexp_eatControlEscape=function(o){var et=o.current();if(et===116)return o.lastIntValue=9,o.advance(),!0;if(et===110)return o.lastIntValue=10,o.advance(),!0;if(et===118)return o.lastIntValue=11,o.advance(),!0;if(et===102)return o.lastIntValue=12,o.advance(),!0;if(et===114)return o.lastIntValue=13,o.advance(),!0;return!1};Mt.regexp_eatControlLetter=function(o){var et=o.current();if(xp(et))return o.lastIntValue=et%32,o.advance(),!0;return!1};function xp(o){return o>=65&&o<=90||o>=97&&o<=122}Mt.regexp_eatRegExpUnicodeEscapeSequence=function(o,et){if(et===void 0)et=!1;var tt=o.pos,nt=et||o.switchU;if(o.eat(117)){if(this.regexp_eatFixedHexDigits(o,4)){var rt=o.lastIntValue;if(nt&&rt>=55296&&rt<=56319){var it=o.pos;if(o.eat(92)&&o.eat(117)&&this.regexp_eatFixedHexDigits(o,4)){var st=o.lastIntValue;if(st>=56320&&st<=57343)return o.lastIntValue=(rt-55296)*1024+(st-56320)+65536,!0}o.pos=it,o.lastIntValue=rt}return!0}if(nt&&o.eat(123)&&this.regexp_eatHexDigits(o)&&o.eat(125)&&hh(o.lastIntValue))return!0;if(nt)o.raise("Invalid unicode escape");o.pos=tt}return!1};function hh(o){return o>=0&&o<=1114111}Mt.regexp_eatIdentityEscape=function(o){if(o.switchU){if(this.regexp_eatSyntaxCharacter(o))return!0;if(o.eat(47))return o.lastIntValue=47,!0;return!1}var et=o.current();if(et!==99&&(!o.switchN||et!==107))return o.lastIntValue=et,o.advance(),!0;return!1};Mt.regexp_eatDecimalEscape=function(o){o.lastIntValue=0;var et=o.current();if(et>=49&&et<=57){do o.lastIntValue=10*o.lastIntValue+(et-48),o.advance();while((et=o.current())>=48&&et<=57);return!0}return!1};var bp=0,ar=1,Gn=2;Mt.regexp_eatCharacterClassEscape=function(o){var et=o.current();if(mh(et))return o.lastIntValue=-1,o.advance(),ar;var tt=!1;if(o.switchU&&this.options.ecmaVersion>=9&&((tt=et===80)||et===112)){o.lastIntValue=-1,o.advance();var nt;if(o.eat(123)&&(nt=this.regexp_eatUnicodePropertyValueExpression(o))&&o.eat(125)){if(tt&&nt===Gn)o.raise("Invalid property name");return nt}o.raise("Invalid property name")}return bp};function mh(o){return o===100||o===68||o===115||o===83||o===119||o===87}Mt.regexp_eatUnicodePropertyValueExpression=function(o){var et=o.pos;if(this.regexp_eatUnicodePropertyName(o)&&o.eat(61)){var tt=o.lastStringValue;if(this.regexp_eatUnicodePropertyValue(o)){var nt=o.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(o,tt,nt),ar}}if(o.pos=et,this.regexp_eatLoneUnicodePropertyNameOrValue(o)){var rt=o.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(o,rt)}return bp};Mt.regexp_validateUnicodePropertyNameAndValue=function(o,et,tt){if(!Vr(o.unicodeProperties.nonBinary,et))o.raise("Invalid property name");if(!o.unicodeProperties.nonBinary[et].test(tt))o.raise("Invalid property value")};Mt.regexp_validateUnicodePropertyNameOrValue=function(o,et){if(o.unicodeProperties.binary.test(et))return ar;if(o.switchV&&o.unicodeProperties.binaryOfStrings.test(et))return Gn;o.raise("Invalid property name")};Mt.regexp_eatUnicodePropertyName=function(o){var et=0;o.lastStringValue="";while(Ep(et=o.current()))o.lastStringValue+=or(et),o.advance();return o.lastStringValue!==""};function Ep(o){return xp(o)||o===95}Mt.regexp_eatUnicodePropertyValue=function(o){var et=0;o.lastStringValue="";while(yh(et=o.current()))o.lastStringValue+=or(et),o.advance();return o.lastStringValue!==""};function yh(o){return Ep(o)||Js(o)}Mt.regexp_eatLoneUnicodePropertyNameOrValue=function(o){return this.regexp_eatUnicodePropertyValue(o)};Mt.regexp_eatCharacterClass=function(o){if(o.eat(91)){var et=o.eat(94),tt=this.regexp_classContents(o);if(!o.eat(93))o.raise("Unterminated character class");if(et&&tt===Gn)o.raise("Negated character class may contain strings");return!0}return!1};Mt.regexp_classContents=function(o){if(o.current()===93)return ar;if(o.switchV)return this.regexp_classSetExpression(o);return this.regexp_nonEmptyClassRanges(o),ar};Mt.regexp_nonEmptyClassRanges=function(o){while(this.regexp_eatClassAtom(o)){var et=o.lastIntValue;if(o.eat(45)&&this.regexp_eatClassAtom(o)){var tt=o.lastIntValue;if(o.switchU&&(et===-1||tt===-1))o.raise("Invalid character class");if(et!==-1&&tt!==-1&&et>tt)o.raise("Range out of order in character class")}}};Mt.regexp_eatClassAtom=function(o){var et=o.pos;if(o.eat(92)){if(this.regexp_eatClassEscape(o))return!0;if(o.switchU){var tt=o.current();if(tt===99||Sp(tt))o.raise("Invalid class escape");o.raise("Invalid escape")}o.pos=et}var nt=o.current();if(nt!==93)return o.lastIntValue=nt,o.advance(),!0;return!1};Mt.regexp_eatClassEscape=function(o){var et=o.pos;if(o.eat(98))return o.lastIntValue=8,!0;if(o.switchU&&o.eat(45))return o.lastIntValue=45,!0;if(!o.switchU&&o.eat(99)){if(this.regexp_eatClassControlLetter(o))return!0;o.pos=et}return this.regexp_eatCharacterClassEscape(o)||this.regexp_eatCharacterEscape(o)};Mt.regexp_classSetExpression=function(o){var et=ar,tt;if(this.regexp_eatClassSetRange(o));else if(tt=this.regexp_eatClassSetOperand(o)){if(tt===Gn)et=Gn;var nt=o.pos;while(o.eatChars([38,38])){if(o.current()!==38&&(tt=this.regexp_eatClassSetOperand(o))){if(tt!==Gn)et=ar;continue}o.raise("Invalid character in character class")}if(nt!==o.pos)return et;while(o.eatChars([45,45])){if(this.regexp_eatClassSetOperand(o))continue;o.raise("Invalid character in character class")}if(nt!==o.pos)return et}else o.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(o))continue;if(tt=this.regexp_eatClassSetOperand(o),!tt)return et;if(tt===Gn)et=Gn}};Mt.regexp_eatClassSetRange=function(o){var et=o.pos;if(this.regexp_eatClassSetCharacter(o)){var tt=o.lastIntValue;if(o.eat(45)&&this.regexp_eatClassSetCharacter(o)){var nt=o.lastIntValue;if(tt!==-1&&nt!==-1&&tt>nt)o.raise("Range out of order in character class");return!0}o.pos=et}return!1};Mt.regexp_eatClassSetOperand=function(o){if(this.regexp_eatClassSetCharacter(o))return ar;return this.regexp_eatClassStringDisjunction(o)||this.regexp_eatNestedClass(o)};Mt.regexp_eatNestedClass=function(o){var et=o.pos;if(o.eat(91)){var tt=o.eat(94),nt=this.regexp_classContents(o);if(o.eat(93)){if(tt&&nt===Gn)o.raise("Negated character class may contain strings");return nt}o.pos=et}if(o.eat(92)){var rt=this.regexp_eatCharacterClassEscape(o);if(rt)return rt;o.pos=et}return null};Mt.regexp_eatClassStringDisjunction=function(o){var et=o.pos;if(o.eatChars([92,113])){if(o.eat(123)){var tt=this.regexp_classStringDisjunctionContents(o);if(o.eat(125))return tt}else o.raise("Invalid escape");o.pos=et}return null};Mt.regexp_classStringDisjunctionContents=function(o){var et=this.regexp_classString(o);while(o.eat(124))if(this.regexp_classString(o)===Gn)et=Gn;return et};Mt.regexp_classString=function(o){var et=0;while(this.regexp_eatClassSetCharacter(o))et++;return et===1?ar:Gn};Mt.regexp_eatClassSetCharacter=function(o){var et=o.pos;if(o.eat(92)){if(this.regexp_eatCharacterEscape(o)||this.regexp_eatClassSetReservedPunctuator(o))return!0;if(o.eat(98))return o.lastIntValue=8,!0;return o.pos=et,!1}var tt=o.current();if(tt<0||tt===o.lookahead()&&gh(tt))return!1;if(xh(tt))return!1;return o.advance(),o.lastIntValue=tt,!0};function gh(o){return o===33||o>=35&&o<=38||o>=42&&o<=44||o===46||o>=58&&o<=64||o===94||o===96||o===126}function xh(o){return o===40||o===41||o===45||o===47||o>=91&&o<=93||o>=123&&o<=125}Mt.regexp_eatClassSetReservedPunctuator=function(o){var et=o.current();if(bh(et))return o.lastIntValue=et,o.advance(),!0;return!1};function bh(o){return o===33||o===35||o===37||o===38||o===44||o===45||o>=58&&o<=62||o===64||o===96||o===126}Mt.regexp_eatClassControlLetter=function(o){var et=o.current();if(Js(et)||et===95)return o.lastIntValue=et%32,o.advance(),!0;return!1};Mt.regexp_eatHexEscapeSequence=function(o){var et=o.pos;if(o.eat(120)){if(this.regexp_eatFixedHexDigits(o,2))return!0;if(o.switchU)o.raise("Invalid escape");o.pos=et}return!1};Mt.regexp_eatDecimalDigits=function(o){var et=o.pos,tt=0;o.lastIntValue=0;while(Js(tt=o.current()))o.lastIntValue=10*o.lastIntValue+(tt-48),o.advance();return o.pos!==et};function Js(o){return o>=48&&o<=57}Mt.regexp_eatHexDigits=function(o){var et=o.pos,tt=0;o.lastIntValue=0;while(Cp(tt=o.current()))o.lastIntValue=16*o.lastIntValue+vp(tt),o.advance();return o.pos!==et};function Cp(o){return o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102}function vp(o){if(o>=65&&o<=70)return 10+(o-65);if(o>=97&&o<=102)return 10+(o-97);return o-48}Mt.regexp_eatLegacyOctalEscapeSequence=function(o){if(this.regexp_eatOctalDigit(o)){var et=o.lastIntValue;if(this.regexp_eatOctalDigit(o)){var tt=o.lastIntValue;if(et<=3&&this.regexp_eatOctalDigit(o))o.lastIntValue=et*64+tt*8+o.lastIntValue;else o.lastIntValue=et*8+tt}else o.lastIntValue=et;return!0}return!1};Mt.regexp_eatOctalDigit=function(o){var et=o.current();if(Sp(et))return o.lastIntValue=et-48,o.advance(),!0;return o.lastIntValue=0,!1};function Sp(o){return o>=48&&o<=55}Mt.regexp_eatFixedHexDigits=function(o,et){var tt=o.pos;o.lastIntValue=0;for(var nt=0;nt<et;++nt){var rt=o.current();if(!Cp(rt))return o.pos=tt,!1;o.lastIntValue=16*o.lastIntValue+vp(rt),o.advance()}return!0};var Ys=function(et){if(this.type=et.type,this.value=et.value,this.start=et.start,this.end=et.end,et.options.locations)this.loc=new cs(et,et.startLoc,et.endLoc);if(et.options.ranges)this.range=[et.start,et.end]},Xt=pn.prototype;Xt.next=function(o){if(!o&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new Ys(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};Xt.getToken=function(){return this.next(),new Ys(this)};if(typeof Symbol<"u")Xt[Symbol.iterator]=function(){var o=this;return{next:function(){var et=o.getToken();return{done:et.type===mt.eof,value:et}}}};Xt.nextToken=function(){var o=this.curContext();if(!o||!o.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(mt.eof);if(o.override)return o.override(this);else this.readToken(this.fullCharCodeAtPos())};Xt.readToken=function(o){if(Pn(o,this.options.ecmaVersion>=6)||o===92)return this.readWord();return this.getTokenFromCode(o)};Xt.fullCharCodeAt=function(o){var et=this.input.charCodeAt(o);if(et<=55295||et>=56320)return et;var tt=this.input.charCodeAt(o+1);return tt<=56319||tt>=57344?et:(et<<10)+tt-56613888};Xt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};Xt.skipBlockComment=function(){var o=this.options.onComment&&this.curPosition(),et=this.pos,tt=this.input.indexOf("*/",this.pos+=2);if(tt===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=tt+2,this.options.locations)for(var nt=void 0,rt=et;(nt=zc(this.input,rt,this.pos))>-1;)++this.curLine,rt=this.lineStart=nt;if(this.options.onComment)this.options.onComment(!0,this.input.slice(et+2,tt),et,this.pos,o,this.curPosition())};Xt.skipLineComment=function(o){var et=this.pos,tt=this.options.onComment&&this.curPosition(),nt=this.input.charCodeAt(this.pos+=o);while(this.pos<this.input.length&&!Tr(nt))nt=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(et+o,this.pos),et,this.pos,tt,this.curPosition())};Xt.skipSpace=function(){e:while(this.pos<this.input.length){var o=this.input.charCodeAt(this.pos);switch(o){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(o>8&&o<14||o>=5760&&So.test(String.fromCharCode(o)))++this.pos;else break e}}};Xt.finishToken=function(o,et){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var tt=this.type;this.type=o,this.value=et,this.updateContext(tt)};Xt.readToken_dot=function(){var o=this.input.charCodeAt(this.pos+1);if(o>=48&&o<=57)return this.readNumber(!0);var et=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&o===46&&et===46)return this.pos+=3,this.finishToken(mt.ellipsis);else return++this.pos,this.finishToken(mt.dot)};Xt.readToken_slash=function(){var o=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(o===61)return this.finishOp(mt.assign,2);return this.finishOp(mt.slash,1)};Xt.readToken_mult_modulo_exp=function(o){var et=this.input.charCodeAt(this.pos+1),tt=1,nt=o===42?mt.star:mt.modulo;if(this.options.ecmaVersion>=7&&o===42&&et===42)++tt,nt=mt.starstar,et=this.input.charCodeAt(this.pos+2);if(et===61)return this.finishOp(mt.assign,tt+1);return this.finishOp(nt,tt)};Xt.readToken_pipe_amp=function(o){var et=this.input.charCodeAt(this.pos+1);if(et===o){if(this.options.ecmaVersion>=12){var tt=this.input.charCodeAt(this.pos+2);if(tt===61)return this.finishOp(mt.assign,3)}return this.finishOp(o===124?mt.logicalOR:mt.logicalAND,2)}if(et===61)return this.finishOp(mt.assign,2);return this.finishOp(o===124?mt.bitwiseOR:mt.bitwiseAND,1)};Xt.readToken_caret=function(){var o=this.input.charCodeAt(this.pos+1);if(o===61)return this.finishOp(mt.assign,2);return this.finishOp(mt.bitwiseXOR,1)};Xt.readToken_plus_min=function(o){var et=this.input.charCodeAt(this.pos+1);if(et===o){if(et===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||wn.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(mt.incDec,2)}if(et===61)return this.finishOp(mt.assign,2);return this.finishOp(mt.plusMin,1)};Xt.readToken_lt_gt=function(o){var et=this.input.charCodeAt(this.pos+1),tt=1;if(et===o){if(tt=o===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+tt)===61)return this.finishOp(mt.assign,tt+1);return this.finishOp(mt.bitShift,tt)}if(et===33&&o===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(et===61)tt=2;return this.finishOp(mt.relational,tt)};Xt.readToken_eq_excl=function(o){var et=this.input.charCodeAt(this.pos+1);if(et===61)return this.finishOp(mt.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(o===61&&et===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(mt.arrow);return this.finishOp(o===61?mt.eq:mt.prefix,1)};Xt.readToken_question=function(){var o=this.options.ecmaVersion;if(o>=11){var et=this.input.charCodeAt(this.pos+1);if(et===46){var tt=this.input.charCodeAt(this.pos+2);if(tt<48||tt>57)return this.finishOp(mt.questionDot,2)}if(et===63){if(o>=12){var nt=this.input.charCodeAt(this.pos+2);if(nt===61)return this.finishOp(mt.assign,3)}return this.finishOp(mt.coalesce,2)}}return this.finishOp(mt.question,1)};Xt.readToken_numberSign=function(){var o=this.options.ecmaVersion,et=35;if(o>=13){if(++this.pos,et=this.fullCharCodeAtPos(),Pn(et,!0)||et===92)return this.finishToken(mt.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+or(et)+"'")};Xt.getTokenFromCode=function(o){switch(o){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(mt.parenL);case 41:return++this.pos,this.finishToken(mt.parenR);case 59:return++this.pos,this.finishToken(mt.semi);case 44:return++this.pos,this.finishToken(mt.comma);case 91:return++this.pos,this.finishToken(mt.bracketL);case 93:return++this.pos,this.finishToken(mt.bracketR);case 123:return++this.pos,this.finishToken(mt.braceL);case 125:return++this.pos,this.finishToken(mt.braceR);case 58:return++this.pos,this.finishToken(mt.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(mt.backQuote);case 48:var et=this.input.charCodeAt(this.pos+1);if(et===120||et===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(et===111||et===79)return this.readRadixNumber(8);if(et===98||et===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(o);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(o);case 124:case 38:return this.readToken_pipe_amp(o);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(o);case 60:case 62:return this.readToken_lt_gt(o);case 61:case 33:return this.readToken_eq_excl(o);case 63:return this.readToken_question();case 126:return this.finishOp(mt.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+or(o)+"'")};Xt.finishOp=function(o,et){var tt=this.input.slice(this.pos,this.pos+et);return this.pos+=et,this.finishToken(o,tt)};Xt.readRegexp=function(){var o,et,tt=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(tt,"Unterminated regular expression");var nt=this.input.charAt(this.pos);if(wn.test(nt))this.raise(tt,"Unterminated regular expression");if(!o){if(nt==="[")et=!0;else if(nt==="]"&&et)et=!1;else if(nt==="/"&&!et)break;o=nt==="\\"}else o=!1;++this.pos}var rt=this.input.slice(tt,this.pos);++this.pos;var it=this.pos,st=this.readWord1();if(this.containsEsc)this.unexpected(it);var at=this.regexpState||(this.regexpState=new nr(this));at.reset(tt,rt,st),this.validateRegExpFlags(at),this.validateRegExpPattern(at);var ct=null;try{ct=new RegExp(rt,st)}catch(lt){}return this.finishToken(mt.regexp,{pattern:rt,flags:st,value:ct})};Xt.readInt=function(o,et,tt){var nt=this.options.ecmaVersion>=12&&et===void 0,rt=tt&&this.input.charCodeAt(this.pos)===48,it=this.pos,st=0,at=0;for(var ct=0,lt=et==null?1/0:et;ct<lt;++ct,++this.pos){var ut=this.input.charCodeAt(this.pos),dt=void 0;if(nt&&ut===95){if(rt)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(at===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(ct===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");at=ut;continue}if(ut>=97)dt=ut-97+10;else if(ut>=65)dt=ut-65+10;else if(ut>=48&&ut<=57)dt=ut-48;else dt=1/0;if(dt>=o)break;at=ut,st=st*o+dt}if(nt&&at===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===it||et!=null&&this.pos-it!==et)return null;return st};function Eh(o,et){if(et)return parseInt(o,8);return parseFloat(o.replace(/_/g,""))}function Tp(o){if(typeof BigInt!=="function")return null;return BigInt(o.replace(/_/g,""))}Xt.readRadixNumber=function(o){var et=this.pos;this.pos+=2;var tt=this.readInt(o);if(tt==null)this.raise(this.start+2,"Expected number in radix "+o);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)tt=Tp(this.input.slice(et,this.pos)),++this.pos;else if(Pn(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(mt.num,tt)};Xt.readNumber=function(o){var et=this.pos;if(!o&&this.readInt(10,void 0,!0)===null)this.raise(et,"Invalid number");var tt=this.pos-et>=2&&this.input.charCodeAt(et)===48;if(tt&&this.strict)this.raise(et,"Invalid number");var nt=this.input.charCodeAt(this.pos);if(!tt&&!o&&this.options.ecmaVersion>=11&&nt===110){var rt=Tp(this.input.slice(et,this.pos));if(++this.pos,Pn(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(mt.num,rt)}if(tt&&/[89]/.test(this.input.slice(et,this.pos)))tt=!1;if(nt===46&&!tt)++this.pos,this.readInt(10),nt=this.input.charCodeAt(this.pos);if((nt===69||nt===101)&&!tt){if(nt=this.input.charCodeAt(++this.pos),nt===43||nt===45)++this.pos;if(this.readInt(10)===null)this.raise(et,"Invalid number")}if(Pn(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var it=Eh(this.input.slice(et,this.pos),tt);return this.finishToken(mt.num,it)};Xt.readCodePoint=function(){var o=this.input.charCodeAt(this.pos),et;if(o===123){if(this.options.ecmaVersion<6)this.unexpected();var tt=++this.pos;if(et=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,et>1114111)this.invalidStringToken(tt,"Code point out of bounds")}else et=this.readHexChar(4);return et};Xt.readString=function(o){var et="",tt=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var nt=this.input.charCodeAt(this.pos);if(nt===o)break;if(nt===92)et+=this.input.slice(tt,this.pos),et+=this.readEscapedChar(!1),tt=this.pos;else if(nt===8232||nt===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(Tr(nt))this.raise(this.start,"Unterminated string constant");++this.pos}}return et+=this.input.slice(tt,this.pos++),this.finishToken(mt.string,et)};var kp={};Xt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(o){if(o===kp)this.readInvalidTemplateToken();else throw o}this.inTemplateElement=!1};Xt.invalidStringToken=function(o,et){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw kp;else this.raise(o,et)};Xt.readTmplToken=function(){var o="",et=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var tt=this.input.charCodeAt(this.pos);if(tt===96||tt===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===mt.template||this.type===mt.invalidTemplate))if(tt===36)return this.pos+=2,this.finishToken(mt.dollarBraceL);else return++this.pos,this.finishToken(mt.backQuote);return o+=this.input.slice(et,this.pos),this.finishToken(mt.template,o)}if(tt===92)o+=this.input.slice(et,this.pos),o+=this.readEscapedChar(!0),et=this.pos;else if(Tr(tt)){switch(o+=this.input.slice(et,this.pos),++this.pos,tt){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:o+=`
|
|
6
|
+
`;break;default:o+=String.fromCharCode(tt);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;et=this.pos}else++this.pos}};Xt.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(mt.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")};Xt.readEscapedChar=function(o){var et=this.input.charCodeAt(++this.pos);switch(++this.pos,et){case 110:return`
|
|
9
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return or(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(o){var tt=this.pos-1;this.invalidStringToken(tt,"Invalid escape sequence in template string")}default:if(et>=48&&et<=55){var nt=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],rt=parseInt(nt,8);if(rt>255)nt=nt.slice(0,-1),rt=parseInt(nt,8);if(this.pos+=nt.length-1,et=this.input.charCodeAt(this.pos),(nt!=="0"||et===56||et===57)&&(this.strict||o))this.invalidStringToken(this.pos-1-nt.length,o?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(rt)}if(Tr(et)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(et)}};Xt.readHexChar=function(o){var et=this.pos,tt=this.readInt(16,o);if(tt===null)this.invalidStringToken(et,"Bad character escape sequence");return tt};Xt.readWord1=function(){this.containsEsc=!1;var o="",et=!0,tt=this.pos,nt=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var rt=this.fullCharCodeAtPos();if(_n(rt,nt))this.pos+=rt<=65535?1:2;else if(rt===92){this.containsEsc=!0,o+=this.input.slice(tt,this.pos);var it=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var st=this.readCodePoint();if(!(et?Pn:_n)(st,nt))this.invalidStringToken(it,"Invalid Unicode escape");o+=or(st),tt=this.pos}else break;et=!1}return o+this.input.slice(tt,this.pos)};Xt.readWord=function(){var o=this.readWord1(),et=mt.name;if(this.keywords.test(o))et=Hs[o];return this.finishToken(et,o)};var Pp="8.18.0";pn.acorn={Parser:pn,version:Pp,defaultOptions:Vs,Position:jr,SourceLocation:cs,getLineInfo:To,Node:ls,TokenType:Zt,tokTypes:mt,keywordTypes:Hs,TokContext:qn,tokContexts:cn,isIdentifierChar:_n,isIdentifierStart:Pn,Token:Ys,isNewLine:Tr,lineBreak:wn,lineBreakG:Kc,nonASCIIwhitespace:So};function Do(o,et){return pn.parse(o,et)}function Ch(o,et,tt){return pn.parseExpressionAt(o,et,tt)}function vh(o,et){return pn.tokenizer(o,et)}var Bn=!0,Sh=new WeakMap;function Th(o){let et=o.Parser.acorn||o,tt=Sh.get(et);if(!tt){let at=function(Nt){return Nt===yt.name||Nt===yt.string||Nt===yt.num||Et.includes(Nt)||At.includes(Nt)},ct=function(Nt){return Nt===yt.name||Et.includes(Nt)||At.includes(Nt)},lt=function(Nt){return Nt===yt.name||At.includes(Nt)},ut=function(Nt){return Nt===Ct.abstract||Nt===Ct.declare||Nt===Ct.enum||Nt===Ct.module||Nt===Ct.namespace||Nt===Ct.interface||Nt===Ct.type},dt=function(Nt){return Nt===Ct.keyof||Nt===Ct.readonly||Nt===Ct.unique},ht=function(Nt){return Nt===yt.invalidTemplate},{tokTypes:yt,keywordTypes:xt}=et,Et=Object.values(xt),Ct=st(),At=Object.values(Ct),_t=it(),vt=rt(),Rt=new RegExp(`^(?:${Object.keys(Ct).join("|")})$`);_t.jsxTagStart.updateContext=function(){this.context.push(vt.tc_expr),this.context.push(vt.tc_oTag),this.exprAllowed=!1},_t.jsxTagEnd.updateContext=function(Nt){let Ot=this.context.pop();if(Ot===vt.tc_oTag&&Nt===yt.slash||Ot===vt.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===vt.tc_expr;else this.exprAllowed=!0},tt={tokTypes:{...Ct,..._t},tokContexts:{...vt},keywordsRegExp:Rt,tokenIsLiteralPropertyName:at,tokenIsKeywordOrIdentifier:ct,tokenIsIdentifier:lt,tokenIsTSDeclarationStart:ut,tokenIsTSTypeOperator:dt,tokenIsTemplate:ht}}return tt;function nt(at,ct={}){return new et.TokenType("name",ct)}function rt(){return{tc_oTag:new et.TokContext("<tag",!1,!1),tc_cTag:new et.TokContext("</tag",!1,!1),tc_expr:new et.TokContext("<tag>...</tag>",!0,!0)}}function it(){return{at:new et.TokenType("@"),jsxName:new et.TokenType("jsxName"),jsxText:new et.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new et.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new et.TokenType("jsxTagEnd")}}function st(){return{assert:nt("assert",{startsExpr:Bn}),asserts:nt("asserts",{startsExpr:Bn}),global:nt("global",{startsExpr:Bn}),keyof:nt("keyof",{startsExpr:Bn}),readonly:nt("readonly",{startsExpr:Bn}),unique:nt("unique",{startsExpr:Bn}),abstract:nt("abstract",{startsExpr:Bn}),declare:nt("declare",{startsExpr:Bn}),enum:nt("enum",{startsExpr:Bn}),module:nt("module",{startsExpr:Bn}),namespace:nt("namespace",{startsExpr:Bn}),interface:nt("interface",{startsExpr:Bn}),type:nt("type",{startsExpr:Bn})}}}var kh=1048576,ds=2097152,Gr=1,ei=2,Ph=4,Oo=8,wh=16,Lp=64,Op=128,Ah=256,Nh=512,Mp=1024,u1=Gr|ei|Oo|Op,d1=Gr|0|Oo|0,f1=Gr|0|Ph|0,h1=Gr|0|wh|0,m1=0|ei|0|Op,y1=0|ei|0|0,Dh=Gr|ei|Oo|Ah,g1=0|Mp,x1=0|Lp,b1=Gr|0|0|Lp,E1=Dh|Nh,C1=0|Mp,$p=4,Bp=2,Fp=1,v1=Bp|Fp,S1=Bp|$p,T1=Fp|$p,_h=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,wp=new RegExp("(?=("+_h.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),fs=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function Ih(o,et){let tt="true";if(et.type==="MethodDefinition"&&(et.kind==="get"||et.kind==="set"))tt=(et.static?"s":"i")+et.kind;if(o==="iget"&&tt==="iset"||o==="iset"&&tt==="iget"||o==="sget"&&tt==="sset"||o==="sset"&&tt==="sget")return[!1,"true"];if(!o)return[!1,tt];return[!0,o]}function Ap(o,et){let{computed:tt,key:nt}=o;return!tt&&(nt.type==="Identifier"&&nt.name===et||nt.type==="Literal"&&nt.value===et)}var $t={AbstractMethodHasImplementation:({methodName:o})=>`Method '${o}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:o})=>`Property '${o}' 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:o})=>`Cannot find name '${o}'.`,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:o})=>`'declare' is not allowed in ${o}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:o})=>`Duplicate modifier: '${o}'.`,EmptyHeritageClauseType:({token:o})=>`'${o}' 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:o})=>`'${o[0]}' modifier cannot be used with '${o[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:o})=>`Index signatures cannot have an accessibility modifier ('${o}').`,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:o})=>`'${o}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:o})=>`'${o}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:o})=>`'${o}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:o})=>`'${o[0]}' modifier must precede '${o[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:o})=>`Private elements cannot have an accessibility modifier ('${o}').`,PrivateMethodsHasAccessibility:({modifier:o})=>`Private methods cannot have an accessibility modifier ('${o}').`,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:o})=>`Single type parameter ${o} should have a trailing comma. Example usage: <${o},>.`,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:o})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${o}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},Zs={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 Rh(o,et,tt){let{tokTypes:nt}=tt,{tokTypes:rt}=et;return class extends o{takeDecorators(st){let at=this.decoratorStack[this.decoratorStack.length-1];if(at.length)st.decorators=at,this.resetStartLocationFromNode(st,at[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(st){let at=this.decoratorStack[this.decoratorStack.length-1];while(this.match(rt.at)){let ct=this.parseDecorator();at.push(ct)}if(this.match(nt._export)){if(!st)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,Zs.UnexpectedLeadingDecorator)}parseDecorator(){let st=this.startNode();this.next(),this.decoratorStack.push([]);let at=this.start,ct=this.startLoc,lt;if(this.match(nt.parenL)){let ut=this.start,dt=this.startLoc;if(this.next(),lt=this.parseExpression(),this.expect(nt.parenR),this.options.preserveParens){let ht=this.startNodeAt(ut,dt);ht.expression=lt,lt=this.finishNode(ht,"ParenthesizedExpression")}}else{lt=this.parseIdent(!1);while(this.eat(nt.dot)){let ut=this.startNodeAt(at,ct);ut.object=lt,ut.property=this.parseIdent(!0),ut.computed=!1,lt=this.finishNode(ut,"MemberExpression")}}return st.expression=this.parseMaybeDecoratorArguments(lt),this.decoratorStack.pop(),this.finishNode(st,"Decorator")}parseMaybeDecoratorArguments(st){if(this.eat(nt.parenL)){let at=this.startNodeAtNode(st);return at.callee=st,at.arguments=this.parseExprList(nt.parenR,!1),this.finishNode(at,"CallExpression")}return st}}}var Np={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:"♦"},Lh=/^[\da-fA-F]+$/,Oh=/^\d+$/;function hs(o){if(!o)return o;if(o.type==="JSXIdentifier")return o.name;if(o.type==="JSXNamespacedName")return o.namespace.name+":"+o.name.name;if(o.type==="JSXMemberExpression")return hs(o.object)+"."+hs(o.property)}function Mh(o,et,tt,nt){let rt=o.tokTypes,it=et.tokTypes,{isNewLine:st,isIdentifierChar:at}=o,ct=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},nt||{});return class extends tt{jsx_readToken(){let ut="",dt=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");let ht=this.input.charCodeAt(this.pos);switch(ht){case 60:case 123:if(this.pos===this.start){if(ht===60&&this.exprAllowed)return++this.pos,this.finishToken(it.jsxTagStart);return this.getTokenFromCode(ht)}return ut+=this.input.slice(dt,this.pos),this.finishToken(it.jsxText,ut);case 38:ut+=this.input.slice(dt,this.pos),ut+=this.jsx_readEntity(),dt=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(ht===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(st(ht))ut+=this.input.slice(dt,this.pos),ut+=this.jsx_readNewLine(!0),dt=this.pos;else++this.pos}}}jsx_readNewLine(ut){let dt=this.input.charCodeAt(this.pos),ht;if(++this.pos,dt===13&&this.input.charCodeAt(this.pos)===10)++this.pos,ht=ut?`
|
|
10
|
+
`:`\r
|
|
11
|
+
`;else ht=String.fromCharCode(dt);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return ht}jsx_readString(ut){let dt="",ht=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let yt=this.input.charCodeAt(this.pos);if(yt===ut)break;if(yt===38)dt+=this.input.slice(ht,this.pos),dt+=this.jsx_readEntity(),ht=this.pos;else if(st(yt))dt+=this.input.slice(ht,this.pos),dt+=this.jsx_readNewLine(!1),ht=this.pos;else++this.pos}return dt+=this.input.slice(ht,this.pos++),this.finishToken(rt.string,dt)}jsx_readEntity(){let ut="",dt=0,ht,yt=this.input[this.pos];if(yt!=="&")this.raise(this.pos,"Entity must start with an ampersand");let xt=++this.pos;while(this.pos<this.input.length&&dt++<10){if(yt=this.input[this.pos++],yt===";"){if(ut[0]==="#"){let Et;if(ut[1]==="x"||ut[1]==="X"){if(ut=ut.substr(2),Lh.test(ut))Et=parseInt(ut,16)}else if(ut=ut.substr(1),Oh.test(ut))Et=parseInt(ut,10);if(Et!==void 0&&Et<=1114111)ht=String.fromCodePoint(Et)}else if(Object.prototype.hasOwnProperty.call(Np,ut))ht=Np[ut];break}ut+=yt}if(ht===void 0)return this.pos=xt,"&";return ht}jsx_readWord(){let ut,dt=this.pos;do ut=this.input.charCodeAt(++this.pos);while(at(ut)||ut===45);return this.finishToken(it.jsxName,this.input.slice(dt,this.pos))}jsx_parseIdentifier(){let ut=this.startNode();if(this.type===it.jsxName)ut.name=this.value;else if(this.type.keyword)ut.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(ut,"JSXIdentifier")}jsx_parseNamespacedName(){let ut=this.start,dt=this.startLoc,ht=this.jsx_parseIdentifier();if(!ct.allowNamespaces||!this.eat(rt.colon))return ht;var yt=this.startNodeAt(ut,dt);return yt.namespace=ht,yt.name=this.jsx_parseIdentifier(),this.finishNode(yt,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===it.jsxTagEnd)return"";let ut=this.start,dt=this.startLoc,ht=this.jsx_parseNamespacedName();if(this.type===rt.dot&&ht.type==="JSXNamespacedName"&&!ct.allowNamespacedObjects)this.unexpected();while(this.eat(rt.dot)){let yt=this.startNodeAt(ut,dt);yt.object=ht,yt.property=this.jsx_parseIdentifier(),ht=this.finishNode(yt,"JSXMemberExpression")}return ht}jsx_parseAttributeValue(){switch(this.type){case rt.braceL:let ut=this.jsx_parseExpressionContainer();if(ut.expression.type==="JSXEmptyExpression")this.raise(ut.start,"JSX attributes must only be assigned a non-empty expression");return ut;case it.jsxTagStart:case rt.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let ut=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(ut,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let ut=this.startNode();if(this.next(),this.eat(rt.ellipsis))return ut.expression=this.parseExpression(),this.expect(rt.braceR),this.finishNode(ut,"JSXSpreadChild");return ut.expression=this.type===rt.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(rt.braceR),this.finishNode(ut,"JSXExpressionContainer")}jsx_parseAttribute(){let ut=this.startNode();if(this.eat(rt.braceL))return this.expect(rt.ellipsis),ut.argument=this.parseMaybeAssign(),this.expect(rt.braceR),this.finishNode(ut,"JSXSpreadAttribute");return ut.name=this.jsx_parseNamespacedName(),ut.value=this.eat(rt.eq)?this.jsx_parseAttributeValue():null,this.finishNode(ut,"JSXAttribute")}jsx_parseOpeningElementAt(ut,dt){let ht=this.startNodeAt(ut,dt);ht.attributes=[];let yt=this.jsx_parseElementName();if(yt)ht.name=yt;while(this.type!==rt.slash&&this.type!==it.jsxTagEnd)ht.attributes.push(this.jsx_parseAttribute());return ht.selfClosing=this.eat(rt.slash),this.expect(it.jsxTagEnd),this.finishNode(ht,yt?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(ut,dt){let ht=this.startNodeAt(ut,dt),yt=this.jsx_parseElementName();if(yt)ht.name=yt;return this.expect(it.jsxTagEnd),this.finishNode(ht,yt?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(ut,dt){let ht=this.startNodeAt(ut,dt),yt=[],xt=this.jsx_parseOpeningElementAt(ut,dt),Et=null;if(!xt.selfClosing){e:for(;;)switch(this.type){case it.jsxTagStart:if(ut=this.start,dt=this.startLoc,this.next(),this.eat(rt.slash)){Et=this.jsx_parseClosingElementAt(ut,dt);break e}yt.push(this.jsx_parseElementAt(ut,dt));break;case it.jsxText:yt.push(this.parseExprAtom());break;case rt.braceL:yt.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(hs(Et.name)!==hs(xt.name))this.raise(Et.start,"Expected corresponding JSX closing tag for <"+hs(xt.name)+">")}let Ct=xt.name?"Element":"Fragment";if(ht["opening"+Ct]=xt,ht["closing"+Ct]=Et,ht.children=yt,this.type===rt.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(ht,"JSX"+Ct)}jsx_parseText(){let ut=this.parseLiteral(this.value);return ut.type="JSXText",ut}jsx_parseElement(){let ut=this.start,dt=this.startLoc;return this.next(),this.jsx_parseElementAt(ut,dt)}}}function $h(o,et,tt){let{tokTypes:nt}=et,{tokTypes:rt}=tt;return class extends o{parseMaybeImportAttributes(st){if(this.type===rt._with||this.type===nt.assert){this.next();let at=this.parseImportAttributes();if(at)st.attributes=at}}parseImportAttributes(){this.expect(rt.braceL);let st=this.parseWithEntries();return this.expect(rt.braceR),st}parseWithEntries(){let st=[],at=new Set;do{if(this.type===rt.braceR)break;let ct=this.startNode(),lt;if(this.type===rt.string)lt=this.parseLiteral(this.value);else lt=this.parseIdent(!0);if(this.next(),ct.key=lt,at.has(ct.key.name))this.raise(this.pos,"Duplicated key in attributes");if(at.add(ct.key.name),this.type!==rt.string)this.raise(this.pos,"Only string is supported as an attribute value");ct.value=this.parseLiteral(this.value),st.push(this.finishNode(ct,"ImportAttribute"))}while(this.eat(rt.comma));return st}}}var Io=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function jp(){return{_tag:"BufferedParserEvents",segments:[]}}var Bh=jp();function Dp(o){return o.segments.length>0}var Fh=class{constructor(o,et){this.options=o,this.state=et,this.callbacks={},this.callbackWrappers={},this.frames=[],this.undoLog=[],this.hasCallbacks=this.captureCallbacks()}get active(){return this.frames.length>0}begin(){let o={_tag:"ParseEffectFrame",depth:this.frames.length,undoMark:this.undoLog.length,checkpoint:this.state?.capture()};if(this.frames.push(o),o.depth===0&&this.hasCallbacks)this.activateCallbacks();return o}commit(o){this.close(o);let et=this.currentFrame();if(et){if(o.output)this.appendOutput(this.outputFor(et),o.output);return}if(this.undoLog.length=o.undoMark,o.output)this.flush(o.output)}rollback(o){this.close(o),this.unwind(o.undoMark),this.restore(o)}rollbackWithEvents(o){return this.close(o),this.unwind(o.undoMark),this.restore(o),o.output??Bh}replay(o){if(!Dp(o))return;let et=this.currentFrame();if(et){this.appendOutput(this.outputFor(et),o);return}this.flush(o)}set(o,et,tt){this.willSet(o,et),o[et]=tt}remove(o,et){this.willSet(o,et),delete o[et]}append(o,et){this.willAppend(o),o.push(et)}pop(o){return this.willMutateTail(o,1),o.pop()}truncate(o,et){if(et<o.length)this.willMutateTail(o,o.length-et);else this.willAppend(o);o.length=et}modify(o,et,tt){let[nt,rt]=tt(o[et]);return this.set(o,et,rt),nt}willAppend(o){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:o,length:o.length})}willMutateTail(o,et){if(!this.active)return;let tt=Math.max(0,o.length-et);this.undoLog.push({_tag:"ArrayTail",target:o,start:tt,values:o.slice(tt)})}willSet(o,et){if(!this.active)return;let tt=o;this.undoLog.push({_tag:"Property",target:tt,key:et,had:Object.prototype.hasOwnProperty.call(tt,et),value:tt[et]})}captureCallbacks(){let o=!1;for(let et of Io){let tt=this.options[et];if(!tt)continue;o=!0,this.callbacks[et]=tt,this.callbackWrappers[et]=(...nt)=>{this.emit({name:et,args:nt})}}return o}activateCallbacks(){for(let o of Io){let et=this.callbackWrappers[o];if(et)this.options[o]=et}}deactivateCallbacks(){for(let o of Io){let et=this.callbacks[o];if(et)this.options[o]=et}}emit(o){let et=this.currentFrame();if(!et){this.invoke(o);return}let tt=this.outputFor(et).segments,nt=tt[tt.length-1];if(Array.isArray(nt))nt.push(o);else tt.push([o])}appendOutput(o,et){if(Dp(et))o.segments.push(et)}outputFor(o){return o.output??=jp()}flush(o){let et=[];for(let tt=o.segments.length-1;tt>=0;tt--)et.push(o.segments[tt]);while(et.length>0){let tt=et.pop();if(Array.isArray(tt)){for(let nt of tt)this.invoke(nt);continue}for(let nt=tt.segments.length-1;nt>=0;nt--)et.push(tt.segments[nt])}}invoke(o){this.callbacks[o.name]?.apply(this.options,o.args)}currentFrame(){return this.frames[this.frames.length-1]}close(o){if(this.currentFrame()!==o||o.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(o){if(this.state)this.state.restore(o.checkpoint)}unwind(o){for(let et=this.undoLog.length-1;et>=o;et--){let tt=this.undoLog[et];switch(tt._tag){case"ArrayLength":if(tt.target.length<tt.length)throw Error("A parse effect shortened an append-only array");tt.target.length=tt.length;break;case"ArrayTail":tt.target.length=tt.start;for(let nt of tt.values)tt.target.push(nt);break;case"Property":if(tt.had)tt.target[tt.key]=tt.value;else delete tt.target[tt.key];break}}this.undoLog.length=o}};function qr(o,et,tt){if(o.length===et)return o;if(o.length<et)throw Error(`A parse branch shortened the ${tt} below its checkpoint`);return o.length=et,o}function jh(o){return{lookahead:o.getCurLookaheadState(),context:o.context,contextLength:o.context.length,scopeStack:o.scopeStack,scopeStackLength:o.scopeStack.length,importsStack:o.importsStack,importsStackLength:o.importsStack.length,labels:o.labels,labelsLength:o.labels.length,privateNameStack:o.privateNameStack,privateNameStackLength:o.privateNameStack.length,decoratorStack:o.decoratorStack,decoratorStackLength:o.decoratorStack.length,strict:o.strict,potentialArrowAt:o.potentialArrowAt,potentialArrowInForAwait:o.potentialArrowInForAwait,yieldPos:o.yieldPos,awaitPos:o.awaitPos,awaitIdentPos:o.awaitIdentPos,preValue:o.preValue,preToken:o.preToken,isLookahead:o.isLookahead,isAmbientContext:o.isAmbientContext,inAbstractClass:o.inAbstractClass,inType:o.inType,inDisallowConditionalTypesContext:o.inDisallowConditionalTypesContext,maybeInArrowParameters:o.maybeInArrowParameters,shouldParseArrowReturnType:o.shouldParseArrowReturnType,shouldParseAsyncArrowReturnType:o.shouldParseAsyncArrowReturnType,importOrExportOuterKind:o.importOrExportOuterKind}}function Vh(o,et){o.setLookaheadTokenState(et.lookahead),o.context=qr(et.context,et.contextLength,"token context stack"),o.scopeStack=qr(et.scopeStack,et.scopeStackLength,"scope stack"),o.importsStack=qr(et.importsStack,et.importsStackLength,"import stack"),o.labels=qr(et.labels,et.labelsLength,"label stack"),o.privateNameStack=qr(et.privateNameStack,et.privateNameStackLength,"private-name stack"),o.decoratorStack=qr(et.decoratorStack,et.decoratorStackLength,"decorator stack"),o.strict=et.strict,o.potentialArrowAt=et.potentialArrowAt,o.potentialArrowInForAwait=et.potentialArrowInForAwait,o.yieldPos=et.yieldPos,o.awaitPos=et.awaitPos,o.awaitIdentPos=et.awaitIdentPos,o.regexpState=null,o.preValue=et.preValue,o.preToken=et.preToken,o.isLookahead=et.isLookahead,o.isAmbientContext=et.isAmbientContext,o.inAbstractClass=et.inAbstractClass,o.inType=et.inType,o.inDisallowConditionalTypesContext=et.inDisallowConditionalTypesContext,o.maybeInArrowParameters=et.maybeInArrowParameters,o.shouldParseArrowReturnType=et.shouldParseArrowReturnType,o.shouldParseAsyncArrowReturnType=et.shouldParseAsyncArrowReturnType,o.importOrExportOuterKind=et.importOrExportOuterKind}function Wh(o){return{capture:()=>jh(o),restore:(et)=>Vh(o,et)}}function qh(o,et){let{acornTokenTypes:tt,typeScriptTokenTypes:nt,scope:rt}=et,it=rt.SCOPE_TOP|rt.SCOPE_FUNCTION|rt.SCOPE_CLASS_STATIC_BLOCK;return class extends o{constructor(at,ct,lt){super(at,ct,lt);this.parseEffects=new Fh(this.options,Wh(this))}overrideContext(at){if(this.curContext()!==at)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(at)}takeDecorators(at){let ct=this.decoratorStack.length-1;if(this.decoratorStack[ct].length>0)this.parseEffects?.willSet(this.decoratorStack,String(ct));return super.takeDecorators(at)}parseDecorators(at){let ct=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(ct),super.parseDecorators(at)}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(at,ct,lt,ut){for(let dt=this.labels.length-1;dt>=0;dt--){let ht=this.labels[dt];if(ht.statementStart!==at.start)break;this.parseEffects?.willSet(ht,"statementStart"),this.parseEffects?.willSet(ht,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(at,ct,lt,ut)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let at=this.privateNameStack[this.privateNameStack.length-2];if(at)this.parseEffects?.willAppend(at.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let at=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(at.used)}return super.parsePrivateIdent()}parseClassField(at){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(at)}updateContext(at){let{type:ct}=this;if(ct===tt.parenR||ct===tt.braceR||ct===tt.braceL||ct===tt.dollarBraceL||ct===tt.parenL||ct===tt._function||ct===tt._class||ct===tt.colon||ct===tt.backQuote||ct===tt.star||ct===nt.jsxTagStart||ct===nt.jsxTagEnd||ct===tt.slash&&at===nt.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(at)}enterScope(at){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(at)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(at,ct,lt){let ut=this.parseEffects;if(ut?.active)if(ct===rt.BIND_LEXICAL){let dt=this.currentScope();if(ut.willAppend(dt.lexical),this.inModule&&dt.flags&rt.SCOPE_TOP)ut.willSet(this.undefinedExports,at)}else if(ct===rt.BIND_SIMPLE_CATCH)ut.willAppend(this.currentScope().lexical);else if(ct===rt.BIND_FUNCTION)ut.willAppend(this.currentScope().functions);else for(let dt=this.scopeStack.length-1;dt>=0;dt--){let ht=this.scopeStack[dt];if(ut.willAppend(ht.var),this.inModule&&ht.flags&rt.SCOPE_TOP)ut.willSet(this.undefinedExports,at);if(ht.flags&it)break}return super.declareName(at,ct,lt)}checkLocalExport(at){return this.parseEffects?.willSet(this.undefinedExports,at.name),super.checkLocalExport(at)}}}var Ro=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function _p(o){if(!o)throw Error("Assert fail")}function Gh(o){return o==="accessor"}function Uh(o){return o==="in"||o==="out"}var Qs=1,Ip=2,Hh=4,Jt={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 Lo(o,et){return Jt.SCOPE_FUNCTION|(o?Jt.SCOPE_ASYNC:0)|(et?Jt.SCOPE_GENERATOR:0)}function Kh(o){if(o.type!=="MemberExpression")return!1;let{computed:et,property:tt}=o;if(et&&(tt.type!=="TemplateLiteral"||tt.expressions.length>0))return!1;return Vp(o.object)}function zh(o){return o.type==="UnaryExpression"&&(o.operator==="-"||o.operator==="+")&&o.argument.type==="Literal"&&(typeof o.argument.value==="number"||typeof o.argument.value==="bigint")}function Vp(o){if(o.type==="Identifier")return!0;if(o.type!=="MemberExpression")return!1;if(o.computed)return!1;return Vp(o.object)}function Rp(o){return o==="private"||o==="public"||o==="protected"}function Xh(o){return Boolean(o.startsExpr)}function Jh(o){if(o==null)throw Error(`Unexpected ${o} value.`);return o}function Yh(o){switch(o){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 Wp(o){let{dts:et=!1}=o||{},tt=!!o?.jsx;return function(nt){let rt=nt.acorn||_o,it=Th(rt),{tokTypes:st,keywordTypes:at,isIdentifierStart:ct,lineBreak:lt,isNewLine:ut,tokContexts:dt,isIdentifierChar:ht}=rt,{tokTypes:yt,tokContexts:xt,keywordsRegExp:Et,tokenIsLiteralPropertyName:Ct,tokenIsTemplate:At,tokenIsTSDeclarationStart:_t,tokenIsIdentifier:vt,tokenIsKeywordOrIdentifier:Rt,tokenIsTSTypeOperator:Nt}=it;function Ot(ot,pt,ft=ot.length){for(let gt=pt;gt<ft;gt++){let bt=ot.charCodeAt(gt);if(ut(bt))return gt<ft-1&&bt===13&&ot.charCodeAt(gt+1)===10?gt+2:gt+1}return-1}if(nt=Rh(nt,it,rt),o?.jsx)nt=Mh(rt,it,nt,typeof o.jsx==="boolean"?{}:o.jsx);nt=$h(nt,it,rt);let Wt=qh(nt,{acornTokenTypes:st,typeScriptTokenTypes:yt,scope:Jt});class tn extends Wt{constructor(ot,pt,ft){super(ot,pt,ft);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=(gt)=>{this.tsParseModifiers({modified:gt,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:$t.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return it}get acornTypeScript(){return it}getTokenFromCodeInType(ot){if(ot===62)return this.finishOp(st.relational,1);if(ot===60)return this.finishOp(st.relational,1);return super.getTokenFromCode(ot)}readToken(ot){if(!this.inType){let pt=this.curContext();if(pt===xt.tc_expr)return this.jsx_readToken();if(pt===xt.tc_oTag||pt===xt.tc_cTag){if(ct(ot))return this.jsx_readWord();if(ot==62)return++this.pos,this.finishToken(yt.jsxTagEnd);if((ot===34||ot===39)&&pt==xt.tc_oTag)return this.jsx_readString(ot)}if(ot===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,o?.jsx)return this.finishToken(yt.jsxTagStart);else return this.finishToken(st.relational,"<")}return super.readToken(ot)}getTokenFromCode(ot){if(this.inType)return this.getTokenFromCodeInType(ot);if(ot===64)return++this.pos,this.finishToken(yt.at);return super.getTokenFromCode(ot)}isAbstractClass(){return this.ts_isContextual(yt.abstract)&&this.lookahead().type===st._class}isDeclareClass(){if(!this.ts_isContextual(yt.declare))return!1;let ot=this.nextTokenStart();if(this.isUnparsedContextual(ot,"class"))return!0;if(!this.isUnparsedContextual(ot,"abstract"))return!1;let pt=this.nextTokenStartSince(ot+8);return this.isUnparsedContextual(pt,"class")}finishNode(ot,pt){if(ot.type!==""&&ot.end!==0)return ot;return super.finishNode(ot,pt)}tryParse(ot){let pt={},ft=this.beginParseEffectScope(),gt;try{gt=ot(()=>{throw pt})}catch(bt){let St=bt===pt;if(!St&&!(bt instanceof SyntaxError))throw this.parseEffects.rollback(ft),bt;let kt={events:this.parseEffects.rollbackWithEvents(ft),selected:!1};return St?{node:null,error:null,thrown:!1,aborted:!0,failState:kt}:{node:null,error:bt,thrown:!0,aborted:!1,failState:kt}}return this.parseEffects.commit(ft),{node:gt,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError(ot,pt){ot.optionalParametersLoc=pt?.loc??this.startLoc}reScan_lt_gt(){if(this.type===st.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:ot}=this;if(ot===st.bitShift)return this.pos-=2,this.finishOp(st.relational,1),st.relational;return ot}resetEndLocation(ot,pt=this.lastTokEnd,ft=this.lastTokEndLoc){if(ot.end=pt,ot.loc.end=ft,this.options.ranges)ot.range[1]=pt}startNodeAtNode(ot){return super.startNodeAt(ot.start,ot.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(ot,pt){return pt.some((ft)=>{if(Rp(ft))return ot.accessibility===ft;return!!ot[ft]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(ot){ot.forEach((pt)=>{if(pt?.type==="TSTypeCastExpression")this.raise(pt.typeAnnotation.start,$t.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(ot){return ot.type==="Identifier"&&ot.name==="async"&&this.lastTokEnd===ot.end&&!this.canInsertSemicolon()&&ot.end-ot.start===5&&ot.start===this.potentialArrowAt}tsIsIdentifier(){return vt(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(st.colon)?this.tsParseTypeOrTypePredicateAnnotation(st.colon):void 0}tsTryParseGenericAsyncArrowFunction(ot,pt,ft){if(!this.tsMatchLeftRelational())return;let gt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let bt=this.tsTryParseAndCatch(()=>{let St=this.startNodeAt(ot,pt);return St.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(St),St.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(st.arrow),St});if(this.maybeInArrowParameters=gt,!bt)return;return this.parseArrowExpression(bt,bt.params,!0,ft)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==st.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext(ot){let pt=this.context;this.context=[pt[0]];try{return ot()}finally{this.context=pt}}tsTryParseTypeAnnotation(){return this.match(st.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(ot,pt){let ft=ot+pt.length;if(this.input.slice(ot,ft)===pt){let gt=this.input.charCodeAt(ft);return!(ht(gt)||(gt&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(yt.abstract)&&this.lookahead().type===st._new}nextTokenStartSince(ot){return Ro.lastIndex=ot,Ro.test(this.input)?Ro.lastIndex:ot}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(ot){this.pos=ot.pos,this.value=ot.value,this.exprAllowed=ot.exprAllowed,this.endLoc=ot.endLoc,this.lastTokEnd=ot.lastTokEnd,this.lastTokStart=ot.lastTokStart,this.lastTokStartLoc=ot.lastTokStartLoc,this.type=ot.type,this.start=ot.start,this.end=ot.end,this.startLoc=ot.startLoc,this.lastTokEndLoc=ot.lastTokEndLoc,this.curLine=ot.curLine,this.lineStart=ot.lineStart,this.containsEsc=ot.containsEsc}setLookaheadState(ot){this.setLookaheadTokenState(ot),this.context=ot.context&&ot.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult(ot){let pt=ot.failState;if(!pt)return;if(pt.selected)throw Error("A parse branch result can only be selected once");pt.selected=!0,this.parseEffects.replay(pt.events)}tsLookAhead(ot){let pt=this.beginParseEffectScope();try{return ot()}finally{this.parseEffects.rollback(pt)}}lookahead(ot){let pt=this.getCurLookaheadState(),ft=this.context,gt=this.preValue,bt=this.preToken,St=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,ot!==void 0)for(let kt=0;kt<ot;kt++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(pt),this.context=ft,this.preValue=gt,this.preToken=bt,this.isLookahead=St}}readWord(){let ot=this.readWord1(),pt=st.name;if(this.keywords.test(ot))pt=at[ot];else if(new RegExp(Et).test(ot))pt=yt[ot];return this.finishToken(pt,ot)}skipBlockComment(){let ot;if(!this.isLookahead)ot=this.options.onComment&&this.curPosition();let pt=this.pos,ft=this.input.indexOf("*/",this.pos+=2);if(ft===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=ft+2,this.options.locations)for(let gt,bt=pt;(gt=Ot(this.input,bt,this.pos))>-1;)++this.curLine,bt=this.lineStart=gt;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice(pt+2,ft),pt,this.pos,ot,this.curPosition())}skipLineComment(ot){let pt=this.pos,ft;if(!this.isLookahead)ft=this.options.onComment&&this.curPosition();let gt=this.input.charCodeAt(this.pos+=ot);while(this.pos<this.input.length&&!ut(gt))gt=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice(pt+ot,this.pos),pt,this.pos,ft,this.curPosition())}finishToken(ot,pt){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let ft=this.type;if(this.type=ot,this.value=pt,!this.isLookahead)this.updateContext(ft)}resetStartLocation(ot,pt,ft){if(ot.start=pt,ot.loc.start=ft,this.options.ranges)ot.range[0]=pt}isLineTerminator(){return this.eat(st.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return wp.lastIndex=this.end,wp.test(this.input)}addExtra(ot,pt,ft,gt=!0){if(!ot)return;let bt=ot.extra=ot.extra||{};if(gt)bt[pt]=ft;else Object.defineProperty(bt,pt,{enumerable:gt,value:ft})}isLiteralPropertyName(){return Ct(this.type)}hasPrecedingLineBreak(){return lt.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(ot,pt){return ot.name=pt,this.finishNode(ot,"Identifier")}resetStartLocationFromNode(ot,pt){this.resetStartLocation(ot,pt.start,pt.loc.start)}isThisParam(ot){return ot.type==="Identifier"&&ot.name==="this"}isLookaheadContextual(ot){let pt=this.nextTokenStart();return this.isUnparsedContextual(pt,ot)}ts_type_isContextual(ot,pt){return ot===pt&&!this.containsEsc}ts_isContextual(ot){return this.type===ot&&!this.containsEsc}ts_isContextualWithState(ot,pt){return ot.type===pt&&!ot.containsEsc}isContextualWithState(ot,pt){return pt.type===st.name&&pt.value===ot&&!pt.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(st.plusMin))return this.ts_isContextual(yt.readonly);if(this.ts_isContextual(yt.readonly))this.next();if(!this.match(st.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(st._in)}tsInDisallowConditionalTypesContext(ot){let pt=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return ot()}finally{this.inDisallowConditionalTypesContext=pt}}tsTryParseType(){return this.tsEatThenParseType(st.colon)}match(ot){return this.type===ot}matchJsx(ot){return this.type===it.tokTypes[ot]}ts_eatWithState(ot,pt,ft){let gt=ft.type;if(ot===gt){for(let bt=0;bt<pt;bt++)this.next();return!0}else return!1}ts_eatContextualWithState(ot,pt,ft){if(Et.test(ot)){if(this.ts_isContextualWithState(ft,yt[ot])){for(let gt=0;gt<pt;gt++)this.next();return!0}return!1}else{if(!this.isContextualWithState(ot,ft))return!1;for(let gt=0;gt<pt;gt++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(st._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual(ot){if(Et.test(ot)){if(this.ts_isContextual(yt[ot]))return this.next(),!0;return!1}else return super.eatContextual(ot)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let ot=this.startNode();if(this.expectContextual("require"),this.expect(st.parenL),!this.match(st.string))this.unexpected();return ot.expression=this.parseExprAtom(),this.expect(st.parenR),this.finishNode(ot,"TSExternalModuleReference")}tsParseEntityName(ot=!0){let pt=this.parseIdent(ot);while(this.eat(st.dot)){let ft=this.startNodeAtNode(pt);ft.left=pt,ft.right=this.parseIdent(ot),pt=this.finishNode(ft,"TSQualifiedName")}return pt}tsParseEnumMember(){let ot=this.startNode();if(ot.id=this.match(st.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(st.eq))ot.initializer=this.parseMaybeAssign();return this.finishNode(ot,"TSEnumMember")}tsParseEnumDeclaration(ot,pt={}){if(pt.const)ot.const=!0;if(pt.declare)ot.declare=!0;this.expectContextual("enum"),ot.id=this.parseIdent();let ft=pt.const?Jt.BIND_TS_CONST_ENUM:Jt.BIND_TS_ENUM;return this.checkLValSimple(ot.id,ft),this.expect(st.braceL),ot.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(st.braceR),this.finishNode(ot,"TSEnumDeclaration")}tsParseModuleBlock(){let ot=this.startNode();this.enterScope(kh),this.expect(st.braceL),ot.body=[];while(this.type!==st.braceR){let pt=this.parseStatement(null,!0);ot.body.push(pt)}return this.next(),super.exitScope(),this.finishNode(ot,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration(ot){if(this.ts_isContextual(yt.global))ot.global=!0,ot.id=this.parseIdent();else if(this.match(st.string))ot.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(st.braceL))this.enterScope(ds),ot.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode(ot,"TSModuleDeclaration")}tsTryParseDeclare(ot){if(this.isLineTerminator())return;let pt=this.type,ft;if(this.isContextual("let"))pt=st._var,ft="let";return this.tsInAmbientContext(()=>{if(pt===st._function)return ot.declare=!0,this.parseFunctionStatement(ot,!1,!0);if(pt===st._class)return ot.declare=!0,this.parseClass(ot,!0);if(pt===yt.enum)return this.tsParseEnumDeclaration(ot,{declare:!0});if(pt===yt.global)return this.tsParseAmbientExternalModuleDeclaration(ot);if(pt===st._const||pt===st._var){if(!this.match(st._const)||!this.isLookaheadContextual("enum"))return ot.declare=!0,this.parseVarStatement(ot,ft||this.value,!0);return this.expect(st._const),this.tsParseEnumDeclaration(ot,{const:!0,declare:!0})}if(pt===yt.interface){let gt=this.tsParseInterfaceDeclaration(ot,{declare:!0});if(gt)return gt}if(vt(pt))return this.tsParseDeclaration(ot,this.value,!0)})}tsIsListTerminator(ot){switch(ot){case"EnumMembers":case"TypeMembers":return this.match(st.braceR);case"HeritageClauseElement":return this.match(st.braceL);case"TupleElementTypes":return this.match(st.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(ot,pt,ft,gt){let bt=[],St=-1;for(;;){if(this.tsIsListTerminator(ot))break;St=-1;let kt=pt();if(kt==null)return;if(bt.push(kt),this.eat(st.comma)){St=this.lastTokStart;continue}if(this.tsIsListTerminator(ot))break;if(ft)this.expect(st.comma);return}if(gt)gt.value=St;return bt}tsParseDelimitedList(ot,pt,ft){return Jh(this.tsParseDelimitedListWorker(ot,pt,!0,ft))}tsParseBracketedList(ot,pt,ft,gt,bt){if(!gt)if(ft)this.expect(st.bracketL);else this.expect(st.relational);let St=this.tsParseDelimitedList(ot,pt,bt);if(ft)this.expect(st.bracketR);else this.expect(st.relational);return St}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(ot){return!this.match(ot)?void 0:this.tsNextThenParseType()}tsExpectThenParseType(ot){return this.tsDoThenParseType(()=>this.expect(ot))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(ot){return this.tsInType(()=>(ot(),this.tsParseType()))}tsSkipParameterStart(){if(vt(this.type)||this.match(st._this))return this.next(),!0;if(this.match(st.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(st.bracketL)){this.next();try{return this.parseBindingList(st.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(st.parenR)||this.match(st.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(st.colon)||this.match(st.comma)||this.match(st.question)||this.match(st.eq))return!0;if(this.match(st.parenR)){if(this.next(),this.match(st.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(st.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(ot){let pt=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return ot()}finally{this.inDisallowConditionalTypesContext=pt}}tsParseBindingListForSignature(){return super.parseBindingList(st.parenR,!0,!0).map((ot)=>{if(ot.type!=="Identifier"&&ot.type!=="RestElement"&&ot.type!=="ObjectPattern"&&ot.type!=="ArrayPattern")this.raise(ot.start,$t.UnsupportedSignatureParameterKind({type:ot.type}));return ot})}tsParseTypePredicateAsserts(){if(this.type!==yt.asserts)return!1;let ot=this.containsEsc;if(this.next(),!vt(this.type)&&!this.match(st._this))return!1;if(ot)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let ot=this.startNode();return this.next(),this.finishNode(ot,"TSThisType")}tsParseTypeAnnotation(ot=!0,pt=this.startNode()){return this.tsInType(()=>{if(ot)this.expect(st.colon);pt.typeAnnotation=this.tsParseType()}),this.finishNode(pt,"TSTypeAnnotation")}tsParseThisTypePredicate(ot){this.next();let pt=this.startNodeAtNode(ot);return pt.parameterName=ot,pt.typeAnnotation=this.tsParseTypeAnnotation(!1),pt.asserts=!1,this.finishNode(pt,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let ot=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(ot);else return ot}tsParseTypePredicatePrefix(){let ot=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),ot}tsParseTypeOrTypePredicateAnnotation(ot){return this.tsInType(()=>{let pt=this.startNode();this.expect(ot);let ft=this.startNode(),gt=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(gt){let Pt=this.tsParseTypeAnnotation(!1);return ft.parameterName=gt,ft.typeAnnotation=Pt,ft.asserts=!1,pt.typeAnnotation=this.finishNode(ft,"TSTypePredicate"),this.finishNode(pt,"TSTypeAnnotation")}let bt=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(bt&&this.match(st._this)){let Pt=this.tsParseThisTypeOrThisTypePredicate();if(Pt.type==="TSThisType")ft.parameterName=Pt,ft.asserts=!0,ft.typeAnnotation=null,Pt=this.finishNode(ft,"TSTypePredicate");else this.resetStartLocationFromNode(Pt,ft),Pt.asserts=!0;return pt.typeAnnotation=Pt,this.finishNode(pt,"TSTypeAnnotation")}let St=bt&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!St){if(!bt)return this.tsParseTypeAnnotation(!1,pt);return ft.parameterName=this.parseIdent(),ft.asserts=bt,ft.typeAnnotation=null,pt.typeAnnotation=this.finishNode(ft,"TSTypePredicate"),this.finishNode(pt,"TSTypeAnnotation")}let kt=this.tsParseTypeAnnotation(!1);return ft.parameterName=St,ft.typeAnnotation=kt,ft.asserts=bt,pt.typeAnnotation=this.finishNode(ft,"TSTypePredicate"),this.finishNode(pt,"TSTypeAnnotation")})}tsFillSignature(ot,pt){let ft=ot===st.arrow,gt="parameters",bt="typeAnnotation";if(pt.typeParameters=this.tsTryParseTypeParameters(),this.expect(st.parenL),pt.parameters=this.tsParseBindingListForSignature(),ft)pt.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(ot);else if(this.match(ot))pt.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(ot)}tsTryNextParseConstantContext(){if(this.lookahead().type!==st._const)return null;this.next();let ot=this.tsParseTypeReference();if(ot.typeParameters||ot.typeArguments)this.raise(ot.typeName.start,$t.CannotFindName({name:"const"}));return ot}tsParseFunctionOrConstructorType(ot,pt){let ft=this.startNode();if(ot==="TSConstructorType"){if(ft.abstract=!!pt,pt)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(st.arrow,ft)),this.finishNode(ft,ot)}tsParseUnionOrIntersectionType(ot,pt,ft){let gt=this.startNode(),bt=this.eat(ft),St=[];do St.push(pt());while(this.eat(ft));if(St.length===1&&!bt)return St[0];return gt.types=St,this.finishNode(gt,ot)}tsCheckTypeAnnotationForReadOnly(ot){switch(ot.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(ot.start,$t.UnexpectedReadonly)}}tsParseTypeOperator(){let ot=this.startNode(),pt=this.value;if(this.next(),ot.operator=pt,ot.typeAnnotation=this.tsParseTypeOperatorOrHigher(),pt==="readonly")this.tsCheckTypeAnnotationForReadOnly(ot);return this.finishNode(ot,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(st._extends)){let ot=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(st.question))return ot}}tsParseInferType(){let ot=this.startNode();this.expectContextual("infer");let pt=this.startNode();return pt.name=this.tsParseTypeParameterName(),pt.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),ot.typeParameter=this.finishNode(pt,"TSTypeParameter"),this.finishNode(ot,"TSInferType")}tsParseLiteralTypeNode(){let ot=this.startNode();return ot.literal=(()=>{switch(this.type){case st.num:case st.string:case st._true:case st._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(ot,"TSLiteralType")}tsParseImportType(){let ot=this.startNode();if(this.expect(st._import),this.expect(st.parenL),!this.match(st.string))this.raise(this.start,$t.UnsupportedImportTypeArgument);if(ot.argument=this.parseExprAtom(),this.expect(st.parenR),this.eat(st.dot))ot.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())ot.typeArguments=this.tsParseTypeArguments();return this.finishNode(ot,"TSImportType")}tsParseTypeQuery(){let ot=this.startNode();if(this.expect(st._typeof),this.match(st._import))ot.exprName=this.tsParseImportType();else ot.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())ot.typeArguments=this.tsParseTypeArguments();return this.finishNode(ot,"TSTypeQuery")}tsParseMappedTypeParameter(){let ot=this.startNode();return ot.name=this.tsParseTypeParameterName(),ot.constraint=this.tsExpectThenParseType(st._in),this.finishNode(ot,"TSTypeParameter")}tsParseMappedType(){let ot=this.startNode();if(this.expect(st.braceL),this.match(st.plusMin))ot.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))ot.readonly=!0;if(this.expect(st.bracketL),ot.typeParameter=this.tsParseMappedTypeParameter(),ot.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(st.bracketR),this.match(st.plusMin))ot.optional=this.value,this.next(),this.expect(st.question);else if(this.eat(st.question))ot.optional=!0;return ot.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(st.braceR),this.finishNode(ot,"TSMappedType")}tsParseTypeLiteral(){let ot=this.startNode();return ot.members=this.tsParseObjectTypeMembers(),this.finishNode(ot,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!Rt(this.type))return!1;let ot=this.lookahead();if(ot.type===st.colon)return!0;if(ot.type!==st.question)return!1;return this.lookahead(2).type===st.colon}tsParseTupleElementType(){let ot=this.startLoc,pt=this.start,ft=this.eat(st.ellipsis),gt;if(this.tsIsTupleElementLabel()){let bt=this.startNode();bt.label=this.parseIdent(!0),bt.optional=this.eat(st.question),this.expect(st.colon),bt.elementType=this.tsParseType(),gt=this.finishNode(bt,"TSNamedTupleMember")}else{gt=this.tsParseType();let bt=this.eat(st.question);if(this.eat(st.colon))this.raise(gt.start,$t.InvalidTupleMemberLabel);if(bt){let St=this.startNodeAtNode(gt);St.typeAnnotation=gt,gt=this.finishNode(St,"TSOptionalType")}}if(ft){let bt=this.startNodeAt(pt,ot);bt.typeAnnotation=gt,gt=this.finishNode(bt,"TSRestType")}return gt}tsParseTupleType(){let ot=this.startNode();ot.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let pt=!1;return ot.elementTypes.forEach((ft)=>{let{type:gt}=ft;if(pt&>!=="TSRestType"&>!=="TSOptionalType"&&!(gt==="TSNamedTupleMember"&&ft.optional))this.raise(ft.start,$t.OptionalTypeBeforeRequired);if(pt||=gt==="TSNamedTupleMember"&&ft.optional||gt==="TSOptionalType",gt==="TSRestType")ft=ft.typeAnnotation}),this.finishNode(ot,"TSTupleType")}tsParseTemplateLiteralType(){let ot=this.startNode();return ot.literal=this.parseTemplate({isTagged:!1}),this.finishNode(ot,"TSLiteralType")}tsParseTypeReference(){let ot=this.startNode();if(ot.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())ot.typeArguments=this.tsParseTypeArguments();return this.finishNode(ot,"TSTypeReference")}tsMatchLeftRelational(){return this.match(st.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(st.relational)&&this.value===">"}tsParseParenthesizedType(){let ot=this.startNode();return this.expect(st.parenL),ot.typeAnnotation=this.tsParseType(),this.expect(st.parenR),this.finishNode(ot,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case st.string:case st.num:case st._true:case st._false:return this.tsParseLiteralTypeNode();case st.plusMin:if(this.value==="-"){let ot=this.startNode();if(this.lookahead().type!==st.num)this.unexpected();return ot.literal=this.parseMaybeUnary(),this.finishNode(ot,"TSLiteralType")}break;case st._this:return this.tsParseThisTypeOrThisTypePredicate();case st._typeof:return this.tsParseTypeQuery();case st._import:return this.tsParseImportType();case st.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case st.bracketL:return this.tsParseTupleType();case st.parenL:return this.tsParseParenthesizedType();case st.backQuote:case st.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:ot}=this;if(Rt(ot)||ot===st._void||ot===st._null){let pt=ot===st._void?"TSVoidKeyword":ot===st._null?"TSNullKeyword":Yh(this.value);if(pt!==void 0&&this.lookaheadCharCode()!==46){let ft=this.startNode();return this.next(),this.finishNode(ft,pt)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let ot=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(st.bracketL))if(this.match(st.bracketR)){let pt=this.startNodeAtNode(ot);pt.elementType=ot,this.expect(st.bracketR),ot=this.finishNode(pt,"TSArrayType")}else{let pt=this.startNodeAtNode(ot);pt.objectType=ot,pt.indexType=this.tsParseType(),this.expect(st.bracketR),ot=this.finishNode(pt,"TSIndexedAccessType")}return ot}tsParseTypeOperatorOrHigher(){return Nt(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),st.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),st.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(st._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){_p(this.inType);let ot=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(st._extends))return ot;let pt=this.startNodeAtNode(ot);return pt.checkType=ot,pt.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(st.question),pt.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(st.colon),pt.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(pt,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),vt(this.type))return this.next(),this.match(st.colon);return!1}tsInType(ot){let pt=this.inType;this.inType=!0;try{return ot()}finally{this.inType=pt}}tsTryParseIndexSignature(ot){if(!(this.match(st.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(st.bracketL);let pt=this.parseIdent();pt.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(pt),this.expect(st.bracketR),ot.parameters=[pt];let ft=this.tsTryParseTypeAnnotation();if(ft)ot.typeAnnotation=ft;return this.tsParseTypeMemberSemicolon(),this.finishNode(ot,"TSIndexSignature")}tsParseNoneModifiers(ot){this.tsParseModifiers({modified:ot,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:$t.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(ot=this.tsParseNoneModifiers.bind(this)){let pt=this.startNode();return ot(pt),pt.name=this.tsParseTypeParameterName(),pt.constraint=this.tsEatThenParseType(st._extends),pt.default=this.tsEatThenParseType(st.eq),this.finishNode(pt,"TSTypeParameter")}tsParseTypeParameters(ot){let pt=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let ft={value:-1};if(pt.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,ot),!1,!0,ft),pt.params.length===0)this.raise(this.start,$t.EmptyTypeParameters);if(ft.value!==-1)this.addExtra(pt,"trailingComma",ft.value);return this.finishNode(pt,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(ot){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(ot)}tsTryParse(ot){let pt=this.beginParseEffectScope(),ft;try{ft=ot()}catch(gt){throw this.parseEffects.rollback(pt),gt}if(ft!==void 0&&ft!==!1)return this.parseEffects.commit(pt),ft;this.parseEffects.rollback(pt);return}tsTokenCanFollowModifier(){return(this.match(st.bracketL)||this.match(st.braceL)||this.match(st.star)||this.match(st.ellipsis)||this.match(st.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(ot,pt){let ft=this.value;if(ot.indexOf(ft)!==-1&&!this.containsEsc){if(pt&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return ft}return}tsParseModifiersByMap({modified:ot,map:pt}){for(let ft of Object.keys(pt))ot[ft]=pt[ft]}tsParseModifiers({modified:ot,allowedModifiers:pt,disallowedModifiers:ft,stopOnStartOfClassStaticBlock:gt,errorTemplate:bt=$t.InvalidModifierOnTypeMember}){let St={},kt=(wt,Tt,Dt,Lt)=>{if(Tt===Dt&&ot[Lt])this.raise(wt.column,$t.InvalidModifiersOrder({orderedModifiers:[Dt,Lt]}))},Pt=(wt,Tt,Dt,Lt)=>{if(ot[Dt]&&Tt===Lt||ot[Lt]&&Tt===Dt)this.raise(wt.column,$t.IncompatibleModifiers({modifiers:[Dt,Lt]}))};for(;;){let wt=this.startLoc,Tt=this.tsParseModifier(pt.concat(ft??[]),gt);if(!Tt)break;if(Rp(Tt))if(ot.accessibility)this.raise(this.start,$t.DuplicateAccessibilityModifier());else kt(wt,Tt,Tt,"override"),kt(wt,Tt,Tt,"static"),kt(wt,Tt,Tt,"readonly"),kt(wt,Tt,Tt,"accessor"),St.accessibility=Tt,ot.accessibility=Tt;else if(Uh(Tt))if(ot[Tt])this.raise(this.start,$t.DuplicateModifier({modifier:Tt}));else kt(wt,Tt,"in","out"),St[Tt]=Tt,ot[Tt]=!0;else if(Gh(Tt))if(ot[Tt])this.raise(this.start,$t.DuplicateModifier({modifier:Tt}));else Pt(wt,Tt,"accessor","readonly"),Pt(wt,Tt,"accessor","override"),St[Tt]=Tt,ot[Tt]=!0;else if(Tt==="const")if(ot[Tt])this.raise(this.start,$t.DuplicateModifier({modifier:Tt}));else St[Tt]=Tt,ot[Tt]=!0;else if(Object.hasOwnProperty.call(ot,Tt))this.raise(this.start,$t.DuplicateModifier({modifier:Tt}));else kt(wt,Tt,"static","readonly"),kt(wt,Tt,"static","override"),kt(wt,Tt,"override","readonly"),kt(wt,Tt,"abstract","override"),Pt(wt,Tt,"declare","override"),Pt(wt,Tt,"static","abstract"),St[Tt]=Tt,ot[Tt]=!0;if(ft?.includes(Tt))this.raise(this.start,bt)}return St}tsParseInOutModifiers(ot){this.tsParseModifiers({modified:ot,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:$t.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(ot){this.tsParseModifiers({modified:ot,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:$t.InvalidModifierOnTypeParameter})}parseMaybeUnary(ot,pt,ft,gt){if(!o?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(ot,pt,ft,gt)}tsParseTypeAssertion(){if(tt)this.raise(this.start,$t.ReservedTypeAssertion);let ot=this.tryParse(()=>{let pt=this.startNode(),ft=this.tsTryNextParseConstantContext();return pt.typeAnnotation=ft||this.tsNextThenParseType(),this.expect(st.relational),pt.expression=this.parseMaybeUnary(),this.finishNode(pt,"TSTypeAssertion")});if(ot.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return ot.node}tsParseTypeArguments(ot=!1){let pt=this.startNode();if(pt.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(st.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),pt.params.length===0)this.raise(this.start,$t.EmptyTypeArguments);if(ot&&this.curContext()!==xt.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode(pt,"TSTypeParameterInstantiation")}tsParseHeritageClause(ot){let pt=this.start,ft=this.tsParseDelimitedList("HeritageClauseElement",()=>{let gt=this.startNode();if(gt.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())gt.typeParameters=this.tsParseTypeArguments();return this.finishNode(gt,"TSExpressionWithTypeArguments")});if(!ft.length)this.raise(pt,$t.EmptyHeritageClauseType({token:ot}));return ft}tsParseTypeMemberSemicolon(){if(!this.eat(st.comma)&&!this.isLineTerminator())this.expect(st.semi)}tsTryParseAndCatch(ot){let pt=this.tryParse((ft)=>ot()||ft());if(pt.aborted||!pt.node)return;return pt.node}tsParseSignatureMember(ot,pt){return this.tsFillSignature(st.colon,pt),this.tsParseTypeMemberSemicolon(),this.finishNode(pt,ot)}tsParsePropertyOrMethodSignature(ot,pt){if(this.eat(st.question))ot.optional=!0;let ft=ot;if(this.match(st.parenL)||this.tsMatchLeftRelational()){if(pt)this.raise(ot.start,$t.ReadonlyForMethodSignature);let gt=ft;if(gt.kind&&this.tsMatchLeftRelational())this.raise(this.start,$t.AccesorCannotHaveTypeParameters);this.tsFillSignature(st.colon,gt),this.tsParseTypeMemberSemicolon();let bt="parameters",St="typeAnnotation";if(gt.kind==="get"){if(gt[bt].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(gt[bt][0]))this.raise(this.start,$t.AccesorCannotDeclareThisParameter)}}else if(gt.kind==="set"){if(gt[bt].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let kt=gt[bt][0];if(this.isThisParam(kt))this.raise(this.start,$t.AccesorCannotDeclareThisParameter);if(kt.type==="Identifier"&&kt.optional)this.raise(this.start,$t.SetAccesorCannotHaveOptionalParameter);if(kt.type==="RestElement")this.raise(this.start,$t.SetAccesorCannotHaveRestParameter)}if(gt[St])this.raise(gt[St].start,$t.SetAccesorCannotHaveReturnType)}else gt.kind="method";return this.finishNode(gt,"TSMethodSignature")}else{let gt=ft;if(pt)gt.readonly=!0;let bt=this.tsTryParseTypeAnnotation();if(bt)gt.typeAnnotation=bt;return this.tsParseTypeMemberSemicolon(),this.finishNode(gt,"TSPropertySignature")}}tsParseTypeMember(){let ot=this.startNode();if(this.match(st.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",ot);if(this.match(st._new)){let ft=this.startNode();if(this.next(),this.match(st.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",ot);else return ot.key=this.createIdentifier(ft,"new"),this.tsParsePropertyOrMethodSignature(ot,!1)}this.tsParseModifiers({modified:ot,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let pt=this.tsTryParseIndexSignature(ot);if(pt)return pt;if(this.parsePropertyName(ot),!ot.computed&&ot.key.type==="Identifier"&&(ot.key.name==="get"||ot.key.name==="set")&&this.tsTokenCanFollowModifier())ot.kind=ot.key.name,this.parsePropertyName(ot);return this.tsParsePropertyOrMethodSignature(ot,!!ot.readonly)}tsParseList(ot,pt){let ft=[];while(!this.tsIsListTerminator(ot))ft.push(pt());return ft}tsParseObjectTypeMembers(){this.expect(st.braceL);let ot=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(st.braceR),ot}tsParseInterfaceDeclaration(ot,pt={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),pt.declare)ot.declare=!0;if(vt(this.type)){ot.id=this.parseIdent(),this.checkLValSimple(ot.id,Jt.BIND_TS_INTERFACE);let gt=this.currentScope();this.maybeExportDefined(gt,ot.id.name)}else ot.id=null,this.raise(this.start,$t.MissingInterfaceName);if(ot.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(st._extends))ot.extends=this.tsParseHeritageClause("extends");let ft=this.startNode();return ft.body=this.tsParseInterfaceBody(),ot.body=this.finishNode(ft,"TSInterfaceBody"),this.finishNode(ot,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(st.braceL);let ot=this.inType;this.inType=!0;let pt=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=ot,this.expect(st.braceR),pt}tsParseAbstractDeclaration(ot){if(this.match(st._class))return ot.abstract=!0,this.parseClass(ot,!0);else if(this.ts_isContextual(yt.interface)){if(!this.hasFollowingLineBreak())return ot.abstract=!0,this.tsParseInterfaceDeclaration(ot)}else this.unexpected(ot.start)}tsIsDeclarationStart(){return _t(this.type)}tsParseExpressionStatement(ot,pt){switch(pt.name){case"declare":{let ft=this.tsTryParseDeclare(ot);if(ft)return ft.declare=!0,ft;break}case"global":if(this.match(st.braceL)){this.enterScope(ds);let ft=ot;return ft.global=!0,ft.id=pt,ft.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(ft,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(ot,pt.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:ot}=this,pt=this.isAsyncFunction(),ft=this.isLet();if(vt(ot)){if(pt&&!this.containsEsc||ft)return!1;if((ot===yt.type||ot===yt.interface)&&!this.containsEsc){let St=this.lookahead();if(vt(St.type)&&!this.isContextualWithState("from",St)||St.type===st.braceL)return!1}}else if(!this.match(st._default))return!1;let gt=this.nextTokenStart(),bt=this.isUnparsedContextual(gt,"from");if(this.input.charCodeAt(gt)===44||vt(this.type)&&bt)return!0;if(this.match(st._default)&&bt){let St=this.input.charCodeAt(this.nextTokenStartSince(gt+4));return St===34||St===39}return!1}tsInAmbientContext(ot){let pt=this.isAmbientContext;this.isAmbientContext=!0;try{return ot()}finally{this.isAmbientContext=pt}}tsCheckLineTerminator(ot){if(ot){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(ot,pt=!1){if(ot.id=this.parseIdent(),!pt)this.checkLValSimple(ot.id,Jt.BIND_TS_NAMESPACE);if(this.eat(st.dot)){let ft=this.startNode();this.tsParseModuleOrNamespaceDeclaration(ft,!0),ot.body=ft}else this.enterScope(ds),ot.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(ot,"TSModuleDeclaration")}checkLValSimple(ot,pt=Jt.BIND_NONE,ft){while(ot.type==="TSNonNullExpression"||ot.type==="TSAsExpression"||ot.type==="TSSatisfiesExpression"||ot.type==="TSTypeAssertion")ot=ot.expression;return super.checkLValSimple(ot,pt,ft)}isSimpleAssignTarget(ot){while(ot.type==="TSNonNullExpression"||ot.type==="TSAsExpression"||ot.type==="TSSatisfiesExpression"||ot.type==="TSTypeAssertion")ot=ot.expression;return super.isSimpleAssignTarget(ot)}tsParseTypeAliasDeclaration(ot){ot.id=this.parseIdent(),this.checkLValSimple(ot.id,Jt.BIND_TS_TYPE);let pt=this.currentScope();return this.maybeExportDefined(pt,ot.id.name),ot.typeAnnotation=this.tsInType(()=>{if(ot.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(st.eq),this.ts_isContextual(yt.interface)&&this.lookahead().type!==st.dot){let ft=this.startNode();return this.next(),this.finishNode(ft,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(ot,"TSTypeAliasDeclaration")}tsParseDeclaration(ot,pt,ft){switch(pt){case"abstract":if(this.tsCheckLineTerminator(ft)&&(this.match(st._class)||vt(this.type)))return this.tsParseAbstractDeclaration(ot);break;case"module":if(this.tsCheckLineTerminator(ft)){if(this.match(st.string))return this.tsParseAmbientExternalModuleDeclaration(ot);else if(vt(this.type))return this.tsParseModuleOrNamespaceDeclaration(ot)}break;case"namespace":if(this.tsCheckLineTerminator(ft)&&vt(this.type))return this.tsParseModuleOrNamespaceDeclaration(ot);break;case"type":if(this.tsCheckLineTerminator(ft)&&vt(this.type))return this.tsParseTypeAliasDeclaration(ot);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(ot,pt){ot.isExport=pt||!1,ot.id=this.parseIdent(),this.checkLValSimple(ot.id,Jt.BIND_LEXICAL),super.expect(st.eq);let ft=this.tsParseModuleReference();if(ot.importKind==="type"&&ft.type!=="TSExternalModuleReference")this.raise(ft.start,$t.ImportAliasHasImportType);return ot.moduleReference=ft,super.semicolon(),this.finishNode(ot,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:ot}=this;if(vt(ot)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((ot===yt.type||ot===yt.interface)&&!this.containsEsc){let gt=this.lookahead();if(vt(gt.type)&&!this.isContextualWithState("from",gt)||gt.type===st.braceL)return!1}}else if(!this.match(st._default))return!1;let pt=this.nextTokenStart(),ft=this.isUnparsedContextual(pt,"from");if(this.input.charCodeAt(pt)===44||vt(this.type)&&ft)return!0;if(this.match(st._default)&&ft){let gt=this.input.charCodeAt(this.nextTokenStartSince(pt+4));return gt===34||gt===39}return!1}parseTemplate({isTagged:ot=!1}={}){let pt=this.startNode();this.next(),pt.expressions=[];let ft=this.parseTemplateElement({isTagged:ot});pt.quasis=[ft];while(!ft.tail){if(this.type===st.eof)this.raise(this.pos,"Unterminated template literal");this.expect(st.dollarBraceL),pt.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(st.braceR),pt.quasis.push(ft=this.parseTemplateElement({isTagged:ot}))}return this.next(),this.finishNode(pt,"TemplateLiteral")}parseFunction(ot,pt,ft,gt,bt){if(this.initFunction(ot),this.ecmaVersion>=9||this.ecmaVersion>=6&&!gt){if(this.type===st.star&&pt&Ip)this.unexpected();ot.generator=this.eat(st.star)}if(this.ecmaVersion>=8)ot.async=!!gt;if(pt&Qs)ot.id=pt&Hh&&this.type!==st.name?null:this.parseIdent();let St=this.yieldPos,kt=this.awaitPos,Pt=this.awaitIdentPos,wt=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Lo(ot.async,ot.generator)),!(pt&Qs))ot.id=this.type===st.name?this.parseIdent():null;this.parseFunctionParams(ot);let Tt=pt&Qs;if(this.parseFunctionBody(ot,ft,!1,bt,{isFunctionDeclaration:Tt}),Tt&&this.isAmbientContext&&ot.id){if(this.currentScope().flags&Jt.SCOPE_TOP)this.declareName(ot.id.name,Jt.BIND_FLAGS_TS_EXPORT_ONLY,ot.id.start)}if(this.yieldPos=St,this.awaitPos=kt,this.awaitIdentPos=Pt,pt&Qs&&ot.id&&!(pt&Ip))if(ot.body)this.checkLValSimple(ot.id,this.strict||ot.generator||ot.async?this.treatFunctionsAsVar?Jt.BIND_VAR:Jt.BIND_LEXICAL:Jt.BIND_FUNCTION);else this.checkLValSimple(ot.id,Jt.BIND_NONE);return this.maybeInArrowParameters=wt,this.finishNode(ot,Tt?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(ot,pt=!1,ft=!1,gt=!1,bt){if(this.match(st.colon))ot.returnType=this.tsParseTypeOrTypePredicateAnnotation(st.colon);let St=bt?.isFunctionDeclaration?"TSDeclareFunction":bt?.isClassMethod?"TSDeclareMethod":void 0;if(St&&!this.match(st.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode(ot,St);if(St==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise(ot.start,$t.DeclareFunctionHasImplementation),ot.declare)return super.parseFunctionBody(ot,pt,ft,!1),this.finishNode(ot,St)}return super.parseFunctionBody(ot,pt,ft,gt),ot}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let ot=this.startNode(),pt=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(st.dot)){ot.meta=pt;let kt=this.containsEsc;if(ot.property=this.parseIdent(!0),ot.property.name!=="target")this.raiseRecoverable(ot.property.start,"The only valid meta property for new is 'new.target'");if(kt)this.raiseRecoverable(ot.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(ot.start,"'new.target' can only be used in functions and class static block");return this.finishNode(ot,"MetaProperty")}let ft=this.start,gt=this.startLoc,bt=this.type===st._import;if(ot.callee=this.parseSubscripts(this.parseExprAtom(),ft,gt,!0,!1),bt&&ot.callee.type==="ImportExpression")this.raise(ft,"Cannot use new with import()");let{callee:St}=ot;if(St.type==="TSInstantiationExpression"&&!St.extra?.parenthesized)ot.typeArguments=St.typeArguments,ot.callee=St.expression;if(this.eat(st.parenL))ot.arguments=this.parseExprList(st.parenR,this.ecmaVersion>=8,!1);else ot.arguments=[];return this.finishNode(ot,"NewExpression")}parseExprOp(ot,pt,ft,gt,bt){if(st._in.binop>gt&&!this.hasPrecedingLineBreak()){let St;if(this.isContextual("as"))St="TSAsExpression";if(this.isContextual("satisfies"))St="TSSatisfiesExpression";if(St){let kt=this.startNodeAt(pt,ft);kt.expression=ot;let Pt=this.tsTryNextParseConstantContext();if(Pt)kt.typeAnnotation=Pt;else kt.typeAnnotation=this.tsNextThenParseType();return this.finishNode(kt,St),this.reScan_lt_gt(),this.parseExprOp(kt,pt,ft,gt,bt)}}return super.parseExprOp(ot,pt,ft,gt,bt)}parseImportSpecifiers(){let ot=[],pt=!0;if(it.tokenIsIdentifier(this.type)){if(ot.push(this.parseImportDefaultSpecifier()),!this.eat(st.comma))return ot}if(this.type===st.star)return ot.push(this.parseImportNamespaceSpecifier()),ot;this.expect(st.braceL);while(!this.eat(st.braceR)){if(!pt){if(this.expect(st.comma),this.afterTrailingComma(st.braceR))break}else pt=!1;ot.push(this.parseImportSpecifier())}return ot}parseImport(ot){let pt=this.lookahead();if(ot.importKind="value",this.importOrExportOuterKind="value",vt(pt.type)||this.match(st.star)||this.match(st.braceL)){let ft=this.lookahead(2);if(ft.type!==st.comma&&!this.isContextualWithState("from",ft)&&ft.type!==st.eq&&this.ts_eatContextualWithState("type",1,pt))this.importOrExportOuterKind="type",ot.importKind="type",pt=this.lookahead(),ft=this.lookahead(2);if(vt(pt.type)&&ft.type===st.eq){this.next();let gt=this.tsParseImportEqualsDeclaration(ot);return this.importOrExportOuterKind="value",gt}}if(this.next(),this.type===st.string)ot.specifiers=[],ot.source=this.parseExprAtom();else ot.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),ot.source=this.type===st.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes(ot),this.semicolon(),this.finishNode(ot,"ImportDeclaration"),this.importOrExportOuterKind="value",ot.importKind==="type"&&ot.specifiers.length>1&&ot.specifiers[0].type==="ImportDefaultSpecifier")this.raise(ot.start,$t.TypeImportCannotSpecifyDefaultAndNamed);return ot}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let ot=this.startNode();return this.next(),ot.abstract=!0,this.parseClass(ot,!0)}if(this.match(yt.interface)){let ot=this.tsParseInterfaceDeclaration(this.startNode());if(ot)return ot}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(ot,pt){if(this.ecmaVersion>=11)if(this.eatContextual("as"))ot.exported=this.parseModuleExportName(),this.checkExport(pt,ot.exported,this.lastTokStart);else ot.exported=null;if(this.expectContextual("from"),this.type!==st.string)this.unexpected();return ot.source=this.parseExprAtom(),this.parseMaybeImportAttributes(ot),this.semicolon(),this.finishNode(ot,"ExportAllDeclaration")}parseDynamicImport(ot){if(this.next(),ot.source=this.parseMaybeAssign(),this.eat(st.comma)){let pt=this.parseExpression();ot.arguments=[pt]}if(!this.eat(st.parenR)){let pt=this.start;if(this.eat(st.comma)&&this.eat(st.parenR))this.raiseRecoverable(pt,"Trailing comma is not allowed in import()");else this.unexpected(pt)}return this.finishNode(ot,"ImportExpression")}parseExport(ot,pt){let ft=this.lookahead();if(this.ts_eatWithState(st._import,2,ft)){if(this.ts_isContextual(yt.type)&&this.lookaheadCharCode()!==61)ot.importKind="type",this.importOrExportOuterKind="type",this.next();else ot.importKind="value",this.importOrExportOuterKind="value";let gt=this.tsParseImportEqualsDeclaration(ot,!0);return this.importOrExportOuterKind=void 0,gt}else if(this.ts_eatWithState(st.eq,2,ft)){let gt=ot;return gt.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(gt,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,ft)){let gt=ot;return this.expectContextual("namespace"),gt.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(gt,"TSNamespaceExportDeclaration")}else{let gt=this.lookahead(2).type;if(this.ts_isContextualWithState(ft,yt.type)&&(gt===st.braceL||gt===st.star))this.next(),this.importOrExportOuterKind="type",ot.exportKind="type";else this.importOrExportOuterKind="value",ot.exportKind="value";if(this.next(),this.eat(st.star))return this.parseExportAllDeclaration(ot,pt);if(this.eat(st._default))return this.checkExport(pt,"default",this.lastTokStart),ot.declaration=this.parseExportDefaultDeclaration(),this.finishNode(ot,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(ot.declaration=this.parseExportDeclaration(ot),ot.declaration.type==="VariableDeclaration")this.checkVariableExport(pt,ot.declaration.declarations);else this.checkExport(pt,ot.declaration.id,ot.declaration.id.start);ot.specifiers=[],ot.source=null}else{if(ot.declaration=null,ot.specifiers=this.parseExportSpecifiers(pt),this.eatContextual("from")){if(this.type!==st.string)this.unexpected();ot.source=this.parseExprAtom(),this.parseMaybeImportAttributes(ot)}else{for(let bt of ot.specifiers)if(this.checkUnreserved(bt.local),this.checkLocalExport(bt.local),bt.local.type==="Literal")this.raise(bt.local.start,"A string literal cannot be used as an exported binding without `from`.");ot.source=null}this.semicolon()}return this.finishNode(ot,"ExportNamedDeclaration")}}checkExport(ot,pt,ft){if(!ot)return;if(typeof pt!=="string")pt=pt.type==="Identifier"?pt.name:pt.value;ot[pt]=!0}parseMaybeDefault(ot,pt,ft){let gt=super.parseMaybeDefault(ot,pt,ft);if(gt.type==="AssignmentPattern"&>.typeAnnotation&>.right.start<gt.typeAnnotation.start)this.raise(gt.typeAnnotation.start,$t.TypeAnnotationAfterAssign);return gt}typeCastToParameter(ot){return ot.expression.typeAnnotation=ot.typeAnnotation,this.resetEndLocation(ot.expression,ot.typeAnnotation.end,ot.typeAnnotation.loc?.end),ot.expression}toAssignableList(ot,pt){if(!ot)ot=[];for(let ft=0;ft<ot.length;ft++){let gt=ot[ft];if(gt?.type==="TSTypeCastExpression")ot[ft]=this.typeCastToParameter(gt)}return super.toAssignableList(ot,pt)}reportReservedArrowTypeParam(ot){if(ot.params.length===1&&!ot.extra?.trailingComma&&tt)this.raise(ot.start,$t.ReservedArrowTypeParam)}parseExprAtom(ot,pt,ft){if(this.type===yt.jsxText)return this.jsx_parseText();else if(this.type===yt.jsxTagStart)return this.jsx_parseElement();else if(this.type===yt.at)return this.parseDecorators(),this.parseExprAtom();else if(vt(this.type)){let gt=this.potentialArrowAt===this.start,bt=this.start,St=this.startLoc,kt=this.containsEsc,Pt=this.parseIdent(!1);if(this.ecmaVersion>=8&&!kt&&Pt.name==="async"&&!this.canInsertSemicolon()&&this.eat(st._function))return this.overrideContext(dt.f_expr),this.parseFunction(this.startNodeAt(bt,St),0,!1,!0,pt);if(gt&&!this.canInsertSemicolon()){if(this.eat(st.arrow))return this.parseArrowExpression(this.startNodeAt(bt,St),[Pt],!1,pt);if(this.ecmaVersion>=8&&Pt.name==="async"&&this.type===st.name&&!kt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Pt=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(st.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(bt,St),[Pt],!0,pt)}}return Pt}else return super.parseExprAtom(ot,pt,ft)}parseExprAtomDefault(){if(vt(this.type)){let ot=this.potentialArrowAt===this.start,pt=this.containsEsc,ft=this.parseIdent();if(!pt&&ft.name==="async"&&!this.canInsertSemicolon()){let{type:gt}=this;if(gt===st._function)return this.next(),this.parseFunction(this.startNodeAtNode(ft),void 0,!0,!0);else if(vt(gt))if(this.lookaheadCharCode()===61){let bt=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(st.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(ft),[bt],!0)}else return ft}if(ot&&this.match(st.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(ft),[ft],!1);return ft}else this.unexpected()}parseIdentNode(){let ot=this.startNode();if(Rt(this.type)&&!((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)))ot.name=this.value;else return super.parseIdentNode();return ot}parseVarStatement(ot,pt,ft=!1){let{isAmbientContext:gt}=this;this.next(),super.parseVar(ot,!1,pt,ft||gt),this.semicolon();let bt=this.finishNode(ot,"VariableDeclaration");if(!gt)return bt;for(let{id:St,init:kt}of bt.declarations){if(!kt)continue;if(pt!=="const"||!!St.typeAnnotation)this.raise(kt.start,$t.InitializerNotAllowedInAmbientContext);else if(kt.type!=="Literal"&&(kt.type!=="TemplateLiteral"||kt.expressions.length>0)&&!zh(kt)&&!Kh(kt))this.raise(kt.start,$t.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return bt}parseStatement(ot,pt,ft){if(this.match(yt.at))this.parseDecorators(!0);if(this.match(st._const)&&this.isLookaheadContextual("enum")){let gt=this.startNode();return this.expect(st._const),this.tsParseEnumDeclaration(gt,{const:!0})}if(this.ts_isContextual(yt.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(yt.interface)){let gt=this.tsParseInterfaceDeclaration(this.startNode());if(gt)return gt}return super.parseStatement(ot,pt,ft)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(ot){if(this.eat(st.question))ot.optional=!0;if(ot.readonly&&this.match(st.parenL))this.raise(ot.start,$t.ClassMethodHasReadonly);if(ot.declare&&this.match(st.parenL))this.raise(ot.start,$t.ClassMethodHasDeclare)}parseExpressionStatement(ot,pt){return(pt.type==="Identifier"?this.tsParseExpressionStatement(ot,pt):void 0)||super.parseExpressionStatement(ot,pt)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(yt.at))return!0;return super.shouldParseExportStatement()}parseConditional(ot,pt,ft,gt,bt){if(this.eat(st.question)){let St=this.startNodeAt(pt,ft);return St.test=ot,St.consequent=this.parseMaybeAssign(),this.expect(st.colon),St.alternate=this.parseMaybeAssign(gt),this.finishNode(St,"ConditionalExpression")}return ot}parseMaybeConditional(ot,pt){let ft=this.start,gt=this.startLoc,bt=this.parseExprOps(ot,pt);if(this.checkExpressionErrors(pt))return bt;if(!this.maybeInArrowParameters||!this.match(st.question))return this.parseConditional(bt,ft,gt,ot,pt);let St=this.tryParse(()=>this.parseConditional(bt,ft,gt,ot,pt));if(!St.node){if(St.error)this.setOptionalParametersError(pt,St.error);return bt}return St.node}parseParenItem(ot){let pt=this.start,ft=this.startLoc;if(ot=super.parseParenItem(ot),this.eat(st.question))ot.optional=!0,this.resetEndLocation(ot);if(this.match(st.colon)){let gt=this.startNodeAt(pt,ft);return gt.expression=ot,gt.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(gt,"TSTypeCastExpression")}return ot}parseExportDeclaration(ot){if(!this.isAmbientContext&&this.ts_isContextual(yt.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(ot));let pt=this.start,ft=this.startLoc,gt=this.eatContextual("declare");if(gt&&(this.ts_isContextual(yt.declare)||!this.shouldParseExportStatement()))this.raise(this.start,$t.ExpectedAmbientAfterExportDeclare);let St=vt(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!St)return null;if(St.type==="TSInterfaceDeclaration"||St.type==="TSTypeAliasDeclaration"||gt)ot.exportKind="type";if(gt)this.resetStartLocation(St,pt,ft),St.declare=!0;return St}parseClassId(ot,pt){if(!pt&&this.isContextual("implements"))return;super.parseClassId(ot,pt);let ft=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if(ft)ot.typeParameters=ft}parseClassPropertyAnnotation(ot){if(!ot.optional){if(this.value==="!"&&this.eat(st.prefix))ot.definite=!0;else if(this.eat(st.question))ot.optional=!0}let pt=this.tsTryParseTypeAnnotation();if(pt)ot.typeAnnotation=pt}parseClassField(ot){if(ot.key.type==="PrivateIdentifier"){if(ot.abstract)this.raise(ot.start,$t.PrivateElementHasAbstract);if(ot.accessibility)this.raise(ot.start,$t.PrivateElementHasAccessibility({modifier:ot.accessibility}));this.parseClassPropertyAnnotation(ot)}else{if(this.parseClassPropertyAnnotation(ot),this.isAmbientContext&&!(ot.readonly&&!ot.typeAnnotation)&&this.match(st.eq))this.raise(this.start,$t.DeclareClassFieldHasInitializer);if(ot.abstract&&this.match(st.eq)){let{key:ft}=ot;this.raise(this.start,$t.AbstractPropertyHasInitializer({propertyName:ft.type==="Identifier"&&!ot.computed?ft.name:`[${this.input.slice(ft.start,ft.end)}]`}))}}return super.parseClassField(ot)}parseClassMethod(ot,pt,ft,gt){let bt=ot.kind==="constructor",St=ot.key.type==="PrivateIdentifier",kt=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(St){if(kt)ot.typeParameters=kt;if(ot.accessibility)this.raise(ot.start,$t.PrivateMethodsHasAccessibility({modifier:ot.accessibility}))}else if(kt&&bt)this.raise(kt.start,$t.ConstructorHasTypeParameters);let{declare:Pt=!1,kind:wt}=ot;if(Pt&&(wt==="get"||wt==="set"))this.raise(ot.start,$t.DeclareAccessor({kind:wt}));if(kt)ot.typeParameters=kt;let Tt=ot.key;if(ot.kind==="constructor"){if(pt)this.raise(Tt.start,"Constructor can't be a generator");if(ft)this.raise(Tt.start,"Constructor can't be an async method")}else if(ot.static&&Ap(ot,"prototype"))this.raise(Tt.start,"Classes may not have a static property named prototype");let Dt=ot.value=this.parseMethod(pt,ft,gt,!0,ot);if(ot.kind==="get"&&Dt.params.length!==0)this.raiseRecoverable(Dt.start,"getter should have no params");if(ot.kind==="set"&&Dt.params.length!==1)this.raiseRecoverable(Dt.start,"setter should have exactly one param");if(ot.kind==="set"&&Dt.params[0].type==="RestElement")this.raiseRecoverable(Dt.params[0].start,"Setter cannot use rest params");return this.finishNode(ot,"MethodDefinition")}isClassMethod(){return this.match(st.relational)}parseClassElement(ot){if(this.eat(st.semi))return null;let pt=this.startNode(),ft="",gt=!1,bt=!1,St="method",kt=!1,Pt=["declare","private","public","protected","accessor","override","abstract","readonly","static"],wt=this.tsParseModifiers({modified:pt,allowedModifiers:Pt,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:$t.InvalidModifierOnTypeParameterPositions});kt=Boolean(wt.static);let Tt=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(pt,Pt))this.raise(this.start,$t.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(pt),pt}else{let Dt=this.tsTryParseIndexSignature(pt);if(Dt){if(pt.abstract)this.raise(pt.start,$t.IndexSignatureHasAbstract);if(pt.accessibility)this.raise(pt.start,$t.IndexSignatureHasAccessibility({modifier:pt.accessibility}));if(pt.declare)this.raise(pt.start,$t.IndexSignatureHasDeclare);if(pt.override)this.raise(pt.start,$t.IndexSignatureHasOverride);return Dt}if(!this.inAbstractClass&&pt.abstract)this.raise(pt.start,$t.NonAbstractClassHasAbstractMethod);if(pt.override){if(!ot)this.raise(pt.start,$t.OverrideNotInSubClass)}if(pt.static=kt,kt){if(!(this.isClassElementNameStart()||this.type===st.star))ft="static"}if(!ft&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===st.star)&&!this.canInsertSemicolon())bt=!0;else ft="async";if(!ft&&(this.ecmaVersion>=9||!bt)&&this.eat(st.star))gt=!0;if(!ft&&!bt&&!gt){let Lt=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())St=Lt;else ft=Lt}if(ft)pt.computed=!1,pt.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),pt.key.name=ft,this.finishNode(pt.key,"Identifier");else this.parseClassElementName(pt);if(this.parsePostMemberNameModifiers(pt),this.isClassMethod()||this.ecmaVersion<13||this.type===st.parenL||St!=="method"||gt||bt){let Lt=!pt.static&&Ap(pt,"constructor"),Ft=Lt&&ot;if(Lt&&St!=="method")this.raise(pt.key.start,"Constructor can't have get/set modifier");pt.kind=Lt?"constructor":St,this.parseClassMethod(pt,gt,bt,Ft)}else this.parseClassField(pt);return pt}};if(pt.declare)this.tsInAmbientContext(Tt);else Tt();return pt}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper(ot){if(super.parseClassSuper(ot),ot.superClass&&(this.tsMatchLeftRelational()||this.match(st.bitShift)))ot.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))ot.implements=this.tsParseHeritageClause("implements")}parseFunctionParams(ot){let pt=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(pt)ot.typeParameters=pt;super.parseFunctionParams(ot)}parseVarId(ot,pt){if(super.parseVarId(ot,pt),ot.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(st.prefix))ot.definite=!0;let ft=this.tsTryParseTypeAnnotation();if(ft)ot.id.typeAnnotation=ft,this.resetEndLocation(ot.id)}parseArrowExpression(ot,pt,ft,gt){if(this.match(st.colon))ot.returnType=this.tsParseTypeAnnotation();let bt=this.yieldPos,St=this.awaitPos,kt=this.awaitIdentPos;this.enterScope(Lo(ft,!1)|Jt.SCOPE_ARROW),this.initFunction(ot);let Pt=this.maybeInArrowParameters;if(this.ecmaVersion>=8)ot.async=!!ft;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,ot.params=this.toAssignableList(pt,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(ot,!0,!1,gt),this.yieldPos=bt,this.awaitPos=St,this.awaitIdentPos=kt,this.maybeInArrowParameters=Pt,this.finishNode(ot,"ArrowFunctionExpression")}parseYield(ot){if(!this.yieldPos)this.yieldPos=this.start;let pt=this.startNode();this.next();let ft=this.tsMatchLeftRelational();if(!(!this.match(st.semi)&&!this.canInsertSemicolon()&&(this.match(st.star)||this.type.startsExpr||ft)))return pt.delegate=!1,pt.argument=null,this.finishNode(pt,"YieldExpression");return pt.delegate=this.eat(st.star),pt.argument=this.parseMaybeAssign(ot),this.finishNode(pt,"YieldExpression")}parseMaybeAssignOrigin(ot,pt,ft){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(ot);else this.exprAllowed=!1;let gt=!1,bt=-1,St=-1,kt=-1;if(pt)bt=pt.parenthesizedAssign,St=pt.trailingComma,kt=pt.doubleProto,pt.parenthesizedAssign=pt.trailingComma=-1;else pt=new fs,gt=!0;let Pt=this.start,wt=this.startLoc;if(this.type===st.parenL||vt(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=ot==="await";let Tt=this.parseMaybeConditional(ot,pt);if(ft)Tt=ft.call(this,Tt,Pt,wt);if(this.type.isAssign){let Dt=this.startNodeAt(Pt,wt);if(Dt.operator=this.value,this.type===st.eq)Tt=this.toAssignable(Tt,!0,pt,!0);if(!gt)pt.parenthesizedAssign=pt.trailingComma=pt.doubleProto=-1;if(pt.shorthandAssign>=Tt.start)pt.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===st.eq)this.checkLValPattern(Tt);else this.checkLValSimple(Tt);if(Dt.left=Tt,this.next(),Dt.right=this.parseMaybeAssign(ot),kt>-1)pt.doubleProto=kt;return this.finishNode(Dt,"AssignmentExpression")}else if(gt)this.checkExpressionErrors(pt,!0);if(bt>-1)pt.parenthesizedAssign=bt;if(St>-1)pt.trailingComma=St;return Tt}parseMaybeAssign(ot,pt,ft){let gt,bt;if(o?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(gt=this.tryParse(()=>this.parseMaybeAssignOrigin(ot,pt,ft)),!gt.error)return gt.node;let Pt=this.context,wt=Pt[Pt.length-1],Tt=Pt[Pt.length-2];if(wt===it.tokContexts.tc_oTag&&Tt===it.tokContexts.tc_expr)this.parseEffects.pop(Pt),this.parseEffects.pop(Pt);else if(wt===it.tokContexts.tc_oTag||wt===it.tokContexts.tc_expr)this.parseEffects.pop(Pt)}if(!gt?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(ot,pt,ft);let St,kt=this.tryParse((Pt)=>{St=this.tsParseTypeParameters(this.tsParseConstModifier);let wt=this.parseMaybeAssignOrigin(ot,pt,ft);if(wt.type!=="ArrowFunctionExpression"||wt.extra?.parenthesized)Pt();if(St?.params.length!==0)this.resetStartLocationFromNode(wt,St);return wt.typeParameters=St,wt});if(!kt.error&&!kt.aborted){if(St)this.reportReservedArrowTypeParam(St);return kt.node}if(!gt){if(_p(!0),bt=this.tryParse(()=>this.parseMaybeAssignOrigin(ot,pt,ft)),!bt.error)return bt.node}if(gt?.thrown)throw this.selectTryParseResult(gt),gt.error;if(kt.thrown)throw this.selectTryParseResult(kt),kt.error;if(bt?.thrown)throw this.selectTryParseResult(bt),bt.error;throw gt?.error||kt.error||bt?.error}parseAssignableListItem(ot){let pt=[];while(this.match(yt.at))pt.push(this.parseDecorator());let ft=this.start,gt=this.startLoc,bt,St=!1,kt=!1;if(ot!==void 0){let Tt={};if(this.tsParseModifiers({modified:Tt,allowedModifiers:["public","private","protected","override","readonly"]}),bt=Tt.accessibility,kt=Tt.override,St=Tt.readonly,ot===!1&&(bt||St||kt))this.raise(gt.column,$t.UnexpectedParameterModifier)}let Pt=this.parseMaybeDefault(ft,gt);this.parseBindingListItem(Pt);let wt=this.parseMaybeDefault(Pt.start,Pt.loc.start,Pt);if(pt.length)wt.decorators=pt;if(bt||St||kt){let Tt=this.startNodeAt(ft,gt);if(bt)Tt.accessibility=bt;if(St)Tt.readonly=St;if(kt)Tt.override=kt;if(wt.type!=="Identifier"&&wt.type!=="AssignmentPattern")this.raise(Tt.start,$t.UnsupportedParameterPropertyKind);return Tt.parameter=wt,this.finishNode(Tt,"TSParameterProperty")}return wt}checkLValInnerPattern(ot,pt=Jt.BIND_NONE,ft){switch(ot.type){case"TSParameterProperty":this.checkLValInnerPattern(ot.parameter,pt,ft);break;default:{super.checkLValInnerPattern(ot,pt,ft);break}}}parseBindingListItem(ot){if(this.eat(st.question)){if(ot.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise(ot.start,$t.PatternIsOptional);ot.optional=!0}let pt=this.tsTryParseTypeAnnotation();if(pt)ot.typeAnnotation=pt;return this.resetEndLocation(ot),ot}isAssignable(ot,pt){switch(ot.type){case"TSTypeCastExpression":return this.isAssignable(ot.expression,pt);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let ft=ot.properties.length-1;return ot.properties.every((gt,bt)=>gt.type!=="ObjectMethod"&&(bt===ft||gt.type!=="SpreadElement")&&this.isAssignable(gt))}case"Property":case"ObjectProperty":return this.isAssignable(ot.value);case"SpreadElement":return this.isAssignable(ot.argument);case"ArrayExpression":return ot.elements.every((ft)=>ft===null||this.isAssignable(ft));case"AssignmentExpression":return ot.operator==="=";case"ParenthesizedExpression":return this.isAssignable(ot.expression);case"MemberExpression":case"OptionalMemberExpression":return!pt;default:return!1}}toAssignable(ot,pt=!1,ft=new fs,gt=!1){switch(ot.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(ot,pt,ft,gt);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(pt);else this.raise(ot.start,$t.UnexpectedTypeCastInParameter);let bt=this.toAssignable(ot.expression,pt,ft,gt);if(gt)return ot.expression=bt,ot;return bt;case"MemberExpression":break;case"AssignmentExpression":if(!pt&&ot.left.type==="TSTypeCastExpression")ot.left=this.typeCastToParameter(ot.left);return super.toAssignable(ot,pt,ft);case"TSTypeCastExpression":return this.typeCastToParameter(ot);default:return super.toAssignable(ot,pt,ft)}return ot}toAssignableParenthesizedExpression(ot,pt,ft,gt=!1){switch(ot.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let bt=this.toAssignable(ot.expression,pt,ft,gt);if(gt)return ot.expression=bt,ot;return bt;default:return super.toAssignable(ot,pt,ft)}}parseBindingAtom(){switch(this.type){case st._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(ot){let pt;if(this.match(st.colon))pt=ot.every((ft)=>this.isAssignable(ft,!0));else pt=!this.canInsertSemicolon();if(pt){if(this.match(st.colon)){let ft=this.tryParse((gt)=>{let bt=this.tsParseTypeOrTypePredicateAnnotation(st.colon);if(this.canInsertSemicolon()||!this.match(st.arrow))gt();return bt});if(ft.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!ft.thrown)this.shouldParseArrowReturnType=ft.node}if(!this.match(st.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,pt}parseParenArrowList(ot,pt,ft,gt){let bt=this.startNodeAt(ot,pt);return bt.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(bt,ft,!1,gt)}parseParenAndDistinguishExpression(ot,pt){let ft=this.start,gt=this.startLoc,bt,St=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let kt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let Pt=this.start,wt=this.startLoc,Tt=[],Dt=!0,Lt=!1,Ft=new fs,Kt=this.yieldPos,nn=this.awaitPos,dn;this.yieldPos=0,this.awaitPos=0;while(this.type!==st.parenR)if(Dt?Dt=!1:this.expect(st.comma),St&&this.afterTrailingComma(st.parenR,!0)){Lt=!0;break}else if(this.type===st.ellipsis){if(dn=this.start,Tt.push(this.parseParenItem(this.parseRestBinding())),this.type===st.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else Tt.push(this.parseMaybeAssign(!1,Ft,this.parseParenItem));let mn=this.lastTokEnd,un=this.lastTokEndLoc;if(this.expect(st.parenR),this.maybeInArrowParameters=kt,ot&&this.shouldParseArrow(Tt)&&this.eat(st.arrow))return this.checkPatternErrors(Ft,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Kt,this.awaitPos=nn,this.parseParenArrowList(ft,gt,Tt,pt);if(!Tt.length||Lt)this.unexpected(this.lastTokStart);if(dn)this.unexpected(dn);if(this.checkExpressionErrors(Ft,!0),this.yieldPos=Kt||this.yieldPos,this.awaitPos=nn||this.awaitPos,Tt.length>1)bt=this.startNodeAt(Pt,wt),bt.expressions=Tt,this.finishNodeAt(bt,"SequenceExpression",mn,un);else bt=Tt[0]}else bt=this.parseParenExpression();if(this.options.preserveParens){let kt=this.startNodeAt(ft,gt);return kt.expression=bt,this.finishNode(kt,"ParenthesizedExpression")}else return bt}parseTaggedTemplateExpression(ot,pt,ft,gt){let bt=this.startNodeAt(pt,ft);if(bt.tag=ot,bt.quasi=this.parseTemplate({isTagged:!0}),gt)this.raise(pt,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(bt,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(st.colon)){let ot=this.tryParse((pt)=>{let ft=this.tsParseTypeOrTypePredicateAnnotation(st.colon);if(this.canInsertSemicolon()||!this.match(st.arrow))pt();return ft});if(ot.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!ot.thrown)return this.shouldParseAsyncArrowReturnType=ot.node,!this.canInsertSemicolon()&&this.eat(st.arrow)}else return!this.canInsertSemicolon()&&this.eat(st.arrow)}parseSubscriptAsyncArrow(ot,pt,ft,gt){let bt=this.startNodeAt(ot,pt);return bt.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(bt,ft,!0,gt)}parseExprList(ot,pt,ft,gt){let bt=[],St=!0;while(!this.eat(ot)){if(!St){if(this.expect(st.comma),pt&&this.afterTrailingComma(ot))break}else St=!1;let kt;if(ft&&this.type===st.comma)kt=null;else if(this.type===st.ellipsis){if(kt=this.parseSpread(gt),this.maybeInArrowParameters&&this.match(st.colon))kt.typeAnnotation=this.tsParseTypeAnnotation();if(gt&&this.type===st.comma&>.trailingComma<0)gt.trailingComma=this.start}else kt=this.parseMaybeAssign(!1,gt,this.parseParenItem);bt.push(kt)}return bt}parseMaybeDecoratorArguments(ot){let pt=this.tsMatchLeftRelational()||this.match(st.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(st.parenL)){let ft=this.startNodeAtNode(ot);if(ft.callee=ot,ft.arguments=this.parseExprList(st.parenR,!1),pt)ft.typeArguments=pt;return this.finishNode(ft,"CallExpression")}if(pt){let ft=this.startNodeAtNode(ot);return ft.expression=ot,ft.typeArguments=pt,this.finishNode(ft,"TSInstantiationExpression")}return ot}parseSubscript(ot,pt,ft,gt,bt,St,kt){let Pt=St;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(st.prefix)){this.exprAllowed=!1,this.next();let Ft=this.startNodeAt(pt,ft);return Ft.expression=ot,ot=this.finishNode(Ft,"TSNonNullExpression"),ot}let wt=!1;if(this.match(st.questionDot)&&this.lookaheadCharCode()===60){if(gt)return ot;ot.optional=!0,Pt=wt=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(st.bitShift)){let Ft,Kt=this.tsTryParseAndCatch(()=>{if(!gt&&this.atPossibleAsyncArrow(ot)){let un=this.tsTryParseGenericAsyncArrowFunction(pt,ft,kt);if(un)return ot=un,ot}let nn=this.tsParseTypeArgumentsInExpression();if(!nn)return ot;if(wt&&!this.match(st.parenL))return Ft=this.curPosition(),ot;if(At(this.type)||this.type===st.backQuote){let un=this.parseTaggedTemplateExpression(ot,pt,ft,Pt);return un.typeArguments=nn,un}if(!gt&&this.eat(st.parenL)){let un=new fs,fn=this.startNodeAt(pt,ft);if(fn.callee=ot,fn.arguments=this.parseExprList(st.parenR,this.ecmaVersion>=8,!1,un),this.tsCheckForInvalidTypeCasts(fn.arguments),fn.typeArguments=nn,Pt)fn.optional=wt;return this.checkExpressionErrors(un,!0),ot=this.finishNode(fn,"CallExpression"),ot}let dn=this.type;if(this.tsMatchRightRelational()||dn===st.bitShift||dn!==st.parenL&&Xh(dn)&&!this.hasPrecedingLineBreak())return;let mn=this.startNodeAt(pt,ft);return mn.expression=ot,mn.typeArguments=nn,this.finishNode(mn,"TSInstantiationExpression")});if(Ft)this.unexpected(Ft);if(Kt){if(Kt.type==="TSInstantiationExpression"&&(this.match(st.dot)||this.match(st.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,$t.InvalidPropertyAccessAfterInstantiationExpression);return ot=Kt,ot}}let Tt=this.ecmaVersion>=11,Dt=Tt&&this.eat(st.questionDot);if(gt&&Dt)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let Lt=this.eat(st.bracketL);if(Lt||Dt&&this.type!==st.parenL&&this.type!==st.backQuote||this.eat(st.dot)){let Ft=this.startNodeAt(pt,ft);if(Ft.object=ot,Lt)Ft.property=this.parseExpression(),this.expect(st.bracketR);else if(this.type===st.privateId&&ot.type!=="Super")Ft.property=this.parsePrivateIdent();else Ft.property=this.parseIdent(this.options.allowReserved!=="never");if(Ft.computed=!!Lt,Tt)Ft.optional=Dt;ot=this.finishNode(Ft,"MemberExpression")}else if(!gt&&this.eat(st.parenL)){let Ft=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let Kt=new fs,nn=this.yieldPos,dn=this.awaitPos,mn=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let un=this.parseExprList(st.parenR,this.ecmaVersion>=8,!1,Kt);if(bt&&!Dt&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Kt,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=nn,this.awaitPos=dn,this.awaitIdentPos=mn,ot=this.parseSubscriptAsyncArrow(pt,ft,un,kt)}else{this.checkExpressionErrors(Kt,!0),this.yieldPos=nn||this.yieldPos,this.awaitPos=dn||this.awaitPos,this.awaitIdentPos=mn||this.awaitIdentPos;let fn=this.startNodeAt(pt,ft);if(fn.callee=ot,fn.arguments=un,Tt)fn.optional=Dt;ot=this.finishNode(fn,"CallExpression")}this.maybeInArrowParameters=Ft}else if(this.type===st.backQuote){if(Dt||Pt)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let Ft=this.startNodeAt(pt,ft);Ft.tag=ot,Ft.quasi=this.parseTemplate({isTagged:!0}),ot=this.finishNode(Ft,"TaggedTemplateExpression")}return ot}parseGetterSetter(ot){ot.kind=ot.key.name,this.parsePropertyName(ot);let pt=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(ot.value=this.parseMethod(!1),pt)ot.value.typeParameters=pt;let ft=ot.kind==="get"?0:1,gt=ot.value.params[0];if(ft=gt&&this.isThisParam(gt)?ft+1:ft,ot.value.params.length!==ft){let St=ot.value.start;if(ot.kind==="get")this.raiseRecoverable(St,"getter should have no params");else this.raiseRecoverable(St,"setter should have exactly one param")}else if(ot.kind==="set"&&ot.value.params[0].type==="RestElement")this.raiseRecoverable(ot.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue(ot,pt,ft,gt,bt,St,kt,Pt){if(this.tsMatchLeftRelational()){if(pt)this.unexpected();ot.kind="init",ot.method=!0;let wt=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(ot.value=this.parseMethod(ft,gt),wt)ot.value.typeParameters=wt;return}return super.parsePropertyValue(ot,pt,ft,gt,bt,St,kt,Pt)}parseProperty(ot,pt){if(!ot){let ft=[];if(this.match(yt.at))while(this.match(yt.at))ft.push(this.parseDecorator());let gt=super.parseProperty(ot,pt);if(gt.type==="SpreadElement"){if(ft.length)this.raise(gt.start,Zs.SpreadElementDecorator)}if(ft.length)gt.decorators=ft,ft=[];return gt}return super.parseProperty(ot,pt)}parseCatchClauseParam(){let ot=this.parseBindingAtom(),pt=ot.type==="Identifier";this.enterScope(pt?Jt.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(ot,pt?Jt.BIND_SIMPLE_CATCH:Jt.BIND_LEXICAL);let ft=this.tsTryParseTypeAnnotation();if(ft)ot.typeAnnotation=ft,this.resetEndLocation(ot);return this.expect(st.parenR),ot}parseClass(ot,pt){let ft=this.inAbstractClass;this.inAbstractClass=!!ot.abstract;try{this.next(),this.takeDecorators(ot);let gt=this.strict;this.strict=!0,this.parseClassId(ot,pt),this.parseClassSuper(ot);let bt=this.enterClassBody(),St=this.startNode(),kt=!1;St.body=[];let Pt=[];this.expect(st.braceL);while(this.type!==st.braceR){if(this.match(yt.at)){Pt.push(this.parseDecorator());continue}let wt=this.parseClassElement(ot.superClass!==null);if(Pt.length)wt.decorators=Pt,this.resetStartLocationFromNode(wt,Pt[0]),Pt=[];if(wt){if(St.body.push(wt),wt.type==="MethodDefinition"&&wt.kind==="constructor"&&wt.value.type==="FunctionExpression"){if(kt)this.raiseRecoverable(wt.start,"Duplicate constructor in the same class");if(kt=!0,wt.decorators&&wt.decorators.length>0)this.raise(wt.start,Zs.DecoratorConstructor)}else if(wt.key&&wt.key.type==="PrivateIdentifier"&&wt.value?.type!=="TSDeclareMethod"){let Tt=wt.key.name;if(this.parseEffects.modify(bt,Tt,(Lt)=>Ih(Lt,wt)))this.raiseRecoverable(wt.key.start,`Identifier '#${Tt}' has already been declared`)}}}if(this.strict=gt,this.next(),Pt.length)this.raise(this.start,Zs.TrailingDecorator);return ot.body=this.finishNode(St,"ClassBody"),this.exitClassBody(),this.finishNode(ot,pt?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=ft}}parseClassFunctionParams(){let ot=this.tsTryParseTypeParameters(),pt=this.parseBindingList(st.parenR,!1,this.ecmaVersion>=8,!0);if(ot)pt.typeParameters=ot;return pt}parseMethod(ot,pt,ft,gt,bt){let St=this.startNode(),kt=this.yieldPos,Pt=this.awaitPos,wt=this.awaitIdentPos;if(this.initFunction(St),this.ecmaVersion>=6)St.generator=ot;if(this.ecmaVersion>=8)St.async=!!pt;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Lo(pt,St.generator)|Jt.SCOPE_SUPER|(ft?Jt.SCOPE_DIRECT_SUPER:0)),this.expect(st.parenL),St.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(St,!1,!0,!1,{isClassMethod:gt}),this.yieldPos=kt,this.awaitPos=Pt,this.awaitIdentPos=wt,bt&&bt.abstract){if(!!St.body){let{key:Dt}=bt;this.raise(bt.start,$t.AbstractMethodHasImplementation({methodName:Dt.type==="Identifier"&&!bt.computed?Dt.name:`[${this.input.slice(Dt.start,Dt.end)}]`}))}}return this.finishNode(St,"FunctionExpression")}static parse(ot,pt){if(pt.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else pt.locations=!0;let ft=new this(pt,ot);if(et)ft.isAmbientContext=!0;return ft.parse()}static parseExpressionAt(ot,pt,ft){if(ft.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else ft.locations=!0;let gt=new this(ft,ot,pt);if(et)gt.isAmbientContext=!0;return gt.nextToken(),gt.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(yt.type)){let pt=this.startNode();return pt.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(pt,!0,this.importOrExportOuterKind==="type"),this.finishNode(pt,"ImportSpecifier")}else{let pt=super.parseImportSpecifier();return pt.importKind="value",pt}}parseExportSpecifier(ot){let pt=this.ts_isContextual(yt.type);if(!this.match(st.string)&&pt){let gt=this.startNode();return gt.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(gt,!1,this.importOrExportOuterKind==="type"),this.finishNode(gt,"ExportSpecifier"),this.checkExport(ot,gt.exported,gt.exported.start),gt}else{let gt=super.parseExportSpecifier(ot);return gt.exportKind="value",gt}}parseTypeOnlyImportExportSpecifier(ot,pt,ft){let gt=pt?"imported":"local",bt=pt?"local":"exported",St=ot[gt],kt,Pt=!1,wt=!0,Tt=St.start;if(this.isContextual("as")){let Lt=this.parseIdent();if(this.isContextual("as")){let Ft=this.parseIdent();if(Rt(this.type))Pt=!0,St=Lt,kt=pt?this.parseIdent():this.parseModuleExportName(),wt=!1;else kt=Ft,wt=!1}else if(Rt(this.type))wt=!1,kt=pt?this.parseIdent():this.parseModuleExportName();else Pt=!0,St=Lt}else if(Rt(this.type))if(Pt=!0,pt){if(St=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(St)}else St=this.parseModuleExportName();if(Pt&&ft)this.raise(Tt,pt?$t.TypeModifierIsUsedInTypeImports:$t.TypeModifierIsUsedInTypeExports);ot[gt]=St,ot[bt]=kt;let Dt=pt?"importKind":"exportKind";if(ot[Dt]=Pt?"type":"value",wt&&this.eatContextual("as"))ot[bt]=pt?this.parseIdent():this.parseModuleExportName();if(!ot[bt])ot[bt]=this.copyNode(ot[gt]);if(pt)this.checkLValSimple(ot[bt],Jt.BIND_LEXICAL)}raiseCommonCheck(ot,pt,ft){switch(pt){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(st.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(ot,pt)}return ft?super.raiseRecoverable(ot,pt):super.raise(ot,pt)}raiseRecoverable(ot,pt){return this.raiseCommonCheck(ot,pt,!0)}raise(ot,pt){return this.raiseCommonCheck(ot,pt,!0)}updateContext(ot){let{type:pt}=this;if(pt==st.braceL){var ft=this.curContext();if(ft==xt.tc_oTag)this.parseEffects.append(this.context,dt.b_expr);else if(ft==xt.tc_expr)this.parseEffects.append(this.context,dt.b_tmpl);else super.updateContext(ot);this.exprAllowed=!0}else if(pt===st.slash&&ot===yt.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,xt.tc_cTag),this.exprAllowed=!1;else return super.updateContext(ot)}jsx_parseOpeningElementAt(ot,pt){let ft=this.startNodeAt(ot,pt),gt=this.jsx_parseElementName();if(gt)ft.name=gt;if(this.match(st.relational)||this.match(st.bitShift)){let bt=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(bt)ft.typeArguments=bt}ft.attributes=[];while(this.type!==st.slash&&this.type!==yt.jsxTagEnd)ft.attributes.push(this.jsx_parseAttribute());return ft.selfClosing=this.eat(st.slash),this.expect(yt.jsxTagEnd),this.finishNode(ft,gt?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(ot){let pt=ot===ds;if(pt)this.parseEffects.append(this.importsStack,[]);let ft=pt?ot|Jt.SCOPE_CLASS_STATIC_BLOCK:ot;super.enterScope(ft);let gt=super.currentScope();gt.types=[],gt.enums=[],gt.constEnums=[],gt.classes=[],gt.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&ds)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport(ot,pt){let ft=this.importsStack.length;if(this.importsStack[ft-1].indexOf(ot)>-1)return!0;if(!pt&&ft>1){for(let gt=0;gt<ft-1;gt++)if(this.importsStack[gt].indexOf(ot)>-1)return!0}return!1}maybeExportDefined(ot,pt){if(this.inModule&&ot.flags&Jt.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,pt)}declareName(ot,pt,ft){if(pt&Jt.BIND_FLAGS_TS_IMPORT){if(this.hasImport(ot,!0))this.raise(ft,`Identifier '${ot}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],ot);return}let gt=this.currentScope();if(pt&Jt.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(gt,ot),this.parseEffects.append(gt.exportOnlyBindings,ot);return}if(pt===Jt.BIND_TS_TYPE||pt===Jt.BIND_TS_INTERFACE){if(pt===Jt.BIND_TS_TYPE&>.types.includes(ot))this.raise(ft,`type '${ot}' has already been declared.`);this.parseEffects.append(gt.types,ot)}else if(pt&Jt.BIND_FLAGS_TS_ENUM){if(gt.enums.includes(ot))return;super.declareName(ot,Jt.BIND_LEXICAL,ft)}else super.declareName(ot,pt,ft);if(pt&Jt.BIND_FLAGS_TS_ENUM)this.parseEffects.append(gt.enums,ot);if(pt&Jt.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(gt.constEnums,ot);if(pt&Jt.BIND_FLAGS_CLASS)this.parseEffects.append(gt.classes,ot)}checkLocalExport(ot){let{name:pt}=ot;if(this.hasImport(pt))return;let ft=this.scopeStack.length;for(let gt=ft-1;gt>=0;gt--){let bt=this.scopeStack[gt];if(bt.types.indexOf(pt)>-1||bt.exportOnlyBindings.indexOf(pt)>-1)return}super.checkLocalExport(ot)}}return tn}}var Qh=/\n/,Zh=/[ \t]/,em=/^[,) \t]*$/,ti="",qp=[];function ni(o,et){ti=o,qp=et}function ri(o,et,tt,nt){let rt=et;if(o&&Qh.test(rt)){let it=tt;while(it>0&&ti[it-1]!==`
|
|
12
|
+
`)it-=1;let st=it;while(Zh.test(ti[st]))st+=1;let at=ti.slice(it,st);rt=tm(rt,at)}qp.push({type:o?"Block":"Line",value:rt,start:tt,end:nt})}function tm(o,et){if(et==="")return o;return(o.startsWith(et)?o.slice(et.length):o).replaceAll(`
|
|
13
|
+
${et}`,`
|
|
14
|
+
`)}function Bo(o,et,tt,nt){let rt=nm(tt,nt);if(rt>=tt.length)return;$o(o,void 0,tt,{index:rt},et)}function nm(o,et){let tt=0,nt=o.length;while(tt<nt){let rt=tt+nt>>>1;if(o[rt].start<et)tt=rt+1;else nt=rt}return tt}function $o(o,et,tt,nt,rt){while(nt.index<tt.length&&tt[nt.index].start<(o.start??0))o.leadingComments??=[],o.leadingComments.push(tt[nt.index]),nt.index++;if(nt.index>=tt.length)return;let it=tt[nt.index].start,st=o.end,ct=st===void 0||st>it?Object.keys(o):[];for(let lt=0;lt<ct.length;lt++){let ut=ct[lt];if(ut==="type"||ut==="leadingComments")continue;let dt=o[ut];if(!dt||typeof dt!=="object")continue;if(Array.isArray(dt)){for(let ht of dt)if(ht&&typeof ht==="object"&&typeof ht.type==="string"){if($o(ht,o,tt,nt,rt),nt.index>=tt.length)return}}else if(typeof dt.type==="string"){if($o(dt,o,tt,nt,rt),nt.index>=tt.length)return}}if(nt.index<tt.length){let lt=tt[nt.index];if(et===void 0||o.end!==et.end){let ut=rt.slice(o.end??0,lt.start);if((et?.type==="BlockStatement"||et?.type==="Program")&&Mo(et.body,o)||et?.type==="ArrayExpression"&&Mo(et.elements,o)||et?.type==="ObjectExpression"&&Mo(et.properties,o))while(nt.index<tt.length){if(et&&tt[nt.index].start>=(et.end??Number.POSITIVE_INFINITY))break;nt.index++}else if((o.end??0)<=lt.start&&em.test(ut))nt.index++}}}function Mo(o,et){return!!o&&o.indexOf(et)===o.length-1}var si={sawParenthesized:!1},Hp=(o)=>class extends o{parseParenAndDistinguishExpression(et,tt){let nt=super.parseParenAndDistinguishExpression(et,tt);if(nt.type==="ParenthesizedExpression")si.sawParenthesized=!0;return nt}parseDecorator(){return si.sawParenthesized=!0,super.parseDecorator()}},Kp=(o)=>class extends o{checkLocalExport(){}},rm=pn.extend(Hp,Kp),sm=pn.extend(Wp(),Hp,Kp);function Wo(o){return o?sm:rm}var im={onComment:ri,sourceType:"module",ecmaVersion:16},zp={onComment:ri,sourceType:"module",ecmaVersion:16,preserveParens:!0},om={onComment:ri,sourceType:"module",ecmaVersion:16},Gp={...zp,startLocation:null},Fo=/\r\n?|\n|\u2028|\u2029/g;function am(o,et){if(et?.breakEnds)return et.breakEnds;let tt=[];Fo.lastIndex=0;while(Fo.test(o))tt.push(Fo.lastIndex);if(et)et.breakEnds=tt;return tt}function cm(o,et,tt){let nt=o.lastIndexOf(`
|
|
15
|
+
`,et-1)+1,rt=am(o,tt),it=0,st=rt.length;while(it<st){let at=it+st>>>1;if(rt[at]<=nt)it=at+1;else st=at}return{line:it+1,column:et-nt}}function Xp(o,et,tt,nt,rt){if(tt.length===rt)return;Bo(o,et,tt,nt)}function mr(o,et,tt){let nt=tt.length;ni(o,tt);let rt=Wo(et).parse(o,im);if(tt.length>0)Bo(rt,o,tt,nt);return rt}var pm={count:0};function Ur(o,et,tt,nt,rt){pm.count+=1;let it=nt.length;ni(o,nt),si.sawParenthesized=!1;let st=zp;if(tt)Gp.startLocation=cm(o,et,rt),st=Gp;let at=Wo(tt).parseExpressionAt(o,et,st);Xp(at,o,nt,et,it);let ct=nt.length>it?nt.at(-1):void 0,lt=ct&&ct.end>(at.end??0)?ct.end:at.end??0;return{node:si.sawParenthesized?lm(at):at,end:lt}}function Jp(o,et,tt,nt){let rt=nt.length,it=Wo(tt);ni(o,nt);let st=new it(om,o,et);st.nextToken();let at=st.parseStatement(null,!0,Object.create(null));return Xp(at,o,nt,et,rt),at}function Up(o){return o!==null&&typeof o==="object"&&typeof o.type==="string"}function jo(o){let et=o;while(et.type==="ParenthesizedExpression"&&et.expression)et=et.expression;return et}function lm(o){let et=jo(o);return Vo(et),et}function Vo(o){for(let et in o){let tt=o[et];if(!tt||typeof tt!=="object")continue;if(Array.isArray(tt))for(let nt=0;nt<tt.length;nt++){let rt=tt[nt];if(!Up(rt))continue;let it=jo(rt);if(it!==rt)tt[nt]=it;Vo(it)}else if(Up(tt)){let nt=jo(tt);if(nt!==tt)o[et]=nt;Vo(nt)}}}function wr(o){if(o===32||o<=13&&o>=9)return!0;if(o<160)return!1;return o===160||o===5760||o>=8192&&o<=8202||o===8232||o===8233||o===8239||o===8287||o===12288||o===65279}class qo{source;index=0;constructor(o){this.source=o}match(o){if(o.length===1)return this.source.charCodeAt(this.index)===o.charCodeAt(0);return this.source.startsWith(o,this.index)}matchRegex(o){o.lastIndex=this.index;let et=o.exec(this.source);if(!et||et.index!==this.index)return null;return et[0]}eat(o,et=!1){if(this.match(o))return this.index+=o.length,!0;if(et)throw new yr(`Expected token ${JSON.stringify(o)}`,this.index);return!1}read(o){let et=this.matchRegex(o);if(et)this.index+=et.length;return et}readUntil(o){if(this.index>=this.source.length)throw new yr("Unexpected end of input",this.source.length);let et=this.index;o.lastIndex=et;let tt=o.exec(this.source);if(tt)return this.index=tt.index,this.source.slice(et,this.index);return this.index=this.source.length,this.source.slice(et)}readUntilString(o){if(this.index>=this.source.length)throw new yr("Unexpected end of input",this.source.length);let et=this.source.indexOf(o,this.index),tt=et===-1?this.source.length:et,nt=this.source.slice(this.index,tt);return this.index=tt,nt}allowWhitespace(){while(this.index<this.source.length&&wr(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!wr(this.source.charCodeAt(this.index)))throw new yr("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let o=this.index,et=o,tt="",nt=this.source.codePointAt(this.index);if(nt!==void 0&&Pn(nt,!0)){et+=nt<=65535?1:2;while(et<this.source.length){let rt=this.source.codePointAt(et);if(rt===void 0||!_n(rt,!0))break;et+=rt<=65535?1:2}tt=this.source.slice(o,et),this.index=et}return{type:"Identifier",name:tt,start:o,end:et}}}class yr extends Error{position;constructor(o,et){super(`${o} (at index ${et})`);this.name="TemplateSyntaxError",this.position=et}}function An(){return{type:"Fragment",nodes:[]}}var um=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"]),dm=["&&","||","??"],fm=["===","!==","==","!="];function Yp(o,et){let tt=o.codePointAt(et);if(tt===void 0||!Pn(tt,!0))return et;let nt=et+(tt<=65535?1:2);while(nt<o.length){let rt=o.codePointAt(nt);if(!_n(rt,!0))break;nt+=rt<=65535?1:2}return nt}function hm(o,et){let tt=et;while(tt<o.length){let nt=o.charCodeAt(tt);if(nt<48||nt>57)break;tt++}return tt}function ii(o,et){let tt=et;while(tt<o.length&&wr(o.charCodeAt(tt)))tt++;return tt}function Qp(o,et){let tt=hm(o,et);if(tt===et)return null;if(o.charCodeAt(et)===48&&tt-et>1)return null;if(tt<o.length){let rt=o.codePointAt(tt);if(rt===46||_n(rt,!0))return null}let nt=o.slice(et,tt);return{type:"Literal",start:et,end:tt,value:Number(nt),raw:nt}}function Zp(o,et){let tt=o.charCodeAt(et),nt=et+1;while(nt<o.length){let rt=o.charCodeAt(nt);if(rt===tt){let it=o.slice(et,nt+1);return{type:"Literal",start:et,end:nt+1,value:o.slice(et+1,nt),raw:it}}if(rt===92||rt===10||rt===13)return null;nt++}return null}function mm(o,et){let tt=o.charCodeAt(et);if(tt===34||tt===39)return Zp(o,et);let nt=Yp(o,et);if(nt===et)return Qp(o,et);let rt=o.slice(et,nt);if(rt==="true"||rt==="false")return{type:"Literal",start:et,end:nt,value:rt==="true",raw:rt};if(rt==="null")return{type:"Literal",start:et,end:nt,value:null,raw:rt};if(um.has(rt))return null;let it={type:"Identifier",start:et,end:nt,name:rt},st=nt;while(st<o.length){let at=o.charCodeAt(st);if(at===46){let ct=st+1,lt=Yp(o,ct);if(lt===ct)return null;let ut={type:"Identifier",start:ct,end:lt,name:o.slice(ct,lt)};it={type:"MemberExpression",start:et,end:lt,object:it,property:ut,computed:!1,optional:!1},st=lt}else if(at===91){let ct=st+1,lt=o.charCodeAt(ct),ut=lt===34||lt===39?Zp(o,ct):Qp(o,ct);if(!ut||o.charCodeAt(ut.end)!==93)return null;it={type:"MemberExpression",start:et,end:ut.end+1,object:it,property:ut,computed:!0,optional:!1},st=ut.end+1}else break}return it}function Go(o,et){if(o.charCodeAt(et)!==33||o.charCodeAt(et+1)===61)return mm(o,et);let tt=Go(o,ii(o,et+1));if(!tt)return null;return{type:"UnaryExpression",start:et,end:tt.end,operator:"!",prefix:!0,argument:tt}}function ym(o,et){for(let tt of fm)if(o.startsWith(tt,et))return{operator:tt,logical:!1};for(let tt of dm)if(o.startsWith(tt,et))return{operator:tt,logical:!0};return null}function el(o,et){let tt=ii(o,et);if(tt>=o.length)return!1;let nt=o.charCodeAt(tt);return nt===125||nt===41}function gm(o){let et=o.source,tt=Go(et,o.index);if(!tt)return null;if(el(et,tt.end))return o.index=tt.end,tt;let nt=ii(et,tt.end),rt=ym(et,nt);if(!rt)return null;let it=Go(et,ii(et,nt+rt.operator.length));if(!it||!el(et,it.end))return null;return o.index=it.end,{type:rt.logical?"LogicalExpression":"BinaryExpression",start:tt.start,end:it.end,left:tt,operator:rt.operator,right:it}}function En(o){let et=gm(o);if(et)return et;let{node:tt,end:nt}=Ur(o.source,o.index,o.isTypeScript,o.root.comments,o.lineTable);return o.index=nt,tt}var xm={"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},Uo=xm;var bm=[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 Em(o,et){if(et&&!o.endsWith(";"))return`${o}\\b(?!=)`;return o}function tl(o){let tt=Object.keys(Uo).map((nt)=>Em(nt,o));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${tt.join("|")})`,"g")}var Ho,Ko;function Cm(o){if(o){if(!Ko)Ko=tl(!0);return Ko}if(!Ho)Ho=tl(!1);return Ho}var nl=0;function vm(o){if(o===10)return 32;if(o<128)return o;if(o<=159)return bm[o-128];if(o<55296)return o;if(o<=57343)return nl;if(o<=65535)return o;if(o>=65536&&o<=131071)return o;if(o>=131072&&o<=196607)return o;if(o>=917504&&o<=917631||o>=917760&&o<=917999)return o;return nl}function zo(o,et){if(o.indexOf("&")===-1)return o;return o.replace(Cm(et),(tt,nt)=>{let rt;if(nt[0]!=="#")rt=Uo[nt];else if(nt[1]==="x")rt=Number.parseInt(nt.substring(2),16);else rt=Number.parseInt(nt.substring(1),10);if(!rt)return tt;return String.fromCodePoint(vm(rt))})}class A extends Error{constructor(o){super(`sveld's template parser doesn't support ${o} yet.`);this.name="TemplateParseNotImplementedError"}}var Sm=/<\/script\s*>/g,Tm=/<\/script\s*>/y,km=/[^\n]/g,Pm=new Set(["server","client","worker","test","default"]);function rl(o,et,tt){let nt=o.index,rt=o.readUntil(Sm);if(o.index>=o.source.length)throw Error("sveld: unclosed <script> tag");let it=o.source.slice(0,nt).replace(km," ")+rt;o.read(Tm);let st=mr(it,o.isTypeScript,o.root.comments);st.start=nt;let at="default";for(let ct of tt){if(Pm.has(ct.name))throw Error(`sveld: "${ct.name}" is a reserved <script> attribute name.`);if(ct.name==="module"){if(ct.value!==!0)throw Error("sveld: <script module> does not take a value.");at="module"}if(ct.name==="context"){let lt=ct.value;if(lt===!0||!Array.isArray(lt)||lt.length!==1||lt[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(lt[0].data!=="module")throw Error('sveld: only context="module" is valid.');at="module"}}return{type:"Script",start:et,end:o.index,context:at,content:st,attributes:tt}}function sl(o,et,tt){let nt=o.index,rt=o.source.indexOf("</style",o.index),it=rt===-1?o.source.length:rt;return o.index=it,o.eat("</style",!0),o.read(/\s*>/y),{type:"StyleSheet",start:et,end:o.index,attributes:tt,children:[],comments:[],content:{start:nt,end:it,styles:o.source.slice(nt,it),comment:null}}}var wm=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Xo(o){return wm.has(o)||o.charCodeAt(0)===33&&o.toLowerCase()==="!doctype"}var Am="^[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}]*)?$",Nm=new RegExp(Am,"u");function il(o){return Nm.test(o)}var Dm=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,ll=/["']/y,_m=/(\/>|[\s"'=<>`])/y,Jo=/<\/textarea(\s[^>]*)?>/iy,Im=/^![a-zA-Z]+$/,Rm=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,Lm=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,ul={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},ol={...ul,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function Om(o){let et=o.charCodeAt(0);if(et<97||et>122)return!1;for(let tt=1;tt<o.length;tt++){let nt=o.charCodeAt(tt);if((nt<97||nt>122)&&(nt<48||nt>57))return!1}return!0}function Mm(o){if(Om(o))return!0;if(Im.test(o))return!0;if(Rm.test(o))return!0;return il(o)}function $m(o){let et=o.charCodeAt(0);if(et>=97&&et<=122&&!o.includes("."))return!1;return!0}function Bm(o){return`Svelte${o.slice(7).split("-").map((tt)=>tt.charAt(0).toUpperCase()+tt.slice(1)).join("")}`}function Fm(o){for(let et=o.length-1;et>=0;et--){let tt=o[et].type;if(tt==="SvelteHead")return!0;if(tt==="RegularElement"||tt==="Component")return!1}return!1}function jm(o){for(let et=o.length-1;et>=0;et--){let tt=o[et];if(tt.type==="RegularElement"&&tt.attributes?.some((nt)=>nt.type==="Attribute"&&nt.name==="shadowrootmode"))return!0}return!1}function al(o){let{source:et,index:tt}=o;if(tt>=et.length)throw new yr("Unexpected end of input",et.length);let nt=tt;while(nt<et.length){let rt=et.charCodeAt(nt);if(rt===47||rt===62||wr(rt))break;nt++}return o.index=nt,{name:et.slice(tt,nt),start:tt,end:nt}}function dl(o){let{source:et,index:tt}=o;if(tt>=et.length)throw new yr("Unexpected end of input",et.length);let nt=tt;while(nt<et.length){let rt=et.charCodeAt(nt);if(rt===61||rt===47||rt===62||rt===34||rt===39||wr(rt))break;nt++}return o.index=nt,{name:et.slice(tt,nt),start:tt,end:nt}}function Vm(o){let et=o.index;if(o.eat("//")){let tt=o.readUntilString(`
|
|
16
|
+
`),nt=o.index;o.root.comments.push({type:"Line",value:tt,start:et,end:nt});return}if(o.eat("/*")){let tt=o.readUntilString("*/");o.eat("*/");let nt=o.index;o.root.comments.push({type:"Block",value:tt,start:et,end:nt})}}function Wm(o){if(o==="use")return"UseDirective";if(o==="animate")return"AnimateDirective";if(o==="bind")return"BindDirective";if(o==="class")return"ClassDirective";if(o==="style")return"StyleDirective";if(o==="on")return"OnDirective";if(o==="let")return"LetDirective";if(o==="in"||o==="out"||o==="transition")return"TransitionDirective";return!1}function fl(o,et,tt){let nt={start:o.index,end:-1,type:"Text",raw:"",data:""},rt=[],it=(st)=>{if(st>nt.start)nt.raw=o.source.slice(nt.start,st),nt.data=zo(nt.raw,!0),nt.end=st,rt.push(nt)};while(o.index<o.source.length){if(et())return it(o.index),rt;if(o.eat("{")){if(o.match("#")||o.match("@"))throw new A("blocks/tags inside attribute value sequences");let st=o.index-1;it(st),o.allowWhitespace();let at=En(o);o.allowWhitespace(),o.eat("}",!0),rt.push({type:"ExpressionTag",start:st,end:o.index,expression:at}),nt={start:o.index,end:-1,type:"Text",raw:"",data:""}}else{let st=o.index+1;if(tt!==void 0){let at=o.source;while(st<at.length){let ct=at.charCodeAt(st);if(ct===123||ct===tt)break;st++}}o.index=st}}throw new A("unterminated attribute value / sequence (loose mode)")}function qm(o){let et=o.eat("'")?"'":o.eat('"')?'"':null;if(et&&o.eat(et))return[{start:o.index-1,end:o.index-1,type:"Text",raw:"",data:""}];let tt=fl(o,()=>{if(et)return o.match(et);return!!o.matchRegex(_m)},et===null?void 0:et.charCodeAt(0));if(tt.length===0&&!et)throw Error("sveld: expected attribute value");if(et)o.index+=1;if(et||tt.length>1||tt[0].type==="Text")return tt;return tt[0]}function Yo(o,et,tt,nt){return{type:"Attribute",start:et,end:tt,name:o,value:nt}}function Gm(o){let et=o.index,tt=dl(o);if(!tt.name)return null;let nt=!0;if(o.eat("=")){o.allowWhitespace();let rt=o.matchRegex(Dm);if(!rt)throw Error("sveld: expected attribute value");o.index+=rt.length;let it=rt[0]==='"'||rt[0]==="'";if(it)rt=rt.slice(1,-1);nt=[{start:o.index-rt.length-(it?1:0),end:it?o.index-1:o.index,type:"Text",raw:rt,data:zo(rt,!0)}]}if(o.matchRegex(ll))throw Error("sveld: expected '='");return Yo(tt.name,et,o.index,nt)}function Um(o){while(!0){let at=o.index;if(Vm(o),o.index===at)break;o.allowWhitespace()}let et=o.index;if(o.eat("{")){if(o.allowWhitespace(),o.eat("@attach")){o.requireWhitespace();let lt=En(o);return o.allowWhitespace(),o.eat("}",!0),{type:"AttachTag",start:et,end:o.index,expression:lt}}if(o.eat("...")){let lt=En(o);return o.allowWhitespace(),o.eat("}",!0),{type:"SpreadAttribute",start:et,end:o.index,expression:lt}}let at=o.readIdentifierName();if(at.name==="")throw Error("sveld: empty attribute shorthand");o.allowWhitespace(),o.eat("}",!0);let ct={type:"ExpressionTag",start:at.start,end:at.end,expression:at};return Yo(at.name,et,o.index,ct)}let tt=dl(o);if(!tt.name)return null;let nt=o.index;o.allowWhitespace();let rt=tt.name.indexOf(":"),it=rt!==-1&&Wm(tt.name.slice(0,rt)),st=!0;if(o.eat("="))if(o.allowWhitespace(),o.source[o.index]==="/"&&o.source[o.index+1]===">"){let at=o.index;o.index++,st=[{start:at,end:at+1,type:"Text",raw:"/",data:"/"}],nt=o.index}else st=qm(o),nt=o.index;else if(o.matchRegex(ll))throw Error("sveld: expected '='");if(it){let at=tt.name.slice(rt+1).split("|",1)[0];if(at==="")throw Error("sveld: directive missing a name");if(it==="StyleDirective")return{start:et,end:nt,type:it,name:at,value:st};let ct=st===!0?void 0:Array.isArray(st)?st[0]:st,lt=null;if(ct){if((Array.isArray(st)?st.length>1:!1)||ct.type==="Text")throw Error("sveld: directive value must be a single expression");lt=ct.expression}let ut={start:et,end:nt,type:it,name:at,expression:lt};if((ut.type==="BindDirective"||ut.type==="ClassDirective")&&!ut.expression)ut.expression={start:et+rt+1,end:nt,type:"Identifier",name:ut.name};return ut}return Yo(tt.name,et,nt,st)}function hl(o){let et=o.index++,tt=o.current();if(o.eat("!--")){let ht=o.readUntilString("-->");o.eat("-->",!0),o.append({type:"Comment",start:et,end:o.index,data:ht});return}if(o.eat("/")){let{name:ht}=al(o);if(o.allowWhitespace(),o.eat(">",!0),Xo(ht))throw Error(`sveld: <${ht}> is a void element and cannot have a closing tag`);while(tt.name!==ht){if(tt.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${ht}>`);tt.end=et,o.pop(),tt=o.current()}if(tt.end=o.index,o.pop(),o.lastAutoClosedTag&&o.stack.length<o.lastAutoClosedTag.depth)o.lastAutoClosedTag=void 0;return}let nt=al(o),rt=$m(nt.name)&&Lm.test(nt.name);if(!Mm(nt.name)&&!rt)throw Error(`sveld: "${nt.name}" is not a valid element or component name`);if(nt.name in ul&&tt.type!=="Root")throw Error(`sveld: <${nt.name}> must be a top-level element`);let it;if(nt.name in ol)it=ol[nt.name];else if(nt.name.startsWith("svelte:"))it=Bm(nt.name);else if(rt)it="Component";else if(nt.name==="title"&&Fm(o.stack))it="TitleElement";else if(nt.name==="slot"&&!jm(o.stack))it="SlotElement";else it="RegularElement";let st={type:it,start:et,end:-1,name:nt.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(o.allowWhitespace(),tt.type==="RegularElement"&&Fc(tt.name,nt.name))tt.end=et,o.pop(),o.lastAutoClosedTag={tag:tt.name,reason:nt.name,depth:o.stack.length},tt=o.current();let at=o.current(),ct=(nt.name==="script"||nt.name==="style")&&at.type==="Root",lt=ct?Gm:Um,ut;while(ut=lt(o))st.attributes.push(ut),o.allowWhitespace();if(st.type==="SvelteComponent")st.expression=pl(cl(st));if(st.type==="SvelteElement"){let ht=cl(st);if(ht.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(Km(ht))st.tag=pl(ht);else{let yt=ht.value[0];st.tag=yt.type==="Text"?{type:"Literal",value:yt.data,raw:`'${yt.raw}'`,start:yt.start,end:yt.end}:yt.expression}}if(ct){o.eat(">",!0);let ht=Hm(at.fragment.nodes,et);if(nt.name==="script"){let yt=rl(o,et,st.attributes);if(ht)yt.content.leadingComments=[{type:"Line",value:ht.data}];if(yt.context==="module"){if(o.root.module)throw Error("sveld: duplicate <script module>");o.root.module=yt}else{if(o.root.instance)throw Error("sveld: duplicate <script>");o.root.instance=yt}}else{if(o.root.css)throw Error("sveld: duplicate <style>");let yt=sl(o,et,st.attributes);yt.content.comment=ht,o.root.css=yt}return}o.append(st);let dt=o.eat("/")||Xo(nt.name);if(o.eat(">",!0),dt)st.end=o.index;else if(nt.name==="textarea")st.fragment.nodes=fl(o,()=>(Jo.lastIndex=o.index,Jo.test(o.source))),o.read(Jo),st.end=o.index;else o.push(st,st.fragment)}function Hm(o,et){for(let tt=o.length-1;tt>=0;tt--){let nt=o[tt];if(tt===o.length-1&&nt.end!==et)break;if(nt.type==="Comment")return nt;if(nt.type!=="Text"||nt.data.trim())break}return null}function cl(o){let et=o.attributes,tt=et.findIndex((nt)=>nt.type==="Attribute"&&nt.name==="this");if(tt===-1)throw Error(`sveld: <${o.name}> requires a \`this\` attribute`);return et.splice(tt,1)[0]}function pl(o){return Array.isArray(o.value)?o.value[0].expression:o.value.expression}function Km(o){return o.value!==!0&&!Array.isArray(o.value)||Array.isArray(o.value)&&o.value.length===1&&o.value[0].type==="ExpressionTag"}function ml(o){let et={start:o.start,end:o.end,attributes:o.attributes};for(let tt of o.attributes){if(tt.type!=="Attribute")continue;if(tt.name==="runes"){let nt=yl(tt);if(typeof nt==="boolean")et.runes=nt}if(tt.name==="customElement"){let nt=Jm(tt);if(nt!==void 0)et.customElement=nt}}return et}function yl(o){let{value:et}=o;if(et===!0)return!0;let tt=Array.isArray(et)?et[0]:et;if(!tt)return!0;if(Array.isArray(et)&&et.length>1)return null;if(tt.type==="Text")return tt.data;if(tt.expression.type!=="Literal")return null;return tt.expression.value}var zm=new Set(["String","Boolean","Number","Array","Object"]);function Qo(o){let et=[];for(let tt of o.properties){if(!tt||typeof tt!=="object"||tt.type!=="Property"||tt.computed||tt.key?.type!=="Identifier")continue;let{key:nt,value:rt}=tt;et.push([nt.name,rt])}return et}function Xm(o){let et={};if(!o||typeof o!=="object"||o.type!=="ObjectExpression")return et;for(let[tt,nt]of Qo(o)){if(!nt||typeof nt!=="object"||nt.type!=="Literal")continue;let rt=nt.value;if(tt==="attribute"&&typeof rt==="string")et.attribute=rt;else if(tt==="reflect"&&typeof rt==="boolean")et.reflect=rt;else if(tt==="type"&&typeof rt==="string"&&zm.has(rt))et.type=rt}return et}function Jm(o){let{value:et}=o;if(et===!0)return;let tt=Array.isArray(et)?et[0]:et;if(!tt)return;if(tt.type==="Text"){let ut=yl(o);return typeof ut==="string"?{tag:ut}:void 0}let nt=tt.expression;if(nt.type==="Literal"&&nt.value===null)return;if(nt.type!=="ObjectExpression")return;let rt=Qo(nt),it={},st=rt.find(([ut])=>ut==="tag")?.[1];if(st&&typeof st==="object"&&st.type==="Literal"&&typeof st.value==="string")it.tag=st.value;let at=rt.find(([ut])=>ut==="props")?.[1];if(at&&typeof at==="object"&&at.type==="ObjectExpression"){it.props={};for(let[ut,dt]of Qo(at))it.props[ut]=Xm(dt)}let ct=rt.find(([ut])=>ut==="shadow")?.[1];if(ct&&typeof ct==="object"){let ut=ct;if(ut.type==="Literal"&&(ut.value==="open"||ut.value==="none"))it.shadow=ut.value;else if(ut.type==="ObjectExpression")it.shadow=ct}let lt=rt.find(([ut])=>ut==="extend")?.[1];if(lt!==void 0)it.extend=lt;return it}var Ym=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class Zo extends qo{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(o,et){super(o);this.isTypeScript=Ym.test(o);let tt=An();this.root={type:"Root",start:0,end:et,css:null,js:[],options:null,fragment:tt,comments:[]},this.stack.push(this.root),this.fragments.push(tt)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(o,et){this.stack.push(o),this.fragments.push(et)}pop(){return this.fragments.pop(),this.stack.pop()}append(o){return this.currentFragment().nodes.push(o),o}}var ea={"{":"}","(":")","[":"]"},Qm=new Set(Object.values(ea));function ms(o,et,tt=ea){let nt=tt===ea?Qm:new Set(Object.values(tt)),rt=[],it=et;while(it<o.source.length){let st=o.source[it++];if(st==="'"||st==='"'||st==="`"){it=Zm(o,it,st);continue}if(Object.hasOwn(tt,st))rt.push(st);else if(nt.has(st)){let at=rt.pop(),ct=at?tt[at]:void 0;if(st!==ct)throw Error(`sveld: expected "${ct}"`);if(rt.length===0)return it}}throw Error("sveld: unexpected end of input")}function Zm(o,et,tt){let nt=!1,rt=et;while(rt<o.source.length){let it=o.source[rt++];if(nt){nt=!1;continue}if(it===tt)return rt;if(it==="\\")nt=!0;if(tt==="`"&&it==="$"&&o.source[rt]==="{")rt=ms(o,rt)}throw Error("sveld: unterminated string constant")}var xl=/[^\n]/g,ey=/\?\s*:/g;function gr(o){let et=o.index,tt=o.readIdentifierName();if(tt.name!==""){let ht=gl(o);return{...tt,typeAnnotation:ht}}let nt=o.source[o.index];if(nt!=="{"&&nt!=="[")throw Error("sveld: expected a binding pattern");let rt=ms(o,et);o.index=rt;let it=o.source.slice(et,rt),st=o.source.slice(0,et).replace(xl," "),at=st.indexOf(" ");st=st.slice(0,at)+st.slice(at+1);let ct=`${st}(${it} = 1)`,{node:lt}=Ur(ct,et-1,o.isTypeScript,o.root.comments),ut=lt.left,dt=gl(o);if(dt)ut.typeAnnotation=dt,ut.end=dt.end;return ut}function gl(o){let et=o.index;if(o.allowWhitespace(),!o.eat(":")){o.index=et;return}let tt="_ as ",nt=o.index-tt.length,rt=o.source.slice(0,nt).replace(xl," ")+tt+o.source.slice(o.index).replace(ey,":"),{node:it}=Ur(rt,nt,o.isTypeScript,o.root.comments),st=it;if(st.type==="AssignmentExpression"){let at=st.right.start;while(rt[at]!=="=")at-=1;({node:it}=Ur(rt.slice(0,at),nt,o.isTypeScript,o.root.comments)),st=it}if(st.type==="SequenceExpression"&&st.expressions)st=st.expressions[0];return o.index=st.end,{type:"TSTypeAnnotation",start:et,end:o.index,typeAnnotation:st.typeAnnotation}}var bl=/\s*}/y,ty={"<":">"};function El(o){let et=o.index-2;while(o.source[et]!=="{")et-=1;if(o.eat("if")){o.requireWhitespace();let tt={type:"IfBlock",elseif:!1,start:et,end:-1,test:En(o),consequent:An(),alternate:null};o.append(tt),o.allowWhitespace(),o.eat("}",!0),o.push(tt,tt.consequent);return}if(o.eat("each")){o.requireWhitespace();let tt=En(o);if(o.allowWhitespace(),!o.match("as")){let at=tt;if(at.type==="SequenceExpression"&&at.expressions)at=at.expressions[0];if(at.type==="TSAsExpression"){let ct=at;tt=ct.expression;let lt=ct.typeAnnotation.start-2;while(lt>=0&&!(o.source[lt]==="a"&&o.source[lt+1]==="s"))lt-=1;o.index=lt}}let nt=null,rt,it;if(o.eat("as"))o.requireWhitespace(),nt=gr(o);if(o.allowWhitespace(),o.eat(",")){o.allowWhitespace();let at=o.readIdentifierName();if(!at.name)throw Error("sveld: expected an identifier");rt=at.name,o.allowWhitespace()}if(o.eat("("))o.allowWhitespace(),it=En(o),o.allowWhitespace(),o.eat(")",!0),o.allowWhitespace();o.eat("}",!0);let st={type:"EachBlock",start:et,end:-1,expression:tt,body:An(),context:nt,index:rt,key:it};o.append(st),o.push(st,st.body);return}if(o.eat("await")){o.requireWhitespace();let tt=En(o);o.allowWhitespace();let nt={type:"AwaitBlock",start:et,end:-1,expression:tt,value:null,error:null,pending:null,then:null,catch:null};if(o.eat("then")){if(!o.matchRegex(bl))o.requireWhitespace(),nt.value=gr(o),o.allowWhitespace();nt.then=An()}else if(o.eat("catch")){if(!o.matchRegex(bl))o.requireWhitespace(),nt.error=gr(o),o.allowWhitespace();nt.catch=An()}else nt.pending=An();o.eat("}",!0),o.append(nt),o.push(nt,nt.then??nt.catch??nt.pending);return}if(o.eat("key")){o.requireWhitespace();let tt=En(o);o.allowWhitespace(),o.eat("}",!0);let nt={type:"KeyBlock",start:et,end:-1,expression:tt,fragment:An()};o.append(nt),o.push(nt,nt.fragment);return}if(o.eat("snippet")){o.requireWhitespace();let tt=o.readIdentifierName();if(tt.name==="")throw Error("sveld: expected a snippet name");o.allowWhitespace();let nt;if(o.isTypeScript&&o.match("<")){let it=o.index,st=ms(o,it,ty);nt=o.source.slice(it+1,st-1),o.index=st}if(o.allowWhitespace(),o.eat("(")){let it=1;while(o.index<o.source.length&&(!o.match(")")||it!==1)){if(o.match("("))it++;if(o.match(")"))it--;o.index+=1}o.eat(")",!0)}o.allowWhitespace(),o.eat("}",!0);let rt={type:"SnippetBlock",start:et,end:-1,expression:tt,typeParams:nt,parameters:[],body:An()};o.append(rt),o.push(rt,rt.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function Cl(o){let et=o.index-1,tt=o.current();if(tt.type==="IfBlock"){if(!o.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(o.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(o.allowWhitespace(),o.fragments.pop(),tt.alternate=An(),o.fragments.push(tt.alternate),o.eat("if")){o.requireWhitespace();let nt=En(o);o.allowWhitespace(),o.eat("}",!0);let rt=et-1;while(o.source[rt]!=="{")rt-=1;let it={type:"IfBlock",start:rt,end:-1,elseif:!0,test:nt,consequent:An(),alternate:null};o.append(it),o.stack.push(it),o.fragments.pop(),o.fragments.push(it.consequent)}else o.allowWhitespace(),o.eat("}",!0);return}if(tt.type==="EachBlock"){if(!o.eat("else"))throw Error("sveld: expected {:else}");o.allowWhitespace(),o.eat("}",!0),tt.fallback=An(),o.fragments.pop(),o.fragments.push(tt.fallback);return}if(tt.type==="AwaitBlock"){if(o.eat("then")){if(tt.then)throw Error("sveld: duplicate {:then}");if(!o.eat("}"))o.requireWhitespace(),tt.value=gr(o),o.allowWhitespace(),o.eat("}",!0);tt.then=An(),o.fragments.pop(),o.fragments.push(tt.then);return}if(o.eat("catch")){if(tt.catch)throw Error("sveld: duplicate {:catch}");if(!o.eat("}"))o.requireWhitespace(),tt.error=gr(o),o.allowWhitespace(),o.eat("}",!0);tt.catch=An(),o.fragments.pop(),o.fragments.push(tt.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function vl(o){let et=o.current();switch(et.type){case"IfBlock":{o.eat("if",!0),o.allowWhitespace(),o.eat("}",!0);while(et.type==="IfBlock"&&et.elseif)et.end=o.index,o.stack.pop(),et=o.current();et.end=o.index,o.pop();return}case"EachBlock":o.eat("each",!0);break;case"KeyBlock":o.eat("key",!0);break;case"AwaitBlock":o.eat("await",!0);break;case"SnippetBlock":o.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}o.allowWhitespace(),o.eat("}",!0),et.end=o.index,o.pop()}var ny=/(?:let|const)\b/y,ry=/(?:var|interface|enum)\b/y,sy=/type\b/y;function Sl(o){let et=o.index;if(o.matchRegex(ry))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!o.matchRegex(ny)&&!o.matchRegex(sy))return null;let tt=o.root.comments.length,nt=Jp(o.source,et,o.isTypeScript,o.root.comments);if(nt.type!=="VariableDeclaration"){if(nt.type==="ExpressionStatement")return o.root.comments.length=tt,null;throw Error("sveld: expected a `let`/`const` declaration")}if(nt.kind!=="let"&&nt.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return o.index=nt.end,o.allowWhitespace(),o.eat("}",!0),nt}var iy=/\s*}/y;function Tl(o){let et=o.index;while(o.source[et]!=="{")et-=1;if(o.eat("html")){o.requireWhitespace();let tt=En(o);o.allowWhitespace(),o.eat("}",!0);let nt={type:"HtmlTag",start:et,end:o.index,expression:tt};o.append(nt);return}if(o.eat("debug")){let tt;if(o.read(iy))tt=[];else{let rt=En(o);tt=rt.type==="SequenceExpression"?rt.expressions:[rt];for(let it of tt)if(it.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");o.allowWhitespace(),o.eat("}",!0)}let nt={type:"DebugTag",start:et,end:o.index,identifiers:tt};o.append(nt);return}if(o.eat("const")){o.requireWhitespace();let tt=gr(o);o.allowWhitespace(),o.eat("=",!0),o.allowWhitespace();let nt=En(o),rt=o.index;o.allowWhitespace(),o.eat("}",!0);let it={type:"VariableDeclarator",id:tt,init:nt,start:tt.start,end:rt},st={type:"ConstTag",start:et,end:o.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[it],start:et+2,end:o.index-1}};o.append(st);return}if(o.eat("render")){o.requireWhitespace();let tt=En(o);if(!(tt.type==="CallExpression"||tt.type==="ChainExpression"&&tt.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");o.allowWhitespace(),o.eat("}",!0);let rt={type:"RenderTag",start:et,end:o.index,expression:tt};o.append(rt);return}throw Error("sveld: expected html/debug/const/render")}function kl(o){let et=o.index;if(o.index+=1,o.allowWhitespace(),o.eat("#")){El(o);return}if(o.eat(":")){Cl(o);return}if(o.eat("@")){Tl(o);return}if(o.match("/")&&!o.match("/*")&&!o.match("//")){o.eat("/"),vl(o);return}let tt=Sl(o);if(tt){let it={type:"DeclarationTag",start:et,end:o.index,declaration:tt};o.append(it);return}let nt=En(o);o.allowWhitespace(),o.eat("}",!0);let rt={type:"ExpressionTag",start:et,end:o.index,expression:nt};o.append(rt)}function Pl(o){let{index:et,source:tt}=o,nt=tt.indexOf("<",et),rt=tt.indexOf("{",et),it;if(nt===-1)it=rt===-1?tt.length:rt;else it=rt===-1?nt:Math.min(nt,rt);o.index=it;let st=tt.slice(et,it),at={type:"Text",start:et,end:o.index,raw:st,data:st};o.append(at)}function M(o){let et=o.trimEnd(),tt=new Zo(et,o.length);while(tt.index<tt.source.length)if(tt.match("<"))hl(tt);else if(tt.match("{"))kl(tt);else Pl(tt);let nt=tt.root.fragment.nodes.findIndex((rt)=>rt.type==="SvelteOptions");if(nt!==-1){let[rt]=tt.root.fragment.nodes.splice(nt,1);tt.root.options=ml(rt)}return tt.root}function ln(o){return typeof o==="object"&&o!==null}function wl(o){return ln(o)&&o.type==="VariableDeclaration"&&Array.isArray(o.declarations)}function h(o){return ln(o)&&o.type==="Literal"}function e(o){return ln(o)&&o.type==="Identifier"&&typeof o.name==="string"}function O(o){return ln(o)&&o.type==="MemberExpression"}function Kn(o){return ln(o)&&o.type==="ObjectExpression"&&Array.isArray(o.properties)}function oy(o){return ln(o)&&o.type==="CallExpression"}function y(o,et){if(!oy(o))return!1;return!!o.callee&&ln(o.callee)&&o.callee.type==="Identifier"&&o.callee.name===et}function g(o){if(ln(o)&&(o.type==="TSAsExpression"||o.type==="TSSatisfiesExpression")&&"expression"in o)return g(o.expression);return o}function Pe(o){if(ln(o)&&(o.type==="TSAsExpression"||o.type==="TSSatisfiesExpression")&&"typeAnnotation"in o)return o.typeAnnotation;return}function ay(o){return ln(o)&&o.type==="NewExpression"}function ta(o,et){if(!ay(o))return!1;return!!o.callee&&ln(o.callee)&&o.callee.type==="Identifier"&&o.callee.name===et}function Yn(o){if(!ln(o)||typeof o.type!=="string")return null;if(o.type==="Literal"){let et=o.value;if(typeof et==="string")return et;return et==null?null:String(et)}if(o.type==="TemplateLiteral"){let et=o.quasis;if(et?.length===1){let tt=et[0]?.value?.cooked;return tt==null?null:tt}}return null}var w=Symbol("sveld.parsedComponentTypeScriptMetadata");function pr(o){return o[w]}function Al(o,et){if(et.length===0)return;let tt=new Set(o.props.map((nt)=>nt.name));for(let nt of et){if(tt.has(nt.name))continue;tt.add(nt.name),o.props.push({name:nt.name,kind:"let",constant:!1,type:nt.type,typeSource:"typescript",...nt.description?{description:nt.description}:{},isFunction:nt.type.includes("=>"),isFunctionDeclaration:!1,isRequired:nt.isRequired,reactive:!1})}}var cy=/\w/;function py(o,et){let tt=o.trim();if(!tt.startsWith("{")||!tt.endsWith("}"))return;let nt=tt.slice(1,-1),rt=[],it=0,st="";for(let at of nt)if(at==="{"||at==="<"||at==="("||at==="[")it++,st+=at;else if(at==="}"||at===">"||at===")"||at==="]")it--,st+=at;else if((at===";"||at===",")&&it===0)rt.push(st.trim()),st="";else st+=at;if(st.trim())rt.push(st.trim());for(let at of rt){if(!at.startsWith(et))continue;let ct=at.slice(et.length);if(ct.length>0&&cy.test(ct[0]))continue;let lt=ct.trimStart();if(lt.startsWith("?"))lt=lt.slice(1).trimStart();if(lt.startsWith(":"))return lt.slice(1).trim()}return}function Q(o,et,tt){let nt=tt;if(nt.computed||nt.object?.type!=="Identifier"||nt.property?.type!=="Identifier")return;let rt=nt.object.name,it=nt.property.name;if(!rt||!it)return;if(o.wholePropsLocals.has(rt))return et.getPropTypeByLocalOrPublic(it);let st=et.getPropTypeByLocalOrPublic(rt)??et.findVariableTypeAndDescription(rt)?.type;if(!st)return;return py(st,it)}function ly(o){let et="";for(let tt=0;tt<o.length;tt++){let nt=o[tt];if(nt==="*"&&o[tt+1]==="*"){if(et+=".*",tt++,o[tt+1]==="/")tt++;continue}if(nt==="*"){et+="[^/]*";continue}if(nt==="?"){et+="[^/]";continue}et+=".+^$()[]{}|\\".includes(nt)?`\\${nt}`:nt}return et}function Nl(o,et){return new RegExp(`^${ly(o)}$`).test(et)}var Y={"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","context-value-unresolved":"sveld/context-value-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","cross-file-unresolved":"sveld/cross-file-unresolved","export-ambiguous":"sveld/export-ambiguous"},uy={"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","context-value-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","cross-file-unresolved":"warning","export-ambiguous":"warning"};function vn(o){return{...o,code:Y[o.kind],severity:uy[o.kind]}}function Z(o,et){if(et)return o;return o.filter((tt)=>tt.kind!=="jsdoc-unknown-tag")}function K(o,et){if(!et)return[];return o.filter((tt)=>!tt.ignored&&(et!=="errors"||tt.severity==="error"))}function dy(o,et){if(et.code!==void 0&&et.code!==o.code)return!1;if(et.name!==void 0&&et.name!==o.name)return!1;if(et.component!==void 0&&!Nl(et.component,o.component))return!1;return!0}function Dl(o,et){if(!et||et.length===0)return o;return o.map((tt)=>tt.ignored||et.some((nt)=>dy(tt,nt))?{...tt,ignored:!0}:tt)}var fy={"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","context-value-unresolved":"setContext values sveld couldn't describe","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","cross-file-unresolved":"Imports a standalone parse couldn't read","export-ambiguous":"Ambiguous `export *` names left out of the entry exports"},hy=["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","context-value-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","cross-file-unresolved","export-ambiguous"];function oi(o){let et=new Set,tt=[];for(let nt of o){let rt=`${nt.component}:${nt.kind}:${nt.name}`;if(et.has(rt))continue;et.add(rt),tt.push(nt)}return tt}function ee(o){let et=o.filter((st)=>!st.ignored),tt=o.length-et.length,nt=tt>0?` (${tt} ignored)`:"";if(et.length===0)return`sveld: all types resolved${nt}.`;let rt=[],it=et.length;rt.push(`sveld: ${it} unresolved type${it===1?"":"s"} found${nt}.`);for(let st of hy){let at=et.filter((lt)=>lt.kind===st);if(at.length===0)continue;rt.push(""),rt.push(`${fy[st]} (${at.length}):`);let ct=new Map;for(let lt of at){let ut=ct.get(lt.component)??[];ut.push(lt),ct.set(lt.component,ut)}for(let[lt,ut]of ct){rt.push(` ${lt}`);for(let dt of ut){let ht=dt.source?` (${lt}:${dt.source.start.line}:${dt.source.start.column})`:"";rt.push(` - ${dt.message}${ht} [${dt.code}]`)}}}return rt.join(`
|
|
17
|
+
`)}var ve=1;function te(o){return`${JSON.stringify({kind:"diagnostics",schemaVersion:ve,diagnostics:o},null,2)}
|
|
18
|
+
`}function r(o,et,tt,nt,rt){o.diagnosticRecords.push(pe(o,et,tt,nt,rt))}function pe(o,et,tt,nt,rt){return vn({component:o.componentFilePath,kind:et,name:tt,message:nt,...rt?{source:rt}:{},...ue(o,et,tt)?{ignored:!0}:{}})}function _l(o,et){return`${o}:${et}`}function T(o,et,tt,nt){if(!nt||nt.length===0)return;let rt=_l(et,tt),it=o.sveldIgnoreDirectives.get(rt)??new Set;for(let st of nt)it.add(st);o.sveldIgnoreDirectives.set(rt,it)}function ue(o,et,tt){let nt=o.sveldIgnoreDirectives.get(_l(et,tt));if(!nt)return!1;return nt.has("")||nt.has(Y[et])}var ai=/[\r\n]+/g;function my(o){if(o.sourceLineStartOffsetsCache)return o.sourceLineStartOffsetsCache;let et=[0];if(o.source){let tt=o.source.indexOf(`
|
|
19
|
+
`);while(tt!==-1)et.push(tt+1),tt=o.source.indexOf(`
|
|
20
|
+
`,tt+1)}return o.sourceLineStartOffsetsCache=et,et}function Il(o,et){if(!o.source||et<0||et>o.source.length)return;let tt=my(o),nt=o.sourceLineHint;if(nt!==void 0)for(let st=nt;st<=nt+1&&st<tt.length;st++){let at=tt[st],ct=tt[st+1]??Number.POSITIVE_INFINITY;if(et>=at&&et<ct)return o.sourceLineHint=st,{line:st+1,column:et-at}}let rt=0,it=tt.length-1;while(rt<=it){let st=rt+it>>>1,at=tt[st],ct=tt[st+1]??Number.POSITIVE_INFINITY;if(et<at)it=st-1;else if(et>=ct)rt=st+1;else return o.sourceLineHint=st,{line:st+1,column:et-at}}return}function ne(o,et,tt){if(et===void 0||tt===void 0||tt<et)return;let nt=Il(o,et),rt=Il(o,tt);if(!nt||!rt)return;return{start:nt,end:rt}}function n(o,et){if(!et||typeof et!=="object")return;let tt="start"in et&&typeof et.start==="number"?et.start:void 0,nt="end"in et&&typeof et.end==="number"?et.end:void 0;return ne(o,tt,nt)}function Fn(o,et){if(!et||et.length===0)return;let tt=[...et];while(tt.length>1){let ct=tt[tt.length-1];if(ct.tag!==void 0||!ct.raw.trim().endsWith("*/"))break;tt.pop()}let nt=tt[0],rt=nt.raw.indexOf(`@${nt.tag??""}`),it=nt.start+Math.max(rt,0),st=tt[tt.length-1],at=st.start+st.raw.length;return ne(o,it,at)}function s(o,et,tt){return o.source?.slice(et,tt)}function f(o,et){if(!et||typeof et!=="object")return;let tt="start"in et&&typeof et.start==="number"?et.start:void 0,nt="end"in et&&typeof et.end==="number"?et.end:void 0;if(tt===void 0||nt===void 0)return;return s(o,tt,nt)?.replace(ai," ")}var yy=/\*\//g;function lr(o){return o.replace(yy,"*\\/")}function b(o){return o.map((et)=>`${et.name}${et.optional?"?":""}: ${et.type}`).join(", ")}function m(o){return o===void 0||o===""?void 0:o}var gy=new Intl.Collator("en");function u(o,et){return gy.compare(o,et)}var xy=/[A-Za-z_$][\w$]*/g;function by(o,et){if(!et)return!1;let tt=new Set(et[0].split(",").map((nt)=>nt.trim()));for(let[nt]of o.matchAll(xy))if(tt.has(nt))return!0;return!1}function le(o,et){if(et===void 0)return;return o.runesPropsDeclarationMetadataByDeclaratorStart.get(et)}function Ae(o,et,tt){return le(o,et)?.props.get(tt)}function De(o){if(!o||typeof o!=="object"||!("type"in o))return;if(o.type==="Identifier"&&"name"in o&&typeof o.name==="string")return o.name;if(o.type==="TSQualifiedName"&&"right"in o&&o.right&&typeof o.right==="object"&&"name"in o.right&&typeof o.right.name==="string")return o.right.name;return}function Rl(o){if(!o||typeof o!=="object"||!("type"in o))return;if(o.type==="Identifier"&&"name"in o&&typeof o.name==="string")return o.name;if(o.type==="TSQualifiedName"&&"left"in o&&o.left&&typeof o.left==="object")return Rl(o.left);return}function E(o,et){let tt=et?.start,nt=et?.end;if(tt===void 0||nt===void 0)return;return s(o,tt+1,nt)?.trim()}function P(o,et){let tt=et?.start,nt=et?.end;if(tt===void 0||nt===void 0)return;return s(o,tt,nt)?.trim()}function l(o,et,tt,nt,rt=new Set){if(!et?.type)return;switch(et.type){case"TSInterfaceDeclaration":for(let it of et.extends??[])l(o,{type:"TSTypeReference",typeName:it.expression,typeParameters:it.typeParameters},tt,nt,rt);l(o,{type:"TSTypeLiteral",members:et.body?.body},tt,nt,rt);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":l(o,et.typeAnnotation,tt,nt,rt);return;case"TSIntersectionType":case"TSUnionType":for(let it of et.types??[])l(o,it,tt,nt,rt);return;case"TSTypeLiteral":for(let it of et.members??[]){if(it?.type!=="TSPropertySignature")continue;l(o,it.typeAnnotation?.typeAnnotation,tt,nt,rt)}return;case"TSTypeReference":{let it=Rl(et.typeName);if(it){if(o.typeImportBindingsByLocalName.has(it)||o.valueImportBindingsByLocalName.has(it))tt.add(it);let at=o.localTypeDeclarationsByName.get(it);if(at&&!rt.has(it))nt.add(it),rt.add(it),l(o,at.node,tt,nt,rt),rt.delete(it)}let st=et.typeArguments??et.typeParameters;if(st&&typeof st==="object"){let at=st;for(let ct of at.params??[])l(o,ct,tt,nt,rt)}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 it in et){let st=et[it];if(!st||typeof st!=="object")continue;if(Array.isArray(st)){for(let at of st){if(!at||typeof at!=="object"||!("type"in at))continue;l(o,at,tt,nt,rt)}continue}if("type"in st)l(o,st,tt,nt,rt)}}function Ey(o,et){let tt=new Map;for(let nt of Array.from(et).sort()){let rt=o.typeImportBindingsByLocalName.get(nt),it=rt?void 0:o.valueImportBindingsByLocalName.get(nt),st=rt??(it?{importedName:it.importedName,localName:it.localName,source:it.source,specifierType:"named"}:void 0);if(!st)continue;let at=tt.get(st.source)??{default:[],named:[],namespace:[]};if(st.specifierType==="default")at.default.push(st.localName);else if(st.specifierType==="namespace")at.namespace.push(st.localName);else at.named.push({imported:st.importedName,local:st.localName});tt.set(st.source,at)}return Array.from(tt.entries()).sort(([nt],[rt])=>u(nt,rt)).map(([nt,rt])=>{if(rt.namespace.length>0)return rt.namespace.map((ct)=>`import type * as ${ct} from "${nt}";`).join(`
|
|
21
|
+
`);let it=rt.named.map(({imported:ct,local:lt})=>{if(!ct||ct===lt)return lt;return`${ct} as ${lt}`}),st=rt.default[0],at=it.length>0?`{ ${it.join(", ")} }`:"";if(st&&at)return`import type ${st}, ${at} from "${nt}";`;if(st)return`import type ${st} from "${nt}";`;return`import type ${at} from "${nt}";`})}function a(o,et){if(et)o.additionalTypeDependencyNodes.push(et)}function Cy(o){if(!o.const)return;let et=o.id?.name;if(!et)return;let tt=[];for(let nt of o.members??[]){let rt=nt.initializer;if(rt?.type!=="Literal")return;let it=rt.value;if(typeof it==="string")tt.push(JSON.stringify(it));else if(typeof it==="number")tt.push(String(it));else return}if(tt.length===0)return;return`type ${et} = ${tt.join(" | ")};`}function _e(o,et){let tt=Cy(et);if(tt)return tt;if(et.start===void 0||et.end===void 0)return;let nt=s(o,et.start,et.end)?.trim();return nt?`declare ${nt}`:void 0}function fe(o,et){let tt=[];for(let nt of et.params??[]){let rt=nt.type==="TSParameterProperty"&&nt.parameter?nt.parameter:nt;if(rt.type==="RestElement"){a(o,rt.typeAnnotation?.typeAnnotation),tt.push({name:rt.argument?.name??"rest",type:E(o,rt.typeAnnotation),optional:!1,rest:!0});continue}let it=rt.type==="AssignmentPattern",st=it?rt.left:rt;a(o,st?.typeAnnotation?.typeAnnotation),tt.push({name:st?.name??"arg",type:E(o,st?.typeAnnotation),optional:it||rt.optional===!0,rest:!1})}a(o,et.returnType?.typeAnnotation);for(let nt of et.typeParameters?.params??[])a(o,nt.constraint),a(o,nt.default);return{params:tt,returnType:E(o,et.returnType),typeParameters:P(o,et.typeParameters)||void 0}}function de(o,et){let{params:tt,returnType:nt,typeParameters:rt}=fe(o,et),it=tt.map(({name:at,type:ct,optional:lt,rest:ut})=>ut?`...${at}: ${ct??"any[]"}`:`${at}${lt?"?":""}: ${ct??"any"}`),st=nt!==void 0||rt!==void 0||tt.some((at)=>at.type!==void 0);return{signature:`${rt??""}(${it.join(", ")}) => ${nt??"any"}`,hasAnnotations:st}}function Ne(o){let et=o.pendingCallDefaultCandidates.length>0?o.pendingCallDefaultCandidates.slice():void 0,tt=o.pendingConstDefaultCandidates.length>0?o.pendingConstDefaultCandidates.slice():void 0,nt=o.pendingContextKeyCandidates.length>0?o.pendingContextKeyCandidates.slice():void 0,rt=o.pendingDispatchEscapeCandidates.length>0?o.pendingDispatchEscapeCandidates.slice():void 0,it=o.deferredEventNoSourceDiagnostics.length>0?o.deferredEventNoSourceDiagnostics.slice():void 0,st=rt&&o.untypedJsDocEventNames.size>0?Array.from(o.untypedJsDocEventNames):void 0,at={...et?{pendingCallDefaultCandidates:et}:{},...tt?{pendingConstDefaultCandidates:tt}:{},...nt?{pendingContextKeyCandidates:nt}:{},...rt?{pendingDispatchEscapeCandidates:rt}:{},...it?{deferredEventNoSourceDiagnostics:it}:{},...st?{untypedJsDocEventNames:st}:{}},ct=et!==void 0||tt!==void 0||nt!==void 0||rt!==void 0,lt=new Set,ut=new Set;for(let Ct of o.additionalTypeDependencyNodes)l(o,Ct,lt,ut);let dt=Array.from(o.localTypeDeclarationsByName.values()).filter((Ct)=>Ct.exported).sort((Ct,At)=>Ct.start-At.start);for(let Ct of dt)l(o,Ct.node,lt,ut);let ht=dt.map((Ct)=>`export ${Ct.code}`),yt=o.typedRunesPropsDeclarations.length===1?o.typedRunesPropsDeclarations[0]:void 0,xt=yt?.canonicalType;if(yt&&xt){for(let Ct of yt.referencedImportedTypes)lt.add(Ct);for(let Ct of yt.referencedLocalTypes)ut.add(Ct)}if(!xt&<.size===0&&ut.size===0&&ht.length===0)return ct?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],...at}:void 0;let Et=Array.from(ut).map((Ct)=>o.localTypeDeclarationsByName.get(Ct)).filter((Ct)=>Ct!==void 0&&!Ct.exported).sort((Ct,At)=>Ct.start-At.start).map((Ct)=>Ct.code);return{...xt?{canonicalPropsType:xt}:{},canonicalPropNames:yt&&xt?Array.from(yt.props.keys()).sort():[],localTypeDeclarations:Et,...ht.length>0?{moduleTypeDeclarations:ht}:{},typeImportStatements:Ey(o,lt),referencesComponentGenerics:xt?by(xt,o.generics):!1,...at}}function re(o,et){let tt=et.source?.value;if(typeof tt!=="string"||et.importKind==="type")return;for(let nt of et.specifiers??[]){if(nt.type!=="ImportSpecifier"||nt.importKind==="type")continue;let rt=nt.local?.name;if(!rt)continue;let it=nt.imported?.name??(typeof nt.imported?.value==="string"?nt.imported.value:rt);o.valueImportBindingsByLocalName.set(rt,{localName:rt,importedName:it,source:tt})}}function ci(o){return[o.importedName,...o.members??[]].join(".")}function me(o,et){let tt=[],nt=et;while(nt.type==="MemberExpression"){if(nt.computed||!e(nt.property))return;tt.unshift(nt.property.name),nt=nt.object}if(!e(nt))return;let rt=nt.name,it=(at,ct,lt)=>lt.length>0?{source:at,importedName:ct,members:lt}:{source:at,importedName:ct},st=o.valueImportBindingsByLocalName.get(rt);if(st)return it(st.source,st.importedName,tt);for(let at of[o.parsed?.instance,o.parsed?.module])for(let ct of(at?S(at):void 0)??[]){let lt=ct,ut=lt.source?.value;if(lt.type!=="ImportDeclaration"||lt.importKind==="type"||typeof ut!=="string")continue;let dt=lt.specifiers?.find((ht)=>ht.local?.name===rt);if(dt?.type==="ImportDefaultSpecifier")return it(ut,"default",tt);if(dt?.type==="ImportNamespaceSpecifier"&&tt.length>0)return it(ut,tt[0],tt.slice(1))}return}function pi(o,et){if(!O(et))return;return me(o,et)}function S(o){let et=o,tt=et.type==="Program"?et.body:et.content?.body??et.body;return Array.isArray(tt)?tt:void 0}function Ie(o){let et=new Map,tt=o?S(o):void 0;if(!tt)return et;for(let nt of tt){let rt=nt;if(rt.type!=="ImportDeclaration"||rt.importKind==="type")continue;let it=rt.source?.value;if(typeof it!=="string")continue;for(let st of rt.specifiers??[]){let at=st.local?.name;if(!at||st.importKind==="type")continue;let ct;if(st.type==="ImportDefaultSpecifier")ct="default";else if(st.type==="ImportNamespaceSpecifier")ct="*";else ct=st.imported?.name??String(st.imported?.value??at);et.set(at,{from:it,imported:ct})}}return et}function he(o,et){if(!et)return;let tt=S(et);if(!tt)return;for(let nt of tt){let rt=nt;if(rt.type==="ImportDeclaration"){re(o,rt);continue}let it=rt.type==="ExportNamedDeclaration"&&rt.declaration?rt.declaration:rt;if(it.type==="FunctionDeclaration"){let st=it;if(st.id?.name)o.funcDecls.set(st.id.name,st)}}}function q(o,et,tt,nt){if(m(tt)===void 0)return;if(o.trackPropLocalName(tt),et.props.has(tt)){let rt=et.props.get(tt);et.props.set(tt,{...rt,...nt})}else et.props.set(tt,nt)}function V(o,et,tt,nt){if(et.pendingCallDefault)o.pendingCallDefaultCandidates.push({propName:tt,location:nt,...et.pendingCallDefault});if(et.pendingConstDefault)o.pendingConstDefaultCandidates.push({propName:tt,location:nt,...et.pendingConstDefault})}var vy=/[^\S\r\n]*[\r\n]\s*/g;function x(o,et,tt,nt=0){let rt,it,st=!1;if(!tt||typeof tt!=="object"||!("type"in tt))return{value:rt,type:it,isFunction:st};let at=Ml(o,et,tt);if(tt.type==="ObjectExpression"||tt.type==="BinaryExpression"||tt.type==="ArrayExpression"||tt.type==="ArrowFunctionExpression"||tt.type==="FunctionExpression"){let ct=tt;if("start"in ct&&"end"in ct&&typeof ct.start==="number"&&typeof ct.end==="number")rt=s(et,ct.start,ct.end)?.replace(ai," ");if(st=tt.type==="ArrowFunctionExpression"||tt.type==="FunctionExpression",tt.type==="BinaryExpression")it=zn(o,et,tt,nt);else if(tt.type==="ObjectExpression"||tt.type==="ArrayExpression"){let{start:lt,end:ut}=ct;it=na(tt)?ky(et,lt,ut,rt):void 0}if(tt.type==="ArrowFunctionExpression"||tt.type==="FunctionExpression")it=Bl(tt),rt=Ol(et,tt)}else if(tt.type==="UnaryExpression"){let ct=tt;if("start"in ct&&"end"in ct&&typeof ct.start==="number"&&typeof ct.end==="number")rt=s(et,ct.start,ct.end);it=zn(o,et,ct,nt)}else if(tt.type==="LogicalExpression"||tt.type==="ConditionalExpression"||tt.type==="SequenceExpression"){let{start:ct,end:lt}=tt,ut=ct===void 0||lt===void 0?void 0:s(et,ct,lt)?.replace(vy," ");rt=ut!==void 0&&tt.type==="SequenceExpression"?`(${ut})`:ut,it=zn(o,et,tt,nt)}else if(tt.type==="NewExpression"){let ct=tt;if("start"in ct&&"end"in ct&&typeof ct.start==="number"&&typeof ct.end==="number")rt=s(et,ct.start,ct.end);if(ct.callee&&typeof ct.callee==="object"&&"type"in ct.callee&&ct.callee.type==="Identifier"){let lt=ct.callee.name;if(lt==="Date")it="Date";else if(lt==="Map")it="Map<any, any>";else if(lt==="Set")it="Set<any>";else if(lt==="WeakMap")it="WeakMap<object, any>";else if(lt==="WeakSet")it="WeakSet<object>";else if(lt==="Array")it="any[]";else if(lt==="RegExp"||lt==="Regexp")it="RegExp";else if(lt==="Error")it="Error";else it=lt}}else if(tt.type==="CallExpression"){let ct=tt;if("start"in ct&&"end"in ct&&typeof ct.start==="number"&&typeof ct.end==="number")rt=s(et,ct.start,ct.end);let lt=ct.callee,ut=lt&&typeof lt==="object"&&"type"in lt&<.type==="Identifier"?lt.name:void 0;if((ut==="$derived"||ut==="$state")&&ct.arguments.length===1&&nt<5)return{...x(o,et,ct.arguments[0],nt+1),value:rt,defaultValue:at};if(ut){let dt=wy(o,et,ut);if(dt)return{value:rt,type:void 0,isFunction:!1,defaultValue:at,resolvedType:dt};if(et.funcDecls.has(ut)||Ay(et,ut))return{value:rt,type:void 0,isFunction:!1,defaultValue:at,pendingCallDefault:{calleeName:ut}};let ht=et.valueImportBindingsByLocalName.get(ut);if(ht)return{value:rt,type:void 0,isFunction:!1,defaultValue:at,pendingCallDefault:{calleeName:ut,importSource:ht.source,importedName:ht.importedName}}}return{value:rt,type:void 0,isFunction:!1,defaultValue:at,pendingCallDefault:{calleeName:ut??Py(et,lt)}}}else if(tt.type==="Identifier"){let ct=tt;if(nt<5){let ut=ui(et,ct.name);if(ut){let dt=x(o,et,ut,nt+1),ht=o.resolveLocalVarJSDoc(ct.name);return{...dt,resolvedType:ht?.type??dt.resolvedType,resolvedDescription:ht?.description??dt.resolvedDescription,resolvedParams:ht?.params??dt.resolvedParams,resolvedReturnType:ht?.returnType??dt.resolvedReturnType}}if(et.funcDecls.has(ct.name)){let dt=o.resolveLocalVarJSDoc(ct.name),ht=et.funcDecls.get(ct.name);return{value:ht?Ol(et,ht):void 0,type:void 0,isFunction:!0,defaultValue:ht?Ml(o,et,ht):void 0,resolvedType:dt?.type??Iy(dt,ht),resolvedDescription:dt?.description,resolvedParams:dt?.params,resolvedReturnType:dt?.returnType}}}if("start"in ct&&"end"in ct&&typeof ct.start==="number"&&typeof ct.end==="number")rt=s(et,ct.start,ct.end);let lt=et.valueImportBindingsByLocalName.get(ct.name);if(lt)return{value:rt,type:it,isFunction:st,defaultValue:at,pendingConstDefault:{importSource:lt.source,importedName:lt.importedName}}}else if(tt.type==="MemberExpression"){let ct=tt;if("start"in ct&&"end"in ct&&typeof ct.start==="number"&&typeof ct.end==="number")rt=s(et,ct.start,ct.end);if(o.isNumericConstant(tt))it="number";let lt=pi(et,tt);if(lt)return{value:rt,type:it,isFunction:st,defaultValue:at,pendingConstDefault:{importSource:lt.source,importedName:lt.importedName,...lt.members?{members:lt.members}:{}}}}else if(tt.type==="TemplateLiteral"){let ct=tt;if("start"in ct&&"end"in ct&&typeof ct.start==="number"&&typeof ct.end==="number")rt=s(et,ct.start,ct.end);it="string"}else if("raw"in tt&&typeof tt.raw==="string")rt=tt.raw,it=ys(tt);return{value:rt,type:it,isFunction:st,defaultValue:at}}function ys(o){if("regex"in o&&o.regex)return"RegExp";if("bigint"in o&&o.bigint)return"bigint";return o.value==null?void 0:typeof o.value}var Sy=new Set(["-","*","/","%","**","<<",">>",">>>","&","|","^"]),Ty=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function zn(o,et,tt,nt){if(!tt||typeof tt!=="object"||!("type"in tt))return;switch(tt.type){case"UnaryExpression":{let rt=tt;if(rt.operator==="!"||rt.operator==="delete")return"boolean";if(rt.operator==="typeof")return"string";if(rt.operator==="void")return;if(rt.operator==="+")return"number";return zn(o,et,rt.argument,nt)==="bigint"?"bigint":"number"}case"BinaryExpression":{let rt=tt;if(Ty.has(rt.operator))return"boolean";let it=zn(o,et,rt.left,nt),st=zn(o,et,rt.right,nt);if(it==="bigint"&&st==="bigint")return"bigint";if(Sy.has(rt.operator))return"number";if(rt.operator!=="+")return;if(it==="string"||st==="string")return"string";if(it==="number"&&st==="number")return"number";return}case"LogicalExpression":{let rt=tt;return Ll([zn(o,et,rt.left,nt),zn(o,et,rt.right,nt)])}case"ConditionalExpression":{let rt=tt;return Ll([zn(o,et,rt.consequent,nt),zn(o,et,rt.alternate,nt)])}case"SequenceExpression":{let rt=tt.expressions;return zn(o,et,rt[rt.length-1],nt)}case"Identifier":{let rt=tt.name;if(rt==="NaN"||rt==="Infinity")return"number";if(rt==="undefined")return;let it=o.findVariableTypeAndDescription(rt)?.type;if(it)return it;if(nt>=5)return;return zn(o,et,ui(et,rt),nt+1)}default:{if(nt>=5)return;let rt=x(o,et,tt,nt+1);return rt.type??rt.resolvedType}}}function Ll(o){let et=new Set;for(let tt of o){if(tt===void 0)return;et.add(tt.includes("=>")?`(${tt})`:tt)}return et.size===1?o[0]:[...et].join(" | ")}function ky(o,et,tt,nt){if(nt===void 0||et===void 0||tt===void 0)return nt;let rt=o.parsed?.comments??[],it="",st=et;for(let at of rt){if(at.start<et||at.end>tt)continue;it+=s(o,st,at.start)??"",st=at.end}if(st===et)return nt;return it+=s(o,st,tt)??"",it.replace(ai," ")}function na(o){if(!o||typeof o!=="object"||!("type"in o))return!1;switch(o.type){case"Literal":return!(("regex"in o)&&o.regex);case"TemplateLiteral":return o.expressions.length===0;case"Identifier":return o.name==="undefined";case"UnaryExpression":{let et=o,tt=et.argument;return et.operator==="-"&&tt?.type==="Literal"&&(typeof tt.value==="number"||typeof tt.value==="bigint")}case"ArrayExpression":return o.elements.every((et)=>et!==null&&na(et));case"ObjectExpression":return o.properties.every((et)=>et.type==="Property"&&et.kind==="init"&&!et.computed&&!et.method&&!et.shorthand&&(et.key.type==="Identifier"||et.key.type==="Literal")&&na(et.value));default:return!1}}function li(o,et,tt){let nt=ui(et,tt);if(!nt||typeof nt!=="object"||!("type"in nt))return;if(nt.type==="CallExpression"){let rt=nt,it=f(et,rt.callee);if(it==="$state"||it==="$state.raw"||it==="$derived"){let st=rt.typeArguments?.params?.[0];if(st)return a(et,st),f(et,st);if(it==="$state.raw")return x(o,et,rt.arguments[0],1).type}}return x(o,et,nt).type}function ui(o,et){for(let tt of o.vars)for(let nt of tt.declarations)if(nt.id&&typeof nt.id==="object"&&"type"in nt.id&&nt.id.type==="Identifier"&&"name"in nt.id&&nt.id.name===et&&nt.init)return nt.init;return}function Hr(o,et){for(let tt of o.vars){if(tt.kind!=="const")continue;for(let nt of tt.declarations)if(nt.id&&typeof nt.id==="object"&&"type"in nt.id&&nt.id.type==="Identifier"&&"name"in nt.id&&nt.id.name===et&&nt.init)return nt.init}return}function Py(o,et){if(et&&typeof et==="object"&&"start"in et&&"end"in et&&typeof et.start==="number"&&typeof et.end==="number")return s(o,et.start,et.end)??"call";return"call"}function wy(o,et,tt){let nt=o.resolveLocalVarJSDoc(tt);if(nt?.returnType)return nt.returnType;let rt=et.funcDecls.get(tt)??$l(et,tt);if(!rt)return;let it=_y(et,rt);if(it)return it;let st=Ny(et,tt);if(st)return st;let at=Fl(rt);return at==="any"?void 0:at}function Ay(o,et){return $l(o,et)!==void 0}function $l(o,et){let tt=ui(o,et);if(!tt||typeof tt!=="object"||!("type"in tt))return;if(tt.type==="ArrowFunctionExpression"||tt.type==="FunctionExpression")return tt;return}function Ny(o,et){for(let tt of o.vars)for(let nt of tt.declarations){let rt=nt.id;if(!rt||typeof rt!=="object"||!("type"in rt)||rt.type!=="Identifier"||!("name"in rt)||rt.name!==et)continue;let it=rt.typeAnnotation;if(it?.type!=="TSTypeAnnotation")return;let st=it.typeAnnotation;if(!st||typeof st.start!=="number"||typeof st.end!=="number")return;return Dy(s(o,st.start,st.end))}return}function Dy(o){if(!o)return;let et=o.lastIndexOf("=>");if(et===-1)return;return o.slice(et+2).trim()||void 0}function _y(o,et){let tt=et.returnType;if(tt?.type!=="TSTypeAnnotation")return;let nt=tt.typeAnnotation;if(!nt||typeof nt.start!=="number"||typeof nt.end!=="number")return;return s(o,nt.start,nt.end)}function Iy(o,et){let tt=o?.returnType??"any",nt=o?.params;if(nt&&nt.length>0)return`(${b(nt)}) => ${tt}`;if(o?.returnType)return`() => ${tt}`;if(et)return Bl(et);return"(...args: any[]) => any"}function Bl(o){return`(${Ry(o)}) => ${Fl(o)}`}function Ry(o){let et=o.params;if(!Array.isArray(et)||et.length===0)return"...args: any[]";let tt=[];for(let nt of et)if(nt&&typeof nt==="object"&&"type"in nt&&nt.type==="Identifier"&&"name"in nt&&typeof nt.name==="string")tt.push(`${nt.name}: any`);else return"...args: any[]";return tt.join(", ")}function Fl(o){if(o.async||o.generator)return"any";let et=o.body,tt;if(et&&typeof et==="object"&&"type"in et&&et.type==="BlockStatement"){if(tt=Ly(et),tt.length===0)return"any"}else tt=[et];let nt=null;for(let rt of tt){let it=Oy(rt);if(!it)return"any";if(nt===null)nt=it;else if(nt!==it)return"any"}return nt??"any"}function Ly(o){let et=[];return ra(o,et),et}function ra(o,et){if(!o||typeof o!=="object")return;let tt=o;if(typeof tt.type!=="string")return;if(tt.type==="FunctionDeclaration"||tt.type==="FunctionExpression"||tt.type==="ArrowFunctionExpression")return;if(tt.type==="ReturnStatement")et.push(tt.argument??null);for(let nt in tt){if(nt==="leadingComments")continue;let rt=tt[nt];if(!rt||typeof rt!=="object")continue;if(Array.isArray(rt))for(let it=0;it<rt.length;it++)ra(rt[it],et);else ra(rt,et)}}function Oy(o){if(!o||typeof o!=="object"||!("type"in o))return null;switch(o.type){case"Literal":{let et=o.value;if(typeof et==="string")return"string";if(typeof et==="number")return"number";if(typeof et==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let et=o.callee;if(et&&typeof et==="object"&&"type"in et&&et.type==="Identifier"){let tt=et.name;if(tt==="String")return"string";if(tt==="Number")return"number";if(tt==="Boolean")return"boolean"}return null}default:return null}}function Re(o){if(y(o,"$bindable"))return{init:o.arguments[0],bindable:!0};return{init:o,bindable:!1}}function My(o,et){let tt=et.params;if(!Array.isArray(tt)||tt.length===0)return"";let nt=tt[0],rt=tt[tt.length-1];if(typeof nt.start!=="number"||typeof rt.end!=="number")return"";return s(o,nt.start,rt.end)??""}function Ol(o,et){if(et.generator)return;let tt=et.body;if(!tt||typeof tt!=="object"||!("type"in tt))return;let nt=My(o,et),rt=et.async?"async ":"",it=(at,ct)=>at&&typeof at==="object"&&("type"in at)&&at.type==="ObjectExpression"?`(${ct})`:ct;if(tt.type!=="BlockStatement"){let at=f(o,tt);return at===void 0?void 0:`${rt}(${nt}) => ${it(tt,at)}`}let st=tt.body;if(st.length===0)return`${rt}(${nt}) => {}`;if(st.length===1){let at=st[0];if(at&&typeof at==="object"&&"type"in at&&at.type==="ReturnStatement"){let ct=at.argument;if(ct){let lt=f(o,ct);if(lt!==void 0)return`${rt}(${nt}) => ${it(ct,lt)}`}}}return}function Ml(o,et,tt){let nt=f(et,tt);if(!nt||!tt||typeof tt!=="object"||!("type"in tt))return;let rt="expression";if(tt.type==="Literal"||tt.type==="UnaryExpression")rt="literal";else if(tt.type==="TemplateLiteral")rt=tt.expressions.length===0?"literal":"expression";else if(tt.type==="ArrayExpression")rt="array";else if(tt.type==="ObjectExpression")rt="object";else if(tt.type==="ArrowFunctionExpression"||tt.type==="FunctionExpression"||tt.type==="FunctionDeclaration")rt="function";let it={raw:nt,kind:rt};if(rt==="literal"||rt==="array"||rt==="object"){let st=sa(o,tt);if(st.ok)it.value=st.value}return it}function sa(o,et){if(!et||typeof et!=="object"||!("type"in et))return{ok:!1};if(et.type==="Literal"){let tt=et.value;return typeof tt==="bigint"||"regex"in et?{ok:!1}:{ok:!0,value:tt}}if(et.type==="UnaryExpression"){let tt=et,nt=tt.argument;if(!nt||typeof nt!=="object"||!("type"in nt)||nt.type!=="Literal")return{ok:!1};let rt=nt.value;if(typeof rt==="number"){if(tt.operator==="-")return{ok:!0,value:-rt};if(tt.operator==="+")return{ok:!0,value:rt}}if(typeof rt==="boolean"&&tt.operator==="!")return{ok:!0,value:!rt};return{ok:!1}}if(et.type==="TemplateLiteral"){let tt=et;if(tt.expressions.length>0||tt.quasis.length!==1)return{ok:!1};return{ok:!0,value:tt.quasis[0].value.cooked??tt.quasis[0].value.raw}}if(et.type==="ArrayExpression"){let tt=et,nt=[];for(let rt of tt.elements){if(!rt)return{ok:!1};let it=sa(o,rt);if(!it.ok)return{ok:!1};nt.push(it.value)}return{ok:!0,value:nt}}if(et.type==="ObjectExpression"){let tt=et,nt={};for(let rt of tt.properties){if(rt.type!=="Property"||rt.computed)return{ok:!1};let it=o.getPropertyName(rt.key);if(!it)return{ok:!1};let st=sa(o,rt.value);if(!st.ok)return{ok:!1};nt[it]=st.value}return{ok:!0,value:nt}}return{ok:!1}}function Sn(o,et,tt){if(!et||o.has(et))return;o.set(et,tt)}function U(o,et){for(let tt=o.activeScopes.length-1;tt>=0;tt-=1){let nt=o.activeScopes[tt]?.get(et);if(!nt)continue;return nt.kind==="prop"?nt.publicPropName:void 0}return}function gs(o,et){for(let tt=o.activeScopes.length-1;tt>=0;tt-=1){let nt=o.activeScopes[tt];if(nt===o.componentScope)return!1;if(nt?.has(et))return!0}return!1}function se(o,et){let tt=et;while(O(tt))tt=tt.object;return e(tt)&&gs(o,tt.name)}function i(o,et=new Set){if(!o||typeof o!=="object"||!("type"in o))return et;switch(o.type){case"Identifier":et.add(o.name);break;case"AssignmentPattern":i(o.left,et);break;case"ArrayPattern":for(let tt of o.elements)i(tt??void 0,et);break;case"ObjectPattern":for(let tt of o.properties)if(tt.type==="Property")i(tt.value,et);else if(tt.type==="RestElement")i(tt.argument,et);break;case"RestElement":i(o.argument,et);break}return et}function ye(o,et){if(!et||typeof et!=="object"||!("type"in et))return;if(et.type==="Identifier"){let nt=U(o,et.name);if(nt)o.reactive_vars.add(nt);return}let tt=i(et);for(let nt of tt){let rt=U(o,nt);if(rt)o.reactive_vars.add(rt)}}function W(o){if(!o||typeof o!=="object"||!("type"in o))return!1;switch(String(o.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"AwaitBlock":return!0;default:return!1}}function jl(o){if(!o||typeof o!=="object"||!("type"in o))return!1;let et=String(o.type);return et==="FunctionDeclaration"||et==="FunctionExpression"||et==="ArrowFunctionExpression"}function $y(o,et){let tt=o.scopeDeclarations.get(et);if(!tt)tt=new Map,o.scopeDeclarations.set(et,tt);return tt}function By(o,et,tt){let nt=[];if(tt.id.type==="Identifier")return nt.push({kind:"local",name:tt.id.name}),nt;if(tt.id.type!=="ObjectPattern")return nt;for(let rt of tt.id.properties){if(rt.type==="RestElement"){if(rt.argument.type==="Identifier")nt.push({kind:"local",name:rt.argument.name});continue}if(rt.computed)continue;let it=o.getPropertyName(rt.key);if(!it)continue;let st;if(rt.value.type==="Identifier")st=rt.value.name;else if(rt.value.type==="AssignmentPattern"&&rt.value.left.type==="Identifier")st=rt.value.left.name;if(!st)continue;nt.push({kind:"prop",name:st,publicPropName:it})}return nt}function ia(o,et,tt,nt,rt){if(!wl(et))return;let it=rt?.allowRunesProps??!1,st=rt?.forceProp??!1,at=et;for(let ct of at.declarations){if(it&&y(g(ct.init),"$props")){for(let dt of By(o,at,ct))Sn(dt.kind==="prop"?tt:nt,dt.name,dt.kind==="prop"?{kind:"prop",publicPropName:dt.publicPropName}:{kind:"local"});continue}let lt=at.kind==="var"?nt:tt,ut=st?"prop":"local";for(let dt of i(ct.id))Sn(lt,dt,ut==="prop"?{kind:"prop",publicPropName:dt}:{kind:"local"})}}function Fy(o,et){if("id"in o&&o.id&&typeof o.id==="object"&&"name"in o.id&&typeof o.id.name==="string")Sn(et,o.id.name,{kind:"local"});for(let tt of o.params)for(let nt of i(tt))Sn(et,nt,{kind:"local"})}function jy(o,et,tt,nt){if(!Array.isArray(et))return;for(let rt of et){if(!rt||typeof rt!=="object"||!("type"in rt))continue;switch(rt.type){case"VariableDeclaration":ia(o,rt,tt,nt);break;case"FunctionDeclaration":if(rt.id?.name)Sn(tt,rt.id.name,{kind:"local"});break;case"ClassDeclaration":if(rt.id?.name)Sn(tt,rt.id.name,{kind:"local"});break}}}function Vy(o,et){for(let{local:tt,exported:nt}of et){if(tt.type!=="Identifier")continue;let rt=nt.type==="Identifier"?nt.name:String(nt.value);if(o.componentScope.get(tt.name)?.kind==="prop")continue;o.componentScope.set(tt.name,{kind:"prop",publicPropName:rt})}}function Wy(o,et,tt){if(!tt||typeof tt!=="object")return;let nt="content"in tt&&tt.content&&typeof tt.content==="object"&&"body"in tt.content&&Array.isArray(tt.content.body)?tt.content:("body"in tt)&&Array.isArray(tt.body)?tt:void 0;if(!nt||!("body"in nt)||!Array.isArray(nt.body))return;for(let rt of nt.body){if(!rt||typeof rt!=="object"||!("type"in rt))continue;switch(rt.type){case"ImportDeclaration":for(let it of rt.specifiers??[])if(it.local?.name)Sn(et.componentScope,it.local.name,{kind:"local"});break;case"VariableDeclaration":ia(o,rt,et.componentScope,et.componentScope,{allowRunesProps:!0});break;case"FunctionDeclaration":if(rt.id?.name)Sn(et.componentScope,rt.id.name,{kind:"local"});break;case"ClassDeclaration":if(rt.id?.name)Sn(et.componentScope,rt.id.name,{kind:"local"});break;case"ExportNamedDeclaration":if(!rt.declaration||typeof rt.declaration!=="object"||!("type"in rt.declaration)){if(rt.source==null)Vy(et,rt.specifiers??[]);break}if(rt.declaration.type==="VariableDeclaration")ia(o,rt.declaration,et.componentScope,et.componentScope,{forceProp:!0});else if(rt.declaration.type==="FunctionDeclaration"&&rt.declaration.id?.name)Sn(et.componentScope,rt.declaration.id.name,{kind:"prop",publicPropName:rt.declaration.id.name});break}}}function Le(o,et){et.componentScope.clear(),et.scopeDeclarations=new Map,et.activeScopes.length=0,Wy(o,et,et.parsed?.instance)}function Oe(o){return{varScopeStack:[o.componentScope]}}function Me(o,et,tt,nt){if(!W(nt))return;let rt=$y(et,nt),it=tt.varScopeStack[tt.varScopeStack.length-1]??et.componentScope;switch(String(nt.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":Fy(nt,rt);break;case"BlockStatement":jy(o,nt.body,rt,it);break;case"CatchClause":if("param"in nt)for(let at of i(nt.param))Sn(rt,at,{kind:"local"});break;case"EachBlock":{let at=nt;for(let ct of i(at.context))Sn(rt,ct,{kind:"local"});if(typeof at.index==="string")Sn(rt,at.index,{kind:"local"});else if(at.index&&"name"in at.index)Sn(rt,at.index.name,{kind:"local"});break}case"AwaitBlock":{let at=nt;for(let ct of i(at.value))Sn(rt,ct,{kind:"local"});for(let ct of i(at.error))Sn(rt,ct,{kind:"local"});break}}if(jl(nt))tt.varScopeStack.push(rt);return rt}function Be(o,et){if(jl(et))o.varScopeStack.pop()}function qy(o){let et=[],tt=0,nt=0;for(let rt=0;rt<o.length;rt++){let it=o[rt];if(it==="<"||it==="("||it==="["||it==="{")tt++;else if(it===">"||it===")"||it==="]"||it==="}")tt=Math.max(tt-1,0);else if(tt===0&&(it===";"||it===","))et.push(o.slice(nt,rt)),nt=rt+1}return et.push(o.slice(nt)),et}function Gy(o){let et=0;for(let tt=0;tt<o.length;tt++){let nt=o[tt];if(nt==="<"||nt==="("||nt==="["||nt==="{")et++;else if(nt===">"||nt===")"||nt==="]"||nt==="}")et=Math.max(et-1,0);else if(et===0&&nt===":")return tt}return-1}var Uy=/^\{([\s\S]*)\}$/,Hy=/^[A-Za-z_$][\w$]*$/;function xs(o){let et=o.trim(),tt=Uy.exec(et);if(!tt)return null;let nt=tt[1].trim();if(nt==="")return[];let rt=[];for(let it of qy(nt)){let st=it.trim();if(!st)continue;let at=Gy(st);if(at===-1)return null;let ct=st.slice(0,at).trim(),lt=st.slice(at+1).trim();if(!lt)return null;let ut=!1;if(ct.endsWith("?"))ut=!0,ct=ct.slice(0,-1).trim();if(!Hy.test(ct))return null;rt.push({name:ct,type:lt,optional:ut})}return rt}function oa(o,et,tt){let nt=et.findVariableTypeAndDescription(tt);if(nt&&nt.type===o.explicitVariableTypesByName.get(tt))a(o,o.explicitVariableTypeNodesByName.get(tt));return nt}function di(o,et,tt,nt=!0){let rt=oa(o,et,tt);if(rt||!nt)return rt;let it=li(et,o,tt);return it?{type:it,...et.findVariableJsDoc(tt)}:null}function Ky(o,et,tt,nt){if(!e(tt))return null;let rt=Hr(o,tt.name);if(Kn(rt))return Kl(o,et,rt,nt).properties;let it=di(o,et,tt.name);return it?xs(it.type):null}function zy(o,et,tt){return et.properties.some((nt)=>nt.type==="Property"&&nt.kind==="get"&&o.getPropertyName(nt.key)===tt)}function Vl(o,et,tt){if(!et||typeof et!=="object"||!(tt in et))return;let nt=et[tt];if(!nt||typeof nt!=="object"||!("typeAnnotation"in nt))return;return f(o,nt.typeAnnotation)}function Xy(o){let et=o?.body.body;if(et?.length!==1||et[0].type!=="ReturnStatement")return;return et[0].argument??void 0}function Jy(o,et,tt,nt,rt,it){if(e(it)){let st=di(o,et,it.name);if(st)return st;return r(o,"context-any-type",nt,`Context "${tt}" property "${nt}" has no type annotation; defaulted to "any".`,n(o,rt)),{type:"any"}}if(it?.type==="ArrowFunctionExpression"||it?.type==="FunctionExpression")return{type:`(${it.params.map((at)=>`${e(at)?at.name||"arg":"arg"}: any`).join(", ")}) => any`};if(h(it))return{type:ys(it)??"null"};return{type:"any"}}function Kl(o,et,tt,nt){let rt=[],it=!1;for(let st of tt.properties){if(st.type==="SpreadElement"){let dt=Ky(o,et,st.argument,nt);if(dt)rt.push(...dt);else it=!0,r(o,"spread-unresolved",nt,`Context "${nt}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,n(o,st));continue}if(st.type!=="Property")continue;let at=et.getPropertyName(st.key);if(!at)continue;if(st.kind==="set"&&zy(et,tt,at))continue;let ct=st.kind==="get"||st.kind==="set"?st.value:void 0,lt=ct?st.kind==="get"?Vl(o,ct,"returnType"):Vl(o,ct.params[0],"typeAnnotation"):void 0,ut=lt?{type:lt}:Jy(o,et,nt,at,st,st.kind==="get"?Xy(ct):st.kind==="set"?void 0:st.value);rt.push({name:at,type:ut.type,description:ut.description,optional:!1,...ut.internal?{internal:!0}:{}})}return{properties:rt,hasUnresolvedSpread:it}}var Yy=/(?:_|[^\p{ID_Continue}$])+/u,Qy=/^[\p{ID_Start}$]/u;function bs(o){let nt=`${o.split(Yy).map((rt)=>rt.charAt(0).toUpperCase()+rt.slice(1)).join("")}Context`;return Qy.test(nt)?nt:`_${nt}`}function Wl(o,et,tt,nt){let{properties:rt,hasUnresolvedSpread:it}=Kl(o,et,tt,nt);return{key:nt,typeName:bs(nt),properties:rt,description:void 0,...it?{hasUnresolvedSpread:it}:{}}}function ql(o,et,tt,nt){if(Kn(tt))return Wl(o,et,tt,nt);else if(e(tt)){let rt=tt.name,it=di(o,et,rt,!1),st=it?void 0:Hr(o,rt);if(Kn(st))return Wl(o,et,st,nt);let at=it??di(o,et,rt);if(at){let ct=xs(at.type);return{key:nt,typeName:bs(nt),...ct?{}:{type:at.type},properties:ct??[],description:at.description,...at.internal?{internal:!0}:{}}}return r(o,"context-any-type",rt,`Context "${nt}" variable "${rt}" has no type annotation; defaulted to "any".`,n(o,tt)),{key:nt,typeName:bs(nt),type:"any",properties:[]}}return null}function Gl(o){let et=o.callee;if(!et||typeof et!=="object"||!("type"in et))return null;let tt=et.type==="Identifier"&&et.name==="Symbol",nt=et.type==="MemberExpression"&&!et.computed&&et.object.type==="Identifier"&&et.object.name==="Symbol"&&et.property.type==="Identifier"&&et.property.name==="for";if(!tt&&!nt)return null;let rt=o.arguments[0];if(!rt||typeof rt!=="object"||!("type"in rt))return"";if(rt.type==="Literal"&&typeof rt.value==="string")return rt.value;if(rt.type==="TemplateLiteral"&&rt.quasis?.length===1)return rt.quasis[0].value.cooked??"";return""}function Ul(o){return{kind:"pending",importSource:o.source,importedName:o.importedName,...o.members?{members:o.members}:{}}}function zl(o,et,tt=0){if(!et||typeof et!=="object"||!("type"in et))return{kind:"unresolved"};let nt=et;if(nt.type==="Literal"||nt.type==="TemplateLiteral"){let rt=Yn(nt);return rt==null?{kind:"unresolved"}:{kind:"resolved",key:rt}}if(nt.type==="CallExpression"||nt.type==="NewExpression"){let rt=Gl(nt);return rt==null?{kind:"unresolved"}:{kind:"resolved",key:rt}}if(nt.type==="Identifier"){if(tt>=5)return{kind:"unresolved"};let rt=Hr(o,nt.name);if(rt&&typeof rt==="object"&&"type"in rt){let st=rt;if((st.type==="CallExpression"||st.type==="NewExpression")&&Gl(st)==="")return{kind:"resolved",key:nt.name};return zl(o,st,tt+1)}let it=tt===0&&gs(o,nt.name)?void 0:o.valueImportBindingsByLocalName.get(nt.name);return it?Ul(it):{kind:"unresolved"}}if(nt.type==="MemberExpression"){let rt=tt===0&&se(o,nt)?void 0:pi(o,nt);if(rt)return Ul(rt)}return{kind:"unresolved"}}function Hl(o,et,tt,nt,rt){let it=f(o,nt)??"";r(o,"context-value-unresolved",et,`setContext(${tt}, ${it}): the value isn't an object literal or a variable, so sveld can't describe its shape; the context is skipped.`,rt)}function je(o,et,tt,nt){if(!tt||typeof tt!=="object"||!("type"in tt)||tt.type!=="CallExpression")return;let rt=tt,it=rt.arguments[0];if(!it)return;let st=zl(o,it);if(st.kind==="unresolved"||st.kind==="resolved"&&!st.key){let dt=f(o,it)??"";r(o,"context-key-unresolved",dt,`setContext key \`${dt}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,n(o,tt));return}let at=rt.arguments[1];if(!at)return;let ct=n(o,tt);if(st.kind==="pending"){let dt=ci(st),ht=ql(o,et,at,dt);if(ht)o.pendingContextKeyCandidates.push({importSource:st.importSource,importedName:st.importedName,...st.members?{members:st.members}:{},...ht.type===void 0?{}:{type:ht.type},properties:ht.properties,description:ht.description,...ht.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...ht.internal?{internal:!0}:{},source:ct});else Hl(o,dt,dt,at,ct);return}let lt=st.key,ut=ql(o,et,at,lt);if(!ut){Hl(o,lt,JSON.stringify(lt),at,ct);return}if(o.contexts.has(lt)){r(o,"context-duplicate-key",lt,`setContext("${lt}", ...) was called more than once; only the first call's shape is used.`,ct);return}o.contexts.set(lt,{...ut,source:ct})}var Zy=/\n/g,eg=/^[A-Za-z_$][\w$]*$/;function ge(o,et,tt){return{variableType:(nt)=>{if(tt?.has(nt))return;return oa(et,o,nt)?.type??li(o,et,nt)},getPropertyName:(nt)=>o.getPropertyName(nt)}}function H(o,et,tt){if(!et||typeof et!=="object"||!("type"in et))return tt;if(e(et)){if(!gs(o,et.name))return tt;let rt=tt??new Set;return rt.add(et.name),rt}let nt=tt;if(Kn(et)){for(let rt of et.properties)if(rt.type==="Property")nt=H(o,rt.value,nt)}else if(et.type==="ArrayExpression")for(let rt of et.elements)nt=H(o,rt,nt);return nt}function xe(o,et){if(e(et))return o.variableType(et.name);return aa(o,et)}function aa(o,et){if(!et||typeof et!=="object"||!("type"in et))return;if(Kn(et))return Jl(o,et);if(et.type==="ArrayExpression")return Yl(o,et);return}function Xl(o,et){if(!et||typeof et!=="object"||!("type"in et))return"any";if(e(et))return o.variableType(et.name)??"any";if(h(et))return ys(et)??"null";if(Kn(et))return Jl(o,et);if(et.type==="ArrayExpression")return Yl(o,et);return"any"}function Jl(o,et){if(et.properties.length===0)return"Record<string, never>";let tt=[],nt=!1;for(let rt of et.properties){let it=rt.type==="Property"&&!rt.computed?o.getPropertyName(rt.key):void 0;if(rt.type!=="Property"||!it){nt=!0;continue}tt.push({name:it,type:Xl(o,rt.value)})}if(!nt)return Es(tt);if(tt.length===0)return"Record<string, any>";return Es([...tt,{name:"[key: string]",type:"any"}])}function Yl(o,et){let tt=new Set(et.elements.filter((nt)=>nt!=null).map((nt)=>Xl(o,nt)));if(tt.size===0)return"any[]";if(tt.size===1)return`${[...tt][0]}[]`;return`(${[...tt].join(" | ")})[]`}function $e(o,et){for(let[tt,nt]of o.arguments.entries()){if(e(nt)&&nt.name===et)return{argumentIndex:tt};if(!Kn(nt))continue;for(let rt of nt.properties){if(rt.type!=="Property"||!e(rt.value))continue;if(rt.value.name!==et)continue;let it=!rt.computed&&e(rt.key)?rt.key.name:void 0;return{argumentIndex:tt,property:it??""}}}return}function ie(o,et){let tt=u(o.name,et.name);if(tt!==0)return tt;let nt=u(o.type,et.type);if(nt!==0)return nt;if(o.type==="forwarded"&&et.type==="forwarded"){let rt=u(o.element,et.element);if(rt!==0)return rt}return u(o.detail??"",et.detail??"")}function G(o){return typeof o==="string"?JSON.stringify(o):String(o)}function k(o,{name:et,detail:tt,has_argument:nt,description:rt,deprecated:it,tags:st,internal:at,source:ct}){if(et===void 0)return;let lt=!nt&&!tt?"null":m(tt),ut=rt,dt=o.events.get(et);if(dt?.type==="forwarded")o.events.set(et,{type:"dispatched",name:et,detail:lt,description:ut||dt.description,deprecated:it??dt.deprecated,tags:st??dt.tags,...at||dt.internal?{internal:!0}:{},source:ct||dt.source});else if(dt){let ht=dt.tags??st,yt=o.untypedJsDocEventNames.delete(et);o.events.set(et,{...dt,detail:dt.detail===void 0||yt?lt:dt.detail,description:dt.description||ut,deprecated:dt.deprecated??it,tags:ht,...dt.internal||at?{internal:!0}:{},source:ct||dt.source})}else o.events.set(et,{type:"dispatched",name:et,detail:lt,description:ut,deprecated:it,tags:st,...at?{internal:!0}:{},source:ct})}function Fe(o,et){let tt=et.arguments[0],nt=ta(tt,"CustomEvent");if(!nt&&!ta(tt,"Event"))return;let rt=tt.arguments[0],it=h(rt)?rt.value:void 0;if(it==null)return;let st=nt?tt.arguments[1]:void 0,at=!1,ct;if(Kn(st)){let lt=st.properties.find((ut)=>ut.type==="Property"&&e(ut.key)&&ut.key.name==="detail");if(lt?.type==="Property")at=!0,ct=lt.value}return{name:String(it),detail:ct,hasArgument:at,nestedBoundNames:H(o,ct),source:n(o,et)}}function Je(o,et,tt){let nt=xe(ge(o,et,tt.nestedBoundNames),tt.detail),rt=nt===void 0&&h(tt.detail)?tt.detail.value:void 0;k(et,{name:tt.name,detail:nt??(rt==null?"":G(rt)),has_argument:tt.hasArgument,source:tt.source})}function Es(o,et,tt=!1){if(o.length===0)return"null";let nt=o.map(({name:rt,type:it,description:st,optional:at,default:ct})=>{let lt=at?"?":"",ut=eg.test(rt)||rt.startsWith("[")?rt:JSON.stringify(rt),dt=st||"";if(ct&&dt)dt=`${dt} @default ${ct}`;else if(ct)dt=`@default ${ct}`;if(dt=lr(dt),dt){if(tt)return`${dt.includes(`
|
|
22
|
+
`)?`/**
|
|
23
|
+
${dt.split(`
|
|
24
|
+
`).map((yt)=>yt?` * ${yt}`:" *").join(`
|
|
25
|
+
`)}
|
|
26
|
+
*/`:`/** ${dt} */`}
|
|
27
|
+
${ut}${lt}: ${it};`;return`/** ${dt.replace(Zy," ")} */ ${ut}${lt}: ${it};`}return`${ut}${lt}: ${it};`}).join(tt?`
|
|
28
|
+
`:" ");return tt?`{
|
|
29
|
+
${nt}
|
|
30
|
+
}`:`{ ${nt} }`}var tg=/^[A-Za-z_$][\w$]*/,ng=/[A-Za-z_$][\w$]*/g,Ql=/^(?:const|in|out)\s+/;function rr(o){let et=[],tt=0,nt=0;for(let rt=0;rt<o.length;rt++){let it=o[rt];if(it==="<"||it==="("||it==="["||it==="{")tt++;else if(it===">"||it===")"||it==="]"||it==="}")tt=Math.max(tt-1,0);else if(it===","&&tt===0)et.push(o.slice(nt,rt)),nt=rt+1}return et.push(o.slice(nt)),et}function qe(o){let et=rr(o).map((nt)=>nt.trim()).filter((nt)=>nt.length>0);if(et.length===0)return null;return[et.map((nt)=>{let rt=nt;while(Ql.test(rt))rt=rt.replace(Ql,"");return rt.match(tg)?.[0]??nt}).join(", "),et.join(", ")]}function Ve(o,et,tt){let nt=o.scriptGenericsAttribute?.value;if(!nt)return;for(let[rt]of nt.matchAll(ng)){if(o.typeImportBindingsByLocalName.has(rt))et.add(rt);if(tt.has(rt))continue;let it=o.localTypeDeclarationsByName.get(rt);if(!it)continue;tt.add(rt),l(o,it.node,et,tt)}}var rg=null;function sg(o,et,tt){let nt={value:void 0,replace:!1};if(!tt||typeof tt!=="object"||!("type"in tt))return nt;if(tt.type==="Identifier")nt.value=tt.name,nt.replace=!0;else if(tt.type==="Literal")nt.value=String(tt.value);else if(tt.type==="MemberExpression")nt.value=Q(o,et,tt);else if((tt.type==="ObjectExpression"||tt.type==="TemplateLiteral")&&"start"in tt&&"end"in tt&&typeof tt.start==="number"&&typeof tt.end==="number")nt.value=s(o,tt.start,tt.end);return nt}function ig(o,et,tt){if(!e(tt))return null;let nt=Hr(o,tt.name);if(Kn(nt))return Te(o,et,nt).slot_props;let rt=et.findVariableTypeAndDescription(tt.name);if(!rt)return null;let it=xs(rt.type);if(!it)return null;let st={};for(let at of it)st[at.name]={value:at.type,replace:!1};return st}function Te(o,et,tt){let nt={},rt=!1;for(let it of tt.properties){if(it.type==="SpreadElement"){let at=ig(o,et,it.argument);if(at)Object.assign(nt,at);else rt=!0,r(o,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,n(o,it));continue}if(it.type!=="Property"||it.computed)continue;let st=et.getPropertyName(it.key);if(!st)continue;nt[st]=sg(o,et,it.value)}return{slot_props:nt,hasUnresolvedSpread:rt}}function og(o,et){if(!et||typeof et!=="object"||!("type"in et))return null;if(et.type==="Identifier"){let it=et,st=o.propLocalToPublicName.get(it.name);if(!st)return null;return{publicName:st,trackingName:it.name}}if(et.type!=="MemberExpression")return null;let tt=et,nt=tt.object&&typeof tt.object==="object"&&"type"in tt.object&&tt.object.type==="Identifier"?tt.object.name:void 0;if(!nt||!o.wholePropsLocals.has(nt))return null;let rt;if(!tt.computed&&tt.property&&typeof tt.property==="object"&&"type"in tt.property){if(tt.property.type==="Identifier")rt=tt.property.name;else if(tt.property.type==="Literal"&&tt.property.value!=null)rt=String(tt.property.value)}else if(tt.computed&&tt.property&&typeof tt.property==="object"&&"type"in tt.property&&tt.property.type==="Literal"&&"value"in tt.property&&tt.property.value!=null)rt=String(tt.property.value);if(!rt)return null;return{publicName:rt,trackingName:rt}}function Ue(o,et){let tt=et;if(tt&&typeof tt==="object"&&"type"in tt&&tt.type==="ChainExpression")tt=tt.expression;if(!tt||typeof tt!=="object"||!("type"in tt)||tt.type!=="CallExpression")return null;let nt=tt;if(!nt.callee||typeof nt.callee!=="object"||!("type"in nt.callee))return null;let rt=og(o,nt.callee);if(!rt)return null;return{...rt,arguments:nt.arguments}}function z(o,{slot_name:et,slot_props:tt,slot_props_unresolved_spread:nt,slot_fallback:rt,slot_description:it,slot_deprecated:st,slot_tags:at,slot_internal:ct,source:lt}){let ut=et===void 0||et==="",dt=ut?rg:et??"",ht=m(rt),yt=tt===void 0||tt===""?void 0:tt,xt=it?.trim()||void 0;if(o.slots.has(dt)){let Et=o.slots.get(dt);if(Et)o.slots.set(dt,{...Et,default:Et.default??ut,fallback:ht,slot_props:Et.slot_props===void 0?yt:Et.slot_props,slot_props_unresolved_spread:Et.slot_props_unresolved_spread||nt,description:Et.description||xt,deprecated:Et.deprecated??st,tags:Et.tags||at,...Et.internal||ct?{internal:!0}:{},source:lt||Et.source})}else o.slots.set(dt,{name:dt,default:ut,fallback:ht,slot_props:yt,slot_props_unresolved_spread:nt,description:xt,deprecated:st,tags:at,...ct?{internal:!0}:{},source:lt})}var ca=/^\s+/,Zl=/\s/,ag=/^@[^\s/]+(?=\s|$)/,cg=/^@(\S+)\s*/;function Cs(o){let et=0;while(et<o.length){let tt=o.charCodeAt(et);if(tt!==32&&tt!==9&&tt!==13&&tt!==10&&!Zl.test(o[et]))break;et++}return et}function pg(o,et){let tt=o.slice(Cs(o)),nt=!1;if(et)tt=tt.slice(3),nt=!0;else if(tt.startsWith("*")&&!tt.startsWith("*/"))tt=tt.slice(1),nt=!0;let rt=tt.slice(0,Cs(tt));tt=tt.slice(rt.length);let it=tt.trimEnd(),st=it.endsWith("*/")?it.slice(0,-2).trimEnd():tt;return{indent:nt?rt.slice(1):rt,content:st}}function lg(o,et,tt){let nt=tt>et&&o.charCodeAt(tt-1)===13?tt-1:tt;return o.slice(et,nt)}function ug(o){let et=[],tt=0;while(!0){let nt=o.indexOf("/**",tt);if(nt===-1)break;let rt=o.lastIndexOf(`
|
|
31
|
+
`,nt-1)+1;if(o.charCodeAt(nt+3)===42||o.slice(rt,nt).trim()!==""){tt=nt+1;continue}let it=[],st=rt,at=!1,ct=0;while(st<=o.length){let lt=o.indexOf(`
|
|
32
|
+
`,st),ut=lt===-1?o.length:lt,dt=lg(o,st,ut),{indent:ht,content:yt}=pg(dt,it.length===0);it.push({raw:dt,start:st,number:it.length,indent:ht,content:yt});let xt=dt.trimEnd();if(xt.endsWith("*/")){at=!0,ct=st+xt.length,tt=ut;break}if(lt===-1)break;st=lt+1}if(!at)break;et.push({start:nt,end:ct,lines:it})}return et}function dg(o){let et=o;if(et.length>0&&et[0].content==="")et=et.slice(1);if(et.length>0&&et[et.length-1].content==="")et=et.slice(0,-1);return et}function fg(o){let et=[[]],tt=!1;for(let nt of o){if(ag.test(nt.content)&&!tt)et.push([nt]);else et[et.length-1].push(nt);if(fi(nt.content))tt=!tt}return et}function fi(o){return hg(o,"```")%2===1}function hg(o,et){let tt=0,nt=o.indexOf(et);while(nt!==-1)tt++,nt=o.indexOf(et,nt+et.length);return tt}function eu(o){return o.map((et)=>et.indent+et.content).join(`
|
|
33
|
+
`)}function mg(o,et){let tt=et;while(tt<o.length-1&&o[tt].content.trim()==="")tt++;if(o[tt].content[0]!=="{")return null;let nt=0,rt,it=!1,st=[],at=tt;for(;at<o.length;at++){let ut=o[at].content,dt=0;for(let ht of ut){if(dt++,rt!==void 0){if(it)it=!1;else if(ht==="\\")it=!0;else if(ht===rt)rt=void 0;continue}if(ht==='"'||ht==="'"||ht==="`")rt=ht;else if(ht==="{")nt++;else if(ht==="}")nt--;if(nt===0)break}if(st.push(dt),nt===0)break}if(nt!==0)return null;let ct=at;return{type:st.map((ut,dt)=>{let ht=tt+dt,yt=o[ht].content.slice(0,ut);if(o[ht].content=o[ht].content.slice(ut).replace(ca,""),ht>0)o[ht].continuesType=!0;return dt===0?yt:o[ht].indent+yt}).join(`
|
|
34
|
+
`).slice(1,-1),endIndex:ct}}function yg(o){let et=o.content.match(ca)?.[0]??"",tt=o.content.slice(et.length),nt=0,rt=0;for(let lt of tt){if(nt===0&&Zl.test(lt))break;if(lt==="[")nt++;if(lt==="]")nt--;rt++}let it=nt===0?tt.slice(0,rt):"";if(!it)return null;let st=it,at=!1,ct;if(it.startsWith("[")&&it.endsWith("]")){at=!0;let ut=it.slice(1,-1).split("=");if(st=ut[0].trim(),ut.length>1)ct=ut.slice(1).join("=").trim();if(!st)return null}if(st.length>1&&(st[0]==='"'||st[0]==="'")&&st[st.length-1]===st[0])st=st.slice(1,-1);return o.content=tt.slice(rt).replace(ca,""),{name:st,optional:at,default:ct}}function gg(o){let et=o[0],tt=et.content.match(cg),nt=tt?tt[1]:"",rt=tt?et.content.slice(tt[0].length):et.content,it=rt.trimEnd(),st=o.slice(1).map((yt)=>yt.indent+yt.content),at=(it?[it,...st]:st).join(`
|
|
35
|
+
`);et.content=rt,et.tag=nt;let ct=mg(o,0),lt=ct?.type??"",ut=ct?.endIndex??0,dt=yg(o[ut]),ht=eu(o.slice(ut));return{tag:nt,name:dt?.name??"",type:lt,optional:dt?.optional??!1,default:dt?.default,description:ht,text:at,lines:o}}function xg(o,et,tt){let nt=dg(o);nt.forEach((st,at)=>{st.number=at});let rt=fg(nt),it=rt.slice(1).map(gg);return{description:eu(rt[0]),tags:it,start:et,end:tt,lines:nt}}function Ar(o){return ug(o).map(({start:et,end:tt,lines:nt})=>xg(nt,et,tt))}var bg=/\s*=\s*/;function Eg(o){let et=o.indexOf("<");if(et===-1||!o.endsWith(">"))return o;let tt=o.slice(0,et),nt=o.slice(et+1,-1),rt=rr(nt).map((it)=>it.trim().replace(bg," = ")).join(", ");return`${tt}<${rt}>`}var Cg=/\s/;function Ee(o,et,tt){let nt=et;while(nt<tt){let rt=o[nt];if(rt==="/"&&o[nt+1]==="/"){let it=o.indexOf(`
|
|
36
|
+
`,nt+2);if(it===-1||it>=tt)return!0;nt=it+1}else if(rt==="/"&&o[nt+1]==="*"&&o[nt+2]!=="*"){let it=o.indexOf("*/",nt+2);if(it===-1||it+2>tt)return!1;nt=it+2}else if(rt===" "||rt===`
|
|
37
|
+
`||rt==="\t"||rt==="\r"||Cg.test(rt))nt++;else return!1}return!0}var vg=/;$/,Sg=/^-\s*/;function da(o){let et=[],tt,nt=!1;for(let rt of o){let it=fi(rt);if(tt!==void 0){if(it)et.push(rt.trim()),tt=void 0;else et.push(rt.slice(Math.min(tt,Cs(rt))).trimEnd());continue}let st=rt.trim();if(st===""){nt=et.length>0;continue}if(nt)et.push("");if(nt=!1,et.push(st),it)tt=Cs(rt)}return et.join(`
|
|
38
|
+
`).trimEnd()}function xr(o){if(o===void 0)return;let et=o.replace(Sg,"").trim();return et===""?"":et}function We(o){let et=o.name?`${o.name} ${o.description}`:o.description;return xr(da(et.split(`
|
|
39
|
+
`)))}var Tg=new Set(["restProps","slot","snippet","event","typedef","callback"]),pa=new Set(["property","type"]),kg=new Set(["slot","snippet","typedef","callback"]);function hi(o){if(!o||o.length===0)return;return o[ru(o)].content}function ru(o){let et=0;while(o[et+1]?.continuesType)et++;return et}function tu(o){return!o||!o.tag&&!o.continuesType&&o.content.trim()===""}function Pg(o){return o.text.split(`
|
|
40
|
+
`).length===o.lines.length}function la(o,et){if(et<=0)return o;return o.split(`
|
|
41
|
+
`).slice(0,-et).join(`
|
|
42
|
+
`).trimEnd()}var su=new Set(["since","example","see"]),wg=new Set(["bindable","default","required"]);function iu(o){return o.length>0?o.map((et)=>({name:et.tag,body:et.text})):void 0}function ua(o){let et=o.trim();return et===""?!0:et}function Ag(o){let et=o.trim().replace(vg,"").trimEnd();if(!et.startsWith("{")||!et.endsWith("}"))return!1;let tt=0,nt=null;for(let rt=0;rt<et.length;rt++){let it=et[rt];if(nt!==null){if(it==="\\"){rt++;continue}if(it===nt)nt=null;continue}if(it==='"'||it==="'"||it==="`"){nt=it;continue}if(it==="{"||it==="["||it==="(")tt++;else if(it==="}"||it==="]"||it===")"){if(tt--,tt===0&&rt<et.length-1)return!1}}return tt===0}function fa(o){let et=o;if(!et.startsWith("/*"))et=`/*${et}`;if(!et.endsWith("*/"))et+="*/";return et}function Ng(o){if(o==="*")return"any";return o.trim()}function ou(o){let et=Ar(fa(o)),{returns:tt}=v(et);return tt?Ng(tt.type):void 0}function au(o){let et=Ar(fa(o)),{deprecated:tt,passthrough:nt,internal:rt}=v(et);return{deprecated:tt,tags:iu(nt),internal:rt}}var Dg=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function be(o,et){let tt=o.parsedJsDocByText.get(et);if(tt===void 0)tt=Ar(et),o.parsedJsDocByText.set(et,tt);return tt}function v(o){let et=o[0]?.tags??[],tt,nt=[],rt,it,st,at=!1,ct=[],lt=[],ut=[];for(let dt of et)if(dt.tag==="type")tt=dt;else if(dt.tag==="param")nt.push(dt);else if(dt.tag==="returns"||dt.tag==="return")rt=dt;else if(dt.tag==="deprecated")st??=ua(dt.text);else if(dt.tag==="ignore"||dt.tag==="internal")at=!0;else if(dt.tag==="sveld-ignore")ut.push(dt.name);else if(su.has(dt.tag))lt.push(dt);else if(dt.tag==="bindable"){if(dt.type)continue;let ht=`${dt.name}${dt.description?` ${dt.description}`:""}`.trim();if(ht==="readonly"||ht==="writable")it??=ht}else if(!Dg.has(dt.tag))ct.push(dt);return{type:tt,param:nt,returns:rt,binding:it,deprecated:st,internal:at,additional:ct,passthrough:lt,ignore:ut,description:o[0]?.description}}function _g(o,et){if(typeof et.start!=="number"||typeof et.end!=="number")return;let tt=o.jsDocBlocksByStart.get(et.start);if(tt===void 0||tt.end!==et.end)return;return[tt]}function Ig(o){if(!o||o.length===0)return;let et=o[o.length-1];return et&&typeof et==="object"&&"value"in et?et:void 0}function cu(o,et,tt){if(!et||et.length===0||tt===void 0||!o.source)return;for(let nt=et.length-1;nt>=0;nt--){let rt=et[nt];if(!rt||typeof rt!=="object"||!("value"in rt)||!("end"in rt))continue;if(typeof rt.end!=="number"||!("start"in rt)||typeof rt.start!=="number")continue;if("type"in rt&&rt.type==="Line"||!String(rt.value).startsWith("*"))continue;if(Ee(o.source,rt.end,tt))return rt}return}function Rg(o){let et=new Set,tt=(rt)=>{let{leadingComments:it,start:st}=rt,at=cu(o,it,st);if(at)et.add(at.start)};for(let rt of o.funcDecls.values())tt(rt);let nt=[{root:o.parsed?.module,isModule:!0},{root:o.parsed?.instance,isModule:!1}];for(let{root:rt,isModule:it}of nt)for(let st of(rt&&S(rt))??[]){let at=st,ct=at.type==="ExportNamedDeclaration",lt=ct?at.declaration:at;if(lt?.type==="FunctionDeclaration"){if(ct)tt(at)}else if(lt?.type==="ClassDeclaration"&&it){tt(ct?at:lt);for(let ut of lt.body?.body??[])if(ut.type==="MethodDefinition")tt(ut)}else if(lt?.type==="VariableDeclaration"&&(it||!ct||lt.kind==="const")&<.declarations?.length===1&&Lg.has(lt.declarations[0].init?.type??""))tt(at)}return et}var Lg=new Set(["ArrowFunctionExpression","FunctionExpression"]);function d(o,et,tt){if(!tt?.leadingComments)return;let nt=cu(o,tt.leadingComments,tt.start);if(!nt)return;return Vg(o,et,[nt])}function He(o,et,tt){if(!tt?.leadingComments)return;return d(o,et,tt)}function Og(o,et,tt){let nt=o;if(et)nt=`${o} extends ${et}`;if(tt)nt+=` = ${tt}`;return nt}var Mg=/^[^\s,]+/,nu=/^\s*,\s*([^\s,]+)/;function pu(o,et){let tt=o.optional?o.name:Mg.exec(o.name)?.[0];if(!tt)return[];let nt=[{name:tt,constraint:Og(tt,et,o.default)}],rt=`${o.optional?"":o.name.slice(tt.length)} ${o.description}`;for(let it=nu.exec(rt);it;it=nu.exec(rt))nt.push({name:it[1],constraint:it[1]}),rt=rt.slice(it[0].length);return nt}var $g=/[\w$]+/g,Bg=new Set(["property","param","returns","return"]);function Fg(o,et,tt){let nt=[o[et].type];for(let it=et+1;Bg.has(o[it]?.tag);it++)nt.push(o[it].type);let rt=new Set(nt.join(" ").match($g));return tt.some(({name:it})=>rt.has(it))}function jg(o){let et=o?.trim();return!et||et==="object"||et==="Object"}function Vg(o,et,tt){if(!tt)return;let nt=Ig(tt);if(!nt)return;let rt=_g(o,nt)??be(o,fa(nt.value)),{type:it,param:st,returns:at,binding:ct,deprecated:lt,internal:ut,additional:dt,passthrough:ht,ignore:yt,description:xt}=v(rt),Et,Ct,At,_t;if(it)Et=et.aliasType(it.type);if(st.length>0)Ct=st.filter((Ot)=>!Ot.name.includes(".")).map((Ot)=>({name:Ot.name,type:et.aliasType(Ot.type),description:xr(da(Ot.description.split(`
|
|
43
|
+
`))),optional:Ot.optional||!1}));if(at)At=et.aliasType(at.type);let vt,Rt=dt;if(typeof nt.start==="number"&&o.functionDocCommentStarts.has(nt.start)){let Ot=dt.filter((Wt)=>Wt.tag==="template"&&Wt.name);if(Ot.length>0)vt=Ot.flatMap((Wt)=>pu(Wt,et.aliasType(Wt.type))).map(({constraint:Wt})=>Wt).join(", "),Rt=dt.filter((Wt)=>Wt.tag!=="template")}let Nt=m(xt?.trim());if(Nt||Rt.length>0){let Ot=[];if(Nt)Ot.push(Nt);for(let Wt of Rt)Ot.push(`@${Wt.tag}${Wt.text?` ${Wt.text}`:""}`);_t=Ot.join(`
|
|
44
|
+
`)}return{type:Et,params:Ct,returnType:At,description:_t,binding:ct,deprecated:lt,tags:iu(ht),sveldIgnore:yt.length>0?yt:void 0,internal:ut,typeParameters:vt}}function Ge(o,et,tt=o.source){if(!tt)return;let nt=!1,rt=!1,it=!1,st=new Set,at=()=>{if(nt&&rt&&!it){it=!0;let xt=o.componentFilePath?` in ${o.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${xt}; their declarations are combined in the order encountered.`)}},ct=(xt,Et)=>{if(st.has(xt))r(o,"generics-conflict",xt,`Duplicate generic name "${xt}".`,Et);else st.add(xt)},lt=(xt,Et)=>{if(o.generics){let At=rr(o.generics[0]).map((_t)=>_t.trim()).indexOf(xt.trim());if(At!==-1){let _t=rr(o.generics[1]).map((vt)=>vt.trim());_t[At]=Et,o.generics=[o.generics[0],_t.join(", ")];return}}et.accumulateGeneric(xt,Et)},ut=(xt,Et)=>{if(o.typedefs.has(xt))r(o,"typedef-duplicate",xt,`Duplicate typedef/callback name "${xt}"; the later declaration overwrites the earlier one.`,Et)},dt=(xt,Et,Ct,At)=>{let _t=xt.findIndex((vt)=>vt.name===Et.name);if(_t===-1)xt.push(Et);else{let vt=Ct?` of "${Ct}"`:"";r(o,"property-duplicate",Et.name,`Duplicate property "${Et.name}"${vt}; the later declaration overwrites the earlier one.`,At),xt[_t]=Et}},ht=tt.includes("@template")?Rg(o):new Set;o.functionDocCommentStarts=ht;let yt=Ar(tt);for(let xt of yt)o.jsDocBlocksByStart.set(xt.start,xt);for(let{tags:xt,description:Et,lines:Ct,start:At}of yt){let _t=ht.has(At),vt,Rt,Nt,Ot,Wt=!1,tn,ot,pt=[],ft=[],gt=[],bt,St,kt,Pt,wt=[],Tt=!1,Dt=[],Lt,Ft,Kt,nn=[],dn=!1,mn=[],un,fn,Ut=!1,Gt=!0,rn=[],jn,Xn=!1,$s=[],Lc=(It)=>{if($s.length===0)return Eg(It);let Ht=`${It}<${$s.join(", ")}>`;return $s.length=0,Ht},rs=new Map,po=new Set,vr=new Set,Oc,lo;for(let It of xt)if(It.lines.length>0)po.add(It.lines[0].number);for(let It of Ct)if(It.continuesType)po.add(It.number);let Bs=new Set,uo=!1,Fs=!1;for(let It of Ct){if(!It.tag&&!It.continuesType&&It.content&&(Fs||It.content.trim()!=="}"))rs.set(It.number,It.content);if(It.tag!==void 0||It.continuesType)uo=!0;else if(!It.content.trim());else if(uo&&(It.indent||Fs))Bs.add(It.number);else uo=!1;if(fi(It.content))Fs=!Fs}let fo=(It,Ht)=>{let an=Ht?Ht.text.split(`
|
|
45
|
+
`):[],jt=Ht?.line;for(let Qt of It){if(jt!==void 0&&Qt-jt>1){let sn=jt+1;while(sn<Qt&&tu(Ct[sn]))sn++;if(sn===Qt)for(let xn=jt+1;xn<Qt;xn++)an.push("")}let Jn=Ct[Qt];an.push(Jn.indent+Jn.content),jt=Qt}return da(an)},Tf=(It)=>{if(It.length===0)return;let Ht=It[0].number,an=[],jt=!1;for(let Qt=Ht-1;Qt>=0;Qt--){if(po.has(Qt)||Bs.has(Qt)||vr.has(Qt))break;if(rs.has(Qt))an.unshift(Qt),jt=!0;else if(jt&&!tu(Ct[Qt]))break}if(an.length===0)return;for(let Qt of an)vr.add(Qt);return Oc?.(an[0]),fo(an)},ho=(It,Ht)=>{if(!Pg(It)){for(let jt=1;jt<It.lines.length;jt++)vr.add(It.lines[jt].number);return}let an=It.lines[It.lines.length-1].number;lo=(jt)=>Ht(an-jt+1)},Br=(It,Ht,an=!1)=>{let jt=xr(hi(It)),Qt=Ht!==void 0&&Tg.has(Ht.tag)&&!xr(hi(Ht.lines)),Jn=an&&(Ht===void 0||!pa.has(Ht.tag)),sn=[];for(let xn=1;xn<It.length;xn++){let on=It[xn];if((Qt||Jn)&&!Bs.has(on.number))continue;if(!rs.get(on.number)?.trim()||vr.has(on.number))continue;sn.push(on.number),vr.add(on.number)}if(sn.length===0)return jt;return fo(sn,{text:jt??"",line:It[ru(It)].number})},kf=(It,Ht,an,jt)=>{if(vt===void 0||Nt)return;if(ot!==void 0&&Bs.has(ot+1))return;if(jt?.tag!=="event"&&!pa.has(jt?.tag??""))return;if(xr(hi(an)))return;let Qt=Ht?`@${It} "${Ht}"`:`@${It}`;r(o,"event-description-ambiguous",vt,`Text after @event "${vt}" was used as the description of ${Qt}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,Fn(o,an))},ss=(It)=>{let{tag:Ht,name:an,lines:jt}=xt[It],Qt=Tf(jt);if(Qt)kf(Ht,an,jt,xt[It-1]);return Qt},mo=()=>{if(vt!==void 0){let It=Rt&&Rt!=="object"&&Rt!=="Object"?Rt:void 0,Ht;if(It)Ht=It;else if(gt.length>0)Ht=Es(gt,vt,!0);else Ht=Rt||"";if(ot!==void 0){let jt;for(let sn of xt){let xn=sn.lines[0]?.number;if(typeof xn!=="number")continue;if(xn<=ot)continue;if(pa.has(sn.tag))continue;jt=xn;break}let Qt=[],Jn=Array.from(rs.keys()).sort((sn,xn)=>sn-xn);for(let sn of Jn){if(sn<=ot)continue;if(jt!==void 0&&sn>=jt)continue;if(vr.has(sn))continue;if(rs.get(sn)?.trim())Qt.push(sn),vr.add(sn)}if(Qt.length>0)Nt=fo(Qt,Nt?{text:Nt,line:ot}:void 0)}let an=Ht===""&&(!o.events.has(vt)||o.untypedJsDocEventNames.has(vt));if(k(o,{name:vt,detail:Ht,has_argument:!1,description:Nt,deprecated:Ot,tags:pt.length>0?pt:void 0,internal:Wt||void 0,source:tn}),an)o.untypedJsDocEventNames.add(vt);o.eventDescriptions.set(vt,Nt),o.jsDocEventNames.add(vt),o.jsDocEventSources.set(vt,tn),T(o,"event-no-source",vt,ft),gt.length=0,vt=void 0,Rt=void 0,Nt=void 0,Ot=void 0,Wt=!1,tn=void 0,ot=void 0,pt=[],ft=[]}},Mc=()=>{if(bt!==void 0){let It,Ht;if(Dt.length>0)It=Es(Dt,void 0,!0),Ht=`type ${bt} = ${It};`;else if(St)It=St,Ht=Ag(It)?`interface ${bt} ${It}`:`type ${bt} = ${It};`;else It="{}",Ht=`type ${bt} = ${It};`;ut(bt,Pt),o.typedefs.set(bt,{type:It,name:bt,description:m(kt),ts:Ht,tags:wt.length>0?wt:void 0,...Tt?{internal:!0}:{},source:Pt}),Dt.length=0,bt=void 0,St=void 0,kt=void 0,Pt=void 0,wt=[],Tt=!1}},$c=()=>{if(Lt!==void 0){let an=`(${mn.map(({name:Qt,type:Jn,optional:sn})=>`${Qt}${sn?"?":""}: ${Jn}`).join(", ")}) => ${un||"void"}`,jt=`type ${Lt} = ${an};`;ut(Lt,Kt),o.typedefs.set(Lt,{type:an,name:Lt,description:m(Ft),ts:jt,tags:nn.length>0?nn:void 0,...dn?{internal:!0}:{},source:Kt}),mn.length=0,un=void 0,Lt=void 0,Ft=void 0,Kt=void 0,nn=[],dn=!1}},Pf=xt.some((It)=>It.tag==="slot"||It.tag==="snippet"),wf=xt.some((It)=>It.tag==="extends"||It.tag==="extendProps"),Af=xt.some((It)=>It.tag==="slot"||It.tag==="snippet"||It.tag==="event"||It.tag==="typedef"||It.tag==="callback");for(let It=0;It<xt.length;It++){let{tag:Ht,type:an,name:jt,description:Qt,optional:Jn,default:sn,text:xn,lines:on}=xt[It],Fr=xt[It+1],$n=et.aliasType(an);switch(Oc=lo,lo=void 0,Ht){case"extends":case"extendProps":if(o.extends!==void 0)r(o,"extend-props-duplicate",jt,`A second @extends/@extendProps tag ("${jt}") overwrote the first ("${o.extends.interface}"); only one is used.`,Fn(o,on));if(o.extends={interface:jt,import:$n},Gt)Gt=!1;break;case"restProps":{let zt=jt?Qt?`${jt} ${Qt}`:jt:Qt,hn=xr(zt),Nn=hn||ss(It);if(!Nn&&Gt&&!Ut&&Et)Nn=Et,Ut=!0;let tr={type:"Element",name:$n,description:Nn||void 0};if(o.rest_props=tr,hn)ho(xt[It],(is)=>{tr.description=xr(la(zt,is))||void 0});if(Gt)Gt=!1;break}case"slot":case"snippet":{let zt=Br(on,Fr);if(!zt&&Gt&&!Ut&&Et)zt=Et,Ut=!0;if(!zt&&rn.length===0)zt=ss(It);if(Gt)Gt=!1;let hn=$n;if(!hn)hn="Record<string, never>",r(o,"slot-missing-type",jt||"default",`@${Ht}${jt?` "${jt}"`:""} is missing a required {Type} annotation; falling back to "${hn}".`,Fn(o,on));z(o,{slot_name:jt,slot_props:hn,slot_description:zt||void 0,slot_deprecated:jn,slot_tags:rn.length>0?[...rn]:void 0,slot_internal:Xn||void 0,source:Fn(o,on)}),rn.length=0,jn=void 0,Xn=!1;{let Nn=jt===void 0||jt===""?null:jt;fn=(tr)=>{let is=o.slots.get(Nn);if(is)is.tags=[...is.tags??[],tr]}}break}case"csspart":{let zt=Br(on,Fr);o.cssParts.push({name:jt,...zt?{description:zt}:{}});break}case"cssprop":case"cssproperty":{let zt=Br(on,Fr);o.cssProperties.push({name:jt,...$n?{type:$n}:{},...sn===void 0?{}:{default:sn},...zt?{description:zt}:{}});break}case"event":{let zt=xr(hi(on))||ss(It);if(mo(),vt=jt,Rt=$n,ot=on.length>0?on[0].number:void 0,Nt=zt,!Nt&&Gt&&!Ut&&Et)Nt=Et,Ut=!0;if(tn=Fn(o,on),rn.length>0)pt.push(...rn),rn.length=0;if(fn=(hn)=>pt.push(hn),Gt)Gt=!1;break}case"type":if(vt!==void 0)Rt=$n;break;case"param":if(Lt!==void 0)mn.push({name:jt,type:$n,optional:Jn||!1});break;case"returns":case"return":if(Lt!==void 0)un=$n;break;case"property":{let zt={name:jt,type:$n,description:Br(on,Fr,vt!==void 0),optional:Jn||!1,default:sn};if(vt!==void 0)dt(gt,zt,vt,Fn(o,on));else if(bt!==void 0&&jg(St))dt(Dt,zt,bt,Fn(o,on));break}case"typedef":{if(Mc(),bt=Lc(jt),St=$n,Pt=Fn(o,on),kt=Br(on,Fr)||ss(It),!kt&&Gt&&!Ut&&Et)kt=Et,Ut=!0;if(rn.length>0)wt.push(...rn),rn.length=0;if(Tt=Xn,Xn=!1,fn=(zt)=>wt.push(zt),Gt)Gt=!1;break}case"callback":{if($c(),Lt=Lc(jt),Kt=Fn(o,on),Ft=Br(on,Fr)||ss(It),!Ft&&Gt&&!Ut&&Et)Ft=Et,Ut=!0;if(rn.length>0)nn.push(...rn),rn.length=0;if(dn=Xn,Xn=!1,fn=(zt)=>nn.push(zt),Gt)Gt=!1;break}case"generics":{let zt=$n||jt;for(let hn of rr(jt))ct(hn.trim(),Fn(o,on));if(nt=!0,at(),lt(jt,zt),Gt)Gt=!1;break}case"template":{let zt=pu(xt[It],$n),hn=It+1;while(xt[hn]?.tag==="template")hn++;let Nn=xt[hn];if((Nn?.tag==="typedef"||Nn?.tag==="callback")&&!Nn.name.includes("<")&&Fg(xt,hn,zt)){$s.push(...zt.map(({constraint:tr})=>tr));break}if(Pf&&!wf){o.deferredSlotBlockGenerics.push(...zt);break}if(_t)break;for(let tr of zt)ct(tr.name,Fn(o,on)),lt(tr.name,tr.constraint);if(rt=!0,at(),Gt)Gt=!1;break}case"deprecated":{let zt=vt!==void 0;if(zt?Ot!==void 0:jn!==void 0)break;let hn=(Nn)=>{if(zt)Ot=Nn;else jn=Nn};hn(ua(xn)),ho(xt[It],(Nn)=>{hn(ua(la(xn,Nn)))});break}case"ignore":case"internal":{if(vt===void 0)Xn=!0;else Wt=!0;break}case"sveld-ignore":if(vt!==void 0)ft.push(jt);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let zt={name:Ht,body:xn};if(ho(xt[It],(hn)=>{zt.body=la(xn,hn)}),!su.has(Ht)&&!wg.has(Ht))r(o,"jsdoc-unknown-tag",Ht,`Unknown JSDoc tag "@${Ht}"; passed through unchanged. If this is a typo, fix the tag name.`,Fn(o,on));if(fn)fn(zt);else rn.push(zt)}break}if(kg.has(Ht))mo()}if(mo(),Mc(),$c(),Af&&rn.length>0){for(let It of rn)r(o,"jsdoc-tag-dropped",It.name,`@${It.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);rn.length=0}}}function Se(o){return o==="TSTypeAnnotation"||o==="TSTypeAliasDeclaration"||o==="TSInterfaceDeclaration"||o==="TSTypeParameterDeclaration"||o==="TSTypeParameterInstantiation"}function C(o,et,tt,nt){ha(o,null,null,et,tt,nt?.skipTypeOnlySubtrees===!0)}function ha(o,et,tt,nt,rt,it){nt(o,et,tt);let st=o.type;if((st==="Identifier"||st==="Literal"||st==="Text")&&o.typeAnnotation===void 0){if(rt)rt(o);return}if(it&&st.charCodeAt(0)===84&&Se(st)){if(rt)rt(o);return}for(let at in o){if(at==="leadingComments")continue;let ct=o[at];if(!ct||typeof ct!=="object")continue;if(Array.isArray(ct))for(let lt=0;lt<ct.length;lt++){let ut=ct[lt];if(ut&&typeof ut==="object"&&typeof ut.type==="string")ha(ut,o,at,nt,rt,it)}else if(typeof ct.type==="string")ha(ct,o,at,nt,rt,it)}if(rt)rt(o)}import lu,{sep as ma}from"node:path";var sr=/\.svelte$/,uu=/\.(?:svelte|[mc]?ts|[mc]?js)$/;function mi(o){if(!o.endsWith(".svelte"))return!1;let et=o.length-7;if(et===0)return!1;let tt=o.charCodeAt(et-1);return tt!==47&&(ma==="/"||tt!==92)}function t(o){return ma==="/"?o:o.split(ma).join("/")}function yi(o,et){return t(lu.join(et,lu.normalize(o)))}function Nr(o){return`${JSON.stringify(o,null,2)}
|
|
46
|
+
`}var du="sveld",gi="0.37.7";var fu={name:du,version:gi,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:types-matrix":"bun scripts/typecheck-option-matrix.ts","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 vs="5.57.0";var xi=1,hu=new WeakMap;function br(o){return o.some((et)=>et.internal)?o.filter((et)=>!et.internal):o}function qg(o){return{...o,props:br(o.props),moduleExports:br(o.moduleExports),slots:br(o.slots),events:br(o.events),typedefs:br(o.typedefs),...o.contexts?{contexts:br(o.contexts).map((et)=>({...et,properties:br(et.properties)}))}:{}}}function c(o,et={}){let tt=hu.get(o),nt=tt?.get(et.entryExports);if(nt)return nt;let rt=Array.from(o,([,at])=>{let{diagnostics:ct,...lt}=at;return qg(lt)}).sort((at,ct)=>u(at.moduleName,ct.moduleName)),it={schemaVersion:xi,generator:{name:du,version:gi,svelteVersion:vs},total:rt.length,components:rt},st=et.entryExports?br(et.entryExports):void 0;if(st&&st.length>0)it.totalExports=st.length,it.exports=st;if(!tt)tt=new Map,hu.set(o,tt);return tt.set(et.entryExports,it),it}import{readFile as Gg}from"node:fs/promises";import Ug from"node:path";var Hg=/[:=]/,bi={none:0,patch:1,minor:2,major:3};function Kg(o,et){return bi[et]>bi[o]?et:o}function zg(o){return o.reduce((et,tt)=>Kg(et,tt.bump),"none")}function Ci(o,et){return bi[o]>=bi[et]}function Eu(o,et){let tt=[],nt=0,rt="",it=null;for(let st=0;st<o.length;st++){let at=o[st];if(it){if(rt+=at,at==="\\")st++,rt+=o[st]??"";else if(at===it)it=null;continue}if(at==='"'||at==="'"||at==="`"){it=at,rt+=at;continue}if(at==="<"||at==="("||at==="{"||at==="[")nt++;if(at===">"||at===")"||at==="}"||at==="]")nt--;if(at===et&&nt===0){tt.push(rt.trim()),rt="";continue}rt+=at}return tt.push(rt.trim()),tt}function mu(o){return new Set(Eu(o,"|").filter((et)=>et.length>0))}function Xg(o){let et=0,tt=null;for(let nt=0;nt<o.length;nt++){let rt=o[nt];if(tt){if(rt==="\\")nt++;else if(rt===tt)tt=null;continue}if(rt==='"'||rt==="'"||rt==="`"){tt=rt;continue}if(rt==="<"||rt==="("||rt==="{"||rt==="[")et++;if(rt===">"||rt===")"||rt==="}"||rt==="]")et--;if(et===0&&rt==="="&&o[nt+1]===">")return nt}return-1}function yu(o){let et=Xg(o);if(et===-1)return;let tt=o.slice(0,et).trim(),nt=o.slice(et+2).trim();if(!tt.startsWith("(")||!tt.endsWith(")"))return;let rt=tt.slice(1,-1).trim();return{params:rt.length===0?[]:Eu(rt,","),returnType:nt}}function Jg(o){return(o.split(Hg,1)[0]??"").trimEnd().endsWith("?")}function Yg(o,et){if(o.returnType!==et.returnType)return"major";if(et.params.length<o.params.length)return"major";for(let nt=0;nt<o.params.length;nt++)if(o.params[nt]!==et.params[nt])return"major";if(et.params.length===o.params.length)return"none";return et.params.slice(o.params.length).every(Jg)?"minor":"major"}function ga(o,et){if(o===et)return"none";if(o===void 0||et===void 0)return"major";let tt=yu(o),nt=yu(et);if(tt&&nt)return Yg(tt,nt);let rt=mu(o),it=mu(et),st=[...it].some((ct)=>!rt.has(ct)),at=[...rt].some((ct)=>!it.has(ct));if(!st&&!at)return"none";if(st&&!at)return"minor";if(at&&!st)return"major";return"major"}function gu(o){return o.bindable===!0||o.binding==="writable"}function xu(o,et,tt,nt){let rt=et==="prop"?"prop":"export",it=[],st=new Map(tt.map((ct)=>[ct.name,ct])),at=new Map(nt.map((ct)=>[ct.name,ct]));for(let[ct,lt]of at){if(st.has(ct))continue;it.push({component:o,kind:et,name:ct,bump:lt.isRequired?"major":"minor",message:`${rt} "${ct}" added${lt.isRequired?" (required)":""}`})}for(let[ct]of st){if(at.has(ct))continue;it.push({component:o,kind:et,name:ct,bump:"major",message:`${rt} "${ct}" removed`})}for(let[ct,lt]of st){let ut=at.get(ct);if(!ut)continue;if(lt.isRequired!==ut.isRequired)it.push({component:o,kind:et,name:ct,bump:ut.isRequired?"major":"minor",message:`${rt} "${ct}" became ${ut.isRequired?"required":"optional"}`});let dt=ga(lt.type,ut.type);if(dt!=="none")it.push({component:o,kind:et,name:ct,bump:dt,message:`${rt} "${ct}" type changed from \`${lt.type??"unknown"}\` to \`${ut.type??"unknown"}\``});let ht=gu(lt),yt=gu(ut);if(ht!==yt)it.push({component:o,kind:et,name:ct,bump:yt?"minor":"major",message:`${rt} "${ct}" ${yt?"gained a writable binding":"lost its writable binding"}`});if(lt.value!==ut.value&&dt==="none")it.push({component:o,kind:et,name:ct,bump:"patch",message:`${rt} "${ct}" default changed from \`${lt.value??"none"}\` to \`${ut.value??"none"}\``});let xt=lt.deprecated!==void 0,Et=ut.deprecated!==void 0;if(xt!==Et)it.push({component:o,kind:et,name:ct,bump:Et?"minor":"patch",message:`${rt} "${ct}" ${Et?"marked as deprecated":"no longer deprecated"}`});if(lt.constant!==ut.constant)it.push({component:o,kind:et,name:ct,bump:"minor",message:`${rt} "${ct}" ${ut.constant?"became constant":"became mutable"}`});if(lt.reactive!==ut.reactive)it.push({component:o,kind:et,name:ct,bump:"minor",message:`${rt} "${ct}" ${ut.reactive?"became reactive":"stopped being reactive"}`})}return it}function Qg(o,et,tt){let nt=[],rt=new Map(et.map((st)=>[st.name,st])),it=new Map(tt.map((st)=>[st.name,st]));for(let[st]of it){if(rt.has(st))continue;nt.push({component:o,kind:"event",name:st,bump:"minor",message:`event "${st}" added`})}for(let[st]of rt){if(it.has(st))continue;nt.push({component:o,kind:"event",name:st,bump:"major",message:`event "${st}" removed`})}for(let[st,at]of rt){let ct=it.get(st);if(!ct)continue;if(at.type!==ct.type){nt.push({component:o,kind:"event",name:st,bump:"major",message:`event "${st}" changed from ${at.type} to ${ct.type}`});continue}let lt=at.type==="dispatched"?at.detail:void 0,ut=ct.type==="dispatched"?ct.detail:void 0,dt=ga(lt,ut);if(dt!=="none")nt.push({component:o,kind:"event",name:st,bump:dt,message:`event "${st}" detail changed from \`${lt??"unknown"}\` to \`${ut??"unknown"}\``})}return nt}function bu(o){return o.name??"default"}function Zg(o,et,tt){let nt=[],rt=new Map(et.map((st)=>[bu(st),st])),it=new Map(tt.map((st)=>[bu(st),st]));for(let[st]of it){if(rt.has(st))continue;nt.push({component:o,kind:"slot",name:st,bump:"minor",message:`slot "${st}" added`})}for(let[st]of rt){if(it.has(st))continue;nt.push({component:o,kind:"slot",name:st,bump:"major",message:`slot "${st}" removed`})}for(let[st,at]of rt){let ct=it.get(st);if(!ct)continue;let lt=ga(at.slot_props,ct.slot_props);if(lt!=="none")nt.push({component:o,kind:"slot",name:st,bump:lt,message:`slot "${st}" props changed from \`${at.slot_props??"none"}\` to \`${ct.slot_props??"none"}\``})}return nt}var ex=new Set(["description","source","componentCommentSource","tags"]);function Ei(o){if(Array.isArray(o))return o.map(Ei);if(o!==null&&typeof o==="object"){let et={};for(let[tt,nt]of Object.entries(o)){if(ex.has(tt))continue;et[tt]=Ei(nt)}return et}return o}var tx=["generics","rest_props","extends","contexts","typedefs"];function nx(o,et,tt){let nt=[];for(let rt of tx){let it=JSON.stringify(Ei(et[rt])),st=JSON.stringify(Ei(tt[rt]));if(it!==st)nt.push({component:o,kind:"shape",name:rt,bump:"major",message:`"${rt}" changed (breaking)`})}return nt}function rx(o,et){let tt=et.moduleName;return[...xu(tt,"prop",o.props,et.props),...xu(tt,"moduleExport",o.moduleExports,et.moduleExports),...Qg(tt,o.events,et.events),...Zg(tt,o.slots,et.slots),...nx(tt,o,et)]}function ze(o,et){let tt=[],nt=new Map(o.components.map((it)=>[it.moduleName,it])),rt=new Map(et.components.map((it)=>[it.moduleName,it]));for(let[it]of rt){if(nt.has(it))continue;tt.push({component:it,kind:"component",bump:"minor",message:`component "${it}" added`})}for(let[it]of nt){if(rt.has(it))continue;tt.push({component:it,kind:"component",bump:"major",message:`component "${it}" removed`})}for(let[it,st]of nt){let at=rt.get(it);if(!at)continue;tt.push(...rx(st,at))}return tt}async function sx(o){let et;try{et=await Gg(Ug.resolve(o),"utf-8")}catch(tt){if(tt.code==="ENOENT")return null;throw tt}try{return JSON.parse(et)}catch{throw Error(`sveld: could not parse "${o}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function oe(o){if(typeof o.check==="string")return o.check;return o.jsonOptions?.outFile??"COMPONENT_API.json"}async function X(o,et,tt={}){let nt=await sx(et);if(nt===null)return{snapshotExists:!1,snapshotFile:et,changes:[],bump:"none"};if(nt.schemaVersion!==xi)return{snapshotExists:!0,snapshotFile:et,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${nt.schemaVersion} differs from ${xi}; regenerate the snapshot`}],bump:"none"};let rt=c(o,{entryExports:tt.entryExports}),it=ze(nt,rt);return{snapshotExists:!0,snapshotFile:et,changes:it,bump:zg(it)}}var ix={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function ke(o){if(!o.snapshotExists)return`sveld --check: no snapshot found at "${o.snapshotFile}". Run \`sveld --json\` and commit the output first.`;if(o.changes.length===0)return`sveld --check: no API changes detected against "${o.snapshotFile}".`;let et=[],tt=o.changes.length;et.push(`sveld --check: ${tt} API change${tt===1?"":"s"} detected against "${o.snapshotFile}".`),et.push(`Suggested semver bump: ${o.bump}.`);let nt=new Map;for(let rt of o.changes){let it=nt.get(rt.component)??[];it.push(rt),nt.set(rt.component,it)}for(let[rt,it]of nt){et.push(""),et.push(` ${rt}`);for(let st of it){let at=st.kind==="schema"?"schema":ix[st.bump];et.push(` [${at}] ${st.message}`)}}return et.join(`
|
|
47
|
+
`)}var Xe=1;function Ce(o){let et={kind:"check-report",schemaVersion:Xe,...o};return Nr(et)}import{existsSync as ax}from"node:fs";import{join as cx}from"node:path";import{pathToFileURL as px}from"node:url";function ox(o,et){let tt=o.length+1,nt=et.length+1,rt=Array.from({length:tt},()=>Array(nt).fill(0));for(let it=0;it<tt;it++)rt[it][0]=it;for(let it=0;it<nt;it++)rt[0][it]=it;for(let it=1;it<tt;it++)for(let st=1;st<nt;st++){let at=o[it-1]===et[st-1]?0:1;rt[it][st]=Math.min(rt[it-1][st]+1,rt[it][st-1]+1,rt[it-1][st-1]+at)}return rt[tt-1][nt-1]}function vi(o,et){let tt,nt=Number.POSITIVE_INFINITY;for(let rt of et){let it=ox(o,rt);if(it<nt)tt=rt,nt=it}if(tt===void 0||nt>3)return;return tt}var lx=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function Ze(o){return o}function ux(o=process.cwd()){for(let et of lx){let tt=cx(o,et);if(ax(tt))return tt}return null}async function xa(o){let et;try{et=await import(`${px(o).href}?t=${Date.now()}`)}catch(nt){let rt=nt instanceof Error?nt.message:String(nt);throw Error(`sveld: failed to load config file "${o}".
|
|
48
|
+
${rt}`)}let tt=et.default;if(!ln(tt)||Array.isArray(tt))throw Error(`sveld: config file "${o}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return tt}async function j(o=process.cwd()){let et=ux(o);if(et===null)return{};return xa(et)}function D(...o){let et={};for(let tt of o){if(!tt)continue;for(let[nt,rt]of Object.entries(tt)){let it=et[nt];et[nt]=ln(it)&&!Array.isArray(it)&&ln(rt)&&!Array.isArray(rt)?{...it,...rt}:rt}}return et}var dx={ci:{strict:!0,reportDiagnostics:!0,check:!0,checkExamples:!0},local:{reportDiagnostics:!0}};function ae(o){let{strict:et,...tt}=o;if(et!=="ci"&&et!=="local")return o;return{...dx[et],...tt}}var Cu=["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"],fx={typesOptions:["outDir","preamble","format","exportTypes","typeNames","comments","propsDeclaration","transform","indexTypes","inline","exports","dryRun","cache","resolvedPathByFilePath","crossFileResolvedPathByFilePath"],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 vu(o,et,tt){let nt=o===null?et:`${o}.${et}`,rt=vi(et,tt),it=rt===void 0?void 0:o===null?rt:`${o}.${rt}`;console.warn(`sveld: unknown option "${nt}".${it?` Did you mean "${it}"?`:""}`)}function F(o){for(let et of Object.keys(o))if(!Cu.includes(et))vu(null,et,Cu);for(let[et,tt]of Object.entries(fx)){let nt=o[et];if(!ln(nt))continue;for(let rt of Object.keys(nt))if(!tt.includes(rt))vu(et,rt,tt)}}var Si=new Map;function I(o,et){if(!et?.replace&&Si.has(o.name))throw Error(`sveld: a writer named "${o.name}" is already registered. Pass { replace: true } to overwrite it.`);Si.set(o.name,o)}function ce(o){return Si.get(o)}function Ke(){return Array.from(Si.values())}import{dirname as uf,isAbsolute as FC,resolve as jC}from"node:path";import{existsSync as kd,lstatSync as Nd,readFileSync as cE,realpathSync as pE,statSync as Dd}from"node:fs";import{readFile as lE}from"node:fs/promises";import{basename as uE,dirname as _d,extname as dE,isAbsolute as fE,join as Pd,parse as hE,relative as sc,resolve as es}from"node:path";function Ss(o){return o}function ur(o){if(o==="")return o;return o.startsWith(".")?o:`./${o}`}import{dirname as Tu,resolve as ku}from"node:path";var hx=/^(['"])(.*)\1$/,Pu=/^[./]/,mx=/import\(\s*(['"])((?:(?!\1).)+)\1\s*\)/g;function yx(o,et){let tt=o.extends?.import;if(tt===void 0)return null;let nt=tt.replace(hx,"$2");if(!Pu.test(nt))return null;return ku(Tu(et),nt)}function Su(o,et){let tt=[];for(let nt of o.matchAll(mx)){let rt=nt[2];if(!Pu.test(rt))continue;tt.push(ku(Tu(et),rt))}return tt}function gx(o,et){let tt=[],nt=yx(o,et);if(nt!==null)tt.push(nt);for(let rt of o.typedefs??[])tt.push(...Su(rt.type,et));for(let rt of o.props)if(rt.type)tt.push(...Su(rt.type,et));return tt}function Ts(o,et){let tt=new Map;for(let nt of o.values()){let rt=et(nt.filePath);for(let it of gx(nt,rt)){let st=tt.get(it);if(st===void 0)st=new Set,tt.set(it,st);st.add(rt)}}return tt}function Ti(o,et){let tt=new Set,nt=[];for(let rt of o)if(!tt.has(rt))tt.add(rt),nt.push(rt);while(nt.length>0){let rt=nt.shift(),it=et.get(rt);if(it===void 0)continue;for(let st of it)if(!tt.has(st))tt.add(st),nt.push(st)}return tt}var xx=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,bx=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),Ex=new Set(["svelte","html"]);function Cx(o){let et=o.trim();if(et==="")return null;let tt=et.match(xx);if(tt){let nt=tt[1].toLowerCase(),rt=tt[2].trim();if(rt==="")return null;if(bx.has(nt))return{kind:"compile",code:rt};if(Ex.has(nt))return{kind:"syntax",code:rt};return null}if(et.startsWith("<"))return null;return{kind:"compile",code:et}}function wu(o){if(!o.isFunction)return"any";return`(${(o.params??[]).map((tt)=>`${tt.name}${tt.optional?"?":""}: any`).join(", ")}) => any`}function ki(o,et,tt,nt,rt){let it=(o??[]).filter((at)=>at.name==="example"),st=[];return it.forEach((at,ct)=>{let lt=Cx(at.body);if(lt===null)return;let ut=it.length>1;st.push({id:ut?`${et}#${ct}`:et,name:ut?`${tt} (example ${ct+1})`:tt,type:nt,code:lt.code,kind:lt.kind,...rt?{source:rt}:{}})}),st}function Au(o){return o.name??"default"}function Nu(o){let et=[];for(let tt of o.props)et.push(...ki(tt.tags,`prop:${tt.name}`,tt.name,wu(tt),tt.source));for(let tt of o.moduleExports)et.push(...ki(tt.tags,`export:${tt.name}`,tt.name,wu(tt),tt.source));for(let tt of o.slots)et.push(...ki(tt.tags,`slot:${Au(tt)}`,Au(tt),"any",tt.source));for(let tt of o.events)et.push(...ki(tt.tags,`event:${tt.name}`,tt.name,"any",tt.source));return et}import{existsSync as vx,readdirSync as Sx}from"node:fs";import{basename as Tx,dirname as kx,join as Px}from"node:path";var ba=new Map;function Pi(){ba.clear()}function wi(o){let et=ba.get(o);if(et!==void 0)return et;try{let tt=Sx(o,{withFileTypes:!0}),nt=new Set;for(let rt of tt)nt.add(rt.name);et={entries:tt,names:nt}}catch{et=null}return ba.set(o,et),et}function Ai(o,et){let tt=wi(o);if(tt===null)return;if(tt.byName===void 0){tt.byName=new Map;for(let nt of tt.entries)tt.byName.set(nt.name,nt)}return tt.byName.get(et)}function Du(o){return o.normalize("NFC").toLowerCase()}function Qn(o,et){let tt=wi(o);if(tt===null)return!1;if(tt.names.has(et))return!0;if(tt.folded===void 0){tt.folded=new Map;for(let rt of tt.names)tt.folded.set(Du(rt),rt)}let nt=tt.folded.get(Du(et));return nt!==void 0&&nt!==et&&vx(Px(o,et))}var wx=/\.[mc]?jsx?$/,Ax={".js":[".ts",".tsx",".d.ts"],".jsx":[".tsx",".d.ts"],".mjs":[".mts",".d.mts"],".cjs":[".cts",".d.cts"]};function Ni(o){let et=wx.exec(o)?.[0];if(et===void 0)return;let tt=o.slice(0,-et.length),nt=kx(tt),rt=Tx(tt);for(let it of Ax[et]??[])if(Qn(nt,rt+it))return tt+it;return}import{lstatSync as U0,readFileSync as H0}from"node:fs";import{basename as K0,dirname as Ma,join as td,resolve as z0}from"node:path";import{existsSync as Ii,readFileSync as Nx}from"node:fs";import{dirname as Ea,isAbsolute as Dx,join as _x,relative as Ix,resolve as Ri}from"node:path";function Di(o){if(!ln(o))return{};let et={};if(typeof o.svelte==="string")et.svelte=o.svelte;if(typeof o.name==="string")et.name=o.name;if(typeof o.description==="string")et.description=o.description;return et}function _u(o){if(!ln(o))return{};let et={};if(typeof o.extends==="string")et.extends=o.extends;if(ln(o.compilerOptions)){let tt={};if(typeof o.compilerOptions.baseUrl==="string")tt.baseUrl=o.compilerOptions.baseUrl;if(ln(o.compilerOptions.paths)){let nt={};for(let[rt,it]of Object.entries(o.compilerOptions.paths))if(Array.isArray(it)&&it.every((st)=>typeof st==="string"))nt[rt]=it;if(Object.keys(nt).length>0)tt.paths=nt}if(Object.keys(tt).length>0)et.compilerOptions=tt}return et}var _i=new Map,Iu=new Map,Rx=/\/\*[\s\S]*?\*\/|\/\/.*/g,Lx=/[.+?^${}()|[\]\\]/g,Ox=[".svelte",".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".d.ts"];class Kr extends Error{specifier;fromFile;searched;constructor(o,et,tt){super(`cannot resolve "${o}" from ${et||"."} (${tt})`);this.name="UnresolvedModuleError",this.specifier=o,this.fromFile=et,this.searched=tt}}function Mx(o){if(Ii(o))return!0;return Ox.some((et)=>Ii(o+et))}function Ru(o){let et=o.indexOf("*");return et===-1?o.length:et}function $x(o){let et=o,tt=Ri(et,"/");while(et!==tt){for(let nt of["tsconfig.json","jsconfig.json"]){let rt=_x(et,nt);if(Ii(rt))return rt}et=Ea(et)}return null}function Lu(o){if(_i.has(o))return _i.get(o)??null;try{let et=Nx(o,"utf-8"),tt;try{tt=JSON.parse(et)}catch{let rt=et.replace(Rx,"");tt=JSON.parse(rt)}let nt=_u(tt);if(nt.extends){let rt=Dx(nt.extends)?nt.extends:Ri(Ea(o),nt.extends),it=rt.endsWith(".json")?rt:`${rt}.json`;if(Ii(it)){let st=Lu(it);if(st)nt.compilerOptions={...st.compilerOptions,...nt.compilerOptions,paths:{...st.compilerOptions?.paths,...nt.compilerOptions?.paths}}}}return _i.set(o,nt),nt}catch{return _i.set(o,null),null}}function Bx(o){let et=Iu.get(o);if(!et){let tt=o.split("*").map((nt)=>nt.replace(Lx,"\\$&")).join("(.*)");et=new RegExp(`^${tt}$`),Iu.set(o,et)}return et}function zr(o,et){if(o.startsWith(".")||o.startsWith("/"))return{resolved:o,unresolved:!1,searched:""};let tt=$x(et);if(!tt)return{resolved:o,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let nt=Lu(tt);if(!nt?.compilerOptions?.paths)return{resolved:o,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:rt=".",paths:it}=nt.compilerOptions,st=Ea(tt),at=Ri(st,rt),ct=Object.entries(it).sort(([lt],[ut])=>Ru(ut)-Ru(lt));for(let[lt,ut]of ct){let dt=o.match(Bx(lt));if(!dt)continue;let ht;for(let yt of ut){let xt=yt;for(let Ct=1;Ct<dt.length;Ct++)xt=xt.replace("*",dt[Ct]);let Et=Ri(at,xt);if(ht===void 0)ht=Et;if(Mx(Et))return{resolved:Et,unresolved:!1,searched:tt}}return{resolved:ht??o,unresolved:!1,searched:tt}}return{resolved:o,unresolved:!0,searched:`tsconfig paths (${tt})`}}function Ca(o,et){return zr(o,et).resolved}function Li(o,et){if(o.startsWith(".")||o.startsWith("/"))return o;let tt=Ca(o,et);if(tt===o)return o;let nt=Ix(et,tt);return nt=t(nt),nt.startsWith(".")?nt:`./${nt}`}var Fx=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var $u=/\s/,jx=/\s{2}|[^\S ]/,Vx=/["'`{}/]/g,Wx=/["'`{};/]/g;function qx(o){return Fx.test(o.slice(-200))}var Ou=[""];function Gx(o){let et=Ou[o];if(et===void 0)et=" ".repeat(o),Ou[o]=et;return et}function Ux(o,et){let tt="";for(let nt=o.length-1;nt>=0&&tt.length<et;nt--)tt=o[nt]+tt;return tt.length>et?tt.slice(-et):tt}function Hx(o){if(o.length===0)return!1;let et=o[o.length-1];return et.charCodeAt(et.length-1)===10}function Kx(o){while(o.length>0){let et=o[o.length-1],tt=et.length;while(tt>0){let nt=et.charCodeAt(tt-1);if(nt!==32&&nt!==9)break;tt--}if(tt===et.length)return;if(tt===0){o.pop();continue}o[o.length-1]=et.slice(0,tt);return}}function zx(o){while(o.length>0){let et=o[o.length-1];if(!$u.test(et[et.length-1]))return;let tt=et.trimEnd();if(tt.length===et.length)return;if(tt.length===0){o.pop();continue}o[o.length-1]=tt;return}}function Xx(o){if(o.includes("{"))return!1;let et=0,tt=0;for(let nt=0;nt<o.length;nt++){let rt=o.charCodeAt(nt);if(et!==0){if(rt===et&&o.charCodeAt(nt-1)!==92)et=0;continue}if(rt===34||rt===39||rt===96){et=rt;continue}if(rt===59&&++tt>=2)return!0}return!1}function Jx(o){if(!jx.test(o))return o.trimEnd();let et="",tt=null,nt=!1;for(let rt=0;rt<o.length;rt++){let it=o[rt],st=o[rt-1];if(tt){if(et+=it,tt==="double"&&it==='"'&&st!=="\\"||tt==="single"&&it==="'"&&st!=="\\"||tt==="template"&&it==="`"&&st!=="\\")tt=null;nt=!1;continue}if(it==='"'||it==="'"||it==="`"){tt=it==='"'?"double":it==="'"?"single":"template",et+=it,nt=!1;continue}if($u.test(it)){if(!nt&&et.length>0)et+=" ",nt=!0;continue}et+=it,nt=!1}return et.trimEnd()}function Bu(o,et){let tt=o[et],nt=o.indexOf(tt,et+1);while(nt!==-1&&o.charCodeAt(nt-1)===92)nt=o.indexOf(tt,nt+1);return nt}function Fu(o,et){let tt=o.indexOf("*/",et+1);return tt===-1?-1:tt+1}function Yx(o){let et=new Map,tt=[],nt=Vx,rt=0;while(rt<o.length){if(nt.lastIndex=rt,!nt.test(o))break;rt=nt.lastIndex-1;let it=o.charCodeAt(rt);if(it===47){if(o.charCodeAt(rt+1)===42){let st=Fu(o,rt);if(st===-1)break;rt=st}}else if(it===34||it===39||it===96){let st=Bu(o,rt);if(st===-1)break;rt=st}else if(it===123)tt.push(rt);else if(it===125&&tt.length>0)et.set(tt.pop(),rt);rt++}return et}function Qx(o,et,tt){for(let nt=et;nt<tt;nt++)if(!va(o.charCodeAt(nt)))return!1;return!0}function va(o){if(o<=32)return o===32||o>=9&&o<=13;if(o<160)return!1;return o===160||o===5760||o>=8192&&o<=8202||o===8232||o===8233||o===8239||o===8287||o===12288||o===65279}function ju(o,et,tt,nt){let rt=[],it=Wx,st=et,at=et;while(at<tt){if(it.lastIndex=at,!it.test(o))break;if(at=it.lastIndex-1,at>=tt)break;let ct=o.charCodeAt(at);if(ct===47){if(o.charCodeAt(at+1)===42){let lt=Fu(o,at);if(lt===-1)break;at=lt}at++;continue}if(ct===34||ct===39||ct===96){let lt=Bu(o,at);if(lt===-1)break;at=lt+1;continue}if(ct===123){let lt=nt.get(at);if(lt===void 0||lt>=tt){at++;continue}if(st<at)rt.push(o.slice(st,at));let ut=at+1;if(Qx(o,ut,lt)){rt.push("{}"),at=lt+1,st=at;continue}let dt=o.slice(ut,lt),ht=o.charCodeAt(ut)===10;if(!ht&&!dt.includes("/*")&&!Xx(dt)&&!qx(Ux(rt,200))){let yt=ju(o,ut,lt,nt),xt=yt.trim();if(!xt.includes(`
|
|
49
|
+
`)){let Et=xt.endsWith(";")?xt.slice(0,-1):xt,Ct=`{ ${Jx(Et)} }`;if(Ct.length<=120){rt.push(Ct),at=lt+1,st=at;continue}}if(rt.push("{"),yt.charCodeAt(0)!==59)rt.push(`
|
|
50
|
+
`);if(yt.length>0)rt.push(yt);at=lt,st=lt;continue}if(rt.push("{"),!ht)rt.push(`
|
|
51
|
+
`);at=ut,st=ut;continue}if(ct===125){if(st<at)rt.push(o.slice(st,at));if(Kx(rt),!Hx(rt))rt.push(`
|
|
52
|
+
`);rt.push("}"),at++,st=at;continue}if(st<at)rt.push(o.slice(st,at));if(zx(rt),rt.push(";"),o.charCodeAt(at+1)!==10)rt.push(`
|
|
53
|
+
`);at++,st=at}if(st<tt)rt.push(o.slice(st,tt));return rt.join("")}function Zx(o){return ju(o,0,o.length,Yx(o))}function e0(o){if(!o.includes(" "))return o;let et="",tt=0;for(let nt=0;nt<o.length;nt++){let rt=o.charCodeAt(nt);if(tt!==0){if(et+=o[nt],rt===tt&&o.charCodeAt(nt-1)!==92)tt=0;continue}if(rt===34||rt===39||rt===96){tt=rt,et+=o[nt];continue}if(rt===32&&et.charCodeAt(et.length-1)===32)continue;et+=o[nt]}return et}function t0(o){return o===125||o===93||o===41||o===62}function n0(o,et,tt){return tt-et>=3&&o.charCodeAt(et)===47&&o.charCodeAt(et+1)===42&&o.charCodeAt(et+2)===42}function Mu(o,et,tt){let nt=o.indexOf("*/",et);return nt!==-1&&nt+2<=tt}function r0(o,et,tt){let nt=o.charCodeAt(et);if(nt===124||nt===38)return!0;return nt===46&&et+1<tt&&o.charCodeAt(et+1)!==46}function s0(o){let et=[],tt=[],nt=o.length,rt=0,it=!1,st=0,at=0;while(at<=nt){let ut=o.indexOf(`
|
|
54
|
+
`,at);if(ut===-1)ut=nt;let dt=ut+1,ht=at,yt=ut;while(ht<yt&&va(o.charCodeAt(ht)))ht++;while(yt>ht&&va(o.charCodeAt(yt-1)))yt--;if(ht===yt){let vt=tt.length>0?tt[tt.length-1]:void 0;if(vt!==void 0&&vt!==""){let Rt=vt.charCodeAt(vt.length-1);if(Rt!==123&&Rt!==40&&Rt!==91)et.push(0),tt.push("")}at=dt;continue}if(it){if(et.push(st),tt.push(` ${o.slice(ht,yt)}`),Mu(o,ht,yt))it=!1;at=dt;continue}let xt=n0(o,ht,yt),Et=xt&&Mu(o,ht,yt);if(xt&&!Et){et.push(rt),tt.push(o.slice(ht,yt)),it=!0,st=rt,at=dt;continue}let Ct=t0(o.charCodeAt(ht)),At=Math.max(0,rt-(Ct?1:0))+(r0(o,ht,yt)?1:0);if(Ct&&At===0&&tt.length>0&&tt[tt.length-1]==="")et.pop(),tt.pop();if(et.push(At),tt.push(e0(o.slice(ht,yt))),at=dt,Et)continue;let _t=0;for(let vt=ht;vt<yt;vt++){let Rt=o.charCodeAt(vt);if(_t!==0){if(Rt===_t&&o.charCodeAt(vt-1)!==92)_t=0;continue}if(Rt===34||Rt===39||Rt===96)_t=Rt;else if(Rt===123||Rt===40||Rt===91||Rt===60)rt++;else if(Rt===125||Rt===41||Rt===93)rt=Math.max(0,rt-1);else if(Rt===62&&o.charCodeAt(vt-1)!==61)rt=Math.max(0,rt-1)}}let ct=tt.length;while(ct>0&&tt[ct-1]==="")ct--;let lt=[];for(let ut=0;ut<ct;ut++){if(ut>0)lt.push(`
|
|
55
|
+
`);let dt=et[ut];if(dt>0)lt.push(Gx(dt));lt.push(tt[ut])}return lt.join("")}function Vu(o){return`${s0(Zx(o))}
|
|
56
|
+
`}var Zn="any",In="",i0="Record<string, any>",ka="Record<string, never>",Oi=/^[A-Za-z_$][A-Za-z0-9_$]*$/,o0=/CustomEvent/,a0=/^[A-Z]/,c0=/\n/,Hu=/=>/,p0=/(?:^|\n)@default\b/,Pa=/\n/g,l0=/^([ \t]*\*) +$/gm,u0=/\s+/g,Xr=/(^|[^.\w])Snippet(?:\s*<|\b)/,d0=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,f0=/[.*+?^${}()|[\]\\]/g,h0=/^const\s+/,m0=/\{name\}/g,y0=/^export /,g0=/[^\w$]/g;function wa(o){return o.replace(h0,"")}function x0(o){if(!o)return;return o.replace(Pa,`
|
|
57
|
+
* `)}function Mi(o){if(!o)return"";return`/** ${lr(o)} */`}function $i(o){if(!o)return"";return`/**
|
|
58
|
+
* ${lr(o).replace(Pa,`
|
|
59
|
+
* `)}
|
|
60
|
+
*/`}function Ku(o){if(o===void 0)return;return o===!0?"@deprecated":`@deprecated ${o}`}function b0(o){let et=Ku(o);if(et===void 0)return;return`* ${et.replace(Pa,`
|
|
61
|
+
* `)}
|
|
62
|
+
`}function E0(o,et){if(!et)return[`@${o}`];if(!et.includes(`
|
|
63
|
+
`))return[`@${o} ${et}`];return[`@${o}`,...et.split(`
|
|
64
|
+
`)]}function Aa(o){let et=[];for(let{name:tt,body:nt}of o??[])et.push(...E0(tt,nt));return et}function Ps(o,et,tt,nt){if(nt==="none")return"";let rt=Ku(tt),it=nt==="all"?Aa(et):[],st=it.length>0;if(!o&&!st&&!rt)return"";if(!st&&!rt)return o?.includes(`
|
|
65
|
+
`)?$i(o):Mi(o);let at=[];if(o)at.push(...o.split(`
|
|
66
|
+
`));if(at.push(...it),rt)at.push(...rt.split(`
|
|
67
|
+
`));return`/**
|
|
68
|
+
* ${lr(at.join(`
|
|
69
|
+
* `))}
|
|
70
|
+
*/`}function C0(o){let et=Aa(o);if(et.length===0)return"";return et.map((tt)=>`* ${tt}
|
|
71
|
+
`).join("")}function Bi(o){if(o===void 0)return Zn;return`${o}
|
|
72
|
+
`}function Yr(o,et={export:!0},tt="all"){if(o.typedefs.length===0)return In;let nt=et.export?"export ":"";return o.typedefs.map((rt)=>{let it=In;if(tt!=="none"){let st=tt==="all"?Aa(rt.tags):[];if(st.length===0)it=rt.description?`${$i(rt.description)}
|
|
73
|
+
`:"";else{let at=rt.description?[...rt.description.split(`
|
|
74
|
+
`),...st]:st;it=`/**
|
|
75
|
+
* ${lr(at.join(`
|
|
76
|
+
* `))}
|
|
77
|
+
*/
|
|
78
|
+
`}}return`${it}${nt}${rt.ts}`.replace(l0,"$1")}).join(`
|
|
79
|
+
|
|
80
|
+
`)}var Wu=new Map;function Sa(o,et){let tt=Wu.get(et);if(tt===void 0){let nt=et.replace(f0,"\\$&");tt=new RegExp(`\\b${nt}\\b`),Wu.set(et,tt)}return tt.test(o)}var qu,Gu=[];function Na(o){if(o!==qu)qu=o,Gu=rr(o);return Gu}function v0(o){if(o===null)return[];return o[0].split(",").map((et,tt)=>({name:et.trim(),constraint:(Na(o[1]??"")[tt]??et).trim()}))}function S0(o,et){let tt=v0(o).filter(({name:nt})=>Sa(et,nt));if(tt.length===0)return{declSuffix:In,refSuffix:In};return{declSuffix:`<${tt.map(({constraint:nt})=>wa(nt)).join(", ")}>`,refSuffix:`<${tt.map(({name:nt})=>nt).join(", ")}>`}}function zu(o,et={export:!0},tt="all"){if(!o.contexts||o.contexts.length===0)return In;let nt=et.export?"export ":"",rt=o.generics===null?[]:o.generics[0].split(",").map((it,st)=>({name:it.trim(),constraint:(Na(o.generics?.[1]??"")[st]??it).trim()}));return o.contexts.map((it)=>{let st=it.properties.map((dt)=>{let ht=tt!=="none"&&dt.description?`${Mi(dt.description)}
|
|
81
|
+
`:"",yt=dt.optional?"?":"";return`${ht}${dt.name}${yt}: ${dt.type};`}).join(`
|
|
82
|
+
`),at=tt!=="none"&&it.description?`${$i(it.description)}
|
|
83
|
+
`:"",ct=rt.filter(({name:dt})=>it.type!==void 0&&Sa(it.type,dt)||it.properties.some((ht)=>Sa(ht.type,dt))).map(({constraint:dt})=>dt),lt=ct.length>0?`<${ct.map(wa).join(", ")}>`:"";if(it.type!==void 0)return`${at}${nt}type ${it.typeName}${lt} = ${it.type};`;if(it.properties.length===0)return it.hasUnresolvedSpread?`${at}${nt}type ${it.typeName} = Record<string, any>;`:`${at}${nt}type ${it.typeName} = Record<string, never>;`;let ut=it.hasUnresolvedSpread?" & Record<string, any>":"";return`${at}${nt}type ${it.typeName}${lt} = {
|
|
84
|
+
${st}
|
|
85
|
+
}${ut};`}).join(`
|
|
86
|
+
|
|
87
|
+
`)}function Er(o){return Oi.test(o)?o:JSON.stringify(o)}function Xu(o,et){if(!o)return;return`* ${et||o}
|
|
88
|
+
`}function Jr(o,et,tt,nt="all"){if(nt==="none")return In;return[Xu(x0(o)),b0(et),nt==="all"?C0(tt):void 0].filter(Boolean).join("")}function Dr(o){return o.length>0?`/**
|
|
89
|
+
${lr(o)}*/`:In}function T0(o,et={export:!0},tt="all"){let nt=et.export?"export ":"",rt=o.props.filter((vt)=>!vt.isFunctionDeclaration&&vt.kind!=="const"),it=new Set([...rt.map((vt)=>vt.name),...Array.from(o.canonicalPropNames??[])]),st=rt.map((vt)=>{let Rt=typeof vt.value==="string"?vt.value.replace(u0," "):vt.value,Ot=p0.test(vt.description??"")||vt.value===void 0,Wt=[Jr(vt.description,vt.deprecated,vt.tags,tt),tt==="all"?Xu(vt.constant,"@constant"):null,tt==="all"&&!Ot?`* @default ${Rt}
|
|
90
|
+
`:null].filter(Boolean).join(""),tn=vt.constant&&!vt.isFunction?vt.value:vt.type||Zn;return`
|
|
91
|
+
${Dr(Wt)}
|
|
92
|
+
${Er(vt.name)}${vt.isRequired?"":"?"}: ${tn};`}),at=o.canonicalPropsType?st.filter((vt,Rt)=>{let Nt=rt[Rt];return Nt?!(o.canonicalPropNames?.has(Nt.name)??!1):!0}):st,ct=(o.slots||[]).filter((vt)=>!vt.default&&vt.name!=null&&!it.has(vt.name)).map((vt)=>{let Rt=vt.name,Nt=Er(Rt),Ot=Ps(vt.description,vt.tags,vt.deprecated,tt),Wt=Ot?`${Ot}
|
|
93
|
+
`:"",ot=vt.slot_props&&vt.slot_props!=="Record<string, never>"?`(this: void, ...args: [${vt.slot_props}]) => void`:"(this: void) => void";return`
|
|
94
|
+
${Wt}${Nt}?: ${ot};`}),lt=(o.slots||[]).find((vt)=>vt.default||vt.name===null),ut=lt&&!it.has("children")?(()=>{let vt=Ps(lt.description,lt.tags,lt.deprecated,tt),Rt=vt?`${vt}
|
|
95
|
+
`:"",Ot=lt.slot_props&<.slot_props!=="Record<string, never>"?`(this: void, ...args: [${lt.slot_props}]) => void`:"(this: void) => void";return`
|
|
96
|
+
${Rt}children?: ${Ot};`})():"",dt=o.events?D0({events:o.events},it,tt):[],ht=[...ct,ut,...dt].filter(Boolean),yt=[...at,...ht].join(`
|
|
97
|
+
`),xt=dr(o.moduleName,et.typeNames),Et=In,Ct=o.generics?`<${Na(o.generics[1]).map((vt)=>wa(vt.trim())).join(", ")}>`:"",At=o.generics?`<${o.generics[0]}>`:"",_t=o.canonicalPropsType?`
|
|
98
|
+
type $Props${Ct} = ${o.canonicalPropsType}${yt.trim()===""?"":` & {${yt}
|
|
99
|
+
}`};
|
|
100
|
+
`:`
|
|
101
|
+
type $Props${Ct} = {
|
|
102
|
+
${yt}
|
|
103
|
+
};
|
|
104
|
+
`;if(o.rest_props?.type==="Element"){let vt;if(o.rest_props.name==="svelte:element")if(o.rest_props.thisValue)vt=`SvelteHTMLElements["${o.rest_props.thisValue}"]`;else vt="HTMLAttributes<HTMLElement>";else vt=o.rest_props.name.split("|").map((Ot)=>`SvelteHTMLElements["${Ot.trim()}"]`).join(" & ");let Rt="[key: `data-${string}`]: unknown;",Nt=tt!=="none"&&o.rest_props.description?o.rest_props.description.includes(`
|
|
105
|
+
`)?`${$i(o.rest_props.description)}
|
|
106
|
+
`:`${Mi(o.rest_props.description)}
|
|
107
|
+
`:"";if(o.extends===void 0)Et=`
|
|
108
|
+
${Nt}${vt?`type $RestProps = ${vt};
|
|
109
|
+
`:""}
|
|
110
|
+
${o.canonicalPropsType?`type $Props${Ct} = (${o.canonicalPropsType}) & {${yt}
|
|
111
|
+
|
|
112
|
+
${Rt}
|
|
113
|
+
};`:`type $Props${Ct} = {
|
|
114
|
+
${yt}
|
|
115
|
+
|
|
116
|
+
${Rt}
|
|
117
|
+
};`}
|
|
118
|
+
|
|
119
|
+
${nt}type ${xt}${Ct} = Omit<$RestProps, keyof $Props${At}> & $Props${At};
|
|
120
|
+
`;else Et=`
|
|
121
|
+
${Nt}${vt?`type $RestProps = ${vt};
|
|
122
|
+
`:""}
|
|
123
|
+
${o.canonicalPropsType?`type $Props${Ct} = (${o.canonicalPropsType}) & {${yt}
|
|
124
|
+
|
|
125
|
+
${Rt}
|
|
126
|
+
};`:`type $Props${Ct} = {
|
|
127
|
+
${yt}
|
|
128
|
+
|
|
129
|
+
${Rt}
|
|
130
|
+
};`}
|
|
131
|
+
|
|
132
|
+
${nt}type ${xt}${Ct} = Omit<$RestProps, keyof ($Props${At} & ${o.extends.interface})> & Omit<${o.extends.interface}, keyof $Props${At}> & $Props${At};
|
|
133
|
+
`}else if(yt.trim()===""&&o.extends===void 0&&!o.canonicalPropsType)Et=`
|
|
134
|
+
${nt}type ${xt}${Ct} = ${ka};
|
|
135
|
+
`;else if(o.canonicalPropsType)Et=`
|
|
136
|
+
${_t}
|
|
137
|
+
${nt}type ${xt}${Ct} = ${o.extends===void 0?"":`Omit<${o.extends.interface}, keyof $Props${At}> & `}$Props${At};
|
|
138
|
+
`;else if(o.extends===void 0)Et=et.propsDeclaration==="interface"&&yt.trim()!==""?`
|
|
139
|
+
${nt}interface ${xt}${Ct} {
|
|
140
|
+
${yt}
|
|
141
|
+
}
|
|
142
|
+
`:`
|
|
143
|
+
${nt}type ${xt}${Ct} = {
|
|
144
|
+
${yt}
|
|
145
|
+
};
|
|
146
|
+
`;else Et=`
|
|
147
|
+
type $Props${Ct} = {
|
|
148
|
+
${yt}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
${nt}type ${xt}${Ct} = Omit<${o.extends.interface}, keyof $Props${At}> & $Props${At};
|
|
152
|
+
`;return{props_name:xt,prop_def:Et}}function k0(o,et="all"){if(o.slots.length===0)return ka;let tt=o.slots.map(({name:nt,slot_props:rt,...it})=>{let st=it.default||nt===null?"default":Er(nt??""),at=Ps(it.description,it.tags,it.deprecated,et);return`${at?`${at}
|
|
153
|
+
`:""}${st}: ${Bi(rt)};`}).join(`
|
|
154
|
+
`);return o.slots.length===1?`{${tt}}`:`{
|
|
155
|
+
${tt}
|
|
156
|
+
}`}var P0=()=>"WindowEventMap",w0=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 ks(o=Zn){if(o0.test(o))return o;return`CustomEvent<${o}>`}function A0(o){return w0.has(o)}function Ju(o){switch(o.type){case"dispatched":return ks(o.detail);case"forwarded":{let et=o.element,nt=!(et&&a0.test(et))||A0(o.name),rt=o.detail!==void 0&&o.detail!=="undefined"&&!(o.detail==="null"&&nt),it=o.detail==="null"&&!nt;if(rt||it)return ks(o.detail);else if(nt)return`${P0()}["${o.name}"]`;else return ks()}default:return o}}function N0(o,et="all"){if(o.events.length===0)return i0;let tt=o.events.map((nt)=>{let rt="",it=Ps(nt.description,nt.tags,nt.deprecated,et);if(it)rt=`${it}
|
|
157
|
+
`;return`${rt}${Er(nt.name)}: ${Ju(nt)};
|
|
158
|
+
`}).join("");return o.events.length===1?`{${tt}}`:`{
|
|
159
|
+
${tt}}`}function D0(o,et,tt="all"){return o.events.map((nt)=>{let rt=`on${nt.name}`;if(et.has(rt))return;let it="",st=Ps(nt.description,nt.tags,nt.deprecated,tt);if(st)it=`${st}
|
|
160
|
+
`;return`
|
|
161
|
+
${it}${Er(rt)}?: (event: ${Ju(nt)}) => void;`}).filter((nt)=>nt!==void 0)}function _0(o){let et=o.type==="() => any";if(o.type&&Hu.test(o.type)&&!et)return o.type;else if(o.params&&o.params.length>0)return`(${b(o.params)}) => ${o.returnType||Zn}`;else if(o.returnType)return`() => ${o.returnType}`;else return o.type||Zn}function Yu(o,et="all"){return o.props.filter((tt)=>tt.isFunctionDeclaration||tt.kind==="const").map((tt)=>{let nt=Jr(tt.description,tt.deprecated,tt.tags,et),rt=_0(tt);return`
|
|
162
|
+
${Dr(nt)}
|
|
163
|
+
${Er(tt.name)}: ${rt};`}).join(`
|
|
164
|
+
`)}function I0(o,et={export:!0},tt="all"){let nt=et.export?"export ":"",rt=_r(o.moduleName,et.typeNames),it=Yu({props:o.props},tt);if(it.trim()==="")return{exports_name:rt,exports_ref:rt,exports_def:`${nt}type ${rt} = ${ka};`};let{declSuffix:st,refSuffix:at}=S0(o.generics,it);return{exports_name:rt,exports_ref:`${rt}${at}`,exports_def:`${nt}type ${rt}${st} = {${it}
|
|
165
|
+
};`}}function R0(o){let et=o.props.filter((tt)=>tt.bindable===!0||tt.binding==="writable").map((tt)=>JSON.stringify(tt.name));return et.length===0?In:et.join(" | ")}function ws(o){return o==="default"?"$$Component":o}function L0(o){let et=ws(o.moduleName),tt=o.bindings===In?'""':o.bindings;return`declare const ${et}: Component<
|
|
166
|
+
${o.propsRef},
|
|
167
|
+
${o.exportsRef},
|
|
168
|
+
${tt}
|
|
169
|
+
>;
|
|
170
|
+
export default ${et};`}function O0(o){let et=ws(o.moduleName),tt=`${et}Component`,nt=o.bindings===In?'""':o.bindings;return`interface ${tt} {
|
|
171
|
+
new ${o.generic}(
|
|
172
|
+
options: ComponentConstructorOptions<${o.propsRef}>
|
|
173
|
+
): SvelteComponent<${o.propsRef}> & ${o.exportsRef};
|
|
174
|
+
${o.generic}(
|
|
175
|
+
this: void,
|
|
176
|
+
internals: ComponentInternals,
|
|
177
|
+
props: ${o.propsRef}
|
|
178
|
+
): {
|
|
179
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
180
|
+
$set?(props: Partial<${o.propsRef}>): void;
|
|
181
|
+
} & ${o.exportsRef};
|
|
182
|
+
element?: typeof HTMLElement;
|
|
183
|
+
z_$$bindings?: ${nt};
|
|
184
|
+
}
|
|
185
|
+
declare const ${et}: ${tt};
|
|
186
|
+
export default ${et};`}function M0(o){if(o.extends===void 0)return"";return`import type { ${o.extends.interface} } from ${o.extends.import};`}function $0(o,et="all"){if(et==="none"||!o.componentComment)return"";if(!c0.test(o.componentComment))return Mi(o.componentComment.trim());return`/*${lr(o.componentComment).split(`
|
|
187
|
+
`).map((tt)=>`* ${tt}`).join(`
|
|
188
|
+
`)}
|
|
189
|
+
*/`}function Ta(o){return Oi.test(o)?o:JSON.stringify(o)}function B0(o,et){let tt=[],nt=new Map;for(let rt of o.moduleExports){if(rt.kind!=="re-export"||!rt.reExport)continue;let{from:it,imported:st}=rt.reExport,at=Jr(rt.description,rt.deprecated,rt.tags,et),ct=Ta(rt.name);if(st==="*"){let dt=rt.name==="*"?"*":`* as ${ct}`;tt.push(`${Dr(at)}
|
|
190
|
+
export ${dt} from ${JSON.stringify(it)};`);continue}let lt=`${it}\x00${at}`,ut=nt.get(lt);if(!ut)ut={comments:at,from:it,specifiers:[]},nt.set(lt,ut),tt.push(lt);ut.specifiers.push(st===rt.name?ct:`${Ta(st)} as ${ct}`)}return tt.map((rt)=>{let it=nt.get(rt);if(!it)return rt;return`${Dr(it.comments)}
|
|
191
|
+
export { ${it.specifiers.join(", ")} } from ${JSON.stringify(it.from)};`}).join(`
|
|
192
|
+
|
|
193
|
+
`)}function Da(o){let et=[o.static?"static ":"",o.abstract?"abstract ":"",o.readonly?"readonly ":""].join(""),tt=o.optional?"?":"";if(o.kind==="property")return`${et}${Er(o.name)}${tt}: ${o.type??Zn}`;let nt=b(o.params??[]);if(o.kind==="constructor")return`constructor(${nt})`;let rt=o.typeParameters?`<${o.typeParameters}>`:"";return`${et}${Er(o.name)}${tt}${rt}(${nt}): ${o.returnType??Zn}`}function F0(o,et,tt){let nt=o.localName??o.name,rt=nt!==o.name,it=`export { ${nt}${rt?` as ${Ta(o.name)}`:""} };`;if(tt.has(nt))return it;tt.add(nt);let st=o.typeParameters?`<${o.typeParameters}>`:"",at=(o.members??[]).map((dt)=>[Dr(Jr(dt.description,dt.deprecated,dt.tags,et)),`${Da(dt)};`].filter(Boolean).join(`
|
|
194
|
+
`)).join(`
|
|
195
|
+
|
|
196
|
+
`),ct=`${o.extends?` extends ${o.extends}`:""}${o.implements?.length?` implements ${o.implements.join(", ")}`:""}`,lt=`${rt?"":"export "}declare ${o.abstract?"abstract ":""}class ${nt}${st}${ct}`;return`
|
|
197
|
+
${[Dr(Jr(o.description,o.deprecated,o.tags,et)),at?`${lt} {
|
|
198
|
+
${at}
|
|
199
|
+
}`:`${lt} {}`,rt?it:""].filter(Boolean).join(`
|
|
200
|
+
`)}`}function j0(o,et="all"){let tt=B0(o,et),nt=new Set,rt=o.moduleExports.filter((it)=>it.kind!=="re-export").map((it)=>{if(it.kind==="class")return F0(it,et,nt);let st=!Oi.test(it.name),at=st?{...it,name:V0(it.name)}:it,ct=Jr(at.description,at.deprecated,at.tags,et),lt,ut=at.type&&Hu.test(at.type),dt=at.type==="() => any",ht=at.typeParameters?`<${at.typeParameters}>`:"";if(at.kind==="const"&&!ut)lt=`export declare const ${at.name}: ${at.type||Zn};
|
|
201
|
+
`;else if(at.params&&at.params.length>0)lt=`export declare function ${at.name}${ht}(${b(at.params)}): ${at.returnType||Zn};`;else if(at.returnType)lt=`export declare function ${at.name}${ht}(): ${at.returnType};`;else if(ut&&at.type&&!dt){let[yt,xt,...Et]=at.type.split("=>"),Ct=Et.map((At)=>` => ${At.trim()}`).join("");lt=`export declare function ${at.name}${yt.trimEnd()}: ${xt.trim()}${Ct};`}else if(ut&&at.type){let[yt,xt,...Et]=at.type.split("=>"),Ct=Et.map((At)=>` => ${At.trim()}`).join("");lt=`export declare function ${at.name}${yt.trimEnd()}: ${xt.trim()}${Ct};`}else if(at.kind==="const")lt=`export declare const ${at.name}: ${at.type||Zn};
|
|
202
|
+
`;else lt=`export declare let ${at.name}: ${at.type||Zn};`;if(st)lt=`${lt.replace(y0,"").trimEnd()}
|
|
203
|
+
export { ${at.name} as ${JSON.stringify(it.name)} };`;return`
|
|
204
|
+
${Dr(ct)}
|
|
205
|
+
${lt}`}).join(`
|
|
206
|
+
`);return[tt,rt].filter(Boolean).join(`
|
|
207
|
+
|
|
208
|
+
`)}function V0(o){return`__export_${o.replace(g0,"_")}`}var W0=120;function q0(o){let tt=`export default class ${o.moduleName==="default"?"":o.moduleName}${o.generic} extends SvelteComponentTyped<`,nt=[o.genericProps,o.events,o.slots];if(o.accessors.trim()===""&&nt.every((rt)=>!rt.includes(`
|
|
209
|
+
`))){let rt=`${tt}${nt.join(", ")}> {}`;if(rt.length<=W0)return rt}return`${tt}
|
|
210
|
+
${o.genericProps},
|
|
211
|
+
${o.events},
|
|
212
|
+
${o.slots}
|
|
213
|
+
> {
|
|
214
|
+
${o.accessors}
|
|
215
|
+
}`}function Uu(o,et,tt){let nt=tt.replace(m0,et);if(!tt.includes("{name}")||!Oi.test(nt))throw Error(`sveld: typesOptions.typeNames.${o} must contain "{name}" and produce a valid identifier; got "${tt}".`);return nt}function Qu(o,et){let tt=Uu("props",o,et?.props??"{name}Props"),nt=Uu("exports",o,et?.exports??"{name}Exports");if(tt===nt)throw Error(`sveld: typesOptions.typeNames.props and typesOptions.typeNames.exports both produce "${tt}" for component "${o}"; they must differ.`);let rt=ws(o);for(let[it,st]of[["props",tt],["exports",nt]])if(st===rt||st===`${rt}Component`)throw Error(`sveld: typesOptions.typeNames.${it} produces "${st}" for component "${o}", which the .d.ts already declares for the component itself; use a different template.`);return{props:tt,exports:nt}}function dr(o,et){return Qu(o,et).props}function _r(o,et){return Qu(o,et).exports}function Fi(o,et,tt){if(o===void 0||o===!0)return{...et};if(o===!1)return{props:!1,exports:!1,typedefs:!1,contexts:!1};return{props:o.props??tt,exports:o.exports??tt,typedefs:o.typedefs??tt,contexts:o.contexts??tt}}var _a={props:!0,exports:!0,typedefs:!0,contexts:!0};function Ia(o){let et=Fi(o?.exportTypes,_a,!0);if(o?.forceExportProps===!0)et.props=!0;return et}function Ra(o){return{format:o.format,exportTypes:o.exportTypes,forceExportProps:o.forceExportProps,typeNames:o.typeNames,comments:o.comments,propsDeclaration:o.propsDeclaration,inline:o.inline}}var G0={format:"class",exportTypes:!0,forceExportProps:!1,typeNames:null,comments:"all",propsDeclaration:"type",inline:!1};function La(o){let et=Ra(o??{}),tt={};for(let[nt,rt]of Object.entries(et))tt[nt]=rt??G0[nt];return JSON.stringify(tt)}function Oa(o,et){let tt=pr(o),{moduleName:nt,typedefs:rt,generics:it,props:st,moduleExports:at,slots:ct,events:lt,rest_props:ut,extends:dt,componentComment:ht,contexts:yt,syntaxMode:xt}=o,Et=et?.format==="component",Ct=it!==null,At=Ia(et),_t=et?.comments??"all",{props_name:vt,prop_def:Rt}=T0({moduleName:nt,props:st,rest_props:ut,extends:dt,generics:it,slots:ct,canonicalPropNames:new Set(tt?.canonicalPropNames??[]),canonicalPropsType:tt?.canonicalPropsType,events:Et&&xt==="legacy"?lt:void 0},{export:At.props,typeNames:et?.typeNames,propsDeclaration:et?.propsDeclaration},_t),Nt=it?`<${it[1]}>`:"",Ot=it?`${vt}<${it[0]}>`:vt,Wt=j0({moduleExports:at},_t),tn=Yr({typedefs:rt},{export:At.typedefs},_t),ot=zu({contexts:yt,generics:it},{export:At.contexts},_t),pt=new Set(et?.inlined?.droppedImportStatements??[]),ft=(tt?.typeImportStatements??[]).filter((nn)=>!pt.has(nn)).join(`
|
|
216
|
+
`),gt=[...et?.inlined?.declarations??[],...tt?.localTypeDeclarations??[],...tt?.moduleTypeDeclarations??[]].join(`
|
|
217
|
+
|
|
218
|
+
`),{exports_ref:bt,exports_def:St}=Et?I0({props:st,moduleName:nt,generics:it},{export:At.exports,typeNames:et?.typeNames},_t):{exports_ref:In,exports_def:In},kt=Et?R0({props:st}):In,Pt=!d0.test(ft)&&(Xr.test(Rt)||Xr.test(Wt)||Xr.test(tn)||Xr.test(ot)||Xr.test(gt)||Xr.test(St)),wt=ut?.type==="Element"&&(ut.name!=="svelte:element"||ut.name==="svelte:element"&&ut.thisValue),Tt=ut?.type==="Element"&&ut.name==="svelte:element"&&!ut.thisValue,Lt=[Et?Ct?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${Pt?", Snippet":""} } from "svelte";`:`import type { Component${Pt?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${Pt?", type Snippet":""} } from "svelte";`,wt?'import type { SvelteHTMLElements } from "svelte/elements";':"",Tt?'import type { HTMLAttributes } from "svelte/elements";':"",ft,M0({extends:dt})].filter(Boolean).join(`
|
|
219
|
+
`),Ft=Et?Ct?O0({moduleName:nt,generic:Nt,propsRef:Ot,exportsRef:bt,bindings:kt}):L0({moduleName:nt,propsRef:Ot,exportsRef:bt,bindings:kt}):q0({moduleName:nt,generic:Nt,genericProps:Ot,events:N0({events:lt},_t),slots:k0({slots:ct},_t),accessors:Yu({props:st},_t)}),Kt=[Wt,tn,gt,ot,Rt,St,[$0({componentComment:ht},_t),Ft].filter(Boolean).join(`
|
|
220
|
+
`)].map((nn)=>nn.trim()).filter(Boolean).join(`
|
|
221
|
+
|
|
222
|
+
`);return Vu([Lt,Kt].filter(Boolean).join(`
|
|
223
|
+
|
|
224
|
+
`))}var X0=[".ts",".d.ts",".mts",".cts"],J0=["index.ts","index.d.ts"],Y0=10,Q0=/^\s*(?:export\s+)?(?:declare\s+)?(?:type|interface)\s+([A-Za-z_$][\w$]*)/,Z0=/^[aeiou]/,eb=new Set(["svelte","svelte/elements"]);function $a(o){return eb.has(o)}function Ns(o,et){let tt=Ma(et),nt;if(o.startsWith(".")||o.startsWith("/"))nt=z0(tt,o);else{let at=zr(o,tt);if(at.unresolved)return{kind:"bare"};nt=at.resolved}let rt=Ma(nt),it=K0(nt);if(Qn(rt,it)){let at=Ai(rt,it);if(at?at.isFile():U0(nt,{throwIfNoEntry:!1})?.isFile())return nt.endsWith(".svelte")?{kind:"svelte"}:{kind:"resolved",path:nt}}if(Qn(rt,`${it}.svelte`))return{kind:"svelte"};for(let at of X0)if(Qn(rt,`${it}${at}`))return{kind:"resolved",path:`${nt}${at}`};for(let at of J0)if(Qn(nt,at))return{kind:"resolved",path:td(nt,at)};let st=Ni(nt);return st?{kind:"resolved",path:st}:{kind:"missing"}}function nd(o){return`${Z0.test(o)?"an":"a"} ${o}`}function en(o){return ln(o)&&typeof o.type==="string"?o:void 0}function Ir(o){if(!Array.isArray(o))return[];let et=[];for(let tt of o){let nt=en(tt);if(nt)et.push(nt)}return et}function gn(o){if(!o)return;if(e(o))return o.name;return Yn(o)??void 0}function Ds(o){return Yn(o)??void 0}function Ba(o,et){let tt=o.files.get(et);if(tt!==void 0)return tt;let nt;try{let rt=H0(et,"utf-8"),it=mr(rt,!0,[]);nt={source:rt,program:it}}catch{nt=null}return o.files.set(et,nt),nt}function tb(o){let et=o;while(et?.type==="TSQualifiedName")et=en(et.left);return et?gn(et):void 0}function nb(o){let et=new Set,tt=[],nt=(rt)=>{if(rt.type!=="TSTypeReference")return;let it=tb(en(rt.typeName));if(it&&!et.has(it))et.add(it),tt.push(it)};for(let rt in o){if(rt==="id"||rt==="typeParameters")continue;let it=o[rt];if(Array.isArray(it))for(let st of it){let at=en(st);if(at)C(at,nt)}else{let st=en(it);if(st)C(st,nt)}}return tt}function rb(o){let et=new Set,tt=en(o.typeParameters);for(let nt of Ir(tt?.params)){let rt=gn(en(nt.name));if(rt)et.add(rt)}return et}function Fa(o,et){for(let tt of o.body){let nt=tt.type==="ExportNamedDeclaration"?en(tt.declaration)??tt:tt;switch(nt.type){case"TSTypeAliasDeclaration":if(gn(en(nt.id))===et)return{kind:"type",node:nt};break;case"TSInterfaceDeclaration":if(gn(en(nt.id))===et)return{kind:"interface",node:nt};break;case"TSEnumDeclaration":if(gn(en(nt.id))===et)return{kind:"unsupported",reason:"enum"};break;case"ClassDeclaration":if(gn(en(nt.id))===et)return{kind:"unsupported",reason:"class"};break;case"FunctionDeclaration":if(gn(en(nt.id))===et)return{kind:"unsupported",reason:"function"};break;case"TSModuleDeclaration":if(gn(en(nt.id))===et)return{kind:"unsupported",reason:"namespace"};break;case"VariableDeclaration":for(let rt of Ir(nt.declarations))if(gn(en(rt.id))===et)return{kind:"unsupported",reason:"const"};break;default:break}}return}function sb(o,et){for(let tt of o.body){if(tt.type!=="ImportDeclaration")continue;let nt=Ds(en(tt.source));if(nt===void 0)continue;for(let rt of Ir(tt.specifiers)){let it=en(rt.local),st=gn(it);if(st!==et)continue;if(rt.type==="ImportNamespaceSpecifier")return{kind:"namespace"};let at=typeof it?.start==="number"?it.start:void 0;if(rt.type==="ImportDefaultSpecifier")return{kind:"named",source:nt,importedName:"default",localNameStart:at};if(rt.type==="ImportSpecifier")return{kind:"named",source:nt,importedName:gn(en(rt.imported))??st,localNameStart:at}}}return}function ja(o,et){return`${o}\x00${et}`}function ib(o,et){let tt=new Set,nt=[];for(let rt of o){let it;try{it=mr(rt,!0,[])}catch{continue}for(let st of it.body){if(st.type!=="ImportDeclaration")continue;let at=Ds(en(st.source));if(at===void 0||$a(at))continue;if(Ns(at,et).kind!=="bare")continue;for(let ct of Ir(st.specifiers)){if(ct.type==="ImportNamespaceSpecifier")continue;let lt=ct.type==="ImportDefaultSpecifier"?"default":gn(en(ct.imported))??void 0;if(!lt)continue;let ut=ja(at,lt);if(tt.has(ut))continue;tt.add(ut),nt.push({source:at,importedName:lt})}}}return nt}function Va(o,et){return t(td(Ma(o),`__sveld_inline_all_${et}.ts`))}function rd(o,et,tt){let nt=ib(tt,o);if(nt.length===0)return null;let rt=nt.map(({source:ct,importedName:lt},ut)=>`import type { ${lt} as __sveld_bare_${ut} } from ${JSON.stringify(ct)};`),it=new Map,st=`${rt.join(`
|
|
225
|
+
`)}
|
|
226
|
+
`;return nt.forEach(({source:ct,importedName:lt},ut)=>{st+=`type __sveld_ref_${ut} = `,it.set(ja(ct,lt),st.length),st+=`__sveld_bare_${ut};
|
|
227
|
+
`}),{virtualFile:Va(o,et),content:st,positions:it}}function Vi(o,et){let tt=new Map;for(let nt of o.values()){let rt=pr(nt)?.typeImportStatements??[];if(rt.length===0)continue;let it=rd(et(nt.filePath),nt.moduleName,rt);if(it)tt.set(it.virtualFile,it.content)}return tt}function Zu(o){switch(o.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:o.type}}}function ji(o,et,tt,nt,rt){let it=`${et}#${tt}`;if(rt>Y0||nt.has(it))return{kind:"not-found"};nt.add(it);let st=Ba(o,et);if(!st)return{kind:"not-found"};o.dependencies.add(et);for(let at of st.program.body){if(at.type==="ExportNamedDeclaration"){let ct=en(at.declaration);if(!ct)continue;if(ct.type==="VariableDeclaration"){for(let ut of Ir(ct.declarations))if(gn(en(ut.id))===tt)return{kind:"unsupported",reason:"const"};continue}if(gn(en(ct.id))!==tt)continue;let lt=Zu(ct);return"reason"in lt?{kind:"unsupported",reason:lt.reason}:{kind:"found",node:ct,filePath:et,source:st.source}}if(at.type==="ExportDefaultDeclaration"&&tt==="default"){let ct=en(at.declaration);if(!ct)return{kind:"not-found"};let lt=Zu(ct);return"reason"in lt?{kind:"unsupported",reason:lt.reason}:{kind:"found",node:ct,filePath:et,source:st.source}}}for(let at of st.program.body){if(at.type!=="ExportNamedDeclaration"||at.declaration)continue;for(let ct of Ir(at.specifiers)){if(gn(en(ct.exported))!==tt)continue;let lt=gn(en(ct.local));if(!lt)return{kind:"not-found"};if(!at.source){let ht=Fa(st.program,lt);if(!ht)return{kind:"not-found"};if(ht.kind==="unsupported")return ht;return{kind:"found",node:ht.node,filePath:et,source:st.source}}let ut=Ds(en(at.source));if(ut===void 0)return{kind:"not-found"};let dt=Ns(ut,et);if(dt.kind!=="resolved")return{kind:"not-found"};return ji(o,dt.path,lt,nt,rt+1)}}for(let at of st.program.body){if(at.type!=="ExportAllDeclaration"||en(at.exported))continue;let ct=Ds(en(at.source));if(ct===void 0)continue;let lt=Ns(ct,et);if(lt.kind!=="resolved")continue;let ut=ji(o,lt.path,tt,nt,rt+1);if(ut.kind!=="not-found")return ut}return{kind:"not-found"}}function sd(o,et,tt){let nt=o.nameOwner.get(et);if(nt!==void 0&&nt!==tt)return{ok:!1,reason:`"${et}" was already inlined from a different source`};if(o.reservedNames.has(et))return{ok:!1,reason:`"${et}" collides with a name the component's .d.ts already declares or imports`};return}function ed(o,et,tt){if(tt===et)return{ok:!0};let nt=`alias#${tt}`;if(o.textByKey.has(nt))return{ok:!0};let rt=sd(o,tt,nt);if(rt)return rt;return o.nameOwner.set(tt,nt),o.tx.keys.push(nt),o.textByKey.set(nt,`type ${tt} = ${et};`),o.order.push(nt),{ok:!0}}async function id(o,et,tt){let nt=await o.bareSession.resolveAt(et,tt);if(nt.kind==="default-lib")return{status:"left-alone"};if(nt.kind==="unresolved")return{status:"unresolved"};let rt=Ba(o,nt.filePath);if(!rt)return{status:"unlocatable",filePath:nt.filePath,declaredName:nt.declaredName};let it=Fa(rt.program,nt.declaredName);if(!it)return{status:"unlocatable",filePath:nt.filePath,declaredName:nt.declaredName};if(it.kind==="unsupported")return{status:"unsupported",reason:it.reason};return{status:"found",node:it.node,filePath:nt.filePath,source:rt.source}}async function As(o,et,tt,nt,rt){let it=gn(en(et.id)),{start:st,end:at}=et;if(!it||typeof st!=="number"||typeof at!=="number")return{ok:!1,reason:"has no name or source position"};let ct=`${tt}#${it}`;if(o.pending.has(ct)||o.textByKey.has(ct))return ed(o,it,rt);let lt=sd(o,it,ct);if(lt)return lt;o.pending.add(ct),o.nameOwner.set(it,ct),o.tx.keys.push(ct),o.dependencies.add(tt);let ut=rb(et),dt=Ba(o,tt);for(let ht of nb(et)){if(ut.has(ht)||ht===it)continue;if(!dt)continue;let yt=Fa(dt.program,ht);if(yt){if(yt.kind==="unsupported")return o.pending.delete(ct),{ok:!1,reason:`references "${ht}", a ${yt.reason} that cannot be inlined`};let _t=await As(o,yt.node,tt,nt,ht);if(!_t.ok)return o.pending.delete(ct),_t;continue}let xt=sb(dt.program,ht);if(!xt||xt.kind==="namespace")continue;let Et=Ns(xt.source,tt);if(Et.kind==="resolved"){let _t=ji(o,Et.path,xt.importedName,new Set,0);if(_t.kind==="not-found")return o.pending.delete(ct),{ok:!1,reason:`references "${ht}", which is not exported from "${xt.source}"`};if(_t.kind==="unsupported")return o.pending.delete(ct),{ok:!1,reason:`references "${ht}", a ${_t.reason} that cannot be inlined`};let vt=await As(o,_t.node,_t.filePath,_t.source,ht);if(!vt.ok)return o.pending.delete(ct),vt;continue}if(Et.kind!=="bare"||$a(xt.source)||!o.bareSession||xt.localNameStart===void 0)continue;let Ct=await id(o,tt,xt.localNameStart);if(Ct.status==="left-alone")continue;if(Ct.status!=="found"){o.pending.delete(ct);let _t=Ct.status==="unresolved"?`which could not be resolved from "${xt.source}"`:Ct.status==="unlocatable"?`which resolves to "${Ct.declaredName}" in "${Ct.filePath}", where sveld could not locate that declaration`:`a ${Ct.reason} that cannot be inlined`;return{ok:!1,reason:`references "${ht}", ${_t}`}}let At=await As(o,Ct.node,Ct.filePath,Ct.source,ht);if(!At.ok)return o.pending.delete(ct),At}return o.pending.delete(ct),o.textByKey.set(ct,nt.slice(st,at).trim()),o.order.push(ct),ed(o,it,rt)}async function ob(o,et,tt,nt){let rt=ji(o,et,tt,new Set,0);if(rt.kind==="not-found")return{ok:!1,reason:`"${tt}" is not exported from "${et}"`};if(rt.kind==="unsupported")return{ok:!1,reason:`"${tt}" is ${nd(rt.reason)}, which cannot be inlined`};return As(o,rt.node,rt.filePath,rt.source,nt)}async function ab(o,et,tt,nt){let rt=o.barePlan?.positions.get(ja(et,tt));if(!o.bareSession||!o.barePlan||rt===void 0)return{ok:!1,reason:`"${tt}" is a package import that sveld could not verify`};let it=await id(o,o.barePlan.virtualFile,rt);switch(it.status){case"left-alone":return{ok:!1,reason:`"${tt}" resolves to a built-in TypeScript type, which cannot be inlined`};case"unresolved":return{ok:!1,reason:`"${tt}" could not be resolved from "${et}"`};case"unlocatable":return{ok:!1,reason:`"${tt}" resolves to "${it.declaredName}" in "${it.filePath}", where sveld could not locate that declaration`};case"unsupported":return{ok:!1,reason:`"${tt}" is ${nd(it.reason)}, which cannot be inlined`};case"found":return As(o,it.node,it.filePath,it.source,nt);default:return it}}function cb(o){o.order.length=o.tx.orderStart;let et=new Set(o.tx.keys);for(let tt of et)o.textByKey.delete(tt);for(let[tt,nt]of o.nameOwner)if(et.has(nt))o.nameOwner.delete(tt)}function pb(o,et,tt){let nt;try{nt=mr(o,!0,[])}catch{return{status:"kept",localNames:[]}}let rt=nt.body.filter((ut)=>ut.type==="ImportDeclaration"),it=rt.flatMap((ut)=>Ir(ut.specifiers)),st=[];for(let ut of it){let dt=gn(en(ut.local));if(!dt)continue;let ht=ut.type==="ImportDefaultSpecifier"?"default":gn(en(ut.imported))??dt;st.push({importedName:ht,localName:dt})}let at=st.map(({localName:ut})=>ut);if(rt.length===0||it.some((ut)=>ut.type==="ImportNamespaceSpecifier"))return{status:"kept",localNames:at};let ct=Ds(en(rt[0]?.source));if(ct===void 0)return{status:"kept",localNames:at};let lt=Ns(ct,et);if(lt.kind==="svelte")return{status:"kept",localNames:at};if(lt.kind==="missing")return{status:"refused",localNames:at,failures:st.map(({localName:ut})=>({name:ut,reason:`"${ct}" was not found on disk`}))};if(lt.kind==="bare"&&($a(ct)||!tt))return{status:"kept",localNames:at};return{status:"attempt",localNames:at,names:st,sourceValue:ct,resolution:lt}}async function lb(o,et){if(et.status!=="attempt")return et;let{names:tt,sourceValue:nt,resolution:rt}=et;o.tx={orderStart:o.order.length,keys:[]};let it=[];for(let{importedName:st,localName:at}of tt){let ct=await(rt.kind==="bare"?ab(o,nt,st,at):ob(o,rt.path,st,at));if(!ct.ok)it.push({name:at,reason:ct.reason})}if(it.length>0)return cb(o),{status:"refused",failures:it};return{status:"inlined"}}function ub(o,et){let tt=new Set;for(let it of o.typedefs)tt.add(it.name);for(let it of o.contexts??[])tt.add(it.typeName);let nt=pr(o);for(let it of[...nt?.localTypeDeclarations??[],...nt?.moduleTypeDeclarations??[]]){let st=Q0.exec(it);if(st)tt.add(st[1])}tt.add(dr(o.moduleName,et)),tt.add(_r(o.moduleName,et));let rt=ws(o.moduleName);tt.add(rt),tt.add(`${rt}Component`);for(let it of db)tt.add(it);return tt}var db=["$Props","$RestProps","Component","ComponentConstructorOptions","ComponentInternals","HTMLAttributes","Snippet","SvelteComponent","SvelteComponentTyped","SvelteHTMLElements"];async function Wi(o,et,tt,nt){let rt=new Map;return await Promise.all(Array.from(o.values()).map(async(it)=>{let at=pr(it)?.typeImportStatements??[];if(at.length===0)return;let ct=et(it.filePath),lt=nt?rd(ct,it.moduleName,at):null,ut=at.map((Nt)=>pb(Nt,ct,nt)),dt=ub(it,tt);for(let Nt of ut)if(Nt.status!=="attempt")for(let Ot of Nt.localNames)dt.add(Ot);let ht=new Map,yt=new Set,xt=()=>({files:ht,reservedNames:new Set(dt),nameOwner:new Map,textByKey:new Map,order:[],pending:new Set,dependencies:yt,tx:{orderStart:0,keys:[]},bareSession:nt,barePlan:lt}),Et=new Set,Ct=new Map,At,_t;for(;;){At=xt(),_t=new Map;for(let ot of Ct.keys())for(let pt of ut[ot].localNames)At.reservedNames.add(pt);let Nt=ut.map((ot,pt)=>pt).filter((ot)=>!Ct.has(ot)),Ot=[...Nt.filter((ot)=>Et.has(ot)),...Nt.filter((ot)=>!Et.has(ot))];for(let ot of Ot){let pt=await lb(At,ut[ot]);if(_t.set(ot,pt),pt.status==="refused")for(let ft of ut[ot].localNames)At.reservedNames.add(ft)}let Wt=At.nameOwner,tn=Ot.filter((ot)=>_t.get(ot)?.status!=="inlined"&&ut[ot].localNames.some((pt)=>Wt.has(pt)));if(tn.length===0)break;for(let ot of tn){let pt=_t.get(ot);if(Et.has(ot))Ct.set(ot,pt?.status==="refused"?pt.failures:[]);else Et.add(ot)}}let vt=[],Rt=(it.diagnostics??[]).filter((Nt)=>Nt.kind!=="types-inline-unresolved");for(let[Nt,Ot]of at.entries()){let Wt=_t.get(Nt),tn=Wt?.status==="refused"?Wt.failures:Ct.get(Nt);if(Wt?.status==="inlined")vt.push(Ot);for(let ot of tn??[])Rt.push(vn({component:it.filePath,kind:"types-inline-unresolved",name:ot.name,message:`Cannot inline "${ot.name}": ${ot.reason}.`}))}if(it.diagnostics=Rt,vt.length===0&&At.order.length===0)return;rt.set(it.filePath,{droppedImportStatements:vt,declarations:At.order.map((Nt)=>At.textByKey.get(Nt)??""),dependencies:Array.from(yt)})})),rt}import{hash as fb}from"node:crypto";import{existsSync as hb,mkdirSync as mb,readFileSync as yb,renameSync as gb,writeFileSync as od}from"node:fs";import{dirname as Wa,isAbsolute as xb,join as cd,resolve as qi}from"node:path";var qa=9,bb=cd("node_modules",".cache","sveld","parse-cache.json"),Eb="b9dd8d74837ec97d";function Ga(){return`${gi}+${Eb}+svelte@${vs}`}function Cb(o){for(let et=qi(o);;et=Wa(et)){if(hb(cd(et,"package.json")))return et;if(Wa(et)===et)return qi(o)}}function pd(o,et){let tt=Cb(o);if(typeof et==="string")return xb(et)?et:qi(tt,et);return qi(tt,bb)}function Gi(o){return fb("sha256",o,"hex")}function ad(){return{formatVersion:qa,toolchainVersion:Ga(),entries:{}}}function vb(o){try{let et=yb(o,"utf-8"),tt=JSON.parse(et);if(tt.formatVersion!==qa||tt.toolchainVersion!==Ga())return ad();return tt}catch{return ad()}}class Ua{cacheFilePath;file;next=new Map;blocked=new Set;constructor(o){this.cacheFilePath=o,this.file=vb(o)}has(o,et){if(this.blocked.has(o))return!1;let tt=this.file.entries[o];return tt!==void 0&&tt.hash===et}get(o,et){if(this.blocked.has(o))return null;let tt=this.file.entries[o];if(tt===void 0||tt.hash!==et)return null;this.next.set(o,tt);let nt=structuredClone(tt.parsed);if(tt.typeScriptMetadata!==void 0)nt[w]=structuredClone(tt.typeScriptMetadata);return nt}set(o,et,tt){this.next.set(o,{hash:et,parsed:structuredClone(tt),typeScriptMetadata:structuredClone(tt[w])})}invalidate(o){this.blocked.add(o)}getGeneratedText(o,et){let tt=this.next.get(o);if(tt?.generatedText===void 0||tt.generatedText.key!==et)return;return tt.generatedText.text}setGeneratedText(o,et,tt){let nt=this.next.get(o);if(nt===void 0)return;nt.generatedText={key:et,text:tt}}save(){mb(Wa(this.cacheFilePath),{recursive:!0});let o={formatVersion:qa,toolchainVersion:Ga(),entries:Object.fromEntries(this.next)},et=JSON.stringify(o),tt=`${this.cacheFilePath}.${process.pid}.tmp`;try{od(tt,et),gb(tt,this.cacheFilePath)}catch{try{od(this.cacheFilePath,et)}catch{}}}}import{lstatSync as Sb,readFileSync as Tb}from"node:fs";import{basename as kb,dirname as Qa,isAbsolute as Pb,join as wb,relative as Ab,resolve as Za}from"node:path";var Ha=!1;function J(o){Ha=o}function Rn(o){if(!Ha)console.error(o)}function Ui(o){if(!Ha)console.error(o)}var Qr=null,Ka=null;function Rr(){if(Qr)return Promise.resolve(Qr);if(!Ka)Ka=Promise.all([import("./chunk-95xn5q1p.js"),import("./chunk-7w571557.js")]).then(([o,et])=>(Qr={ComponentParser:o.default,parseSvelte:et.parse},Qr));return Ka}function Hi(){if(!Qr)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return Qr}var za=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],Nb=/\r?\n/,Db=/^\s*\*+/;function ec(o=new Map){return{cache:new Map,computing:new Set,modules:o}}function Vt(o){return o&&typeof o==="object"?o:void 0}function ir(o){return Array.isArray(o)?o:[]}function Tn(o){return e(o)?o.name:void 0}function _b(o){return o==="."||o===".."||o.startsWith("./")||o.startsWith("../")||Pb(o)}function Ln(o,et){let tt=Ca(o,et);if(tt===o&&!_b(o))return null;let nt=Za(et,tt),rt=Qa(nt),it=kb(nt);if(Qn(rt,it)){let at=Ai(rt,it)??Sb(nt,{throwIfNoEntry:!1});if(at?.isFile())return nt;for(let ct of za)if(Qn(rt,it+ct))return nt+ct;if(at?.isDirectory()){for(let ct of za)if(Qn(nt,`index${ct}`))return wb(nt,`index${ct}`)}return null}for(let st of za)if(Qn(rt,it+st))return nt+st;return Ni(nt)??null}function Ib(o){let et=o.trimEnd();for(;;){let tt=et.lastIndexOf(`
|
|
228
|
+
`)+1;if(et.slice(tt).trimStart().startsWith("//")){et=et.slice(0,tt).trimEnd();continue}let nt=et.endsWith("*/")?et.lastIndexOf("/*",et.length-3):-1;if(nt!==-1&&et[nt+2]!=="*"){et=et.slice(0,nt).trimEnd();continue}return et}}function Rb(o,et){let tt=Ib(o.slice(0,et));if(!tt.endsWith("*/"))return;let nt=tt.length-2,rt=tt.lastIndexOf("/**",nt);if(rt===-1)return;return tt.slice(rt,nt+2)}function Lb(o){let et=[];for(let tt of o.slice(3,-2).split(Nb)){let nt=tt.replace(Db,"").trim();if(nt.startsWith("@"))break;if(nt)et.push(nt)}return et.join(" ")||void 0}function Lr(o,et){if(!et)return;return o.text.slice(et.start,et.end)}function Ob(o,et){let tt=Vt(et?.typeAnnotation);if(tt?.type!=="TSTypeAnnotation")return;return Lr(o,Vt(tt.typeAnnotation))}function Xa(o,et){let tt=Vt(et.returnType);return tt?.type==="TSTypeAnnotation"?Lr(o,Vt(tt.typeAnnotation)):void 0}function Ja(o,et){let tt=ir(et.params).map((rt)=>Lr(o,rt)??"").join(", "),nt=Xa(o,et);return`(${tt})${nt?` => ${nt}`:""}`}function dd(o){if(o.type==="Literal"){let et=o.value;if(typeof et==="string")return"string";if(typeof et==="number")return"number";if(typeof et==="boolean")return"boolean"}if(o.type==="TemplateLiteral")return"string";return}function Mb(o,et){let tt=Lr(o,et);if(tt===void 0)return;if(et.type==="Literal"){let rt=et.value;if(typeof rt==="string"||typeof rt==="number"||typeof rt==="boolean")return{raw:tt,value:rt,type:typeof rt};return}if(et.type==="UnaryExpression"&&et.operator==="-"){let rt=Vt(et.argument);if(rt?.type==="Literal"&&typeof rt.value==="number")return{raw:tt,value:-rt.value,type:"number"};return}let nt=et.type==="TemplateLiteral"?Yn(et):null;return nt===null?void 0:{raw:tt,value:nt,type:"string"}}function $b(o,et){if(o.type!=="CallExpression"&&o.type!=="NewExpression")return;let tt=Vt(o.callee);if(!(Tn(tt)==="Symbol"||tt?.type==="MemberExpression"&&!tt.computed&&Tn(Vt(tt.object))==="Symbol"&&Tn(Vt(tt.property))==="for"))return;return Yn(ir(o.arguments)[0])||et}var Bb=new Set(["any","bigint","boolean","false","never","null","number","object","readonly","string","symbol","true","undefined","unknown","void"]),Fb=/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,jb=/(?<![\w$.])[A-Za-z_$][\w$]*(?![\w$]|\s*\??:)/g;function Vb(o,et){let tt=et?v(Ar(et)).type?.type.trim():void 0,nt=o?{type:o,source:"typescript"}:tt?{type:tt,source:"jsdoc"}:void 0;if(!nt||nt.type.includes("`"))return;return(nt.type.replace(Fb,'""').match(jb)??[]).every((it)=>Bb.has(it))?nt:void 0}function Wb(o){if(!o)return;let et=o.lastIndexOf("=>");if(et===-1)return;return o.slice(et+2).trim()||void 0}function ld(o){if(o.async||o.generator)return;let et=Vt(o.body);if(!et)return;let tt=[];if(et.type==="BlockStatement"){if(_s(et,tt),tt.length===0)return}else tt.push(et);let nt;for(let rt of tt){if(!rt)return;let it=dd(rt);if(!it)return;if(nt===void 0)nt=it;else if(nt!==it)return}return nt}function _s(o,et){for(let tt of ir(o.body)){if(tt.type==="FunctionDeclaration"||tt.type==="FunctionExpression"||tt.type==="ArrowFunctionExpression")continue;if(tt.type==="ReturnStatement"){et.push(Vt(tt.argument)??null);continue}if(tt.type==="BlockStatement"){_s(tt,et);continue}let nt=Vt(tt.consequent);if(nt?.type==="BlockStatement")_s(nt,et);else if(nt?.type==="ReturnStatement")et.push(Vt(nt.argument)??null);let rt=Vt(tt.alternate);if(rt?.type==="BlockStatement")_s(rt,et);else if(rt?.type==="ReturnStatement")et.push(Vt(rt.argument)??null);let it=Vt(tt.body);if(it?.type==="BlockStatement")_s(it,et)}}function qb(o){let et=Vt(o.initializer);if(!et)return;if(et.type==="Literal"){let tt=et.value;return typeof tt==="string"||typeof tt==="number"?tt:void 0}if(et.type==="UnaryExpression"){let tt=Vt(et.argument);if(et.operator==="-"&&tt?.type==="Literal"){let rt=tt.value;if(typeof rt==="number")return-rt}}return}function Gb(o){let et=ir(o.members);if(et.length===0)return;let tt=[],nt=0;for(let rt of et){if(!Vt(rt.initializer)){tt.push(String(nt)),nt+=1;continue}let st=qb(rt);if(st===void 0)return;tt.push(typeof st==="string"?JSON.stringify(st):String(st)),nt=typeof st==="number"?st+1:nt}return tt.join(" | ")}function Ya(o,et,tt,nt){let rt=o.filePath,it=Rb(o.text,tt),st=it?Lb(it):void 0,at=it?ou(it):void 0,{deprecated:ct,tags:lt,internal:ut}=it?au(it):{deprecated:void 0,tags:void 0,internal:!1},dt=ut?{internal:!0}:{};if(et.type==="VariableDeclaration"){let ht=et.kind??"const",yt=[];for(let xt of ir(et.declarations)){let Et=Vt(xt.id),Ct=Tn(Et);if(!Ct)continue;let At=Ob(o,Et),_t=At,vt,Rt,Nt,Ot,Wt,tn,ot=Vt(xt.init);if(ot)if(ot.type==="ArrowFunctionExpression"||ot.type==="FunctionExpression"){if(tn=ot,!_t)_t=Ja(o,ot);Rt=Xa(o,ot)??at??Wb(_t)??ld(ot)}else{if(vt=Lr(o,ot),!_t)_t=dd(ot);let pt=Vt(g(ot))??ot;if(Nt=Yn(pt)??$b(pt,Ct),ht==="const")Ot=Mb(o,pt),Wt=Vb(At,it)}yt.push({name:Ct,kind:ht,type:_t,value:vt,returnType:Rt,literalValue:Nt,primitiveLiteral:Ot,declaredType:Wt,functionNode:tn,description:st,deprecated:ct,tags:lt,...dt,declFile:rt,isTypeOnly:!1})}return yt}if(et.type==="FunctionDeclaration"||et.type==="TSDeclareFunction"){let ht=Tn(Vt(et.id))??nt;if(!ht)return[];return[{name:ht,kind:"function",type:Ja(o,et),returnType:Xa(o,et)??at??ld(et),...et.type==="FunctionDeclaration"?{functionNode:et}:{},description:st,deprecated:ct,tags:lt,...dt,declFile:rt,isTypeOnly:!1}]}if(et.type==="ClassDeclaration"){let ht=Tn(Vt(et.id)),yt=ht??nt;if(!yt)return[];return[{name:yt,kind:"class",...ht?{type:ht}:{},description:st,deprecated:ct,tags:lt,...dt,declFile:rt,isTypeOnly:!1}]}if(et.type==="TSTypeAliasDeclaration"){let ht=Tn(Vt(et.id));if(!ht)return[];return[{name:ht,kind:"type",type:Lr(o,Vt(et.typeAnnotation)),description:st,deprecated:ct,tags:lt,...dt,declFile:rt,isTypeOnly:!0}]}if(et.type==="TSInterfaceDeclaration"){let ht=Tn(Vt(et.id));if(!ht)return[];return[{name:ht,kind:"interface",type:Lr(o,Vt(et.body)),description:st,deprecated:ct,tags:lt,...dt,declFile:rt,isTypeOnly:!0}]}if(et.type==="TSEnumDeclaration"){let ht=Tn(Vt(et.id));if(!ht)return[];return[{name:ht,kind:"enum",type:Gb(et)??ht,description:st,deprecated:ct,tags:lt,...dt,declFile:rt,isTypeOnly:!1}]}return[]}function Ub(o,et,tt){let nt=Vt(et.declaration);if(!nt)return;if(nt.type==="FunctionDeclaration"||nt.type==="TSDeclareFunction"||nt.type==="ClassDeclaration"){let[st]=Ya(o,nt,et.start,"default");return st?{...st,name:"default"}:void 0}if(nt.type==="FunctionExpression"||nt.type==="ArrowFunctionExpression")return{name:"default",kind:"function",type:Ja(o,nt),functionNode:nt,declFile:o.filePath,isTypeOnly:!1};let rt=Tn(nt),it=rt?tt(rt):null;return it?{...it,name:"default"}:void 0}function Hb(o){let et;try{et=Tb(o,"utf-8")}catch{return null}try{let tt;if(o.endsWith(".svelte")){let nt=Hi().parseSvelte(et);tt=ir(nt.module?.content?.body)}else tt=ir(mr(et,!0,[]).body);return{source:{text:et,filePath:o,dir:Qa(o)},body:tt}}catch(tt){let nt=tt instanceof Error?tt.message:String(tt);return Ui(`Warning: sveld couldn't parse ${o} to read its exports (${nt}); skipping it.`),null}}function Kb(o,et){for(let tt of o){if(tt.type!=="ImportDeclaration")continue;let nt=Vt(tt.source)?.value;if(typeof nt!=="string")continue;for(let rt of ir(tt.specifiers)){if(Tn(Vt(rt.local))!==et)continue;let it=tt.importKind==="type"||rt.importKind==="type";if(rt.type==="ImportDefaultSpecifier")return{specifier:nt,importedName:"default",isTypeOnly:it};if(rt.type==="ImportNamespaceSpecifier")return{specifier:nt,importedName:"*",isTypeOnly:it};if(rt.type==="ImportSpecifier"){let st=Tn(Vt(rt.imported))??et;return{specifier:nt,importedName:st,isTypeOnly:it}}}}return null}function ud(o,et,tt){return{name:o,kind:"const",declFile:et,namespaceFile:et,isTypeOnly:tt}}function tc(o,et){let tt=et.cache.get(o);if(tt)return tt;if(et.computing.has(o))return[];et.computing.add(o);let nt=et.modules.get(o);if(nt===void 0)nt=Hb(o),et.modules.set(o,nt);if(!nt)return et.computing.delete(o),et.cache.set(o,[]),[];let{source:rt,body:it}=nt,st=[],at=new Map;for(let ht of it){let yt=ht.type==="ExportNamedDeclaration"?Vt(ht.declaration):ht;if(!yt)continue;for(let xt of Ya(rt,yt,yt.start))at.set(xt.name,xt)}let ct=(ht,yt)=>({name:ht,kind:"const",declFile:Za(rt.dir,yt),isTypeOnly:!1}),lt=(ht)=>{let yt=at.get(ht);if(yt)return yt;let xt=Kb(it,ht);if(!xt)return null;if(xt.specifier.endsWith(".svelte"))return ct(ht,xt.specifier);let Et=Ln(xt.specifier,rt.dir);if(!Et)return null;if(xt.importedName==="*")return ud(ht,Et,xt.isTypeOnly);return Or(Et,xt.importedName,et)??null},ut=new Map;for(let ht of it){if(ht.type==="ExportAllDeclaration"){let At=Vt(ht.source)?.value;if(typeof At!=="string"||At.endsWith(".svelte"))continue;let _t=Ln(At,rt.dir);if(!_t)continue;let vt=ht.exportKind==="type",Rt=Tn(Vt(ht.exported));if(Rt){st.push(ud(Rt,_t,vt));continue}for(let Nt of tc(_t,et)){let Ot=ut.get(Nt.name)??[];Ot.push(vt?{...Nt,isTypeOnly:!0}:Nt),ut.set(Nt.name,Ot)}continue}if(ht.type==="ExportDefaultDeclaration"){let At=Ub(rt,ht,lt);if(At)st.push(At);continue}if(ht.type!=="ExportNamedDeclaration")continue;let yt=Vt(ht.declaration);if(yt){st.push(...Ya(rt,yt,ht.start));continue}let xt=Vt(ht.source)?.value,Et=typeof xt==="string"?xt:void 0;if(Et?.endsWith(".svelte")){for(let At of ir(ht.specifiers)){let _t=Tn(Vt(At.exported));if(_t)st.push(ct(_t,Et))}continue}let Ct=ht.exportKind==="type";for(let At of ir(ht.specifiers)){if(At.type!=="ExportSpecifier")continue;let _t=Tn(Vt(At.exported)),vt=Tn(Vt(At.local));if(!_t||!vt)continue;let Rt=Ct||At.exportKind==="type",Nt=null;if(Et){let Ot=Ln(Et,rt.dir);if(Ot)Nt=Or(Ot,vt,et)??null}else Nt=lt(vt);if(Nt)st.push({...Nt,name:_t,isTypeOnly:Nt.isTypeOnly||Rt});else if(vt!=="default")st.push({name:_t,kind:Rt?"type":"const",declFile:o,isTypeOnly:Rt})}}let dt=new Set(st.map((ht)=>ht.name));for(let[ht,yt]of ut){if(dt.has(ht)||ht==="default")continue;if(yt.every((xt)=>xt.declFile===yt[0].declFile))st.push(...yt);else et.onAmbiguousStarExport?.(o,ht,yt)}return et.computing.delete(o),et.cache.set(o,st),st}function Or(o,et,tt){return tc(o,tt).findLast((nt)=>nt.name===et)}function Zr(o,{importedName:et,members:tt=[]},nt){let rt=Or(o,et,nt);for(let it of tt){if(rt?.namespaceFile===void 0)return;rt=Or(rt.namespaceFile,it,nt)}return rt}async function Ki(o,et={}){await Rr();let tt=Za(o),nt=Qa(tt),rt=(at)=>t(`./${Ab(nt,at)}`),it=tc(tt,{...ec(),onAmbiguousStarExport:(at,ct,lt)=>{if(at!==tt||!et.diagnostics)return;if(lt.every((yt)=>yt.declFile.endsWith(".svelte")))return;let ut=Array.from(new Set(lt.map((yt)=>rt(yt.declFile)))),dt=ut.map((yt)=>`"${yt}"`),ht=`${dt.slice(0,-1).join(", ")} and ${dt[dt.length-1]}`;et.diagnostics.push(vn({component:rt(tt),kind:"export-ambiguous",name:ct,message:`"${ct}" is exported by ${ht} through \`export *\`, so the barrel doesn't export it and the docs leave it out; export it explicitly from the barrel (e.g. \`export { ${ct} } from "${ut[0]}"\`).`}))}}),st=new Map;for(let at of it){if(at.name==="default"||at.declFile.endsWith(".svelte"))continue;let{declFile:ct,returnType:lt,literalValue:ut,primitiveLiteral:dt,declaredType:ht,functionNode:yt,namespaceFile:xt,...Et}=at,Ct=rt(ct);if(xt!==void 0)Et.type=`typeof import(${JSON.stringify(rt(xt))})`;st.set(at.name,{...Et,source:Ct})}return Array.from(st.values()).sort((at,ct)=>u(at.name,ct.name))}import{readFileSync as yd}from"node:fs";import{dirname as nc,join as zb,relative as fd,resolve as hd}from"node:path";var md=new Map;function Xb(o){return Do(o,{ecmaVersion:"latest",sourceType:"module"})}function Jb(o,et,tt){let nt=Ln(o,et);if(!nt)return null;let rt=nc(nt);if(tt.has(nt))return{dir:rt,exports:{}};tt.add(nt);try{return{dir:rt,exports:zi(yd(nt,"utf-8"),rt,tt,nt)}}catch{return{dir:rt,exports:{}}}finally{tt.delete(nt)}}function zi(o,et,tt=new Set,nt=et){let rt=md.get(nt),it=rt?.source===o?rt.ast:void 0;if(!it)it=Xb(o),md.set(nt,{source:o,ast:it});let st={};for(let at of it.body)if(at.type==="ExportDefaultDeclaration"){let ct=at.declaration.name;if(ct in st)st[ct].default=!0;else st[ct]={source:ur(""),default:!0}}else if(at.type==="ExportAllDeclaration"){if(!at.source)continue;let ct=at.source.value,lt=Ln(ct,et);if(!lt){let ht=zr(ct,et);throw new Kr(ct,nt,ht.unresolved?ht.searched:"no matching file or index found")}if(tt.has(lt))continue;tt.add(lt);let ut=yd(lt,"utf-8"),dt=zi(ut,nc(lt),tt,lt);tt.delete(lt);for(let[ht,yt]of Object.entries(dt)){let xt=ur(t(yt.source.startsWith(".")?`./${fd(et,hd(nc(lt),yt.source))}`:`./${zb(ct,yt.source)}`));st[ht]={...yt,source:xt}}}else if(at.type==="ExportNamedDeclaration"){let ct=at.source?.value,lt=ct!==void 0&&sr.test(ct);if(lt){let ht=zr(ct,et);if(ht.unresolved)throw new Kr(ct,nt,ht.searched)}let dt=ct!==void 0&&!lt?Jb(ct,et,tt):void 0;if(dt===null)console.warn(`sveld: could not resolve re-exported module "${ct}" from barrel "${et||"."}"; skipping.`);for(let ht of at.specifiers){let yt=ht.exported.name,xt=ht.local.name,Et=yt||xt;if(dt===null)continue;let Ct=dt?.exports[xt],At=Ct?ur(t(`./${fd(et,hd(dt.dir,Ct.source))}`)):ur(Li(ct??"",et)),_t=Ct?Ct.default:xt==="default";if(Et in st){if(st[Et].mixed=!0,!st[Et].source)st[Et].source=At}else st[Et]={source:At,default:_t}}}else if(at.type==="ImportDeclaration"){let ct=at.specifiers[0].local.name;if(ct in st){if(!st[ct].source)st[ct].source=ur(Li(at.source?.value??"",et))}else st[ct]={source:ur(Li(at.source?.value??"",et)),default:ct==="default"}}return st}import{existsSync as Yb}from"node:fs";import{dirname as Qb}from"node:path";var Zb=/\.[^./\\]+$/;function eE(o){if(o.endsWith(".d.ts"))return null;let et=o.replace(Zb,".d.ts");return Yb(et)?et:null}function gd(o,et,tt){let nt=Qb(o);return et.map((rt)=>{if(!rt.importSource||!rt.importedName)return{candidate:rt};let it=Ln(rt.importSource,nt);if(!it)return{candidate:rt,failureReason:"module-not-found"};let st=Or(it,rt.importedName,tt);if(!st)return{candidate:rt,failureReason:"export-not-found"};if(st.returnType)return{candidate:rt,type:st.returnType};let at=eE(it);if(at){let ct=Or(at,rt.importedName,tt);if(ct?.returnType)return{candidate:rt,type:ct.returnType}}return{candidate:rt,failureReason:"return-type-unresolved"}})}function xd(o,et){switch(et){case"module-not-found":return`Prop "${o.propName}" default calls "${o.calleeName}()", but "${o.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${o.propName}" default calls "${o.calleeName}()", but "${o.importedName}" is not exported from "${o.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${o.propName}" default calls "${o.calleeName}()" imported from "${o.importSource}", but its return type could not be resolved; falling back to "any".`}}import{dirname as tE}from"node:path";function bd(o,et,tt){let nt=tE(o);return et.map((rt)=>{let it=Ln(rt.importSource,nt);if(!it)return{candidate:rt};let st=Zr(it,rt,tt);if(!st?.primitiveLiteral)return{candidate:rt};return{candidate:rt,literal:st.primitiveLiteral,declaredType:st.declaredType}})}import{dirname as nE}from"node:path";function Ed(o,et,tt){let nt=nE(o);return et.map((rt)=>{let it=Ln(rt.importSource,nt);if(!it)return{candidate:rt};let st=Zr(it,rt,tt);if(st?.kind!=="const"||st.literalValue===void 0)return{candidate:rt};return{candidate:rt,key:st.literalValue}})}import{dirname as rE}from"node:path";function Sd(o,et,tt){let nt=rE(o);return et.map((rt)=>{let it=Ln(rt.importSource,nt);if(!it)return{candidate:rt,failureReason:"module-not-found"};let st=Zr(it,rt,tt)?.functionNode;if(!st)return{candidate:rt,failureReason:"not-a-function"};let at=sE(st,rt);if(!at)return{candidate:rt,failureReason:"parameter-not-found"};return aE(st,at,rt)})}function Cd(o){return o?.type==="AssignmentPattern"?Vt(o.left):o}function sE(o,et){let tt=Array.isArray(o.params)?o.params:[],nt=Cd(Vt(tt[et.argumentIndex]));if(et.property===void 0)return e(nt)?{name:nt.name}:void 0;if(!et.property)return;if(e(nt))return{object:nt.name,property:et.property};if(nt?.type!=="ObjectPattern"||!Array.isArray(nt.properties))return;for(let rt of nt.properties){if(rt.type!=="Property"||rt.computed)continue;let it=Vt(rt.key);if(!e(it)||it.name!==et.property)continue;let st=Cd(Vt(rt.value));return e(st)?{name:st.name}:void 0}return}function rc(o){if(!o)return null;if(o.type==="ConditionalExpression"){let tt=rc(Vt(o.consequent)),nt=rc(Vt(o.alternate));return tt&&nt?[...tt,...nt]:null}let et=Yn(o);return et?[et]:null}var iE={variableType:()=>{return},getPropertyName:(o)=>{if(e(o))return o.name;return h(o)&&o.value!=null?String(o.value):void 0}};function oE(o){if(!o)return"null";if(o.type==="Literal")return G(o.value);return aa(iE,o)??"any"}function vd(o,et){if("name"in et)return o.type==="Identifier"&&o.name===et.name;if(o.type!=="MemberExpression"||o.computed)return!1;let tt=Vt(o.object),nt=Vt(o.property);return e(tt)&&tt.name===et.object&&e(nt)&&nt.name===et.property}function aE(o,et,tt){let nt=Vt(o.body);if(!nt)return{candidate:tt,events:[]};let rt=new Map,it="name"in et?et.name:et.object,st;if(C(nt,(ct,lt,ut)=>{if(st)return;if(ct.type==="CallExpression"){let ht=Vt(ct.callee);if(!ht||!vd(ht,et))return;let yt=Array.isArray(ct.arguments)?ct.arguments:[],xt=rc(yt[0]);if(!xt){st="dynamic-event-name";return}for(let Et of xt){let Ct=rt.get(Et)??new Set;Ct.add(oE(yt[1])),rt.set(Et,Ct)}return}let dt=lt?.type==="CallExpression"&&ut==="callee";if(ct.type==="MemberExpression"&&vd(ct,et)&&!dt){st="passed-on";return}if(ct.type!=="Identifier"||ct.name!==it)return;if(dt)return;if(!("name"in et)&<?.type==="MemberExpression"&&ut==="object")return;if(lt?.type==="MemberExpression"&&ut==="property"&&!lt.computed)return;if(lt?.type==="Property"&&ut==="key"&&!lt.computed)return;st="passed-on"}),st)return{candidate:tt,failureReason:st};let at=Array.from(rt,([ct,lt])=>{let ut=Array.from(lt);return{name:ct,detail:ut.includes("any")?"any":ut.join(" | ")}});return{candidate:tt,events:at}}function Td(o,et){let tt=o.members?`"${o.calleeText}"`:o.importedName==="default"?"the default export":`"${o.importedName}"`;switch(et){case"module-not-found":return`"${o.importSource}" isn't a local module sveld can read`;case"not-a-function":return`${tt} isn't a function declared in "${o.importSource}"`;case"parameter-not-found":return`no parameter of ${tt} receives it`;case"dynamic-event-name":return"an event name isn't a string literal";case"passed-on":return`${tt} passes it on`}}function _(o){return{failFast:o?.failFast,resolveTypes:o?.resolveTypes===!0,documentExports:o?.documentExports===!0,cache:o?.cache,checkExamples:o?.checkExamples==="syntax"?"syntax":o?.checkExamples===!0,dryRun:o?.dryRun===!0,diagnostics:o?.diagnostics,typesTypeNames:o?.typesOptions?.typeNames,typesInline:o?.typesOptions?.inline}}var mE=/-/g,yE=/[^A-Za-z0-9_$]/g,gE=/^[0-9]/;function xE(o){let et=o.replace(yE,""),tt=gE.test(et)?`_${et}`:et;if(tt!==o)console.warn(`Warning: "${o}" is not a valid identifier; using "${tt}" instead.`);return tt}function Id(o,et=[],tt=new Set,nt){let rt;try{rt=nt??pE(o)}catch{return et}if(tt.has(rt))return et;tt.add(rt);let it=wi(o);if(it===null)return et;let st=it.entries;for(let at of st){if(at.name.startsWith("."))continue;let ct=Pd(o,at.name),lt=at.isSymbolicLink(),ut=lt?Dd(ct,{throwIfNoEntry:!1}):at;if(!ut)continue;if(ut.isDirectory())Id(ct,et,tt,lt?void 0:Pd(rt,at.name));else if(ut.isFile()&&at.name.endsWith(".svelte"))et.push(ct)}return et}function bE(o){return Id(o).map((et)=>{let tt=xE(uE(et,".svelte").replace(mE,"")),nt=ur(t(`./${sc(o,et)}`));return{moduleName:tt,source:nt}}).sort((et,tt)=>u(et.source,tt.source))}function EE(o){return!mi(o)}function CE(o,et){let tt=o.endsWith("/")?o:`${o}/`;return et.startsWith(tt)}function Xi(o,et){return{seenPaths:new Set(o.map(([,tt])=>et(tt.source))),seenModuleNamePaths:new Map(o.map(([tt,nt])=>[tt,et(nt.source)])),warnedModuleNames:new Set}}function ic(o,et,tt,nt,rt){for(let{moduleName:it,source:st}of bE(o)){let at=nt(st),ct=et[it];if(ct&&EE(ct.source)&&CE(ct.source,st)){rt.seenPaths.delete(nt(ct.source)),ct.source=st,rt.seenPaths.add(at),rt.seenModuleNamePaths.set(it,at);continue}if(rt.seenPaths.has(at))continue;rt.seenPaths.add(at);let lt=rt.seenModuleNamePaths.get(it);if(lt===void 0)rt.seenModuleNamePaths.set(it,at);else if(lt!==at&&!rt.warnedModuleNames.has(it))rt.warnedModuleNames.add(it),console.warn(`Warning: multiple components named "${it}" found (${t(sc(o,lt))} and ${t(sc(o,at))}). Both are included in TypeScript definitions, but only one can be the named export.`);tt.push([it,{source:st,default:!1}])}}function Ji(o,et,tt=!1){Pi();let nt=Nd(o).isFile(),rt=nt?_d(o):o,it=es(rt),st=new Map,at=(ut)=>{let dt=st.get(ut);if(dt===void 0)dt=fE(ut)?es(ut):es(it,ut),st.set(ut,dt);return dt},ct={};if(nt){let ut=cE(o,"utf-8");try{ct=zi(ut,it,new Set([es(o)]))}catch(dt){if(!tt)throw dt;let ht=dt instanceof Error?dt.message:String(dt);console.warn(`Warning: Failed to parse component exports from ${o}: ${ht}`)}}let lt=Object.entries(ct);if(et){let ut=Xi(lt,at);if(ic(it,ct,lt,at,ut),!nt)ct=Object.fromEntries(lt.map(([dt,ht])=>[dt,{...ht,default:!0}]))}return{exports:ct,allComponentEntries:lt,rootDir:it,resolveComponentFilePath:at}}async function Yi(o){let et=await Promise.all(Array.from(o).map(async(tt)=>{try{let nt=await lE(tt,"utf-8");return{path:tt,content:nt}}catch(nt){return console.warn(`Warning: Failed to read file ${tt}:`,nt),{path:tt,content:null}}}));return new Map(et.map(({path:tt,content:nt})=>[tt,nt]))}function Cr([o,et],tt,nt,rt,it={}){let st=et.source,at=o;if(tt.length===1&&o==="default")at=hE(st).name;if(mi(st)){let ct=rt(st),lt=nt.get(ct);if(lt===null||lt===void 0)return null;let ut=t(st),dt=it.memo?.get(ct),ht=it.hashes?.get(ct),yt=dt===void 0?ht===void 0?null:it.cache?.get(ct,ht):null,xt;if(dt!==void 0)xt=dt;else if(yt)xt=yt;else{let Et=new(Hi()).ComponentParser;try{xt=Et.parseSvelteComponent(lt,{moduleName:at,filePath:ut})}catch(Ct){if(it.failFast)throw Ct;let At=Ct instanceof Error?Ct.message:String(Ct),_t=Ct instanceof Error?Ct.stack:void 0;return it.onParseError?.({filePath:ut,moduleName:at,message:At,stack:_t}),null}if(ht!==void 0)it.cache?.set(ct,ht,xt)}return it.memo?.set(ct,xt),{moduleName:at,filePath:ut,...xt}}return null}function oc(o,et){let tt=new Set;for(let nt of o)for(let[,rt]of nt)if(mi(rt.source))tt.add(et(rt.source));return tt}function Qi(o){if(o.length===0)return;console.error(`sveld: failed to parse ${o.length} component(s):`);for(let{filePath:et,message:tt}of o)console.error(` - ${et}: ${tt}`)}async function N(o,et,tt={}){let nt=tt.documentExports===!0,{exports:rt,allComponentEntries:it,rootDir:st,resolveComponentFilePath:at}=Ji(o,et,nt),ct=[],lt=nt&&Nd(o).isFile()?await Ki(es(o),{diagnostics:ct}):[],ut=Object.entries(rt),dt=oc([ut,it],at),ht=await Yi(dt),yt=new Map,xt=new Map,Et=tt.cache===!1?void 0:new Ua(pd(st,tt.cache??!0)),Ct=Et?new Map:void 0,At=new Set,_t=new Map;if(Et)for(let Tt of dt){let Dt=ht.get(Tt);if(Dt===null||Dt===void 0)continue;let Lt=Gi(Dt);if(_t.set(Tt,Lt),!Et.has(Tt,Lt))At.add(Tt)}if(dt.size>0&&(!Et||At.size>0))await Rr();let vt=new Map,Rt=new Map,Nt={failFast:tt.failFast===!0,onParseError:(Tt)=>vt.set(Tt.filePath,Tt),cache:Et,hashes:_t,memo:Rt};for(let Tt of ut){let Dt=Cr(Tt,ut,ht,at,Nt);if(Dt)yt.set(Dt.moduleName,Dt)}for(let Tt of it){let Dt=Cr(Tt,it,ht,at,Nt);if(Dt)xt.set(Dt.filePath,Dt),Ct?.set(Dt.filePath,at(Tt[1].source))}if(Et&&At.size>0){let Tt=Ts(xt,at),Dt=Ti(At,Tt);for(let Lt of Dt){if(At.has(Lt))continue;Et.invalidate(Lt),Rt.delete(Lt)}for(let Lt of ut){let Ft=at(Lt[1].source);if(!Dt.has(Ft)||At.has(Ft))continue;let Kt=Cr(Lt,ut,ht,at,Nt);if(Kt)yt.set(Kt.moduleName,Kt)}for(let Lt of it){let Ft=at(Lt[1].source);if(!Dt.has(Ft)||At.has(Ft))continue;let Kt=Cr(Lt,it,ht,at,Nt);if(Kt)xt.set(Kt.filePath,Kt),Ct?.set(Kt.filePath,Ft)}}let Ot=Array.from(vt.values());if(Qi(Ot),!tt.dryRun)Et?.save();let Wt=tt.resolveTypes?PE(yt):[],tn=tt.checkExamples?AE(xt):[],ot=tt.checkExamples===!0?Ad(tn,"compile"):[],pt=tt.checkExamples?Ad(tn,"syntax"):[];if(pt.length>0)NE(pt);let ft=tt.typesInline==="all"?Vi(xt,at):new Map,gt,bt;if(Wt.length>0||ot.length>0||ft.size>0){let{TypeResolver:Tt}=await import("./chunk-mxv2ftxe.js"),Dt=await Tt.create(st);if(!Dt.ok){let Ft=[Wt.length>0?"resolveTypes":null,ot.length>0?"checkExamples":null,ft.size>0?'typesOptions.inline: "all"':null].filter((Kt)=>Kt!==null).join(" and ");throw Error(`sveld: \`${Ft}\` ${Dt.message}.`)}let Lt=Dt.resolver;try{if(Wt.length>0)await wE(Wt,Lt,at);if(ot.length>0)await DE(ot,Lt,at);if(ft.size>0)gt=await Lt.openBareTypeSession(ft),bt=Lt;else await Lt.dispose()}catch(Ft){throw await Lt.dispose(),Ft}}let St=await ac(xt.values(),at);cc(yt,xt);let kt=Ct?new Map:void 0;if(Ct&&kt){let Tt=[...St.keys(),...Wt.map(({component:Dt})=>Dt.filePath)];for(let Dt of Tt){let Lt=Ct.get(Dt);if(Lt===void 0)continue;Ct.delete(Dt),kt.set(Dt,Lt)}}lc(xt,at,tt.typesTypeNames),pc(xt.values(),tt.typesTypeNames);let Pt;try{Pt=tt.typesInline==="local"||tt.typesInline==="all"?await Wi(xt,at,tt.typesTypeNames,gt):void 0}finally{if(gt)await gt.dispose();if(bt)await bt.dispose()}let wt=Dl(oi([...Array.from(xt.values()).flatMap((Tt)=>Tt.diagnostics??[]),...ct]),tt.diagnostics?.ignore);return{exports:rt,entryExports:lt,components:yt,allComponentsForTypes:xt,errors:Ot,diagnostics:wt,cache:Et,resolvedPathByFilePath:Ct,crossFileResolvedPathByFilePath:kt,inlinedTypesByFilePath:Pt}}async function ac(o,et){let tt=Array.from(o,(it)=>{let st=pr(it);return{component:it,callDefaults:st?.pendingCallDefaultCandidates?.filter((at)=>at.importSource!==void 0)??[],constDefaults:st?.pendingConstDefaultCandidates??[],contextKeys:st?.pendingContextKeyCandidates??[],dispatchEscapes:st?.pendingDispatchEscapeCandidates??[],deferredEventNoSource:st?.deferredEventNoSourceDiagnostics??[],untypedEventNames:st?.untypedJsDocEventNames??[]}}).filter((it)=>it.callDefaults.length>0||it.constDefaults.length>0||it.contextKeys.length>0||it.dispatchEscapes.length>0),nt=new Map;if(tt.length===0)return nt;await Rr();let rt=new Map;for(let{component:it,callDefaults:st,constDefaults:at,contextKeys:ct,dispatchEscapes:lt,deferredEventNoSource:ut,untypedEventNames:dt}of tt){let ht=ec(rt),yt=et(it.filePath);if(st.length>0)vE(it,gd(yt,st,ht));if(at.length>0)SE(it,bd(yt,at,ht));if(ct.length>0)TE(it,Ed(yt,ct,ht));if(lt.length>0)kE(it,Sd(yt,lt,ht),ut,dt);nt.set(it.filePath,Array.from(ht.cache.keys()))}return nt}function vE(o,et){for(let{candidate:tt,type:nt,failureReason:rt}of et){let it=Rd(o,tt);if(it?.typeSource!=="unknown")continue;if(nt){ts(it,"type",nt),ts(it,"typeSource","typescript"),Ld(o,tt);continue}if(tt.location==="props"&&rt){let st=o.diagnostics?.find((at)=>at.kind==="prop-unknown-type"&&at.name===tt.propName);if(st)st.message=xd(tt,rt)}}}function SE(o,et){for(let{candidate:tt,literal:nt,declaredType:rt}of et){if(!nt)continue;let it=Rd(o,tt);if(!it)continue;if(ts(it,"value",nt.raw),ts(it,"defaultValue",{raw:nt.raw,kind:"literal",value:nt.value}),it.typeSource!=="unknown")continue;ts(it,"type",rt?.type??nt.type),ts(it,"typeSource",rt?.source??"default"),Ld(o,tt)}}function ts(o,et,tt){if(o[et]===void 0)delete o[et];o[et]=tt}function Rd(o,et){return(et.location==="props"?o.props:o.moduleExports).find((nt)=>nt.name===et.propName)}function Ld(o,et){if(et.location!=="props")return;o.diagnostics=(o.diagnostics??[]).filter((tt)=>!(tt.kind==="prop-unknown-type"&&tt.name===et.propName))}function TE(o,et){for(let{candidate:tt,key:nt}of et){if(!nt){let at=ci(tt);o.diagnostics=[...o.diagnostics??[],vn({component:o.filePath,kind:"context-key-unresolved",name:at,message:`setContext key \`${at}\` from "${tt.importSource}" isn't an \`export const\` string or Symbol() sveld can read; the context is skipped.`,...tt.source?{source:tt.source}:{}})];continue}let rt=[...o.contexts??[]],it=rt.findIndex((at)=>at.key===nt);if(it!==-1){let at=rt[it],ct=wd(at.source,tt.source),lt=ct?at.source:tt.source;if(o.diagnostics=[...o.diagnostics??[],vn({component:o.filePath,kind:"context-duplicate-key",name:nt,message:`setContext("${nt}", ...) was called more than once; only the first call's shape is used.`,...lt?{source:lt}:{}})],!ct)continue;rt.splice(it,1)}let st=rt.findIndex((at)=>wd(at.source,tt.source));rt.splice(st===-1?rt.length:st,0,{key:nt,typeName:bs(nt),...tt.type===void 0?{}:{type:tt.type},description:tt.description,properties:tt.properties,...tt.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...tt.internal?{internal:!0}:{},source:tt.source}),o.contexts=rt}}function wd(o,et){if(!o||!et)return!1;let{line:tt,column:nt}=o.start;return tt>et.start.line||tt===et.start.line&&nt>et.start.column}function kE(o,et,tt,nt){let rt=new Map,it=[...o.diagnostics??[]],st=!0;for(let{candidate:yt,events:xt,failureReason:Et}of et){if(Et){st=!1,it.push(vn({component:o.filePath,kind:"dispatch-escapes",name:yt.dispatcherName,message:`\`${yt.dispatcherName}\` is passed to \`${yt.calleeText}\`, but sveld couldn't read the events it dispatches: ${Td(yt,Et)}. Document them with @event tags.`,...yt.source?{source:yt.source}:{},...yt.ignored?{ignored:!0}:{}}));continue}for(let Ct of xt??[]){if(rt.has(Ct.name))continue;rt.set(Ct.name,{type:"dispatched",name:Ct.name,detail:Ct.detail,...yt.source?{source:yt.source}:{}})}}if(st){for(let yt of tt)if(!rt.has(yt.name))it.push(yt)}if(o.diagnostics=it,rt.size===0)return;let at=new Map,ct=new Set;for(let yt of o.events)if(yt.type==="dispatched")ct.add(yt.name);else if(!at.has(yt.name))at.set(yt.name,yt);let lt=new Set(nt),ut=new Map,dt=[];for(let yt of rt.values()){if(ct.has(yt.name)){if(lt.has(yt.name)&&yt.detail!==void 0)ut.set(yt.name,yt.detail);continue}let xt=at.get(yt.name);if(!xt){dt.push(yt);continue}let Et=yt.source??xt.source;dt.push({type:"dispatched",name:yt.name,detail:xt.detail??yt.detail,...xt.description?{description:xt.description}:{},...xt.deprecated===void 0?{}:{deprecated:xt.deprecated},...xt.tags?{tags:xt.tags}:{},...xt.internal?{internal:!0}:{},...Et?{source:Et}:{}})}if(dt.length===0&&ut.size===0)return;let ht=new Set(dt.map((yt)=>yt.name));o.events=[...o.events.filter((yt)=>yt.type==="dispatched"||!ht.has(yt.name)).map((yt)=>{let xt=yt.type==="dispatched"?ut.get(yt.name):void 0;return xt===void 0?yt:{...yt,detail:xt}}),...dt].sort(ie)}function cc(o,et){for(let tt of o.values()){let nt=et.get(tt.filePath);if(!nt||nt===tt)continue;tt.contexts=nt.contexts,tt.events=nt.events,tt.diagnostics=nt.diagnostics}}function PE(o){let et=[];for(let tt of o.values()){let nt=pr(tt);if(!nt?.canonicalPropsType||tt.props.length>0)continue;et.push({component:tt,metadata:nt})}return et}async function wE(o,et,tt){let nt=await et.expandAll(o.map(({component:rt,metadata:it})=>({moduleName:rt.moduleName,metadata:it,filePath:tt(rt.filePath)})));for(let{component:rt}of o){let it=nt.get(tt(rt.filePath));if(it)Al(rt,it)}}function AE(o){let et=[];for(let tt of o.values()){let nt=Nu(tt);if(nt.length===0)continue;et.push({component:tt,sources:nt})}return et}function Ad(o,et){let tt=[];for(let{component:nt,sources:rt}of o){let it=rt.filter((st)=>st.kind===et);if(it.length===0)continue;tt.push({component:nt,sources:it})}return tt}function NE(o){for(let{component:et,sources:tt}of o){let nt=et.diagnostics??[];for(let rt of tt)try{M(rt.code)}catch(it){if(it instanceof A)continue;nt.push(vn({component:et.filePath,kind:"example-syntax-error",name:rt.name,message:it instanceof Error?it.message:String(it),...rt.source?{source:rt.source}:{}}))}et.diagnostics=nt}}async function DE(o,et,tt){let nt=await et.checkExamples(o.map(({component:rt,sources:it})=>({moduleName:rt.moduleName,filePath:tt(rt.filePath),sources:it})));for(let{component:rt,sources:it}of o){let st=nt.get(tt(rt.filePath));if(!st||st.length===0)continue;let at=new Map(it.map((lt)=>[lt.id,lt.source])),ct=rt.diagnostics??[];for(let lt of st){let ut=at.get(lt.id);ct.push(vn({component:rt.filePath,kind:"example-compile-error",name:lt.name,message:lt.message,...ut?{source:ut}:{}}))}rt.diagnostics=ct}}var _E=[".ts",".tsx",".d.ts",".svelte"];function IE(o){let et=o.trim();if(et.length<2)return;let tt=et[0],nt=et[et.length-1];if((tt==='"'||tt==="'"||tt==="`")&&tt===nt)return et.slice(1,-1);return}function RE(o,et){let tt=es(_d(o),et);if(kd(tt)&&Dd(tt).isFile())return tt;if(dE(et)!=="")return;for(let nt of _E){let rt=`${tt}${nt}`;if(kd(rt))return rt}return}function pc(o,et){for(let tt of o){let nt=tt.moduleExports.filter((st)=>st.kind==="re-export");if(nt.length===0)continue;let rt=new Set([dr(tt.moduleName,et),_r(tt.moduleName,et)]),it=tt.diagnostics??[];for(let st of nt){if(!rt.has(st.name))continue;it.push(vn({component:tt.filePath,kind:"module-export-conflict",name:st.name,message:`Re-export "${st.name}" has the same name as the generated "${st.name}" type; the .d.ts won't type-check if "${st.reExport?.from}" exports a type by that name.`,source:st.source}))}tt.diagnostics=it}}function lc(o,et,tt,nt=o.values()){let rt=new Map(Array.from(o.values()).map((it)=>[et(it.filePath),it]));for(let it of nt){let st=it.extends;if(!st)continue;let at=IE(st.import);if(at===void 0||!at.startsWith(".")&&!at.startsWith("/"))continue;let ct=et(it.filePath),lt=RE(ct,at),ut=it.diagnostics??[];if(lt===void 0){ut.push(vn({component:it.filePath,kind:"extend-props-target-missing",name:st.interface,message:`@extends/@extendProps target "${at}" was not found on disk.`})),it.diagnostics=ut;continue}let dt=rt.get(lt);if(!dt)continue;let ht=dr(dt.moduleName,tt);if(st.interface!==ht){ut.push(vn({component:it.filePath,kind:"extend-props-target-missing",name:st.interface,message:`@extends/@extendProps names "${st.interface}", but "${at}" generates "${ht}".`})),it.diagnostics=ut;continue}for(let yt of it.props){let xt=dt.props.find((Et)=>Et.name===yt.name);if(xt&&xt.type!==yt.type)ut.push(vn({component:it.filePath,kind:"extend-props-override",name:yt.name,message:`Own prop "${yt.name}" (${yt.type}) overrides "${ht}"'s "${yt.name}" (${xt.type}).`}))}it.diagnostics=ut}}import{existsSync as Od,readFileSync as LE}from"node:fs";import{join as Md}from"node:path";function B(o){if(o){let tt=Md(process.cwd(),o);if(Od(tt))return Ss(o);return console.error(`Invalid entry point: ${tt}. Pass a valid --entry (or "entry" option), or unset it and`),console.error('set the "svelte" field in your package.json instead.'),null}let et=Md(process.cwd(),"package.json");if(!Od(et))return console.error("Could not locate a package.json file."),console.error(`Specify an entry point with --entry (or the "entry" option) instead.
|
|
229
|
+
`),null;try{let tt=Di(JSON.parse(LE(et,"utf-8")));if(tt.svelte?.trim())return Ss(tt.svelte);return console.error(`Could not determine an entry point.
|
|
230
|
+
`),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).
|
|
231
|
+
`),null}catch(tt){throw console.error("Error reading package.json:",tt),tt}}import{lstatSync as OE}from"node:fs";import{resolve as uc}from"node:path";function $d(o,et,tt){let nt=o.get(et);if(!nt)nt=new Set,o.set(et,nt);nt.add(tt)}async function Bd(o,et,tt=!1,nt,rt){let it=OE(o).isFile(),st=it?uc(o):null,at=Ji(o,et,tt),{rootDir:ct,exports:lt,allComponentEntries:ut,resolveComponentFilePath:dt}=at,ht;if(nt==="all"){let{TypeResolver:Pt}=await import("./chunk-mxv2ftxe.js"),wt=await Pt.create(ct);if(!wt.ok)throw Error(`sveld: \`typesOptions.inline: "all"\` ${wt.message}.`);ht=wt.resolver}let yt=[],xt=async()=>(yt=[],tt&&it?Ki(uc(o),{diagnostics:yt}):[]),Et=await xt(),Ct=Object.entries(lt),At=Xi(ut,dt),_t=new Map,vt=new Map;await Rr();let Rt=new Map,Nt={onParseError:(Pt)=>Rt.set(Pt.filePath,Pt),memo:new Map},Ot=new Map,Wt=async(Pt)=>{let wt=new Set(Pt.map((Dt)=>dt(Dt.filePath)));for(let Dt of Ot.values())for(let Lt of wt)Dt.delete(Lt);let Tt=await ac(Pt,dt);for(let[Dt,Lt]of Tt){let Ft=dt(Dt);for(let Kt of Lt)$d(Ot,Kt,Ft)}lc(vt,dt,rt,Pt),pc(Pt,rt),cc(_t,vt)},tn=new Map,ot=new Map,pt=async(Pt)=>{if(nt!=="local"&&nt!=="all")return;for(let Dt of Pt.values()){tn.delete(Dt.filePath);for(let Lt of ot.values())Lt.delete(Dt.filePath)}let wt=new Map;if(nt==="all"&&ht)ht.forgetOverlayFiles(Array.from(Pt.values(),(Dt)=>Va(dt(Dt.filePath),Dt.moduleName))),wt=Vi(Pt,dt);let Tt;try{if(ht&&wt.size>0)Tt=await ht.openBareTypeSession(wt);let Dt=await Wi(Pt,dt,rt,Tt);for(let[Lt,Ft]of Dt){tn.set(Lt,Ft);for(let Kt of Ft.dependencies)$d(ot,Kt,Lt)}}finally{if(Tt)await Tt.dispose()}},ft=()=>{for(let Pt of tn.keys())if(!vt.has(Pt))tn.delete(Pt)},gt=()=>({exports:lt,entryExports:Et,components:_t,allComponentsForTypes:vt,errors:Array.from(Rt.values()),diagnostics:oi([...Array.from(vt.values()).flatMap((Pt)=>Pt.diagnostics??[]),...yt]),inlinedTypesByFilePath:nt==="local"||nt==="all"?tn:void 0});{let Pt=oc([Ct,ut],dt),wt=await Yi(Pt);for(let Tt of Ct){let Dt=Cr(Tt,Ct,wt,dt,Nt);if(Dt)_t.set(Dt.moduleName,Dt)}for(let Tt of ut){let Dt=Cr(Tt,ut,wt,dt,Nt);if(Dt)vt.set(Dt.filePath,Dt)}await Wt(Array.from(vt.values())),await pt(vt),Qi(Array.from(Rt.values()))}let bt=Ts(vt,dt),St=(Pt,wt,Tt,Dt,Lt)=>{let Ft=new Set;for(let Kt of Tt){let nn=dt(Kt[1].source);if(!Dt.has(nn))continue;let dn=Cr(Kt,Tt,Lt,dt,Nt);if(dn)Pt.set(wt(dn),dn),Ft.add(nn);else for(let[mn,un]of Pt)if(dt(un.filePath)===nn)Pt.delete(mn)}return Ft};return{get result(){return Promise.resolve(gt())},update:async(Pt)=>{let wt=Pt.map((Ut)=>uc(Ut));if(Pi(),wt.length===0)return{result:gt(),reparsed:[]};let Tt=new Set;for(let Ut of wt){let Gt=ot.get(Ut);if(Gt)for(let rn of Gt)Tt.add(rn)}let Dt=st!==null&&wt.includes(st),Lt=[];if(Dt){let Ut=Ji(o,et,tt),Gt=new Set(Object.keys(lt)),rn=new Set(Object.keys(Ut.exports));for(let jn of Gt)if(!rn.has(jn))_t.delete(jn);for(let jn of rn){let Xn=Ut.resolveComponentFilePath(Ut.exports[jn].source);if(!Gt.has(jn))Lt.push(Xn);else if(dt(lt[jn].source)!==Xn)_t.delete(jn),Lt.push(Xn)}lt=Ut.exports,ut=Ut.allComponentEntries,dt=Ut.resolveComponentFilePath,Ct=Object.entries(lt),At=Xi(ut,dt),Et=await xt()}if(et)ic(ct,lt,ut,dt,At);if(Dt){let Ut=new Set([...Ct,...ut].map(([,Gt])=>dt(Gt.source)));for(let[Gt,rn]of vt)if(!Ut.has(dt(rn.filePath)))vt.delete(Gt);for(let[Gt,rn]of Rt)if(!Ut.has(dt(rn.filePath)))Rt.delete(Gt);ft()}let Ft=wt.filter((Ut)=>sr.test(Ut)||bt.has(Ut)),Kt=wt.flatMap((Ut)=>Array.from(Ot.get(Ut)??[]));if(Ft.length===0&&Lt.length===0&&Kt.length===0){if(Tt.size>0){let Ut=new Map;for(let[Gt,rn]of vt)if(Tt.has(rn.filePath))Ut.set(Gt,rn);await pt(Ut)}return{result:gt(),reparsed:[]}}let nn=Ti([...Ft,...Lt,...Kt],bt);for(let[Ut,Gt]of Rt)if(nn.has(dt(Gt.filePath)))Rt.delete(Ut);let dn=await Yi(nn);Nt.memo=new Map;let mn=new Set;for(let Ut of St(_t,(Gt)=>Gt.moduleName,Ct,nn,dn))mn.add(Ut);for(let Ut of St(vt,(Gt)=>Gt.filePath,ut,nn,dn))mn.add(Ut);bt=Ts(vt,dt),await Wt(Array.from(vt.values()).filter((Ut)=>mn.has(dt(Ut.filePath))));let un=new Map;for(let[Ut,Gt]of vt)if(mn.has(dt(Gt.filePath))||Tt.has(Gt.filePath))un.set(Ut,Gt);await pt(un),ft();let fn=gt();return Qi(fn.errors),{result:fn,reparsed:Array.from(mn)}}}}import YE from"node:path";import{mkdir as ME,readFile as $E,writeFile as BE}from"node:fs/promises";import{parse as FE}from"node:path";class kn{dryRun;ensuredDirs=new Set;constructor(o){this.dryRun=o?.dryRun===!0}async write(o,et){if(this.dryRun)return console.log(`would write "${t(o)}"`),!0;try{if(await $E(o,"utf-8")===et)return!1}catch{}let tt=FE(o).dir;if(!this.ensuredDirs.has(tt))await ME(tt,{recursive:!0}),this.ensuredDirs.add(tt);return await BE(o,et),!0}}var jE=/^=>\s*/;function VE(o){let et=o.trim();if(!et.startsWith("("))return{parameters:[],returnTypeText:et||"any"};let tt=0,nt=-1;for(let at=0;at<et.length;at++)if(et[at]==="(")tt++;else if(et[at]===")"){if(tt--,tt===0){nt=at;break}}if(nt===-1)return{parameters:[],returnTypeText:"any"};let rt=et.slice(1,nt).trim(),it=et.slice(nt+1).trim().replace(jE,"");return{parameters:rt===""?[]:rr(rt).map((at)=>{let ct=at.trim(),lt=ct.startsWith("..."),ut=lt?ct.slice(3):ct,dt=ut.indexOf(":"),ht=(dt===-1?ut:ut.slice(0,dt)).trim(),yt=dt===-1?void 0:ut.slice(dt+1).trim(),xt=ht.endsWith("?"),Et={name:xt?ht.slice(0,-1):ht};if(yt)Et.type={text:yt};if(xt)Et.optional=!0;if(lt)Et.rest=!0;return Et}),returnTypeText:it||"any"}}function WE(o){if(o.params!==void 0||o.returnType!==void 0)return{parameters:(o.params??[]).map((tt)=>{let nt={name:tt.name};if(tt.type)nt.type={text:tt.type};if(tt.optional)nt.optional=!0;return nt}),returnTypeText:o.returnType??"any"};return o.type?VE(o.type):{parameters:[],returnTypeText:"any"}}function qE(o){return o.map((et)=>{if(et.isFunctionDeclaration){let{parameters:nt,returnTypeText:rt}=WE(et),it={kind:"method",name:et.name,static:!1};if(nt.length>0)it.parameters=nt;if(it.return={type:{text:rt}},et.description)it.description=et.description;if(et.deprecated!==void 0)it.deprecated=et.deprecated;return it}let tt={kind:"field",name:et.name};if(et.type)tt.type={text:et.type};if(et.value!==void 0)tt.default=et.value;if(et.description)tt.description=et.description;if(et.deprecated!==void 0)tt.deprecated=et.deprecated;if(et.kind==="const")tt.readonly=!0;return tt})}function GE(o){let et=o.customElement?.props,tt=new Map,nt=[];for(let rt of o.props){if(rt.isFunctionDeclaration)continue;let it=et?.[rt.name];if(it?.attribute===!1)continue;let st=it?.attribute||rt.name.toLowerCase(),at=tt.get(st);if(at!==void 0){console.warn(`sveld: props "${at}" and "${rt.name}" of component "${o.moduleName}" both map to the custom-element attribute "${st}"; only "${at}" is included.`);continue}tt.set(st,rt.name);let lt=it?.type==="Array"||it?.type==="Object"?[rt.description,"Serialized to/from JSON for the attribute."].filter(Boolean).join(" "):rt.description,ut={name:st,fieldName:rt.name};if(rt.type)ut.type={text:rt.type};if(rt.value!==void 0)ut.default=rt.value;if(lt)ut.description=lt;if(it?.reflect)ut.reflects=!0;nt.push(ut)}return nt}function UE(o){if(!o||o.length===0)return;return o.map((et)=>{let tt={name:et.name};if(et.description)tt.description=et.description;return tt})}function HE(o){if(!o||o.length===0)return;return o.map((et)=>{let tt={name:et.name};if(et.type)tt.type={text:et.type};if(et.default!==void 0)tt.default=et.default;if(et.description)tt.description=et.description;return tt})}function KE(o){return o.filter((et)=>et.type==="dispatched").map((et)=>{let tt={name:et.name,type:{text:ks(et.detail??"unknown")}};if(et.description)tt.description=et.description;if(et.deprecated!==void 0)tt.deprecated=et.deprecated;return tt})}function zE(o){return o.map((et)=>{let tt={name:et.default?"":et.name??""};if(et.description)tt.description=et.description;if(et.deprecated!==void 0)tt.deprecated=et.deprecated;return tt})}function XE(o){let et=UE(o.cssParts),tt=HE(o.cssProperties),nt=qE(o.props),rt=GE(o),it=KE(o.events),st=zE(o.slots),at=o.moduleName,ct=o.componentComment?{kind:"class",name:at,description:o.componentComment,members:nt,attributes:rt,events:it,slots:st}:{kind:"class",name:at,members:nt,attributes:rt,events:it,slots:st};if(et)ct.cssParts=et;if(tt)ct.cssProperties=tt;if(o.customElementTag)ct.tagName=o.customElementTag,ct.customElement=!0;return ct}function JE(o,et){let tt=[{kind:"js",name:o.moduleName,declaration:{name:o.moduleName,module:et}}];if(o.customElementTag)tt.push({kind:"custom-element-definition",name:o.customElementTag,declaration:{name:o.moduleName,module:et}});return tt}function Fd(o,et={}){let tt=c(o),nt=et.resolveModulePath??((it)=>it.filePath);return{schemaVersion:"1.0.0",modules:tt.components.map((it)=>{let st=nt(it);return{kind:"javascript-module",path:st,declarations:[XE(it)],exports:JE(it,st)}})}}function dc(o,et){let tt=Fd(o,{resolveModulePath:(nt)=>yi(nt.filePath,et.inputDir)});return Nr(tt)}async function fc(o,et){let tt=dc(o,et),nt=YE.join(process.cwd(),et.outFile),it=await new kn({dryRun:et.dryRun}).write(nt,tt);if(!et.dryRun)Rn(`${it?"created":"unchanged"} "${et.outFile}".`)}import mc from"node:path";function jd(o){let et=new Map;for(let[nt,rt]of Object.entries(o)){let it=et.get(rt.source)||[];it.push({id:nt,exportee:rt}),et.set(rt.source,it)}let tt=[];for(let[nt,rt]of et){let it=sr.test(nt),st=rt.some(({id:ht,exportee:yt})=>ht!=="default"&&yt.default),at=rt.some(({exportee:ht})=>!ht.default),ct=it&&st&&at,lt=[],ut=[],dt=[];for(let{id:ht,exportee:yt}of rt){if(ht==="default"){ut.push(`export { default } from "${nt}";`);continue}if(yt.default)if(yt.mixed)ut.push(`export { default as ${ht} } from "${nt}";`),ut.push(`export { default } from "${nt}";`);else dt.push(`default as ${ht}`);else if(it&&!ct)dt.push(`default as ${ht}`);else lt.push(ht)}if(dt.length>0&<.length>0)tt.push(`export { ${[...dt,...lt].join(", ")} } from "${nt}";`);else{if(lt.length>0)tt.push(`export { ${lt.join(", ")} } from "${nt}";`);if(dt.length>0)tt.push(`export { ${dt.join(", ")} } from "${nt}";`)}tt.push(...ut)}return tt.join(`
|
|
232
|
+
`)}function Vd(o){return o.filter((et)=>et.names.length>0).map((et)=>`export type { ${et.names.join(", ")} } from "${et.source}";`).join(`
|
|
233
|
+
`)}function Wd(o){return o.replace(sr,"")}function hc(o){return o.replace(sr,".svelte.d.ts")}function QE(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)&&"start"in o&&"end"in o}function Is(o){if(Array.isArray(o))return o.map((et)=>Is(et));if(o!==null&&typeof o==="object"){let et={};for(let[tt,nt]of Object.entries(o)){if((tt==="source"||tt==="componentCommentSource")&&QE(nt))continue;et[tt]=Is(nt)}return et}return o}function yc(o,et){return o.map((tt)=>({...tt,filePath:yi(tt.filePath,et)}))}function ZE(o,et,tt){if(!et)return`${o.moduleName}.api.json`;if(!tt.has(o.moduleName))tt.add(o.moduleName),console.warn(`Warning: multiple components named "${o.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${Wd(o.filePath)}.api.json`}async function eC(o,et){let tt=c(o),nt=yc(tt.components,et.inputDir);if(et.source===!1)nt=Is(nt);let rt=new Map;for(let st of nt)rt.set(st.moduleName,(rt.get(st.moduleName)??0)+1);let it=new Set;await Promise.all(nt.map(async(st)=>{let at=(rt.get(st.moduleName)??0)>1,ct=ZE(st,at,it),lt=mc.resolve(mc.join(et.outDir||"",ct)),dt=await new kn({dryRun:et.dryRun}).write(lt,Nr(st));if(!et.dryRun)Rn(`${dt?"created":"unchanged"} "${lt}".`)}))}function gc(o,et){let tt=c(o,{entryExports:et.entryExports}),nt={...tt,components:yc(tt.components,et.inputDir)};if(et.source===!1)nt=Is(nt);return Nr(nt)}function qd(o,et){let tt=c(o,{entryExports:et.entryExports}),nt=yc(tt.components,et.inputDir);if(et.source===!1)nt=Is(nt);return`${nt.map((rt)=>JSON.stringify(rt)).join(`
|
|
234
|
+
`)}
|
|
235
|
+
`}async function tC(o,et){let tt=gc(o,et),nt=mc.join(process.cwd(),et.outFile),it=await new kn({dryRun:et.dryRun}).write(nt,tt);if(!et.dryRun)Rn(`${it?"created":"unchanged"} "${et.outFile}".`)}async function xc(o,et){if(et.outDir)await eC(o,et);else await tC(o,et)}import ao from"node:path";import{readFileSync as nC}from"node:fs";import{join as rC}from"node:path";function Gd(){try{let{name:o,description:et}=Di(JSON.parse(nC(rC(process.cwd(),"package.json"),"utf-8")));return{name:o,description:et}}catch{return{}}}var Ud=/`/g,Hd=/\s+/g,On="--",Kd=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
|
|
236
|
+
| :- | :- | :- | :- | :- | :- | :- | :- |
|
|
237
|
+
`,Zi=`| Slot name | Default | Props | Fallback | Description |
|
|
238
|
+
| :- | :- | :- | :- | :- |
|
|
239
|
+
`,eo=`| Event name | Type | Detail | Description |
|
|
240
|
+
| :- | :- | :- | :- |
|
|
241
|
+
`,Cc=`| Name | Kind | Type | Description |
|
|
242
|
+
| :- | :- | :- | :- |
|
|
243
|
+
`,sC=`| Member | Signature | Description |
|
|
244
|
+
| :- | :- | :- |
|
|
245
|
+
`,zd=`| Part name | Description |
|
|
246
|
+
| :- | :- |
|
|
247
|
+
`,Xd=`| Property name | Type | Default value | Description |
|
|
248
|
+
| :- | :- | :- | :- |
|
|
249
|
+
`,vc=/\|/g,iC=/</g,oC=/>/g,Mr=/\n/g,aC=/^[A-Za-z_$][\w$]*$/,cC=/\s*\n\s*/g,pC=/&(?=#?\w+;)|<(?=[A-Za-z/!?])|[|`*]|\\(?=[!-/:-@[-`{-~])|(?<![A-Za-z0-9])_|_(?![A-Za-z0-9])/g,lC=/[&<|`*\\_]/;function Sc(o){if(!lC.test(o))return o;return o.replace(pC,(et)=>et==="&"?"&":et==="<"?"<":et==="_"?"_":`&#${et.charCodeAt(0)};`)}function Jd(o){return`<code>${Sc(o.includes(`
|
|
250
|
+
`)?o.replace(cC," "):o)}</code>`}var uC=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function dC(o){if(!o.includes("{@link"))return o;return o.replace(uC,(et,tt,nt)=>`[${nt===void 0?tt:nt.trim()}](${tt})`)}function bc(o){return o.includes("```")||o.includes("~~~")}function Ec(o){return Zd(dC(o))}var fC=/^([ \t]*)(`{3,}|~{3,})(.*)$/,hC=/^\n/,mC=/\n$/;function Yd(o){let et=(it)=>({kind:"prose",text:Ec(it.join(`
|
|
251
|
+
`))});if(!bc(o))return[et([o])];let tt=o.split(`
|
|
252
|
+
`),nt=[],rt=[];for(let it=0;it<tt.length;it++){let st=fC.exec(tt[it]),[,at="",ct="",lt=""]=st??[];if(!st||ct[0]==="`"&<.includes("`")){rt.push(tt[it]);continue}if(rt.push(""),rt.length>1)nt.push(et(rt));let ut=[],dt=new RegExp(`^[ \\t]*${ct[0]}{${ct.length},}[ \\t]*$`);for(it++;it<tt.length&&!dt.test(tt[it]);it++){let ht=tt[it],yt=0;while(yt<at.length&&(ht[yt]===" "||ht[yt]==="\t"))yt++;ut.push(ht.slice(yt))}nt.push({kind:"code",block:{fence:ct,info:lt.trim(),code:ut.join(`
|
|
253
|
+
`)}}),rt=[""]}if(rt.length>1||nt.length===0)nt.push(et(rt));return nt}function Qd(o,et){let tt="";for(let nt=0;nt<o.length;nt++){let rt=o[nt];if(rt.kind==="code"){if(et)et.push(rt.block),tt+="(code below)";else tt+=`<pre><code>${Sc(rt.block.code).replace(Mr,"<br />")}</code></pre>`;continue}let it=rt.text;if(!et){if(o[nt-1]?.kind==="code")it=it.replace(hC,"");if(o[nt+1]?.kind==="code")it=it.replace(mC,"")}tt+=it.replace(vc,"|").replace(Mr,"<br />")}return tt}function Rs(o,et,tt,nt){let rt=[],it=$r(tt,nt,rt);if(rt.length>0)o.push({label:et,blocks:rt});return it}function Ls(o,et){if(o.append("raw",`
|
|
254
|
+
`),et.length===0)return;let tt="";for(let{label:nt,blocks:rt}of et){tt+=`Code for \`${nt}\`:
|
|
255
|
+
|
|
256
|
+
`;for(let{fence:it,info:st,code:at}of rt)tt+=`${it}${st}
|
|
257
|
+
${at}${at?`
|
|
258
|
+
`:""}${it}
|
|
259
|
+
|
|
260
|
+
`}o.append("raw",tt)}function Mn(o){if(o===void 0)return On;return Jd(o)}function to(o){if(!o.reExport)return Mn(o.type);let{from:et,imported:tt}=o.reExport,nt=tt==="*"?"":aC.test(tt)?`.${tt}`:`[${JSON.stringify(tt)}]`;return Mn(`typeof import(${JSON.stringify(et)})${nt}`)}function Zd(o){if(!o.includes("<")&&!o.includes(">"))return o;return o.replace(iC,"<").replace(oC,">")}function Os(o){if(o===void 0)return On;return Jd(o)}function er(o,et){if(et===void 0)return o;let tt=typeof et==="string"&&et.trim().length>0?`: ${Zd(et).replace(Mr," ").replace(vc,"|")}`:"";return`<s>${o}</s><br />**Deprecated**${tt}`}function no(o){if(o===void 0||o.trim().length===0)return On;return Qd(Yd(o),void 0)}function ro(o){if(o===void 0||o==="{}")return On;return Mn(Bi(o).replace(Mr," "))}function so(o){if(o===void 0)return On;return`<code>${Sc(o).replace(Mr,"<br />")}</code>`}function $r(o,et,tt){let nt=o!==void 0&&o.trim().length>0;if(!(nt&&bc(o))&&!et?.some(({body:at})=>at&&bc(at))){let at=nt?[Ec(o)]:[];for(let{name:ct,body:lt}of et??[]){let ut=lt?.trim();at.push(ut?`@${ct} ${Ec(ut)}`:`@${ct}`)}if(at.length===0)return On;return at.join(`
|
|
261
|
+
`).replace(vc,"|").replace(Mr,"<br />")}let rt=[],it=(at)=>{let ct=rt.at(-1);if(ct?.kind==="prose")ct.text+=at;else rt.push({kind:"prose",text:at})},st=(at,ct)=>{if(rt.length>0)it(`
|
|
262
|
+
`);if(at)it(at);for(let lt of Yd(ct))if(lt.kind==="prose")it(lt.text);else rt.push(lt)};if(nt)st("",o);for(let{name:at,body:ct}of et??[]){let lt=ct?.trim();st(lt?`@${at} `:`@${at}`,lt??"")}if(rt.length===0)return On;return Qd(rt,tt)}function io(o){if(o===void 0)return On;return Mn(o.replace(Mr," "))}function yC(o){let et=[o.extends?`Extends ${Mn(o.extends)}.`:"",o.implements?.length?`Implements ${o.implements.map((tt)=>Mn(tt)).join(", ")}.`:""].filter(Boolean);return et.length>0?et.join(" "):void 0}function oo(o,et,tt){let nt=new Set;for(let rt of et){if(rt.kind!=="class")continue;let it=yC(rt);if(!rt.members?.length&&!it)continue;let st=rt.localName??rt.name;if(nt.has(st))continue;if(nt.add(st),o.append("h4",`\`${st}\` members`),it)o.append("raw",`${it}
|
|
263
|
+
|
|
264
|
+
`);if(!rt.members?.length)continue;o.append("raw",sC);let at=[];for(let ct of rt.members){let lt=tt?.codeBelow?Rs(at,ct.name,ct.description,ct.tags):$r(ct.description,ct.tags);o.append("raw",`| ${er(ct.name,ct.deprecated)} | ${Mn(Da(ct))} | ${lt} |
|
|
265
|
+
`)}Ls(o,at)}}var gC=/[^\w\- ]+/g,xC=/\s+/g;function bC(o,et){let tt=o.toLowerCase().replace(Ud,"").replace(gC,"").replace(xC,"-"),nt=et.get(tt)??0;return et.set(tt,nt+1),nt===0?tt:`${tt}-${nt}`}class ns{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
|
|
266
|
+
|
|
267
|
+
`),this}append(o,et){switch(o){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let tt=Number(o.slice(-1));if(this.sourceParts.push(`${"#".repeat(tt)} ${et}`),this.hasToC&&o==="h2")this.toc.push({indent:0,raw:et??""});break}case"quote":this.sourceParts.push(`> ${et}`);break;case"p":this.sourceParts.push(et??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(et??"");break}if(o!=="raw")this.appendLineBreaks();return this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let o=this.sourceParts.join("");if(!this.hasToC)return o;let et="<!-- __TOC__ -->",tt=o.indexOf(et);if(tt===-1)return o;let nt=new Map,rt=this.toc.map(({indent:it,raw:st})=>`${" ".repeat(it)}- [${st}](#${bC(st,nt)})`).join(`
|
|
268
|
+
`);return o.slice(0,tt)+rt+o.slice(tt+et.length)}}var EC=`| Name | Type | Default | Required | Description |
|
|
269
|
+
| :- | :- | :- | :- | :- |
|
|
270
|
+
`,CC=/[.!?](?:\s|$)/,vC=/\r?\n[ \t]*\r?\n/,SC=/\s+/g;function ef(o,et){if(!o)return et;let tt=o.trim().split(vC)[0]?.replace(SC," ").trim();if(!tt)return et;let nt=CC.exec(tt);return nt?tt.slice(0,nt.index+1):tt}function Tc(o,et,tt){if(tt.length===0)return;o.append("h3",et),o.append("raw",EC);let nt=[];for(let rt of tt)o.append("raw",`| ${er(rt.name,rt.deprecated)} | ${to(rt)} | ${Os(rt.value)} | ${rt.isRequired?"Yes":"No"} | ${Rs(nt,rt.name,rt.description,rt.tags)} |
|
|
271
|
+
`);Ls(o,nt)}function TC(o,et){if(et.length===0)return;o.append("h3","Events"),o.append("raw",eo);let tt=[];for(let nt of et)o.append("raw",`| ${er(nt.name,nt.deprecated)} | ${nt.type} | ${io(nt.detail)} | ${Rs(tt,nt.name,nt.description,nt.tags)} |
|
|
272
|
+
`);Ls(o,tt)}function kC(o,et,tt){if(tt.length===0)return;o.append("h3",et),o.append("raw",Zi);let nt=[];for(let rt of tt)o.append("raw",`| ${er(rt.default?On:rt.name??On,rt.deprecated)} | ${rt.default?"Yes":"No"} | ${ro(rt.slot_props)} | ${so(rt.fallback)} | ${Rs(nt,rt.default?"default":rt.name??"default",rt.description,rt.tags)} |
|
|
273
|
+
`);Ls(o,nt)}function PC(o,et){if(et.typedefs.length===0)return;o.append("h3","Typedefs"),o.append("raw",`\`\`\`ts
|
|
274
|
+
${Yr({typedefs:et.typedefs})}
|
|
275
|
+
\`\`\`
|
|
276
|
+
|
|
277
|
+
`)}function wC(o,et){if(o.append("h2",et.moduleName),et.generics)o.append("p",`Type parameters: ${Mn(`<${et.generics[1]}>`)}`);if(et.componentComment?.trim())o.append("p",et.componentComment.trim());Tc(o,"Props",et.props),Tc(o,"Bindings",et.props.filter((tt)=>tt.reactive)),TC(o,et.events),kC(o,et.syntaxMode==="runes"?"Snippets":"Slots",et.slots),PC(o,et),Tc(o,"Module exports",et.moduleExports),oo(o,et.moduleExports,{codeBelow:!0})}function AC(o,et,tt,nt){let rt=new ns,it=nt.linkBase??"";if(rt.append("h1",et),tt)rt.append("quote",tt);rt.append("h2","Components");for(let st of o)rt.append("raw",`- [${st.moduleName}](${it}/${st.moduleName}): ${ef(st.componentComment,"Component")}
|
|
278
|
+
`);if(rt.append("raw",`
|
|
279
|
+
`),nt.entryExports&&nt.entryExports.length>0){rt.append("h2","Exports");for(let st of nt.entryExports)rt.append("raw",`- \`${st.name}\`: ${ef(st.description,st.kind)}
|
|
280
|
+
`);rt.append("raw",`
|
|
281
|
+
`)}return rt.end()}function NC(o,et,tt){let nt=new ns;if(nt.append("h1",et),tt)nt.append("quote",tt);for(let rt of o)wC(nt,rt);return nt.end()}function DC(o,et){let tt=c(o,{entryExports:et.entryExports}),nt=Gd(),rt=et.title??nt.name??"Components",it=et.summary??nt.description;return{llmsTxt:AC(tt.components,rt,it,et),llmsFullTxt:NC(tt.components,rt,it)}}async function kc(o,et){let{llmsTxt:tt,llmsFullTxt:nt}=DC(o,et),rt=new kn({dryRun:et.dryRun}),it=t(ao.join(et.outDir??"","llms.txt")),st=t(ao.join(et.outDir??"","llms-full.txt")),[at,ct]=await Promise.all([rt.write(ao.join(process.cwd(),it),tt),rt.write(ao.join(process.cwd(),st),nt)]);if(!et.dryRun)Rn(`${at?"created":"unchanged"} "${it}".`),Rn(`${ct?"created":"unchanged"} "${st}".`)}import{join as wc,resolve as af}from"node:path";function tf(o,et,tt){if(o.append("h1","Component Index"),o.append("h2","Components").tableOfContents(),o.append("divider"),tt&&tt.length>0)rf(o,tt);let nt=c(et);for(let rt of nt.components)of(o,rt)}function nf(o,et,tt){o.append("h1","Component Index"),o.append("h2","Components");for(let nt of et)o.append("raw",`- [${nt.moduleName}](./${nt.moduleName}.md)
|
|
282
|
+
`);if(o.append("raw",`
|
|
283
|
+
`),o.append("divider"),tt&&tt.length>0)rf(o,tt)}function rf(o,et){o.append("h2","Exports"),o.append("raw",Cc);for(let tt of et){let nt=(tt.type??tt.value)?.replace(Hd," ").trim();o.append("raw",`| ${er(tt.name,tt.deprecated)} | ${`<code>${tt.kind}</code>`} | ${Mn(nt)} | ${no(tt.description)} |
|
|
284
|
+
`)}o.append("raw",`
|
|
285
|
+
`),o.append("divider")}function _C(o){return o.kind==="const"||o.isFunctionDeclaration}function IC(o,et){o.append("h3","Module exports"),o.append("raw",Cc);for(let tt of et)o.append("raw",`| ${er(tt.name,tt.deprecated)} | ${`<code>${tt.kind}</code>`} | ${to(tt)} | ${$r(tt.description,tt.tags)} |
|
|
286
|
+
`);o.append("raw",`
|
|
287
|
+
`),oo(o,et)}function Pc(o,et,tt,nt){if(et.length>0)tt(),o.append("raw",`
|
|
288
|
+
`);else o.append("p",nt??"None.")}function sf(o,et){of(o,et)}function of(o,et){if(o.append("h2",`\`${et.moduleName}\``),et.generics)o.append("p",`**Type parameters:** ${Mn(`<${et.generics[1]}>`)}`);if(et.typedefs.length>0)o.append("h3","Types").append("raw",`\`\`\`ts
|
|
289
|
+
${Yr({typedefs:et.typedefs})}
|
|
290
|
+
\`\`\`
|
|
291
|
+
|
|
292
|
+
`);if(o.append("h3","Props"),Pc(o,et.props,()=>{o.append("raw",Kd);let tt=(rt)=>rt.reactive?0:rt.constant?2:1,nt=et.props.map((rt,it)=>({prop:rt,index:it})).sort((rt,it)=>tt(rt.prop)-tt(it.prop)||rt.index-it.index).map(({prop:rt})=>rt);for(let rt of nt){let it=_C(rt)?"accessor":rt.kind;o.append("raw",`| ${er(rt.name,rt.deprecated)} | ${rt.isRequired?"Yes":"No"} | ${`<code>${it}</code>`} | ${rt.reactive?"Yes":"No"} | ${rt.binding??"--"} | ${Mn(rt.type)} | ${Os(rt.value)} | ${$r(rt.description,rt.tags)} |
|
|
293
|
+
`)}}),et.moduleExports.length>0)IC(o,et.moduleExports);if(o.append("h3","Slots"),Pc(o,et.slots,()=>{o.append("raw",Zi);for(let tt of et.slots)o.append("raw",`| ${er(tt.default?On:tt.name??On,tt.deprecated)} | ${tt.default?"Yes":"No"} | ${ro(tt.slot_props)} | ${so(tt.fallback)} | ${$r(tt.description,tt.tags)} |
|
|
294
|
+
`)}),o.append("h3","Events"),Pc(o,et.events,()=>{o.append("raw",eo);for(let tt of et.events)o.append("raw",`| ${er(tt.name,tt.deprecated)} | ${tt.type} | ${io(tt.detail)} | ${$r(tt.description,tt.tags)} |
|
|
295
|
+
`)}),et.cssParts&&et.cssParts.length>0){o.append("h3","CSS Parts"),o.append("raw",zd);for(let tt of et.cssParts)o.append("raw",`| ${tt.name} | ${no(tt.description)} |
|
|
296
|
+
`);o.append("raw",`
|
|
297
|
+
`)}if(et.cssProperties&&et.cssProperties.length>0){o.append("h3","CSS Custom Properties"),o.append("raw",Xd);for(let tt of et.cssProperties)o.append("raw",`| ${tt.name} | ${Mn(tt.type)} | ${Os(tt.default)} | ${no(tt.description)} |
|
|
298
|
+
`);o.append("raw",`
|
|
299
|
+
`)}}class co extends kn{onAppend;markdownBase;constructor(o){super();this.onAppend=o.onAppend,this.markdownBase=new ns}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(o,et){return this.markdownBase.append(o,et),this.onAppend?.call(this,o,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function Ac(o,et){return new co({onAppend:(tt,nt)=>{o.onAppend?.call(null,tt,nt,et)}})}async function RC(o,et){let tt=et.outDir,nt=c(o,{entryExports:et.entryExports}),rt=new kn({dryRun:et.dryRun}),it=Ac(et,o);nf(it,nt.components,et.entryExports);let st=af(wc(tt,"README.md")),at=await rt.write(st,it.end());if(!et.dryRun)Rn(`${at?"created":"unchanged"} "${st}".`);await Promise.all(nt.components.map(async(ct)=>{let lt=Ac(et,o);sf(lt,ct);let ut=af(wc(tt,`${ct.moduleName}.md`)),dt=await rt.write(ut,lt.end());if(!et.dryRun)Rn(`${dt?"created":"unchanged"} "${ut}".`)}))}function Nc(o,et){let tt=Ac(et,o);return tf(tt,o,et.entryExports),tt.end()}async function Dc(o,et){if(et.outDir){if(et.write!==!1)await RC(o,et);return}let tt=et?.write!==!1,nt=Nc(o,et);if(tt){let rt=wc(process.cwd(),et.outFile),it=await new kn({dryRun:et.dryRun}).write(rt,nt);if(!et.dryRun)Rn(`${it?"created":"unchanged"} "${et.outFile}".`)}return nt}import{join as cf}from"node:path";function LC(o){let et=new Set;for(let tt of o)if(tt.extends)et.add(tt.extends.interface);return et}function OC(o){return Fi(o,_a,!0).props}var MC={props:!0,exports:!0,typedefs:!1,contexts:!1};function $C(o){if(!o)return;return Fi(o,MC,!1)}function BC(o,et,tt){let nt=$C(et.indexTypes);if(!nt)return[];let rt=Ia(et),it=et.format==="component",st=new Map,at=new Set,ct=[];for(let[,lt]of Object.entries(et.exports)){if(!lt.default||!sr.test(lt.source))continue;let ut=t(lt.source);if(at.has(ut))continue;at.add(ut);let dt=o.components.find((Ct)=>Ct.filePath===ut);if(!dt)continue;let ht=dr(dt.moduleName,et.typeNames),yt=tt.has(ht),xt=[];if(nt.props&&(rt.props||yt))xt.push(ht);if(nt.exports&&it&&rt.exports)xt.push(_r(dt.moduleName,et.typeNames));if(nt.typedefs&&rt.typedefs)for(let Ct of dt.typedefs)xt.push(Ct.name);if(nt.contexts&&rt.contexts)for(let Ct of dt.contexts??[])xt.push(Ct.typeName);let Et=[];for(let Ct of xt){let At=st.get(Ct);if(At!==void 0){Ui(`sveld: index.d.ts skips duplicate type export "${Ct}" from "${lt.source}" (already exported from "${At}").`);continue}st.set(Ct,lt.source),Et.push(Ct)}if(Et.length>0)ct.push({source:lt.source,names:Et})}return ct}async function pf(o,et,tt){if(!o)return et;try{let nt=await o(et,tt);if(typeof nt!=="string")throw TypeError(`must return a string, got ${typeof nt}`);return nt}catch(nt){let rt=nt instanceof Error?nt.message:String(nt);throw Error(`sveld: typesOptions.transform failed for "${tt.filePath}": ${rt}`,{cause:nt})}}async function _c(o,et){let tt=cf(process.cwd(),et.outDir,"index.d.ts"),nt=new kn({dryRun:et.dryRun}),rt=c(o),it=LC(rt.components),st=Vd(BC(rt,et,it)),at=et.preamble+[jd(et.exports),st].filter((dt)=>dt!=="").join(`
|
|
300
|
+
|
|
301
|
+
`),ct=Ra(et),lt=rt.components.map(async(dt)=>{let ht=hc(cf(et.outDir,dt.filePath)),yt=t(hc(dt.filePath)),xt=et.resolvedPathByFilePath?.get(dt.filePath),Et=xt?void 0:et.crossFileResolvedPathByFilePath?.get(dt.filePath),Ct=xt??Et,At=et.inlinedTypesByFilePath?.get(dt.filePath),_t=it.has(dr(dt.moduleName,et.typeNames))&&!OC(ct.exportTypes)?{...ct,forceExportProps:!0}:ct,vt=At?{..._t,inlined:At}:_t,Rt=(At?.declarations.length??0)>0,Nt=!Rt&&Et?`${La(vt)}
|
|
302
|
+
${Gi(JSON.stringify(dt))}`:La(vt),Ot=!Rt&&Ct?et.cache?.getGeneratedText(Ct,Nt):void 0;if(Ot===void 0){if(Ot=Oa(dt,vt),!Rt&&Ct)et.cache?.setGeneratedText(Ct,Nt,Ot)}let Wt=await pf(et.transform,Ot,{kind:"component",component:dt,filePath:yt});await nt.write(ht,Wt)}),ut=(async()=>{let dt=await pf(et.transform,at,{kind:"index",filePath:"index.d.ts"});await nt.write(tt,`${dt}
|
|
303
|
+
`)})();if(await Promise.all([...lt,ut]),!et.dryRun)Rn("created TypeScript definitions.")}I({name:"json",componentSet:"exported",write:xc});I({name:"markdown",componentSet:"exported",write:Dc});I({name:"types",componentSet:"all",write:_c});I({name:"custom-elements",componentSet:"exported",write:fc});I({name:"llms",componentSet:"exported",write:kc});var lf='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',VC=50;function WC(o){let et=Promise.resolve();return()=>{et=et.then(o,o)}}function Qe(o){let et=o?.watch===!0,tt,nt,rt=o??{},it,st=null,at,ct=new Set,ut=WC(async()=>{if(st==null||nt==null||ct.size===0)return;let ht=Array.from(ct);ct.clear();try{let{result:yt}=await st.update(ht);await R(yt,rt,nt)}catch(yt){console.error("sveld: failed to regenerate types in watch mode:",yt)}}),dt=(ht)=>{if(!et||st==null||!uu.test(ht))return;ct.add(ht),clearTimeout(at),at=setTimeout(ut,VC)};return{name:"vite-plugin-sveld",apply:et?void 0:"build",enforce:"post",configResolved(ht){it=ht.root},async buildStart(){if(o?.config){let ht=it??process.cwd(),yt=typeof o.config==="string"?await xa(FC(o.config)?o.config:jC(ht,o.config)):await j(ht);rt=D(yt,o)}if(F(rt),J(rt.quiet===!0),nt=B(rt.entry),et&&nt!=null)try{st=await Bd(nt,rt.glob===!0,rt.documentExports===!0,rt.typesOptions?.inline,rt.typesOptions?.typeNames),await R(await st.result,rt,nt)}catch(ht){console.error("sveld: failed to generate initial types in watch mode:",ht)}},async generateBundle(){if(et)return;if(nt==null)this.error(lf);tt=await N(nt,rt.glob===!0,_(rt))},async writeBundle(){if(et)return;if(nt==null)this.error(lf);await R(tt,rt,nt),tt.cache?.save()},handleHotUpdate(ht){dt(ht.file)},watchChange(ht){dt(ht)}}}function Ms(o,et,tt){let nt=ce(o);if(!nt)throw Error(`sveld: built-in writer "${o}" is not registered.`);return nt.write(et,tt)}async function R(o,et,tt){let nt=uf(tt),rt=et?.dryRun===!0;if(et?.types!==!1)await Ms("types",o.allComponentsForTypes,{outDir:"types",preamble:"",...et?.typesOptions,exports:o.exports,inputDir:nt,dryRun:rt,cache:o.cache,resolvedPathByFilePath:o.resolvedPathByFilePath,crossFileResolvedPathByFilePath:o.crossFileResolvedPathByFilePath,inlinedTypesByFilePath:o.inlinedTypesByFilePath});if(et?.json)await Ms("json",o.components,{outFile:"COMPONENT_API.json",...et?.jsonOptions,input:tt,inputDir:nt,entryExports:o.entryExports,dryRun:rt});if(et?.markdown)await Ms("markdown",o.components,{outFile:"COMPONENT_INDEX.md",...et?.markdownOptions,entryExports:o.entryExports,dryRun:rt});if(et?.customElements)await Ms("custom-elements",o.components,{outFile:"custom-elements.json",...et?.customElementsOptions,inputDir:nt,dryRun:rt});if(et?.llms)await Ms("llms",o.components,{...et?.llmsOptions,entryExports:o.entryExports,dryRun:rt});let it=Object.entries(et?.additionalWriters??{}).map(([st,at])=>{let ct=ce(st);if(!ct){console.warn(`sveld: no writer registered with name "${st}"; skipping.`);return}let lt=ct.componentSet==="all"?o.allComponentsForTypes:o.components,ut={...at,dryRun:rt};return qC(st,ct,lt,ut)});await Promise.all(it)}async function qC(o,et,tt,nt){try{return await et.write(tt,nt)}catch(rt){let it=rt instanceof Error?rt.message:String(rt);throw Error(`sveld: writer "${o}" failed: ${it}`,{cause:rt})}}async function df(o,et,tt){let nt=uf(tt);if(et?.json){let rt={...et?.jsonOptions,inputDir:nt,entryExports:o.entryExports},it=et.stdout==="ndjson"?qd(o.components,rt):gc(o.components,rt);process.stdout.write(it);return}if(et?.markdown){let rt=Nc(o.components,{...et?.markdownOptions,entryExports:o.entryExports});process.stdout.write(rt);return}if(et?.customElements){let rt=dc(o.components,{...et?.customElementsOptions,inputDir:nt});process.stdout.write(rt)}}import{appendFileSync as KC,existsSync as zC}from"node:fs";import{join as XC}from"node:path";var hf=/%/g,mf=/\r/g,yf=/\n/g,GC=/,/g,UC=/:/g,gf=/\|/g;function ff(o){return o.replace(hf,"%25").replace(mf,"%0D").replace(yf,"%0A").replace(GC,"%2C").replace(UC,"%3A")}function HC(o){return o.replace(hf,"%25").replace(mf,"%0D").replace(yf,"%0A")}function xf(o,et,tt,nt,rt,it){let st=o==="error"?"error":"warning",at=[];if(nt!==void 0)at.push(`file=${ff(nt)}`);if(rt!==void 0)at.push(`line=${rt}`);if(it!==void 0)at.push(`col=${it}`);return at.push(`title=${ff(et)}`),`::${st} ${at.join(",")}::${HC(tt)}`}function bf(o){return o.filter((et)=>!et.ignored).map((et)=>xf(et.severity,`sveld ${et.code}`,et.message,et.component,et.source?.start.line,et.source?.start.column)).join(`
|
|
304
|
+
`)}function Ef(o){let et=o.filter((nt)=>!nt.ignored);if(et.length===0)return"";return["### sveld diagnostics","","| Severity | Code | Location | Message |","| --- | --- | --- | --- |",...et.map((nt)=>{let rt=nt.source?`${nt.component}:${nt.source.start.line}`:nt.component;return`| ${nt.severity} | ${nt.code} | ${rt} | ${nt.message.replace(gf,"\\|")} |`})].join(`
|
|
305
|
+
`)}function Cf(o,et){return o.changes.filter((tt)=>Ci(tt.bump,et))}function vf(o,et){return Cf(o,et).map((tt)=>xf("error","sveld breaking change",tt.message,tt.component==="*"?void 0:tt.component)).join(`
|
|
306
|
+
`)}function Sf(o,et){let tt=Cf(o,et);if(tt.length===0)return"";return["### sveld breaking changes","","| Component | Kind | Message |","| --- | --- | --- |",...tt.map((rt)=>`| ${rt.component} | ${rt.kind} | ${rt.message.replace(gf,"\\|")} |`)].join(`
|
|
307
|
+
`)}var Ic="src/index.js",yn={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},JC=`Usage: sveld [options]
|
|
308
|
+
|
|
309
|
+
Generate TypeScript definitions and component documentation for a Svelte
|
|
310
|
+
library. With no flags, only TypeScript definitions are generated for the
|
|
311
|
+
entry resolved from package.json#svelte.
|
|
312
|
+
|
|
313
|
+
--entry, --cache, --check, --types-format, --types-export,
|
|
314
|
+
--types-comments, --types-inline, and --types-props-declaration accept
|
|
315
|
+
their value as --flag=value or as a separate --flag value argument.
|
|
316
|
+
|
|
317
|
+
Options:
|
|
318
|
+
--entry=<path> Entry point to uncompiled Svelte source (default: package.json "svelte" field)
|
|
319
|
+
--glob Analyze all *.svelte files instead of the entry barrel
|
|
320
|
+
--types Generate TypeScript definitions (default: true)
|
|
321
|
+
--json Generate component documentation in JSON format
|
|
322
|
+
--markdown Generate component documentation in Markdown format
|
|
323
|
+
--custom-elements Generate a Custom Elements Manifest (custom-elements.json)
|
|
324
|
+
--llms Generate an llms.txt / llms-full.txt pair (https://llmstxt.org)
|
|
325
|
+
--fail-fast Abort the run when a single component fails to parse
|
|
326
|
+
--dry-run Resolve, parse, and print "would write" lines for each output file instead of writing anything (including the parse cache)
|
|
327
|
+
--quiet Suppress progress logs (errors, the diagnostics summary, and the --check report are unaffected)
|
|
328
|
+
--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
|
|
329
|
+
--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)
|
|
330
|
+
--resolve-types Expand opaque imported $props() types into JSON (alias: --resolveTypes, deprecated)
|
|
331
|
+
--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
|
|
332
|
+
--report-diagnostics Print unresolved-type diagnostics to stderr
|
|
333
|
+
--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}
|
|
334
|
+
--types-format=<format> ".d.ts" output format: "class" (default) or "component" (Svelte 5 Component<...>)
|
|
335
|
+
--types-export=<all|none> Sets typesOptions.exportTypes; "all" exports every generated type (default), "none" keeps them all local
|
|
336
|
+
--types-comments=<all|descriptions|none> Sets typesOptions.comments; how much JSDoc lands in the generated .d.ts (default: all)
|
|
337
|
+
--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)
|
|
338
|
+
--types-index-types Sets typesOptions.indexTypes; also re-exports generated types from index.d.ts (pass --types-index-types=false to disable)
|
|
339
|
+
--types-props-declaration=<type|interface> Sets typesOptions.propsDeclaration; emits the props type as a type alias (default) or an interface
|
|
340
|
+
--check[=<path>] Diff the parsed API against a committed snapshot; exit 3 on a breaking change (default path: COMPONENT_API.json)
|
|
341
|
+
--check-level=<major|minor|patch> Minimum bump --check fails the run on (default: major)
|
|
342
|
+
--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
|
|
343
|
+
--help Print this help message and exit
|
|
344
|
+
--version Print the installed sveld version and exit
|
|
345
|
+
|
|
346
|
+
Exit codes:
|
|
347
|
+
0 success
|
|
348
|
+
1 usage or configuration error
|
|
349
|
+
2 generation failure
|
|
350
|
+
3 breaking API change detected by --check
|
|
351
|
+
4 diagnostics present under --strict
|
|
352
|
+
`,Rc={resolveTypes:"resolve-types",checkExamples:"check-examples"},YC=["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"],QC=[...YC,...Object.keys(Rc)],ZC=new Set(["glob","types","json","markdown","quiet","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","types-index-types"]),e1=new Set(["entry","cache","check","types-format","types-export","types-comments","types-inline","types-props-declaration"]),t1=new Set(["entry","types-format","types-export","types-comments","types-inline","types-props-declaration"]);function n1(o){let et=vi(o,QC);return et===void 0?void 0:Rc[et]??et}function r1(o,et){let tt=o.indexOf("="),nt=tt===-1?o.slice(2):o.slice(2,tt),rt=Rc[nt]??nt,it=tt===-1?!0:o.slice(tt+1),st=!1;if(tt===-1&&e1.has(rt)){if(et!==void 0&&!et.startsWith("--"))it=et,st=!0;else if(t1.has(rt))return{result:{kind:"usage-error",message:`sveld: --${rt} requires a value (pass --${rt}=<value> or --${rt} <value>).`},consumedNext:!1,flag:rt}}return{result:s1(rt,it,o,nt),consumedNext:st,flag:rt}}function s1(o,et,tt,nt){switch(o){case"help":return{kind:"help"};case"version":return{kind:"version"};case"glob":case"types":case"json":case"markdown":case"quiet":return{kind:"option",option:{[o]:et===!0||et==="true"}};case"stdout":if(et===!0||et==="true")return{kind:"option",option:{stdout:!0}};if(et==="false")return{kind:"option",option:{stdout:!1}};return{kind:"option",option:{stdout:et}};case"custom-elements":return{kind:"option",option:{customElements:et===!0||et==="true"}};case"llms":return{kind:"option",option:{llms:et===!0||et==="true"}};case"strict":if(et===!0||et==="true")return{kind:"option",option:{strict:!0}};if(et==="false")return{kind:"option",option:{strict:!1}};return{kind:"option",option:{strict:et}};case"report-diagnostics":return{kind:"option",option:{reportDiagnostics:et===!0||et==="true"}};case"resolve-types":return{kind:"option",option:{resolveTypes:et===!0||et==="true"}};case"check-examples":if(et===!0||et==="true")return{kind:"option",option:{checkExamples:!0}};if(et==="false")return{kind:"option",option:{checkExamples:!1}};return{kind:"option",option:{checkExamples:et}};case"fail-fast":return{kind:"option",option:{failFast:et===!0||et==="true"}};case"dry-run":return{kind:"option",option:{dryRun:et===!0||et==="true"}};case"entry":return typeof et==="string"?{kind:"option",option:{entry:et}}:{kind:"option",option:{}};case"cache":if(et==="false")return{kind:"option",option:{cache:!1}};return{kind:"option",option:{cache:typeof et==="string"?et:!0}};case"check":if(et==="false")return{kind:"option",option:{check:!1}};return{kind:"option",option:{check:typeof et==="string"?et:!0}};case"types-format":return typeof et==="string"?{kind:"option",option:{typesOptions:{format:et}}}:{kind:"option",option:{}};case"types-export":return typeof et==="string"?{kind:"option",option:{typesOptions:{exportTypes:et}}}:{kind:"option",option:{}};case"types-comments":return typeof et==="string"?{kind:"option",option:{typesOptions:{comments:et}}}:{kind:"option",option:{}};case"types-inline":if(et==="false")return{kind:"option",option:{typesOptions:{inline:!1}}};return typeof et==="string"?{kind:"option",option:{typesOptions:{inline:et}}}:{kind:"option",option:{}};case"types-index-types":return{kind:"option",option:{typesOptions:{indexTypes:et===!0||et==="true"}}};case"types-props-declaration":return typeof et==="string"?{kind:"option",option:{typesOptions:{propsDeclaration:et}}}:{kind:"option",option:{}};case"format":return typeof et==="string"?{kind:"option",option:{format:et}}:{kind:"option",option:{}};case"check-level":return typeof et==="string"?{kind:"option",option:{checkLevel:et}}:{kind:"option",option:{}};default:return{kind:"unknown",arg:tt,suggestion:n1(nt)}}}function i1(o){let et={},tt=!1;for(let nt=0;nt<o.length;nt++){let rt=o[nt];if(!rt.startsWith("--"))return{kind:"unknown",arg:rt,positionalHint:tt?!0:void 0};let{result:it,consumedNext:st,flag:at}=r1(rt,o[nt+1]);if(it.kind!=="option")return it;if(et=D(et,it.option),tt=ZC.has(at),st)nt++}return{kind:"options",options:et}}var o1=[{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 a1(o){let et=o.map((tt)=>`"${tt}"`);return et.length<=2?et.join(" or "):`${et.slice(0,-1).join(", ")}, or ${et.at(-1)}`}async function we(o){let et=i1(o.argv.slice(2));if(et.kind==="help"){console.log(JC);return}if(et.kind==="version"){console.log(fu.version);return}if(et.kind==="usage-error"){console.error(et.message),o.exitCode=yn.USAGE_ERROR;return}if(et.kind==="unknown"){let Et=`Unknown flag: ${et.arg}`;if(et.suggestion)Et+=` Did you mean --${et.suggestion}?`;if(et.positionalHint)Et+=" (values are passed as --flag=value or --flag value)";console.error(Et),console.error("Run sveld --help for a list of available flags."),o.exitCode=yn.USAGE_ERROR;return}let tt=et.options,nt=await j(),rt=ae(D(nt,tt));if(F(rt),rt.stdout){if(rt.stdout!==!0&&rt.stdout!=="json"&&rt.stdout!=="ndjson"){console.error(`sveld: --stdout must be "json" or "ndjson"; got "${rt.stdout}".`),o.exitCode=yn.USAGE_ERROR;return}if([rt.json,rt.markdown,rt.customElements].filter(Boolean).length!==1){console.error("sveld: --stdout requires exactly one of --json, --markdown, or --custom-elements."),o.exitCode=yn.USAGE_ERROR;return}if(rt.stdout==="ndjson"&&!rt.json){console.error("sveld: --stdout=ndjson is only valid with --json."),o.exitCode=yn.USAGE_ERROR;return}if(rt.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),o.exitCode=yn.USAGE_ERROR;return}if(rt.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),o.exitCode=yn.USAGE_ERROR;return}}if(rt.format!==void 0&&rt.format!=="text"&&rt.format!=="json"&&rt.format!=="github"){console.error(`sveld: --format must be "text", "json", or "github"; got "${rt.format}".`),o.exitCode=yn.USAGE_ERROR;return}if(rt.strict!==void 0&&rt.strict!==!0&&rt.strict!==!1&&rt.strict!=="errors"){console.error(`sveld: --strict must be "errors", "ci", or "local" when given a value; got "${rt.strict}".`),o.exitCode=yn.USAGE_ERROR;return}if(rt.checkLevel!==void 0&&rt.checkLevel!=="major"&&rt.checkLevel!=="minor"&&rt.checkLevel!=="patch"){console.error(`sveld: --check-level must be "major", "minor", or "patch"; got "${rt.checkLevel}".`),o.exitCode=yn.USAGE_ERROR;return}if(rt.checkExamples!==void 0&&rt.checkExamples!==!0&&rt.checkExamples!==!1&&rt.checkExamples!=="syntax"){console.error(`sveld: --check-examples must be "syntax" when given a value; got "${rt.checkExamples}".`),o.exitCode=yn.USAGE_ERROR;return}let it=rt.typesOptions?.exportTypes;if(typeof it==="string"){if(it!=="all"&&it!=="none"){console.error(`sveld: --types-export must be "all" or "none"; got "${it}".`),o.exitCode=yn.USAGE_ERROR;return}rt.typesOptions={...rt.typesOptions,exportTypes:it==="all"}}for(let{flagName:Et,key:Ct,values:At}of o1){let _t=rt.typesOptions?.[Ct];if(_t===void 0||_t===!1)continue;if(!At.includes(_t)){console.error(`sveld: --${Et} must be ${a1(At)}; got "${_t}".`),o.exitCode=yn.USAGE_ERROR;return}}J(rt.quiet===!0);let st=B(rt.entry),at;if(st!==null)at=st;else if(zC(XC(o.cwd(),Ic)))console.error(`sveld: could not resolve an entry point; falling back to "${Ic}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),at=Ss(t(Ic));else{o.exitCode=yn.USAGE_ERROR;return}let ct,lt;try{if(ct=await N(at,rt.glob===!0,_(rt)),rt.check)lt=await X(ct.components,oe(rt),{entryExports:ct.entryExports});if(rt.stdout)await df(ct,rt,at);else if(await R(ct,rt,at),!rt.dryRun)ct.cache?.save()}catch(Et){if(Et instanceof Kr){console.error(`sveld: ${Et.message}`),o.exitCode=yn.USAGE_ERROR;return}console.error(Et instanceof Error?Et.message:String(Et)),o.exitCode=yn.GENERATION_FAILURE;return}let ut=rt.reportDiagnostics||rt.strict,dt=Z(ct.diagnostics,ut),ht=[];if(ut&&dt.length>0)if(rt.format==="json")o.stderr.write(te(dt));else if(rt.format==="github"){let Et=bf(dt);if(Et)console.error(Et);let Ct=Ef(dt);if(Ct)ht.push(Ct)}else console.error(ee(dt));if(lt)if(rt.format==="json")o.stdout.write(Ce(lt));else if(rt.format==="github"){let Et=vf(lt,rt.checkLevel??"major");if(Et)console.log(Et);let Ct=Sf(lt,rt.checkLevel??"major");if(Ct)ht.push(Ct)}else console.log(ke(lt));if(rt.format==="github"&&ht.length>0&&o.env.GITHUB_STEP_SUMMARY)KC(o.env.GITHUB_STEP_SUMMARY,`${ht.join(`
|
|
353
|
+
|
|
354
|
+
`)}
|
|
355
|
+
`);let yt;if(lt?.changes.some((Et)=>Et.kind==="schema")??!1)yt=yn.USAGE_ERROR;else if(lt&&Ci(lt.bump,rt.checkLevel??"major"))yt=yn.BREAKING_CHANGE;if(K(dt,rt.strict).length>0)yt=yt===void 0?yn.DIAGNOSTICS:Math.min(yt,yn.DIAGNOSTICS);if(yt!==void 0)o.exitCode=yt}
|
|
356
|
+
export{Ye,p,L,h,e,O,y,g,Pe,w,Q,Y,Z,K,ee,ve,te,r,pe,T,ue,ne,n,s,f,b,m,u,le,Ae,De,E,P,l,a,_e,fe,de,Ne,re,me,S,Ie,he,q,V,x,Re,U,se,i,ye,W,Le,Oe,Me,Be,je,ge,H,xe,$e,ie,G,k,Fe,Je,qe,Ve,Te,Ue,z,Ee,We,be,v,d,He,Ge,Se,C,A,M,t,c,ze,oe,X,ke,Xe,Ce,B,Ze,j,D,ae,F,J,_,N,I,ce,Ke,Qe,R,we};
|