jpegxl 8.4.0 → 8.4.1

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.
Files changed (88) hide show
  1. package/README.md +294 -229
  2. package/dist/animation.browser.mjs +2 -2
  3. package/dist/animation.mjs +2 -2
  4. package/dist/capture-complete.browser.mjs +2 -2
  5. package/dist/capture-complete.mjs +2 -2
  6. package/dist/capture-groups.mjs +2 -2
  7. package/dist/capture.browser.mjs +2 -2
  8. package/dist/capture.mjs +2 -2
  9. package/dist/cli-add.mjs +2 -2
  10. package/dist/cli-astro.mjs +2 -2
  11. package/dist/cli-cloudflare.mjs +2 -2
  12. package/dist/cli-emdash.mjs +2 -2
  13. package/dist/cli-places.mjs +2 -2
  14. package/dist/cli-selftest.mjs +2 -2
  15. package/dist/cli-workers.mjs +2 -2
  16. package/dist/cli.mjs +2 -2
  17. package/dist/decode.browser.mjs +2 -2
  18. package/dist/decode.mjs +2 -2
  19. package/dist/decode.node.mjs +2 -2
  20. package/dist/format.browser.mjs +2 -2
  21. package/dist/format.mjs +2 -2
  22. package/dist/hdr.mjs +2 -2
  23. package/dist/helpers.mjs +2 -2
  24. package/dist/index.browser.mjs +2 -2
  25. package/dist/index.mjs +2 -2
  26. package/dist/jpeg.browser.mjs +2 -2
  27. package/dist/jpeg.mjs +2 -2
  28. package/dist/jpeg.node.mjs +2 -2
  29. package/dist/metadata.mjs +2 -2
  30. package/dist/polyfill.mjs +2 -2
  31. package/dist/resumable.mjs +2 -2
  32. package/dist/resumable.node.mjs +2 -2
  33. package/dist/serve.mjs +2 -2
  34. package/dist/serve.node.mjs +2 -2
  35. package/dist/upload.browser.mjs +2 -2
  36. package/dist/upload.mjs +2 -2
  37. package/dist/verify.mjs +2 -2
  38. package/dist/verify.node.mjs +2 -2
  39. package/dist/wasm-modules.mjs +2 -2
  40. package/examples/agents/jxl-tools.mjs +8 -8
  41. package/examples/android/prepare-assets.mjs +2 -2
  42. package/examples/capacitor/prepare-assets.mjs +2 -2
  43. package/examples/emdash/admin-work.mjs +1 -1
  44. package/examples/emdash/backfill.mjs +4 -4
  45. package/examples/emdash/background.mjs +5 -5
  46. package/examples/emdash/browser-candidate.mjs +1 -1
  47. package/examples/emdash/deliver.mjs +2 -2
  48. package/examples/emdash/host-policy.mjs +6 -6
  49. package/examples/emdash/index.mjs +3 -3
  50. package/examples/emdash/job-runner.mjs +31 -31
  51. package/examples/emdash/job-store.mjs +21 -21
  52. package/examples/emdash/jpeg-source.mjs +2 -2
  53. package/examples/emdash/library-jobs.mjs +21 -21
  54. package/examples/emdash/local-store.mjs +16 -16
  55. package/examples/emdash/media-admin.mjs +9 -9
  56. package/examples/emdash/media-plugin.mjs +62 -62
  57. package/examples/emdash/media-storage.mjs +55 -55
  58. package/examples/emdash/media-words.mjs +89 -89
  59. package/examples/emdash/media-worker.mjs +1 -1
  60. package/examples/emdash/original-envelope.mjs +2 -2
  61. package/examples/emdash/originals.mjs +77 -77
  62. package/examples/emdash/r2-store.mjs +3 -3
  63. package/examples/emdash/read-all.mjs +14 -14
  64. package/examples/emdash/server-only.mjs +1 -1
  65. package/examples/emdash/storage.mjs +1 -1
  66. package/examples/emdash/structural-delivery.mjs +42 -42
  67. package/examples/emdash/thread-driver.mjs +15 -15
  68. package/examples/emdash/thread-worker.mjs +3 -3
  69. package/examples/emdash/work-queue.mjs +11 -11
  70. package/examples/flutter/prepare-assets.mjs +3 -3
  71. package/examples/ios/prepare-assets.mjs +3 -3
  72. package/examples/page-rects.js +14 -14
  73. package/examples/react-native/src/JXLProvider.tsx +19 -9
  74. package/examples/snapdom/jxl.js +3 -2
  75. package/examples/svg-jxl.js +10 -10
  76. package/package.json +1 -1
  77. package/types/animation.d.mts +2 -2
  78. package/types/capture-complete.d.mts +5 -5
  79. package/types/capture.d.mts +1 -1
  80. package/types/format.d.mts +2 -2
  81. package/types/index.d.mts +6 -6
  82. package/types/jpeg.d.mts +1 -1
  83. package/types/result.d.mts +5 -4
  84. package/types/resumable.d.mts +7 -7
  85. package/types/serve.d.mts +1 -1
  86. package/types/types.d.mts +19 -18
  87. package/types/upload.d.mts +1 -1
  88. package/types/verify.d.mts +4 -4
@@ -1,2 +1,2 @@
1
- /*! rapier-jxl 8.4.0 | MIT */
2
- import{readFile as e,writeFile as t,lstat as i,stat as s,realpath as r,mkdtemp as a,rename as n,chmod as o,rm as l}from"node:fs/promises";import{join as h,dirname as p,resolve as c,relative as u,isAbsolute as d,sep as f,basename as m}from"node:path";import{spawn as g}from"node:child_process";import{createHash as x,randomUUID as y}from"node:crypto";import{gunzipSync as w}from"node:zlib";import{homedir as k}from"node:os";import{fileURLToPath as b,pathToFileURL as v}from"node:url";import{createInterface as S}from"node:readline/promises";var E=Object.defineProperty,C=(e,t)=>{for(var i in t)E(e,i,{get:t[i],enumerable:!0})},_={};C(_,{Node:()=>He,Parser:()=>be,Position:()=>oe,SourceLocation:()=>le,TokContext:()=>je,Token:()=>Mt,TokenType:()=>B,defaultOptions:()=>pe,getLineInfo:()=>he,isIdentifierChar:()=>M,isIdentifierStart:()=>D,isNewLine:()=>Q,keywordTypes:()=>$,lineBreak:()=>z,lineBreakG:()=>J,nonASCIIwhitespace:()=>X,parse:()=>Gt,parseExpressionAt:()=>Ht,tokContexts:()=>Fe,tokTypes:()=>H,tokenizer:()=>zt,version:()=>$t});var A=[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,31,4,33,15,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,7,0,259,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,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,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],I=[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,13,65,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,18,21,18,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,18,0,182,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,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,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,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,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,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,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,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],P="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-׉ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୓-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫰ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",T="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆ՘ՙՠ-ֈ֋֌א-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ₏-₟ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-꟝꟢꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩ꭬꭭ꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",N={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"},L="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",V={5:L,"5module":L+" export import",6:L+" const class extends export import super"},O=/^in(stanceof)?$/,R=new RegExp("["+T+"]"),j=new RegExp("["+T+P+"]");var B=class{constructor(e,t={}){this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null}};var q={beforeExpr:!0},W={startsExpr:!0},$={};var H={num:new B("num",W),regexp:new B("regexp",W),string:new B("string",W),name:new B("name",W),privateId:new B("privateId",W),eof:new B("eof"),bracketL:new B("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new B("]"),braceL:new B("{",{beforeExpr:!0,startsExpr:!0}),braceR:new B("}"),parenL:new B("(",{beforeExpr:!0,startsExpr:!0}),parenR:new B(")"),comma:new B(",",q),semi:new B(";",q),colon:new B(":",q),dot:new B("."),question:new B("?",q),questionDot:new B("?."),arrow:new B("=>",q),template:new B("template"),invalidTemplate:new B("invalidTemplate"),ellipsis:new B("...",q),backQuote:new B("`",W),dollarBraceL:new B("${",{beforeExpr:!0,startsExpr:!0}),eq:new B("=",{beforeExpr:!0,isAssign:!0}),assign:new B("_=",{beforeExpr:!0,isAssign:!0}),incDec:new B("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new B("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:U("||",1),logicalAND:U("&&",2),bitwiseOR:U("|",3),bitwiseXOR:U("^",4),bitwiseAND:U("&",5),equality:U("==/!=/===/!==",6),relational:U("</>/<=/>=",7),bitShift:U("<</>>/>>>",8),plusMin:new B("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:U("%",10),star:U("*",10),slash:U("/",10),starstar:new B("**",{beforeExpr:!0}),coalesce:U("??",1),_break:G("break"),_case:G("case",q),_catch:G("catch"),_continue:G("continue"),_debugger:G("debugger"),_default:G("default",q),_do:G("do",{isLoop:!0,beforeExpr:!0}),_else:G("else",q),_finally:G("finally"),_for:G("for",{isLoop:!0}),_function:G("function",W),_if:G("if"),_return:G("return",q),_switch:G("switch"),_throw:G("throw",q),_try:G("try"),_var:G("var"),_const:G("const"),_while:G("while",{isLoop:!0}),_with:G("with"),_new:G("new",{beforeExpr:!0,startsExpr:!0}),_this:G("this",W),_super:G("super",W),_class:G("class",W),_extends:G("extends",q),_export:G("export"),_import:G("import",W),_null:G("null",W),_true:G("true",W),_false:G("false",W),_in:G("in",{beforeExpr:!0,binop:7}),_instanceof:G("instanceof",{beforeExpr:!0,binop:7}),_typeof:G("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:G("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:G("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},z=/\r\n?|\n|\u2028|\u2029/,J=new RegExp(z.source,"g");var X=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Y=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,{hasOwnProperty:Z,toString:ee}=Object.prototype,te=Object.hasOwn,ie=Array.isArray,se=Object.create(null);var ne=/[\uD800-\uDFFF]/u,oe=class e{constructor(e,t){this.line=e,this.column=t}offset(t){return new e(this.line,this.column+t)}},le=class{constructor(e,t,i){this.start=t,this.end=i,e.sourceFile!==null&&(this.source=e.sourceFile)}};var pe={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},ce=!1;var me=0,ge=1,xe=2,ye=3,we=4,ke=5,be=class{constructor(e,t,i){this.options=e=ue(e),this.sourceFile=e.sourceFile,this.keywords=re(V[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);let s="";e.allowReserved!==!0&&(s=N[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module"&&(s+=" await")),this.reservedWords=re(s);let r=(s?s+" ":"")+N.strict;this.reservedWordsStrict=re(r),this.reservedWordsStrictBind=re(r+" "+N.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=i||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):i?(this.lineStart=this.input.lastIndexOf(`\n`,i-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(z).length)):this.lineStart=0,this.type=H.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?2:1),this.regexpState=null,this.privateNameStack=[]}parse(){let e=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(()=>this.parseTopLevel(e))}get inFunction(){return(this.currentVarScope().flags&2)>0}get inGenerator(){return(this.currentVarScope().flags&8)>0}get inAsync(){return(this.currentVarScope().flags&4)>0}get canAwait(){for(let e=this.scopeStack.length-1;e>=0;e--){let{flags:t}=this.scopeStack[e];if(t&768)return!1;if(t&2)return(t&4)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction}get allowReturn(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&1)}get allowSuper(){let{flags:e}=this.currentThisScope();return(e&64)>0||this.options.allowSuperOutsideMethod}get allowDirectSuper(){return(this.currentThisScope().flags&128)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}get allowNewDotTarget(){for(let e=this.scopeStack.length-1;e>=0;e--){let{flags:t}=this.scopeStack[e];if(t&768||t&2&&!(t&16))return!0}return!1}get allowUsing(){let{flags:e}=this.currentScope();return!(e&1024||!this.inModule&&e&1)}get inClassStaticBlock(){return(this.currentVarScope().flags&256)>0}static extend(...e){let t=this;for(let i=0;i<e.length;i++)t=e[i](t);return t}static parse(e,t){return new this(t,e).parse()}static parseExpressionAt(e,t,i){let s=new this(i,e,t);return s.nextToken(),s.parseExpression()}static tokenizer(e,t){return new this(t,e)}},ve=be.prototype,Se=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;ve.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){Y.lastIndex=e,e+=Y.exec(this.input)[0].length;let t=Se.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){Y.lastIndex=e+t[0].length;let i=Y.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||z.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="="||r==="i"&&Ee(this,s))}e+=t[0].length,Y.lastIndex=e,e+=Y.exec(this.input)[0].length,this.input[e]===";"&&e++}};ve.eat=function(e){return this.type===e?(this.next(),!0):!1};ve.isContextual=function(e){return this.type===H.name&&this.value===e&&!this.containsEsc};ve.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};ve.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,"Not enough stack space to parse input");else throw e}};ve.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};ve.canInsertSemicolon=function(){return this.type===H.eof||this.type===H.braceR||z.test(this.input.slice(this.lastTokEnd,this.start))};ve.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};ve.semicolon=function(){!this.eat(H.semi)&&!this.insertSemicolon()&&this.unexpected()};ve.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};ve.expect=function(e){this.eat(e)||this.unexpected()};ve.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Ce=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};ve.checkPatternErrors=function(e,t){if(!e)return;e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");let i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")};ve.checkExpressionErrors=function(e,t){if(!e)return!1;let{shorthandAssign:i,doubleProto:s}=e;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};ve.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};ve.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var _e=be.prototype;_e.parseTopLevel=function(e){let t=Object.create(null);for(e.body||(e.body=[]);this.type!==H.eof;){let i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(let e of Object.keys(this.undefinedExports))this.raiseRecoverable(this.undefinedExports[e].start,`Export '${e}' is not defined`);return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var Ae={kind:"loop"},Ie={kind:"switch"};_e.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Y.lastIndex=this.pos;let t=Y.exec(this.input),i=this.pos+t[0].length,s=this.fullCharCodeAt(i);if(s===91||s===92)return!0;if(e)return!1;if(s===123)return!0;if(D(s)){let e=i;do{i+=s<=65535?1:2}while(M(s=this.fullCharCodeAt(i)));if(s===92)return!0;let t=this.input.slice(e,i);if(!O.test(t))return!0}return!1};_e.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Y.lastIndex=this.pos;let e=Y.exec(this.input),t=this.pos+e[0].length,i;return!z.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(M(i=this.fullCharCodeAt(t+8))||i===92))};_e.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;Y.lastIndex=this.pos;let i=Y.exec(this.input),s=this.pos+i[0].length;if(z.test(this.input.slice(this.pos,s)))return!1;if(e){let e=s+5,t;if(this.input.slice(s,e)!=="using"||e===this.input.length||M(t=this.fullCharCodeAt(e))||t===92)return!1;Y.lastIndex=e;let i=Y.exec(this.input);if(s=e+i[0].length,i&&z.test(this.input.slice(e,s)))return!1}let r=this.fullCharCodeAt(s);if(!D(r)&&r!==92)return!1;let a=s;do{s+=r<=65535?1:2}while(M(r=this.fullCharCodeAt(s)));if(r===92)return!0;let n=this.input.slice(a,s);if(O.test(n))return!1;if(t&&!e&&n==="of"){Y.lastIndex=s;let e=Y.exec(this.input);if(s=s+e[0].length,this.input.charCodeAt(s)!==61||(r=this.input.charCodeAt(s+1))===61||r===62)return!1}return!0};_e.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};_e.isUsing=function(e){return this.isUsingKeyword(!1,e)};_e.parseStatement=function(e,t,i){let s=this.type,r=this.startNode(),a;switch(this.isLet(e)&&(s=H._var,a="let"),s){case H._break:case H._continue:return this.parseBreakContinueStatement(r,s.keyword);case H._debugger:return this.parseDebuggerStatement(r);case H._do:return this.parseDoStatement(r);case H._for:return this.parseForStatement(r);case H._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case H._class:return e&&this.unexpected(),this.parseClass(r,!0);case H._if:return this.parseIfStatement(r);case H._return:return this.parseReturnStatement(r);case H._switch:return this.parseSwitchStatement(r);case H._throw:return this.parseThrowStatement(r);case H._try:return this.parseTryStatement(r);case H._const:case H._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(r,a);case H._while:return this.parseWhileStatement(r);case H._with:return this.parseWithStatement(r);case H.braceL:return this.parseBlock(!0,r);case H.semi:return this.parseEmptyStatement(r);case H._export:case H._import:if(this.options.ecmaVersion>10&&s===H._import){Y.lastIndex=this.pos;let e=Y.exec(this.input),t=this.pos+e[0].length,i=this.input.charCodeAt(t);if(i===40||i===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===H._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);let n=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(n)return 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"),e&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),n==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,n),this.semicolon(),this.finishNode(r,"VariableDeclaration");let o=this.value,l=this.parseExpression();return s===H.name&&l.type==="Identifier"&&this.eat(H.colon)?this.parseLabeledStatement(r,o,l,e):this.parseExpressionStatement(r,l)}};_e.parseBreakContinueStatement=function(e,t){let i=t==="break";this.next(),this.eat(H.semi)||this.insertSemicolon()?e.label=null:this.type!==H.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());let s=0;for(;s<this.labels.length;++s){let t=this.labels[s];if((e.label==null||t.name===e.label.name)&&(t.kind!=null&&(i||t.kind==="loop")||e.label&&i))break}return s===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};_e.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};_e.parseDoStatement=function(e){return this.next(),this.labels.push(Ae),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(H._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(H.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};_e.parseForStatement=function(e){this.next();let t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ae),this.enterScope(0),this.expect(H.parenL),this.type===H.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);let i=this.isLet();if(this.type===H._var||this.type===H._const||i){let s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(e,s,t)}let s=this.isContextual("let"),r=!1,a=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(a){let i=this.startNode();return this.next(),a==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(i,!0,a),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(e,i,t)}let n=this.containsEsc,o=new Ce,l=this.start,h=t>-1?this.parseExprSubscripts(o,"await"):this.parseExpression(!0,o);return this.type===H._in||(r=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===H._in&&this.unexpected(t),e.await=!0):r&&this.options.ecmaVersion>=8&&(h.start===l&&!n&&h.type==="Identifier"&&h.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),s&&r&&this.raise(h.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(h,!1,o),this.checkLValPattern(h),this.parseForIn(e,h)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,h))};_e.parseForAfterInit=function(e,t,i){return(this.type===H._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.type===H._in?((t.kind==="using"||t.kind==="await using")&&!t.declarations[0].init&&this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&i>-1&&this.unexpected(i)):this.options.ecmaVersion>=9&&(e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))};_e.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Te|(i?0:Ne),!1,t)};_e.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(H._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};_e.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(H.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};_e.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(H.braceL),this.labels.push(Ie),this.enterScope(1024);let t;for(let i=!1;this.type!==H.braceR;)if(this.type===H._case||this.type===H._default){let s=this.type===H._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(H.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};_e.parseThrowStatement=function(e){return this.next(),z.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Pe=[];_e.parseCatchClauseParam=function(){let e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?32:0),this.checkLValPattern(e,t?we:xe),this.expect(H.parenR),e};_e.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===H._catch){let t=this.startNode();this.next(),this.eat(H.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(H._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};_e.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};_e.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ae),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};_e.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};_e.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};_e.parseLabeledStatement=function(e,t,i,s){for(let e of this.labels)e.name===t&&this.raise(i.start,"Label '"+t+"' is already declared");let r=this.type.isLoop?"loop":this.type===H._switch?"switch":null;for(let t=this.labels.length-1;t>=0;t--){let i=this.labels[t];if(i.statementStart===e.start)i.statementStart=this.start,i.kind=r;else break}return this.labels.push({name:t,kind:r,statementStart:this.start}),e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};_e.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};_e.parseBlock=function(e=!0,t=this.startNode(),i){for(t.body=[],this.expect(H.braceL),e&&this.enterScope(0);this.type!==H.braceR;){let e=this.parseStatement(null);t.body.push(e)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};_e.parseFor=function(e,t){return e.init=t,this.expect(H.semi),e.test=this.type===H.semi?null:this.parseExpression(),this.expect(H.semi),e.update=this.type===H.parenR?null:this.parseExpression(),this.expect(H.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};_e.parseForIn=function(e,t){let i=this.type===H._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,`${i?"for-in":"for-of"} loop variable declaration may not have an initializer`),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(H.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};_e.parseVar=function(e,t,i,s){for(e.declarations=[],e.kind=i;;){let r=this.startNode();if(this.parseVarId(r,i),this.eat(H.eq)?r.init=this.parseMaybeAssign(t):!s&&i==="const"&&!(this.type===H._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==H._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,`Missing initializer in ${i} declaration`):!s&&r.id.type!=="Identifier"&&!(t&&(this.type===H._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(H.comma))break}return e};_e.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?ge:xe,!1)};var Te=1,Ne=2,Le=4;_e.parseFunction=function(e,t,i,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===H.star&&t&Ne&&this.unexpected(),e.generator=this.eat(H.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&Te&&(e.id=t&Le&&this.type!==H.name?null:this.parseIdent(),e.id&&!(t&Ne)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?ge:xe:ye));let a=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(fe(e.async,e.generator)),t&Te||(e.id=this.type===H.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,r),this.yieldPos=a,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(e,t&Te?"FunctionDeclaration":"FunctionExpression")};_e.parseFunctionParams=function(e){this.expect(H.parenL),e.params=this.parseBindingList(H.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};_e.parseClass=function(e,t){this.next();let i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);let s=this.enterClassBody(),r=this.startNode(),a=!1;for(r.body=[],this.expect(H.braceL);this.type!==H.braceR;){let t=this.parseClassElement(e.superClass!==null);t&&(r.body.push(t),t.type==="MethodDefinition"&&t.kind==="constructor"?(a&&this.raiseRecoverable(t.start,"Duplicate constructor in the same class"),a=!0):t.key&&t.key.type==="PrivateIdentifier"&&Ve(s,t)&&this.raiseRecoverable(t.key.start,`Identifier '#${t.key.name}' has already been declared`))}return this.strict=i,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};_e.parseClassElement=function(e){if(this.eat(H.semi))return null;let t=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,a=!1,n="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(H.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===H.star?o=!0:s="static"}if(i.static=o,!s&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===H.star)&&!this.canInsertSemicolon()?a=!0:s="async"),!s&&(t>=9||!a)&&this.eat(H.star)&&(r=!0),!s&&!a&&!r){let e=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?n=e:s=e)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===H.parenL||n!=="method"||r||a){let t=!i.static&&Oe(i,"constructor"),s=t&&e;t&&n!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=t?"constructor":n,this.parseClassMethod(i,r,a,s)}else this.parseClassField(i);return i};_e.isClassElementNameStart=function(){return this.type===H.name||this.type===H.privateId||this.type===H.num||this.type===H.string||this.type===H.bracketL||this.type.keyword};_e.parseClassElementName=function(e){this.type===H.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};_e.parseClassMethod=function(e,t,i,s){let r=e.key;e.kind==="constructor"?(t&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):e.static&&Oe(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");let a=e.value=this.parseMethod(t,i,s);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};_e.parseClassField=function(e){return Oe(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Oe(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(H.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};_e.parseClassStaticBlock=function(e){e.body=[];let t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==H.braceR;){let t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};_e.parseClassId=function(e,t){this.type===H.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,xe,!1)):(t===!0&&this.unexpected(),e.id=null)};_e.parseClassSuper=function(e){e.superClass=this.eat(H._extends)?this.parseExprSubscripts(null,!1):null};_e.enterClassBody=function(){let e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};_e.exitClassBody=function(){let{declared:e,used:t}=this.privateNameStack.pop();if(!this.options.checkPrivateFields)return;let i=this.privateNameStack.length,s=i===0?null:this.privateNameStack[i-1];for(let i=0;i<t.length;++i){let r=t[i];te(e,r.name)||(s?s.used.push(r):this.raiseRecoverable(r.start,`Private field '#${r.name}' must be declared in an enclosing class`))}};_e.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==H.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};_e.parseExport=function(e,t){if(this.next(),this.eat(H.star))return this.parseExportAllDeclaration(e,t);if(this.eat(H._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==H.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(let t of e.specifiers)this.checkUnreserved(t.local),this.checkLocalExport(t.local),t.local.type==="Literal"&&this.raise(t.local.start,"A string literal cannot be used as an exported binding without `from`.");e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};_e.parseExportDeclaration=function(e){return this.parseStatement(null)};_e.parseExportDefaultDeclaration=function(){let e;if(this.type===H._function||(e=this.isAsyncFunction())){let t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Te|Le,!1,e)}else if(this.type===H._class){let e=this.startNode();return this.parseClass(e,"nullableID")}else{let e=this.parseMaybeAssign();return this.semicolon(),e}};_e.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),te(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};_e.checkPatternExport=function(e,t){let i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(let i of t.properties)this.checkPatternExport(e,i);else if(i==="ArrayPattern")for(let i of t.elements)i&&this.checkPatternExport(e,i);else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)};_e.checkVariableExport=function(e,t){if(e)for(let i of t)this.checkPatternExport(e,i.id)};_e.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};_e.parseExportSpecifier=function(e){let t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};_e.parseExportSpecifiers=function(e){let t=[],i=!0;for(this.expect(H.braceL);!this.eat(H.braceR);){if(i)i=!1;else if(this.expect(H.comma),this.afterTrailingComma(H.braceR))break;t.push(this.parseExportSpecifier(e))}return t};_e.parseImport=function(e){return this.next(),this.type===H.string?(e.specifiers=Pe,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===H.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};_e.parseImportSpecifier=function(){let e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,xe),this.finishNode(e,"ImportSpecifier")};_e.parseImportDefaultSpecifier=function(){let e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,xe),this.finishNode(e,"ImportDefaultSpecifier")};_e.parseImportNamespaceSpecifier=function(){let e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,xe),this.finishNode(e,"ImportNamespaceSpecifier")};_e.parseImportSpecifiers=function(){let e=[],t=!0;if(this.type===H.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(H.comma)))return e;if(this.type===H.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(H.braceL);!this.eat(H.braceR);){if(t)t=!1;else if(this.expect(H.comma),this.afterTrailingComma(H.braceR))break;e.push(this.parseImportSpecifier())}return e};_e.parseWithClause=function(){let e=[];if(!this.eat(H._with))return e;this.expect(H.braceL);let t={},i=!0;for(;!this.eat(H.braceR);){if(i)i=!1;else if(this.expect(H.comma),this.afterTrailingComma(H.braceR))break;let s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;te(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e};_e.parseImportAttribute=function(){let e=this.startNode();return e.key=this.type===H.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(H.colon),this.type!==H.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};_e.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===H.string){let e=this.parseLiteral(this.value);return ne.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};_e.adaptDirectivePrologue=function(e){for(let t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};_e.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Re=be.prototype;Re.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(let i of e.properties)this.toAssignable(i,t),i.type==="RestElement"&&(i.argument.type==="ArrayPattern"||i.argument.type==="ObjectPattern")&&this.raise(i.argument.start,"Unexpected token");break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};Re.toAssignableList=function(e,t){let i=e.length;for(let s=0;s<i;s++){let i=e[s];i&&this.toAssignable(i,t)}if(i){let s=e[i-1];this.options.ecmaVersion===6&&t&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return e};Re.parseSpread=function(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};Re.parseRestBinding=function(){let e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==H.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};Re.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case H.bracketL:let e=this.startNode();return this.next(),e.elements=this.parseBindingList(H.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case H.braceL:return this.parseObj(!0)}return this.parseIdent()};Re.parseBindingList=function(e,t,i,s){let r=[],a=!0;for(;!this.eat(e);)if(a?a=!1:this.expect(H.comma),t&&this.type===H.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===H.ellipsis){let t=this.parseRestBinding();this.parseBindingListItem(t),r.push(t),this.type===H.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else r.push(this.parseAssignableListItem(s))}return r};Re.parseAssignableListItem=function(e){let t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};Re.parseBindingListItem=function(e){return e};Re.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(H.eq))return i;let s=this.startNodeAt(e,t);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};Re.checkLValSimple=function(e,t=me,i){let s=t!==me;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode"),s&&(t===xe&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(te(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==ke&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}};Re.checkLValPattern=function(e,t=me,i){switch(e.type){case"ObjectPattern":for(let s of e.properties)this.checkLValInnerPattern(s,t,i);break;case"ArrayPattern":for(let s of e.elements)s&&this.checkLValInnerPattern(s,t,i);break;default:this.checkLValSimple(e,t,i)}};Re.checkLValInnerPattern=function(e,t=me,i){switch(e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var je=class{constructor(e,t,i,s,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=s,this.generator=!!r}},Fe={b_stat:new je("{",!1),b_expr:new je("{",!0),b_tmpl:new je("${",!1),p_stat:new je("(",!1),p_expr:new je("(",!0),q_tmpl:new je("`",!0,!0,e=>e.tryReadTemplateToken()),f_stat:new je("function",!1),f_expr:new je("function",!0),f_expr_gen:new je("function",!0,!1,null,!0),f_gen:new je("function",!1,!1,null,!0)},De=be.prototype;De.initialContext=function(){return[Fe.b_stat]};De.curContext=function(){return this.context[this.context.length-1]};De.braceIsBlock=function(e){let t=this.curContext();return t===Fe.f_expr||t===Fe.f_stat?!0:e===H.colon&&(t===Fe.b_stat||t===Fe.b_expr)?!t.isExpr:e===H._return||e===H.name&&this.exprAllowed?z.test(this.input.slice(this.lastTokEnd,this.start)):e===H._else||e===H.semi||e===H.eof||e===H.parenR||e===H.arrow?!0:e===H.braceL?t===Fe.b_stat:e===H._var||e===H._const||e===H.name?!1:!this.exprAllowed};De.inGeneratorContext=function(){for(let e=this.context.length-1;e>=1;e--){let t=this.context[e];if(t.token==="function")return t.generator}return!1};De.updateContext=function(e){let t,i=this.type;i.keyword&&e===H.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};De.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};H.parenR.updateContext=H.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}let e=this.context.pop();e===Fe.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};H.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Fe.b_stat:Fe.b_expr),this.exprAllowed=!0};H.dollarBraceL.updateContext=function(){this.context.push(Fe.b_tmpl),this.exprAllowed=!0};H.parenL.updateContext=function(e){let t=e===H._if||e===H._for||e===H._with||e===H._while;this.context.push(t?Fe.p_stat:Fe.p_expr),this.exprAllowed=!0};H.incDec.updateContext=function(){};H._function.updateContext=H._class.updateContext=function(e){e.beforeExpr&&e!==H._else&&!(e===H.semi&&this.curContext()!==Fe.p_stat)&&!(e===H._return&&z.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===H.colon||e===H.braceL)&&this.curContext()===Fe.b_stat)?this.context.push(Fe.f_expr):this.context.push(Fe.f_stat),this.exprAllowed=!1};H.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};H.backQuote.updateContext=function(){this.curContext()===Fe.q_tmpl?this.context.pop():this.context.push(Fe.q_tmpl),this.exprAllowed=!1};H.star.updateContext=function(e){if(e===H._function){let e=this.context.length-1;this.context[e]===Fe.f_expr?this.context[e]=Fe.f_expr_gen:this.context[e]=Fe.f_gen}this.exprAllowed=!0};H.name.updateContext=function(e){let t=!1;this.options.ecmaVersion>=6&&e!==H.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Me=be.prototype;Me.checkPropClash=function(e,t,i){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement"||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))return;let{key:s}=e,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}let{kind:a}=e;if(this.options.ecmaVersion>=6){r==="__proto__"&&a==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),t.proto=!0);return}r="$"+r;let n=t[r];if(n){let e;a==="init"?e=this.strict&&n.init||n.get||n.set:e=n.init||n[a],e&&this.raiseRecoverable(s.start,"Redefinition of property")}else n=t[r]={init:!1,get:!1,set:!1};n[a]=!0};Me.parseExpression=function(e,t){return this.catchStackOverflow(()=>{let i=this.start,s=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===H.comma){let a=this.startNodeAt(i,s);for(a.expressions=[r];this.eat(H.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,"SequenceExpression")}return r})};Me.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}let s=!1,r=-1,a=-1,n=-1;t?(r=t.parenthesizedAssign,a=t.trailingComma,n=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Ce,s=!0);let o=this.start,l=this.startLoc;(this.type===H.parenL||this.type===H.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");let h=this.parseMaybeConditional(e,t);if(i&&(h=i.call(this,h,o,l)),this.type.isAssign){let i=this.startNodeAt(o,l);return i.operator=this.value,this.type===H.eq&&(h=this.toAssignable(h,!1,t)),s||(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=h.start&&(t.shorthandAssign=-1),t.doubleProto>=h.start&&(t.doubleProto=-1)),this.type===H.eq?this.checkLValPattern(h):this.checkLValSimple(h),i.left=h,this.next(),i.right=this.parseMaybeAssign(e),n>-1&&(t.doubleProto=n),this.finishNode(i,"AssignmentExpression")}else s&&this.checkExpressionErrors(t,!0);return r>-1&&(t.parenthesizedAssign=r),a>-1&&(t.trailingComma=a),h};Me.parseMaybeConditional=function(e,t){let i=this.start,s=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(!(r.type==="ArrowFunctionExpression"&&r.start===i)&&this.eat(H.question)){let t=this.startNodeAt(i,s);return t.test=r,t.consequent=this.parseMaybeAssign(),this.expect(H.colon),t.alternate=this.parseMaybeAssign(e),this.finishNode(t,"ConditionalExpression")}return r};Me.parseExprOps=function(e,t){let i=this.start,s=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||r.start===i&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,i,s,-1,e)};Me.parseExprOp=function(e,t,i,s,r){let a=this.type.binop;if(a!=null&&(!r||this.type!==H._in)&&a>s){let n=this.type===H.logicalOR||this.type===H.logicalAND,o=this.type===H.coalesce;o&&(a=H.logicalAND.binop);let l=this.value;this.next();let h=this.start,p=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),h,p,a,r),u=this.buildBinary(t,i,e,c,l,n||o);return(n&&this.type===H.coalesce||o&&(this.type===H.logicalOR||this.type===H.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,t,i,s,r)}return e};Me.buildBinary=function(e,t,i,s,r,a){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");let n=this.startNodeAt(e,t);return n.left=i,n.operator=r,n.right=s,this.finishNode(n,a?"LogicalExpression":"BinaryExpression")};Me.parseMaybeUnary=function(e,t,i,s){let r=this.start,a=this.startLoc,n;if(this.isContextual("await")&&this.canAwait)n=this.parseAwait(s),t=!0;else if(this.type.prefix){let i=this.startNode(),r=this.type===H.incDec;i.operator=this.value,i.prefix=!0,this.next(),i.argument=this.parseMaybeUnary(null,!0,r,s),this.checkExpressionErrors(e,!0),r?this.checkLValSimple(i.argument):this.strict&&i.operator==="delete"&&Be(i.argument)?this.raiseRecoverable(i.start,"Deleting local variable in strict mode"):i.operator==="delete"&&Ue(i.argument)?this.raiseRecoverable(i.start,"Private fields can not be deleted"):t=!0,n=this.finishNode(i,r?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===H.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),n=this.parsePrivateIdent(),this.type!==H._in&&this.unexpected();else{if(n=this.parseExprSubscripts(e,s),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){let e=this.startNodeAt(r,a);e.operator=this.value,e.prefix=!1,e.argument=n,this.checkLValSimple(n),this.next(),n=this.finishNode(e,"UpdateExpression")}}if(!i&&!(n.type==="ArrowFunctionExpression"&&n.start===r)&&this.eat(H.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(r,a,n,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return n};Me.parseExprSubscripts=function(e,t){let i=this.start,s=this.startLoc,r=-1,a=-1;e&&(r=e.doubleProto,a=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1);let n=this.parseExprAtom(e,t);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return n;let o=this.parseSubscripts(n,i,s,!1,t);return e&&(o.end>n.end&&(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=o.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=o.start&&(e.parenthesizedBind=-1),e.trailingComma>=o.start&&(e.trailingComma=-1)),r>-1&&(e.doubleProto=r),a>-1&&(e.shorthandAssign=a)),o};Me.parseSubscripts=function(e,t,i,s,r){let a=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,n=!1;for(;;){let o=this.parseSubscript(e,t,i,s,a,n,r);if(o.optional&&(n=!0),o.end===e.end||o.type==="ArrowFunctionExpression"){if(n){let e=this.startNodeAt(t,i);e.expression=o,o=this.finishNode(e,"ChainExpression")}return o}e=o,a=!1}};Me.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(H.arrow)};Me.parseSubscriptAsyncArrow=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,s)};Me.parseSubscript=function(e,t,i,s,r,a,n){let o=this.options.ecmaVersion>=11,l=o&&this.eat(H.questionDot);s&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let h=this.eat(H.bracketL);if(h||l&&this.type!==H.parenL&&this.type!==H.backQuote||this.eat(H.dot)){let s=this.startNodeAt(t,i);s.object=e,h?(s.property=this.parseExpression(),this.expect(H.bracketR)):this.type===H.privateId&&e.type!=="Super"?s.property=this.parsePrivateIdent():s.property=this.parseIdent(this.options.allowReserved!=="never"),s.computed=!!h,o&&(s.optional=l),e=this.finishNode(s,"MemberExpression")}else if(!s&&this.eat(H.parenL)){let s=new Ce,a=this.yieldPos,h=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let c=this.parseExprList(H.parenR,this.options.ecmaVersion>=8,!1,s);if(r&&!l&&this.shouldParseAsyncArrow())return this.checkPatternErrors(s,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=a,this.awaitPos=h,this.awaitIdentPos=p,this.parseSubscriptAsyncArrow(t,i,c,n);this.checkExpressionErrors(s,!0),this.yieldPos=a||this.yieldPos,this.awaitPos=h||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;let u=this.startNodeAt(t,i);u.callee=e,u.arguments=c,o&&(u.optional=l),e=this.finishNode(u,"CallExpression")}else if(this.type===H.backQuote){(l||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let s=this.startNodeAt(t,i);s.tag=e,s.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(s,"TaggedTemplateExpression")}return e};Me.parseExprAtom=function(e,t,i){this.type===H.slash&&this.readRegexp();let s,r=this.potentialArrowAt===this.start;switch(this.type){case H._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===H.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==H.dot&&this.type!==H.bracketL&&this.type!==H.parenL&&this.unexpected(),this.finishNode(s,"Super");case H._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case H.name:let a=this.start,n=this.startLoc,o=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&l.name==="async"&&!this.canInsertSemicolon()&&this.eat(H._function))return this.overrideContext(Fe.f_expr),this.parseFunction(this.startNodeAt(a,n),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(H.arrow))return this.parseArrowExpression(this.startNodeAt(a,n),[l],!1,t);if(this.options.ecmaVersion>=8&&l.name==="async"&&this.type===H.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return l=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(H.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,n),[l],!0,t)}return l;case H.regexp:let h=this.value;return s=this.parseLiteral(h.value),s.regex={pattern:h.pattern,flags:h.flags},s;case H.num:case H.string:return this.parseLiteral(this.value);case H._null:case H._true:case H._false:return s=this.startNode(),s.value=this.type===H._null?null:this.type===H._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case H.parenL:let p=this.start,c=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),c;case H.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(H.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case H.braceL:return this.overrideContext(Fe.b_expr),this.parseObj(!1,e);case H._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case H._class:return this.parseClass(this.startNode(),!1);case H._new:return this.parseNew();case H.backQuote:return this.parseTemplate();case H._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};Me.parseExprAtomDefault=function(){this.unexpected()};Me.parseExprImport=function(e){let t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===H.parenL&&!e)return this.parseDynamicImport(t);if(this.type===H.dot){let e=this.startNodeAt(t.start,t.loc&&t.loc.start);return e.name="import",t.meta=this.finishNode(e,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};Me.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(H.parenR)?e.options=null:(this.expect(H.comma),this.afterTrailingComma(H.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(H.parenR)||(this.expect(H.comma),this.afterTrailingComma(H.parenR)||this.unexpected())));else if(!this.eat(H.parenR)){let e=this.start;this.eat(H.comma)&&this.eat(H.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(e,"ImportExpression")};Me.parseImportMeta=function(e){this.next();let t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};Me.parseLiteral=function(e){let t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};Me.parseParenExpression=function(){this.expect(H.parenL);let e=this.parseExpression();return this.expect(H.parenR),e};Me.shouldParseArrow=function(e){return!this.canInsertSemicolon()};Me.parseParenAndDistinguishExpression=function(e,t){let i=this.start,s=this.startLoc,r,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();let n=this.start,o=this.startLoc,l=[],h=!0,p=!1,c=new Ce,u=this.yieldPos,d=this.awaitPos,f;for(this.yieldPos=0,this.awaitPos=0;this.type!==H.parenR;)if(h?h=!1:this.expect(H.comma),a&&this.afterTrailingComma(H.parenR,!0)){p=!0;break}else if(this.type===H.ellipsis){f=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===H.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else l.push(this.parseMaybeAssign(!1,c,this.parseParenItem));let m=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(H.parenR),e&&this.shouldParseArrow(l)&&this.eat(H.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=d,this.parseParenArrowList(i,s,l,t);(!l.length||p)&&this.unexpected(this.lastTokStart),f&&this.unexpected(f),this.checkExpressionErrors(c,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,l.length>1?(r=this.startNodeAt(n,o),r.expressions=l,this.finishNodeAt(r,"SequenceExpression",m,g)):r=l[0]}else r=this.parseParenExpression();if(this.options.preserveParens){let e=this.startNodeAt(i,s);return e.expression=r,this.finishNode(e,"ParenthesizedExpression")}else return r};Me.parseParenItem=function(e){return e};Me.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var qe=[];Me.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");let e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===H.dot){let t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();let i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}let t=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),t,i,!0,!1),e.callee.type==="Super"&&this.raiseRecoverable(t,"Invalid use of 'super'"),this.eat(H.parenL)?e.arguments=this.parseExprList(H.parenR,this.options.ecmaVersion>=8,!1):e.arguments=qe,this.finishNode(e,"NewExpression")};Me.parseTemplateElement=function({isTagged:e}){let t=this.startNode();return this.type===H.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value.replace(/\r\n?/g,`\n`),cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`\n`),cooked:this.value},this.next(),t.tail=this.type===H.backQuote,this.finishNode(t,"TemplateElement")};Me.parseTemplate=function({isTagged:e=!1}={}){let t=this.startNode();this.next(),t.expressions=[];let i=this.parseTemplateElement({isTagged:e});for(t.quasis=[i];!i.tail;)this.type===H.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(H.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(H.braceR),t.quasis.push(i=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(t,"TemplateLiteral")};Me.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===H.name||this.type===H.num||this.type===H.string||this.type===H.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===H.star)&&!z.test(this.input.slice(this.lastTokEnd,this.start))};Me.parseObj=function(e,t){let i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(H.braceR);){if(s)s=!1;else if(this.expect(H.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(H.braceR))break;let a=this.parseProperty(e,t);e||this.checkPropClash(a,r,t),i.properties.push(a)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};Me.parseProperty=function(e,t){let i=this.startNode(),s,r,a,n;if(this.options.ecmaVersion>=9&&this.eat(H.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===H.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===H.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(a=this.start,n=this.startLoc),e||(s=this.eat(H.star)));let o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(H.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,e,s,r,a,n,t,o),this.finishNode(i,"Property")};Me.parseGetterSetter=function(e){let t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;let i=e.kind==="get"?0:1;if(e.value.params.length!==i){let t=e.value.start;e.kind==="get"?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};Me.parsePropertyValue=function(e,t,i,s,r,a,n,o){(i||s)&&this.type===H.colon&&this.unexpected(),this.eat(H.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),e.kind="init"):this.options.ecmaVersion>=6&&this.type===H.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(i,s),e.kind="init"):!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==H.comma&&this.type!==H.braceR&&this.type!==H.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),t?e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key)):this.type===H.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected()};Me.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(H.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(H.bracketR),e.key;e.computed=!1}return e.key=this.type===H.num||this.type===H.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Me.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};Me.parseMethod=function(e,t,i){let s=this.startNode(),r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(fe(t,s.generator)|64|(i?128:0)),this.expect(H.parenL),s.params=this.parseBindingList(H.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(s,"FunctionExpression")};Me.parseArrowExpression=function(e,t,i,s){let r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.enterScope(fe(i,!1)|16),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(e,"ArrowFunctionExpression")};Me.parseFunctionBody=function(e,t,i,s){let r=t&&this.type!==H.braceL,a=this.strict,n=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{let s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(n=this.strictDirective(this.end),n&&s&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));let r=this.labels;this.labels=[],n&&(this.strict=!0),this.checkParams(e,!a&&!n&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,ke),e.body=this.parseBlock(!1,void 0,n&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=r}this.exitScope()};Me.isSimpleParamList=function(e){for(let t of e)if(t.type!=="Identifier")return!1;return!0};Me.checkParams=function(e,t){let i=Object.create(null);for(let s of e.params)this.checkLValInnerPattern(s,ge,t?null:i)};Me.parseExprList=function(e,t,i,s){let r=[],a=!0;for(;!this.eat(e);){if(a)a=!1;else if(this.expect(H.comma),t&&this.afterTrailingComma(e))break;let n;i&&this.type===H.comma?n=null:this.type===H.ellipsis?(n=this.parseSpread(s),s&&this.type===H.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):n=this.parseMaybeAssign(!1,s),r.push(n)}return r};Me.checkUnreserved=function({start:e,end:t,name:i}){this.inGenerator&&i==="yield"&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&i==="await"&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&259)&&i==="arguments"&&this.raiseRecoverable(e,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(i==="arguments"||i==="await")&&this.raise(e,`Cannot use ${i} in class static initialization block`),this.keywords.test(i)&&this.raise(e,`Unexpected keyword '${i}'`),!(this.options.ecmaVersion<6&&this.input.slice(e,t).indexOf("\\")!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(!this.inAsync&&i==="await"&&this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,`The keyword '${i}' is reserved`))};Me.parseIdent=function(e){let t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};Me.parseIdentNode=function(){let e=this.startNode();return this.type===H.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=H.name):this.unexpected(),e};Me.parsePrivateIdent=function(){let e=this.startNode();return this.type===H.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#${e.name}' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};Me.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);let t=this.startNode();return this.next(),this.type===H.semi||this.canInsertSemicolon()||this.type!==H.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(H.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};Me.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);let t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var We=be.prototype;We.raise=function(e,t){let i=he(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);let s=new SyntaxError(t);throw s.pos=e,s.loc=i,s.raisedAt=this.pos,s};We.raiseRecoverable=We.raise;We.curPosition=function(){if(this.options.locations)return new oe(this.curLine,this.pos-this.lineStart)};var $e=be.prototype,Ge=class{constructor(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]}};$e.enterScope=function(e){this.scopeStack.push(new Ge(e))};$e.exitScope=function(){this.scopeStack.pop()};$e.treatFunctionsAsVarInScope=function(e){return e.flags&2||!this.inModule&&e.flags&1};$e.declareName=function(e,t,i){let s=!1;if(t===xe){let t=this.currentScope();s=t.lexical.indexOf(e)>-1||t.functions.indexOf(e)>-1||t.var.indexOf(e)>-1,t.lexical.push(e),this.inModule&&t.flags&1&&delete this.undefinedExports[e]}else if(t===we)this.currentScope().lexical.push(e);else if(t===ye){let t=this.currentScope();this.treatFunctionsAsVar?s=t.lexical.indexOf(e)>-1:s=t.lexical.indexOf(e)>-1||t.var.indexOf(e)>-1,t.functions.push(e)}else for(let t=this.scopeStack.length-1;t>=0;--t){let i=this.scopeStack[t];if(i.lexical.indexOf(e)>-1&&!(i.flags&32&&i.lexical[0]===e)||!this.treatFunctionsAsVarInScope(i)&&i.functions.indexOf(e)>-1){s=!0;break}if(i.var.push(e),this.inModule&&i.flags&1&&delete this.undefinedExports[e],i.flags&259)break}s&&this.raiseRecoverable(i,`Identifier '${e}' has already been declared`)};$e.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};$e.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};$e.currentVarScope=function(){for(let e=this.scopeStack.length-1;;e--){let t=this.scopeStack[e];if(t.flags&771)return t}};$e.currentThisScope=function(){for(let e=this.scopeStack.length-1;;e--){let t=this.scopeStack[e];if(t.flags&771&&!(t.flags&16))return t}};var He=class{constructor(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new le(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])}},ze=be.prototype;ze.startNode=function(){return new He(this,this.start,this.startLoc)};ze.startNodeAt=function(e,t){return new He(this,e,t)};ze.finishNode=function(e,t){return Je.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ze.finishNodeAt=function(e,t,i,s){return Je.call(this,e,t,i,s)};ze.copyNode=function(e){let t=new He(this,e.start,this.startLoc);for(let i in e)t[i]=e[i];return t};var Qe="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",Ke="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",Xe=Ke+" Extended_Pictographic",Ye=Xe,Ze=Ye+" EBase EComp EMod EPres ExtPict",et=Ze,tt=et,it={9:Ke,10:Xe,11:Ye,12:Ze,13:et,14:tt},st="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",rt={9:"",10:"",11:"",12:"",13:"",14:st},at="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",nt="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",ot=nt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",lt=ot+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ht=lt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",pt=ht+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ct=pt+" "+Qe,ut={9:nt,10:ot,11:lt,12:ht,13:pt,14:ct},dt={};for(let e of[9,10,11,12,13,14])ft(e);var mt=dt,gt=be.prototype,xt=class e{constructor(e,t){this.parent=e,this.base=t||this}separatedFrom(e){for(let t=this;t;t=t.parent)for(let i=e;i;i=i.parent)if(t.base===i.base&&t!==i)return!0;return!1}sibling(){return new e(this.parent,this.base)}},yt=class{constructor(e){this.parser=e,this.validFlags=`gim${e.options.ecmaVersion>=6?"uy":""}${e.options.ecmaVersion>=9?"s":""}${e.options.ecmaVersion>=13?"d":""}${e.options.ecmaVersion>=15?"v":""}`,this.unicodeProperties=mt[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null}reset(e,t,i){let s=i.indexOf("v")!==-1,r=i.indexOf("u")!==-1;this.start=e|0,this.source=t+"",this.flags=i,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)}raise(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /${this.source}/: ${e}`)}at(e,t=!1){let i=this.source,s=i.length;if(e>=s)return-1;let r=i.charCodeAt(e);if(!(t||this.switchU)||r<=55295||r>=57344||e+1>=s)return r;let a=i.charCodeAt(e+1);return a>=56320&&a<=57343?(r<<10)+a-56613888:r}nextIndex(e,t=!1){let i=this.source,s=i.length;if(e>=s)return s;let r=i.charCodeAt(e),a;return!(t||this.switchU)||r<=55295||r>=57344||e+1>=s||(a=i.charCodeAt(e+1))<56320||a>57343?e+1:e+2}current(e=!1){return this.at(this.pos,e)}lookahead(e=!1){return this.at(this.nextIndex(this.pos,e),e)}advance(e=!1){this.pos=this.nextIndex(this.pos,e)}eat(e,t=!1){return this.current(t)===e?(this.advance(t),!0):!1}eatChars(e,t=!1){let i=this.pos;for(let s of e){let e=this.at(i,t);if(e===-1||e!==s)return!1;i=this.nextIndex(i,t)}return this.pos=i,!0}};gt.validateRegExpFlags=function(e){let t=e.validFlags,i=e.flags,s=!1,r=!1;for(let a=0;a<i.length;a++){let n=i.charAt(a);t.indexOf(n)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(n,a+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),n==="u"&&(s=!0),n==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")};gt.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&wt(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};gt.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(let t of e.backReferenceNames)e.groupNames[t]||e.raise("Invalid named capture referenced")};gt.regexp_disjunction=function(e){let t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new xt(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};gt.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};gt.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};gt.regexp_eatAssertion=function(e){let t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){let t=!1;if(this.options.ecmaVersion>=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=t,!1};gt.regexp_eatQuantifier=function(e,t=!1){return this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};gt.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};gt.regexp_eatBracedQuantifier=function(e,t){let i=e.pos;if(e.eat(123)){let s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return r!==-1&&r<s&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};gt.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};gt.regexp_eatReverseSolidusAtomEscape=function(e){let t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};gt.regexp_eatUncapturingGroup=function(e){let t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){let t=this.regexp_eatModifiers(e),i=e.eat(45);if(t||i){for(let i=0;i<t.length;i++){let s=t.charAt(i);t.indexOf(s,i+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(i){let i=this.regexp_eatModifiers(e);!t&&!i&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(let s=0;s<i.length;s++){let r=i.charAt(s);(i.indexOf(r,s+1)>-1||t.indexOf(r)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};gt.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};gt.regexp_eatModifiers=function(e){let t="",i=0;for(;(i=e.current())!==-1&&kt(i);)t+=ae(i),e.advance();return t};gt.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};gt.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};gt.regexp_eatSyntaxCharacter=function(e){let t=e.current();return bt(t)?(e.lastIntValue=t,e.advance(),!0):!1};gt.regexp_eatPatternCharacters=function(e){let t=e.pos,i=0;for(;(i=e.current())!==-1&&!bt(i);)e.advance();return e.pos!==t};gt.regexp_eatExtendedPatternCharacter=function(e){let t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};gt.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");let t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(let t of i)t.separatedFrom(e.branchID)||e.raise("Duplicate capture group name");else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}};gt.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};gt.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ae(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ae(e.lastIntValue);return!0}return!1};gt.regexp_eatRegExpIdentifierStart=function(e){let t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),vt(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};gt.regexp_eatRegExpIdentifierPart=function(e){let t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),St(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};gt.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};gt.regexp_eatBackReference=function(e){let t=e.pos;if(this.regexp_eatDecimalEscape(e)){let i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};gt.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};gt.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};gt.regexp_eatCControlLetter=function(e){let t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};gt.regexp_eatZero=function(e){return e.current()===48&&!Rt(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};gt.regexp_eatControlEscape=function(e){let t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};gt.regexp_eatControlLetter=function(e){let t=e.current();return Et(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};gt.regexp_eatRegExpUnicodeEscapeSequence=function(e,t=!1){let i=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){let t=e.lastIntValue;if(s&&t>=55296&&t<=56319){let i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){let i=e.lastIntValue;if(i>=56320&&i<=57343)return e.lastIntValue=(t-55296)*1024+(i-56320)+65536,!0}e.pos=i,e.lastIntValue=t}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ct(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=i}return!1};gt.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;let t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};gt.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;let t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};var _t=0,At=1,It=2;gt.regexp_eatCharacterClassEscape=function(e){let t=e.current();if(Pt(t))return e.lastIntValue=-1,e.advance(),At;let i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();let t;if(e.eat(123)&&(t=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&t===It&&e.raise("Invalid property name"),t;e.raise("Invalid property name")}return _t};gt.regexp_eatUnicodePropertyValueExpression=function(e){let t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){let t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){let i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,i),At}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){let t=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,t)}return _t};gt.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){te(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};gt.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return At;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return It;e.raise("Invalid property name")};gt.regexp_eatUnicodePropertyName=function(e){let t=0;for(e.lastStringValue="";Tt(t=e.current());)e.lastStringValue+=ae(t),e.advance();return e.lastStringValue!==""};gt.regexp_eatUnicodePropertyValue=function(e){let t=0;for(e.lastStringValue="";Nt(t=e.current());)e.lastStringValue+=ae(t),e.advance();return e.lastStringValue!==""};gt.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};gt.regexp_eatCharacterClass=function(e){if(e.eat(91)){let t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===It&&e.raise("Negated character class may contain strings"),!0}return!1};gt.regexp_classContents=function(e){return e.current()===93?At:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),At)};gt.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){let t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){let i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};gt.regexp_eatClassAtom=function(e){let t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){let t=e.current();(t===99||Dt(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}let i=e.current();return i!==93?(e.lastIntValue=i,e.advance(),!0):!1};gt.regexp_eatClassEscape=function(e){let t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};gt.regexp_classSetExpression=function(e){let t=At,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===It&&(t=It);let s=e.pos;for(;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==It&&(t=At);continue}e.raise("Invalid character in character class")}if(s!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===It&&(t=It)}};gt.regexp_eatClassSetRange=function(e){let t=e.pos;if(this.regexp_eatClassSetCharacter(e)){let i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){let t=e.lastIntValue;return i!==-1&&t!==-1&&i>t&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};gt.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?At:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};gt.regexp_eatNestedClass=function(e){let t=e.pos;if(e.eat(91)){let i=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return i&&s===It&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){let i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null};gt.regexp_eatClassStringDisjunction=function(e){let t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){let t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=t}return null};gt.regexp_classStringDisjunctionContents=function(e){let t=this.regexp_classString(e);for(;e.eat(124);)this.regexp_classString(e)===It&&(t=It);return t};gt.regexp_classString=function(e){let t=0;for(;this.regexp_eatClassSetCharacter(e);)t++;return t===1?At:It};gt.regexp_eatClassSetCharacter=function(e){let t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);let i=e.current();return i<0||i===e.lookahead()&&Lt(i)||Vt(i)?!1:(e.advance(),e.lastIntValue=i,!0)};gt.regexp_eatClassSetReservedPunctuator=function(e){let t=e.current();return Ot(t)?(e.lastIntValue=t,e.advance(),!0):!1};gt.regexp_eatClassControlLetter=function(e){let t=e.current();return Rt(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};gt.regexp_eatHexEscapeSequence=function(e){let t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};gt.regexp_eatDecimalDigits=function(e){let t=e.pos,i=0;for(e.lastIntValue=0;Rt(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};gt.regexp_eatHexDigits=function(e){let t=e.pos,i=0;for(e.lastIntValue=0;jt(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ft(i),e.advance();return e.pos!==t};gt.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){let t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){let i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};gt.regexp_eatOctalDigit=function(e){let t=e.current();return Dt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};gt.regexp_eatFixedHexDigits=function(e,t){let i=e.pos;e.lastIntValue=0;for(let s=0;s<t;++s){let t=e.current();if(!jt(t))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Ft(t),e.advance()}return!0};var Mt=class{constructor(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new le(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])}},Bt=be.prototype;Bt.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Mt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};Bt.getToken=function(){return this.next(),new Mt(this)};typeof Symbol<"u"&&(Bt[Symbol.iterator]=function(){return{next:()=>{let e=this.getToken();return{done:e.type===H.eof,value:e}}}});Bt.nextToken=function(){let e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(H.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};Bt.readToken=function(e){return D(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};Bt.fullCharCodeAt=function(e){let t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;let i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888};Bt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};Bt.skipBlockComment=function(){let e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(let e,i=t;(e=K(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=e;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};Bt.skipLineComment=function(e){let t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);for(;this.pos<this.input.length&&!Q(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};Bt.skipSpace=function(){e:for(;this.pos<this.input.length;){let e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++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(e>8&&e<14||e>=5760&&X.test(String.fromCharCode(e)))++this.pos;else break e}}};Bt.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());let i=this.type;this.type=e,this.value=t,this.updateContext(i)};Bt.readToken_dot=function(){let e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);let t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(H.ellipsis)):(++this.pos,this.finishToken(H.dot))};Bt.readToken_slash=function(){let e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(H.assign,2):this.finishOp(H.slash,1)};Bt.readToken_mult_modulo_exp=function(e){let t=this.input.charCodeAt(this.pos+1),i=1,s=e===42?H.star:H.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,s=H.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(H.assign,i+1):this.finishOp(s,i)};Bt.readToken_pipe_amp=function(e){let t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(H.assign,3):this.finishOp(e===124?H.logicalOR:H.logicalAND,2):t===61?this.finishOp(H.assign,2):this.finishOp(e===124?H.bitwiseOR:H.bitwiseAND,1)};Bt.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(H.assign,2):this.finishOp(H.bitwiseXOR,1)};Bt.readToken_plus_min=function(e){let t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||z.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(H.incDec,2):t===61?this.finishOp(H.assign,2):this.finishOp(H.plusMin,1)};Bt.readToken_lt_gt=function(e){let t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(H.assign,i+1):this.finishOp(H.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(H.relational,i))};Bt.readToken_eq_excl=function(e){let t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(H.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(H.arrow)):this.finishOp(e===61?H.eq:H.prefix,1)};Bt.readToken_question=function(){let e=this.options.ecmaVersion;if(e>=11){let t=this.input.charCodeAt(this.pos+1);if(t===46){let e=this.input.charCodeAt(this.pos+2);if(e<48||e>57)return this.finishOp(H.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(H.assign,3):this.finishOp(H.coalesce,2)}return this.finishOp(H.question,1)};Bt.readToken_numberSign=function(){let e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),D(t,!0)||t===92))return this.finishToken(H.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ae(t)+"'")};Bt.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(H.parenL);case 41:return++this.pos,this.finishToken(H.parenR);case 59:return++this.pos,this.finishToken(H.semi);case 44:return++this.pos,this.finishToken(H.comma);case 91:return++this.pos,this.finishToken(H.bracketL);case 93:return++this.pos,this.finishToken(H.bracketR);case 123:return++this.pos,this.finishToken(H.braceL);case 125:return++this.pos,this.finishToken(H.braceR);case 58:return++this.pos,this.finishToken(H.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(H.backQuote);case 48:let t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===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(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(H.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ae(e)+"'")};Bt.finishOp=function(e,t){let i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};Bt.readRegexp=function(){let e,t,i=this.pos;for(;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");let s=this.input.charAt(this.pos);if(z.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(s==="[")t=!0;else if(s==="]"&&t)t=!1;else if(s==="/"&&!t)break;e=s==="\\"}++this.pos}let s=this.input.slice(i,this.pos);++this.pos;let r=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(r);let n=this.regexpState||(this.regexpState=new yt(this));n.reset(i,s,a),this.validateRegExpFlags(n),this.validateRegExpPattern(n);let o=null;try{o=new RegExp(s,a)}catch{}return this.finishToken(H.regexp,{pattern:s,flags:a,value:o})};Bt.readInt=function(e,t,i){let s=this.options.ecmaVersion>=12&&t===void 0,r=i&&this.input.charCodeAt(this.pos)===48,a=this.pos,n=0,o=0;for(let i=0,a=t??1/0;i<a;++i,++this.pos){let t=this.input.charCodeAt(this.pos),a;if(s&&t===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),i===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=t;continue}if(t>=97?a=t-97+10:t>=65?a=t-65+10:t>=48&&t<=57?a=t-48:a=1/0,a>=e)break;o=t,n=n*e+a}return s&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||t!=null&&this.pos-a!==t?null:n};Bt.readRadixNumber=function(e){let t=this.pos;this.pos+=2;let i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=qt(this.input.slice(t,this.pos)),++this.pos):D(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(H.num,i)};Bt.readNumber=function(e){let t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");let i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");let s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&s===110){let e=qt(this.input.slice(t,this.pos));return++this.pos,D(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(H.num,e)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),D(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");let r=Ut(this.input.slice(t,this.pos),i);return this.finishToken(H.num,r)};Bt.readCodePoint=function(){let e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();let e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t};Bt.readString=function(e){let t="",i=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let s=this.input.charCodeAt(this.pos);if(s===e)break;s===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Q(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(H.string,t)};var Wt={};Bt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Wt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};Bt.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Wt;this.raise(e,t)};Bt.readTmplToken=function(){let e="",t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");let i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===H.template||this.type===H.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(H.dollarBraceL)):(++this.pos,this.finishToken(H.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(H.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Q(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`\n`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};Bt.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(H.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`\n`&&++this.pos;case`\n`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};Bt.readEscapedChar=function(e){let t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`\n`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ae(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){let e=this.pos-1;this.invalidStringToken(e,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){let i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(i,8);return s>255&&(i=i.slice(0,-1),s=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),(i!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Q(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};Bt.readHexChar=function(e){let t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};Bt.readWord1=function(){this.containsEsc=!1;let e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;for(;this.pos<this.input.length;){let r=this.fullCharCodeAtPos();if(M(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);let r=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;let a=this.readCodePoint();(t?D:M)(a,s)||this.invalidStringToken(r,"Invalid Unicode escape"),e+=ae(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};Bt.readWord=function(){let e=this.readWord1(),t=H.name;return this.keywords.test(e)&&(t=$[e]),this.finishToken(t,e)};var $t="8.19.0";be.acorn={Parser:be,version:$t,defaultOptions:pe,Position:oe,SourceLocation:le,getLineInfo:he,Node:He,TokenType:B,tokTypes:H,keywordTypes:$,TokContext:je,tokContexts:Fe,isIdentifierChar:M,isIdentifierStart:D,Token:Mt,isNewLine:Q,lineBreak:z,lineBreakG:J,nonASCIIwhitespace:X};var Jt={..._};var Qt={name:"JPEG XL Image Optimizer",listing:"JPEG XL copies for EmDash media. Text stays exact; photos use a chosen quality. Other browsers receive the original.",listingEncoder:"rapier-jxl encodes JPEG XL with WebAssembly. Efforts 6–9 measure photo quality; efforts 1–5 predict it.",listingFamily:"rapier-jxl is the encoder inside [rapier.website](https://rapier.website), the free Markdown editor and painting app. Rapier is also a free [Android app](https://play.google.com/store/apps/details?id=app.rapier&referrer=utm_source%3Demdash) that opens and converts JPEG XL pictures.",listingNew:"New in 8.4.0: EmDash 1.5's `<Image formats>` offers JPEG XL first. A replaced image is converted at once. Phone photos with long headers work on Workers Free. WordPress libraries convert faster and resume where they stopped.",titleInfo:"Every upload gets a JPEG XL copy, served to compatible browsers. Browsers which cannot display it get served the original file.",saved:"{size} saved",images:"{count} images · {percent}% smaller",image:"{count} image · {percent}% smaller",convertOlder:"Convert {count} older images",convertOlderOne:"Convert {count} older image",serverNote:"Runs on your server.",allConverted:"All images converted.",imagesLabel:"Your images",mode:"Mode",modeInfo:"Same look: looks like the original, much smaller. Exact: Lossless. Size limit: fits under the size limit you set.",sameLook:"Same look",exact:"Exact",sizeLimit:"Size limit",sizeLimitInfo:"Each image fits under this size, at the best possible quality.",quality:"Quality",qualityInfo:"1 to 100. 90 suits most photos.",effort:"Effort",effortInfo:"1 to 9. Higher: smaller files, slower.",sizes:"Sizes",sizesInfo:"Smaller copies for small screens.",sizeCount:"{count} sizes",sizeCountOne:"{count} size",widths:"Widths",widthsDescription:"Widths of responsive image copies, in pixels.",widthsError:"Use up to 16 widths, from 16 to 8192 pixels.",recent:"Recent",originals:"Keep original JPEG files",originalsInfo:"JPEGs are kept as JPEG XL, then converted back losslessly when needed. Other formats always keep the original file.",originalsPaid:"Needs the Workers Paid plan.",about:"About {label}",decrease:"Decrease {label}",increase:"Increase {label}",infoGlyph:"i",minusGlyph:"−",plusGlyph:"+",arrowGlyph:"›",menuGlyph:"⋯",percentSaved:"−{percent}%",deliverySizes:"{before} → {after}",bytes:"B",kilobytes:"KB",megabytes:"MB",downloadOriginal:"Download original",useOriginal:"Use original",makeSmaller:"Make smaller",actionsFor:"Actions for {name}",cancelImage:"Cancel {name}",showMore:"Show more",cancel:"Cancel",pause:"Pause",resume:"Resume",continue:"Continue",retry:"Retry",close:"Close",loadingImages:"Reading your images…",emptyImages:"No images yet. Upload images in ",media:"Media",sentenceEnd:".",emptyRecent:"Your images will appear here.",imagesError:"Your images could not be refreshed.",loadingSettings:"Loading settings…",settingsNotSaved:"Settings not saved",settingsUnavailable:"Settings unavailable",limitError:"Enter a positive size in KB.",pausing:"Pausing…",preparing:"Preparing images…",convertingImages:"Converting images",paused:"Paused",canceling:"Canceling…",countOfTotal:"{count} of {total}",queueError:"The conversion queue could not be refreshed.",convertingBrowser:"Converting in this browser",savingCopy:"Saving the copy",converting:"Converting",original:"Original",done:"Done",canceled:"Canceled",waiting:"Waiting",alreadySmall:"Already small",notExact:"Not exact",tooLarge:"Too large",changed:"Changed",missing:"Missing",notSupported:"Not supported",overTarget:"Over target",notPicture:"Not a picture",failed:"Could not convert",linksNotUpdated:"Links not updated",importSiteExport:"Import a site export",importDescription:"Choose your old site's export file. EmDash imports the original images and updates links in your posts.",chooseExport:"Choose export",foundImages:"{count} images",foundImage:"{count} image",importCount:"Import {count}",importingImages:"Importing images…",updatingLinks:"Updating post links…",importedImages:"{count} images imported. Post links are updated.",importedImage:"{count} image imported. Post links are updated.",importLinksError:"Images were imported, but post links were not updated.",cancelImport:"Cancel import",setupIntro:"Just run this in your site's folder:",setupCommandTab:"Command",setupAgentTab:"Coding agent",setupManualTab:"By hand",setupCommand:"npx jpegxl add emdash",setupAgent:"Add rapier-jxl to my EmDash site with npx jpegxl add emdash.",setupInstall:`npm install jpegxl \\\n @cloudflare/kumo@2.6.0`,setupManual:`import {jxl}\n from 'jpegxl/emdash';\n\njxl(emdash, {\n // Your existing EmDash options.\n})`,setupOpen:"open the optimizer",setupAfter:"Then open the optimizer and remove this guide.",faqWhatQuestion:"What does this plug-in do?",faqWhatAnswer:"It makes a JPEG XL copy of every image in your media library. Browsers that show JPEG XL get the copy. Incompatible browsers are served your original file.",faqFormatQuestion:"Which browsers show JPEG XL?",faqFormatAnswer:"Chrome, Firefox and Safari all now support JXL by default.",faqSmallerQuestion:"How much smaller will my images be?",faqSmallerAnswer:'File size depends on the picture and effort. "Exact" preserves every pixel. "Same look" aims at the selected quality.',faqLookQuestion:"Will my images look worse?",faqLookAnswer:'"Same look" uses SSIMULACRA 2: efforts 6–9 measure the result; efforts 1–5 predict it. "Exact" preserves every pixel.',faqOriginalQuestion:"What happens to my original files?",faqOriginalAnswer:"Nothing is ever lost. JPEGs are kept as JPEG XL, then converted back losslessly into the identical JPEG when needed. Other formats always keep the original file.",faqPrivateQuestion:"Do I need an account, key or a subscription?",faqPrivateAnswer:"No. Images are converted on your own server, or in your own browser where the server cannot handle it. Nothing is uploaded and there are no usage limits.",faqOlderQuestion:"What about older images or an imported site?",faqOlderAnswer:`The plug-in's page converts older images in the background. "Import a site export" brings in the images from your old site's export file and updates the links in your posts.`,faqWhereQuestion:"Which images does it convert?",faqWhereAnswer:"JPEG, PNG, WebP and AVIF. GIF and SVG are left as they are.",faqEffortQuestion:"What is Effort?",faqEffortAnswer:"Effort is how much work the encoder does to find a smaller file, from 1 to 9. The default is 7.",faqSizesQuestion:"Does it work with responsive images and CDNs?",faqSizesAnswer:"Yes. Sizes makes JPEG XL copies up to 3840 pixels wide, and image responses carry `Vary: Accept`.",faqCacheQuestion:"Does it work with my CDN or page cache?",faqCacheAnswer:"Image responses carry `Vary: Accept`, so any cache that honors it keeps the JPEG XL copy and the original separate.",faqHowQuestion:"How does it work?",faqHowAnswer:"rapier-jxl encodes JPEG XL on the site's server or in the browser. It keeps an original JPEG losslessly when possible. Photo quality is measured at efforts 6–9 and predicted at efforts 1–5.",faqRemovalQuestion:"How do I remove it?",faqRemovalSteps:"Run `npx jpegxl remove emdash`. It restores every original JPEG, then removes the plug-in.",faqRemovalAnswer:"`npx jpegxl remove emdash` restores every original file.",faqStorageQuestion:"What storage works?",faqStorageAnswer:"Cloudflare R2 and Node local storage."};var Xt="jpegxl",Yt=Qt.setupCommand,Zt=Qt.faqRemovalAnswer,ei={addHelp:`Usage: ${Xt} add emdash [--package <tarball>] [--workers-paid | --workers-free]\n\nAdd {name} to an EmDash site.\n${Qt.setupIntro}\n${Yt}\n\nKeeps its adapter, database, media storage and other plugins.\n\nOptions:\n --package <tarball> Install a local jpegxl package\n --workers-paid Use Workers Paid with a 30,000 ms CPU allowance\n --workers-free Use Workers Free and keep uploaded JPEG originals\n --dry-run Say what would change, and change nothing\n --json One JSON object: what changed\n -h, --help Show this help\n\nCloudflare setup asks Workers Paid? once when no allowance is recorded.\nUse an explicit Workers flag when running without an interactive terminal.\n`,removeHelp:`Usage: ${Xt} remove emdash [--url <site>]\n\n${Zt}\nKeep the site running until this command finishes.\n\nOptions:\n --url <site> EmDash URL (EMDASH_URL or http://localhost:4321)\n -h, --help Show this help\n\nUses EMDASH_TOKEN or the matching EmDash login.\n`,manual:"import {jxl} from 'jpegxl/emdash' and replace emdash({...}) with jxl(emdash, {...}), keeping the site's storage and other options",removeFix:`keep the integration enabled until every JPEG is restored, then run npx ${Xt} remove emdash again`,addOption:"Unknown add emdash option: {option}",addHelpFix:`run npx ${Xt} add emdash --help`,workersQuestion:"Workers Paid?",workersChoice:"Choose the Workers allowance for this Cloudflare site",workersChoiceFix:`run npx ${Xt} add emdash with --workers-paid or --workers-free; Node needs neither flag`,workersAnswer:"Answer yes or no",workersDowngrade:"Restore archived JPEG originals before changing this integration to Workers Free",workersDowngradeFix:`run npx ${Xt} remove emdash under the existing allowance, then run npx ${Xt} add emdash --workers-free`,workersHost:"The native Workers allowance is not an unambiguous numeric option",workersHostFix:"use an explicit cpuLimitMs number in the third jxl(emdash, config, options) argument, then run setup again",workersSource:"Expected one regular source wrangler.json or wrangler.jsonc in the site folder",workersSourceFix:"configure the intended source Worker manually; use cpuLimitMs: 30000 and limits.cpu_ms: 30000 for Paid, or cpuLimitMs: 10 with no custom CPU limit for Free",workersEnvironment:"This Worker has an environment or config selection that setup cannot safely choose",workersEnvironmentFix:"configure the intended Worker environment and its matching native CPU allowance explicitly before running setup",workersJson:"The source Wrangler config must be one unambiguous JSON or JSONC object",workersChanged:"The source Wrangler config changed during setup",workersChangedFix:"keep your latest config, finish that edit, then run setup again",updatedWrangler:"Updated {file}.",removeOption:"Unknown remove emdash option: {option}",removeHelpFix:`run npx ${Xt} remove emdash --help`,explicitObject:"Cannot edit astro.config.mjs safely: {property} needs an explicit object",explicitProperty:"Cannot edit astro.config.mjs safely: expected one explicit {property} property",laterProperty:"Cannot edit astro.config.mjs safely: a later spread or computed key may replace {property}",configSyntax:"Cannot read astro.config.mjs",configSyntaxFix:"fix its JavaScript syntax, then run this command again",emdashImport:"Cannot edit astro.config.mjs safely: expected one EmDash import from emdash/astro",configDynamic:"Cannot edit astro.config.mjs safely: export a config object or defineConfig({...}); this config is dynamic",explicitIntegrations:"Cannot edit astro.config.mjs safely: integrations must be an explicit array without spreads",reactMissing:"The EmDash admin needs react() in integrations",reactFix:`add the @astrojs/react integration to this site, then run npx ${Xt} add emdash again`,oneIntegration:"Cannot edit astro.config.mjs safely: expected one EmDash integration in integrations",explicitOptions:"Cannot edit astro.config.mjs safely: the EmDash options must be one explicit object",explicitStorage:"Cannot edit astro.config.mjs safely: use the site's local() or r2() storage directly in its EmDash options",directWrapper:"Cannot edit astro.config.mjs safely: the wrapper call is not direct",explicitWrapperImport:"Cannot edit astro.config.mjs safely: the wrapper import is not explicit",directEmdash:"Cannot edit astro.config.mjs safely: the EmDash call is not direct",manifest:"Cannot read {file}",manifestFix:"fix that file, then run this command again",ambiguousPackage:"More than one npx package was requested, so the local jpegxl source is ambiguous",ambiguousPackageFix:`run ${Xt} add emdash --package <jpegxl.tgz> to name the local build explicitly`,localPackage:"--package must name a local .tgz file",localPackageFix:"pass the tarball made by npm pack",packageRead:"Cannot read the package tarball",packageReadFix:"pass an intact local tarball made by npm pack",packageMissing:"That tarball does not contain jpegxl/emdash",packageMissingFix:"pack the jpegxl build that includes the EmDash integration",managerType:"packageManager in package.json must be a string",managerTypeFix:"set it to the package manager this site uses, then run this command again",managerUnsupported:"Cannot install with the site's package manager: {manager}",managerUnsupportedFix:"install jpegxl and @cloudflare/kumo with that manager, then run this command again",managerAmbiguous:"More than one package manager lockfile is present",managerAmbiguousFix:"set packageManager in package.json to the manager this site uses, then run this command again",managerRun:"Could not run {manager}",managerRunFix:"install jpegxl and @cloudflare/kumo with {manager}, then run this command again",managerExit:"{manager} install did not finish ({reason})",managerExitCode:"exit {code}",managerExitFix:`resolve the install error, then run npx ${Xt} add emdash again`,configFile:"Cannot edit astro.config.mjs safely: this folder needs a regular, unlinked config file",configFileFix:"run this in the EmDash site folder; for a shared or differently named config, add jxl(emdash, {...}) manually",siteMissing:"This folder does not declare an EmDash and Astro site in package.json",siteMissingFix:"run this command in the existing EmDash site folder",adminMissing:"The installed EmDash admin needs @cloudflare/kumo 2.6.0 or later",adminMissingFix:`install the site's EmDash dependencies with its package manager, then run npx ${Xt} add emdash again`,kumoMismatch:"The site uses @cloudflare/kumo {siteVersion}, but its EmDash admin uses {hostVersion}",kumoMismatchFix:`align the site's @cloudflare/kumo dependency with EmDash ({hostVersion}), then run npx ${Xt} add emdash again`,dependencyOld:"{dependency} {minimum} or later is needed (installed: {version})",dependencyOldFix:`update {dependency} with the site's package manager, then run npx ${Xt} add emdash again`,installing:"Installing {packages} with {manager}…",dryRun:"Dry run, nothing changed. Would install: {packages}. Would update: {files}.",dryRunNone:"nothing",tarball:"the jpegxl tarball",packageSeparator:" and ",installedMissing:"The installed jpegxl does not include jpegxl/emdash",installedMissingFix:"reinstall jpegxl, then run this command again",packageChanged:"The local package changed during setup or its installed version differs",packageChangedFix:"finish packing the package, then run this command again",dependencyMissing:"{dependency} {minimum} or later is not installed",dependencyMissingFix:"install {dependency} with the site's package manager, then run this command again",kumoInstalledMismatch:"The installed @cloudflare/kumo does not match the EmDash admin",kumoInstalledFix:"install @cloudflare/kumo@{hostVersion} with the site's package manager, then run this command again",configChanged:"astro.config.mjs changed during {action}; it was not overwritten",configChangedFix:"review the change, then run this command again",setup:"setup",removal:"removal",updated:"Updated astro.config.mjs. The site keeps its existing storage and plugins.",alreadyAdded:"{name} is already set up.",added:"Restart the site. {setupAfter}",nativePage:"Optimizer: /_emdash/admin/plugins/rapier-media/jpeg-xl",alreadyRemoved:"{name} is not enabled in astro.config.mjs.",removed:Zt+" Removed {name} from astro.config.mjs.",restartRemoved:"Rebuild and redeploy the site to finish removal.",removalUrl:"Expected an EmDash site origin with HTTPS, or HTTP on localhost",removalUrlFix:"pass --url with the site origin; URL credentials, paths, queries and fragments are not accepted",removalClient:"The installed EmDash client transport is unavailable",removalClientFix:"install this site's EmDash dependencies, then run this command again",credentials:"The matching EmDash login could not be read or has expired",loginFix:"run npx emdash login --url {url}, or set EMDASH_TOKEN for that site, then run this command again",credentialHeader:"The matching EmDash login has invalid custom headers",requestFailed:"The EmDash restoration request failed ({status})",responseInvalid:"EmDash returned an invalid restoration response",restorationMismatch:"The restoration response belongs to another site, backend or operation",restorationFailed:"JPEG restoration has not completed",restoring:"Restoring JPEGs: {count}"};import{readFile as ti}from"node:fs/promises";var ii=["jpegxl","rapier-jxl"],si=ii[0];import{stat as ri}from"node:fs/promises";import{dirname as ai,join as ni}from"node:path";var oi=(e,t,i)=>Object.assign(new Error(`${t}; ${i}.`),{code:e,fix:i});var hi=[["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"]],pi=["package.json",...hi.map(([e])=>e)];import{readFile as fi,stat as mi,rm as gi,rmdir as xi,chmod as yi}from"node:fs/promises";import{dirname as wi,join as ki,sep as bi}from"node:path";import{createHash as vi}from"node:crypto";import{lstat as Si,mkdir as Ei,readFile as Ci,readlink as _i,realpath as Ai,rename as Ii,rm as Pi,writeFile as Ti}from"node:fs/promises";import{randomBytes as Ni}from"node:crypto";import{basename as Li,dirname as Vi,isAbsolute as Oi,join as Ri,relative as ji,resolve as Fi,sep as Di}from"node:path";var Mi=e=>process.platform==="win32"?e.toLowerCase():e,Bi=(e,t)=>{let i=ji(Mi(e),Mi(t));return i===""||i!==".."&&!i.startsWith(".."+Di)&&!Oi(i)},Ui=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;var Gi=e=>e==="emdash"?".rapier-jxl-emdash.json":".rapier-jxl-add.json",Hi=e=>vi("sha256").update(e).digest("hex"),zi=e=>oi("JXL_SETUP",e,"restore the files recorded by add, then try again"),Ji=e=>fi(e).catch(e=>{if(e.code==="ENOENT")return null;throw e}),Qi=e=>e===null?null:Hi(e),Ki=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Xi=(e,t)=>t.map(t=>e+".config."+t),Yi=["rapier-jxl-files.mjs"],Zi=[...Yi,"rapier-jxl-vite.mjs","rapier-jxl-vite.d.mts","rapier-jxl-images.d.ts","src/rapier-jxl-images.d.ts"],es={vite:[...Zi,...Xi("vite",["ts","mts","js","mjs"])],sveltekit:[...Zi,...Xi("vite",["ts","mts","js","mjs"])],nuxt:[...Zi,...Xi("nuxt",["ts","mts","js","mjs"])],webpack:[...Yi,"rapier-jxl-webpack.mjs","rapier-jxl-webpack.d.mts",...["webpack","rspack"].flatMap(e=>Xi(e,["js","mjs","cjs","ts"]))],next:[...Yi,"rapier-jxl-next.mjs","rapier-jxl-next-proxy.mjs","rapier-jxl-next-loader.mjs","package.json",".gitignore",...["","src/"].flatMap(e=>["proxy","middleware"].flatMap(t=>["js","mjs","ts"].map(i=>e+t+"."+i)))],netlify:["netlify.toml",...["index.mjs","edge.mjs","manifest.yml","package.json","rapier-jxl-files.mjs"].map(e=>"netlify/plugins/rapier-jxl/"+e)],astro:[...Xi("astro",["mjs","js","ts","mts","cjs","cts"]),"src/jxl/service.mjs","src/jxl/service-workers.mjs","src/jxl/index.mjs","src/jxl/options.mjs","package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock"],workers:["jxl-worker.mjs","wrangler.json","wrangler.jsonc","wrangler.toml","package.json"],emdash:["astro.config.mjs","wrangler.json","wrangler.jsonc",...pi]},ts=(e,t)=>Object.hasOwn(es,e)&&es[e].includes(t),is=(e,t)=>typeof t=="string"&&es[e]?.some(e=>e.startsWith(t+"/"));var os=(e,t)=>Kt(ei[e],{name:Qt.name,...t}),ls=os("addHelp"),hs=os("removeHelp"),ps=(e,t=ei.manual)=>oi("JXL_SETUP",e,t);var ds=e=>e.type==="Property"?e.computed?e.key.type==="Literal"?e.key.value:null:e.key.name??e.key.value:null,fs=(e,t)=>e?.type==="CallExpression"&&!e.optional&&e.callee.type==="Identifier"&&e.callee.name===t;var gs=(e,t)=>ys(e,!1,t);var Ps=(e,t)=>{let i=u(e,t);return i!==""&&i!==".."&&!i.startsWith(".."+f)&&!d(i)};var Rs=256*1024*1024;var Bs=e=>typeof e=="string"&&/^[a-f0-9]{32}$/.test(e);export{ls as ADD_EMDASH_HELP,hs as REMOVE_EMDASH_HELP,Ms as addEmdash,Ls as emdashConnection,gs as planEmdashConfig,xs as planEmdashRemoval,vs as planWranglerAllowance,qs as removeEmdash,cs as runAddEmdash,us as runRemoveEmdash};function F(e,t){let i=65536;for(let s=0;s<t.length;s+=2){if(i+=t[s],i>e)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function D(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&R.test(String.fromCharCode(e)):t===!1?!1:F(e,I)}function M(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&j.test(String.fromCharCode(e)):t===!1?!1:F(e,I)||F(e,A)}function U(e,t){return new B(e,{beforeExpr:!0,binop:t})}function G(e,t={}){return t.keyword=e,$[e]=new B(e,t)}function Q(e){return e===10||e===13||e===8232||e===8233}function K(e,t,i=e.length){for(let s=t;s<i;s++){let t=e.charCodeAt(s);if(Q(t))return s<i-1&&t===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}function re(e){return se[e]||(se[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ae(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function he(e,t){for(let i=1,s=0;;){let r=K(e,s,t);if(r<0)return new oe(i,t-s);++i,s=r}}function ue(e){let t={};for(let i in pe)t[i]=e&&te(e,i)?e[i]:pe[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ce&&typeof console=="object"&&console.warn&&(ce=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ie(t.onToken)){let e=t.onToken;t.onToken=t=>e.push(t)}if(ie(t.onComment)&&(t.onComment=de(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function de(e,t){return function(i,s,r,a,n,o){let l={type:i?"Block":"Line",value:s,start:r,end:a};e.locations&&(l.loc=new le(this,n,o)),e.ranges&&(l.range=[r,a]),t.push(l)}}function fe(e,t){return 2|(e?4:0)|(t?8:0)}function Ee(e,t){let i=t+1,s=Math.min(e.input.length,t+11);for(;i<s;){let t=e.fullCharCodeAt(i);if(!M(t,!0))break;i+=t<=65535?1:2}return i===t+2&&e.input.slice(t,i)==="in"||i===t+10&&e.input.slice(t,i)==="instanceof"}function Ve(e,t){let i=t.key.name,s=e[i],r="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(r=(t.static?"s":"i")+t.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(e[i]="true",!1):s?!0:(e[i]=r,!1)}function Oe(e,t){let{computed:i,key:s}=e;return!i&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.value===t)}function Be(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Be(e.expression)}function Ue(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Ue(e.expression)||e.type==="ParenthesizedExpression"&&Ue(e.expression)}function Je(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}function ft(e){let t=dt[e]={binary:re(it[e]+" "+at),binaryOfStrings:re(rt[e]),nonBinary:{General_Category:re(at),Script:re(ut[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}function wt(e){for(let t in e)return!0;return!1}function kt(e){return e===105||e===109||e===115}function bt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}function vt(e){return D(e,!0)||e===36||e===95}function St(e){return M(e,!0)||e===36||e===95||e===8204||e===8205}function Et(e){return e>=65&&e<=90||e>=97&&e<=122}function Ct(e){return e>=0&&e<=1114111}function Pt(e){return e===100||e===68||e===115||e===83||e===119||e===87}function Tt(e){return Et(e)||e===95}function Nt(e){return Tt(e)||Rt(e)}function Lt(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Vt(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}function Ot(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}function Rt(e){return e>=48&&e<=57}function jt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ft(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}function Dt(e){return e>=48&&e<=55}function Ut(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function qt(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}function Gt(e,t){return be.parse(e,t)}function Ht(e,t,i){return be.parseExpressionAt(e,t,i)}function zt(e,t){return be.tokenizer(e,t)}function Kt(e,t={}){return e.replace(/\{(\w+)\}/g,(e,i)=>String(t[i]))}function li(e){if(!Array.isArray(e))throw oi("JXL_OPTIONS","Command arguments are not an array of text values","pass an array of strings");let t=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s!="string")throw oi("JXL_OPTIONS","A command argument is not text","pass each argument as a string");t.push(s)}return t}async function ci(e){for(let t=e;;t=ai(t)){let e=[];for(let[i,s]of hi)await ri(ni(t,i)).catch(()=>null)&&e.push(s);if(e.length)return[...new Set(e)];if(ai(t)===t)return[]}}function ui(e){let t=String(e);if(/[%\0\r\n]/.test(t))throw oi("JXL_SETUP",`${t} has % or a line break, which Windows' shell would run`,"rename or move the file so its path has neither");return`"${t.replace(/"/g,'""')}"`}function di(e,t,{cwd:i,env:s=process.env,platform:r=process.platform,execPath:a=process.execPath,quiet:n=!1}){let o=n?["ignore","ignore","inherit"]:"inherit";return e==="npm"&&s.npm_execpath&&/(?:^|[/\\])npm(?:-cli)?\.(?:c?js|mjs)$/.test(s.npm_execpath)?[a,[s.npm_execpath,...t],{cwd:i,env:s,stdio:o,shell:!1}]:r==="win32"?[[e,...t.map(ui)].join(" "),[],{cwd:i,env:s,stdio:o,shell:!0}]:[e,t,{cwd:i,env:s,stdio:o,shell:!1}]}async function qi(e,t=0){if(t>40)throw Object.assign(new Error("Symbolic link loop"),{code:"ELOOP"});try{return await Ai(e)}catch(e){if(!["ENOENT","ENOTDIR"].includes(e.code))throw e}if((await Si(e).catch(()=>null))?.isSymbolicLink())return qi(Fi(Vi(e),await _i(e)),t+1);let i=Vi(e);return i===e?e:Ri(await qi(i,t),Li(e))}async function Wi(e,t,i){let s=await Ai(e),r=[];for(let a of t){if(typeof a!="string"||a.includes("\0"))throw i("A project file path is invalid","use a plain relative path inside this folder");let t;try{t=await qi(Fi(e,a))}catch(t){throw t?.code==="ELOOP"?i(`${ji(e,Fi(e,a))||a} has a symbolic link loop`,"replace the link with a folder or file"):t}if(!Bi(s,t))throw i(`${ji(e,Fi(e,a))||a} leads outside this folder, to ${t}`,"replace the link with the file itself, or run it in the folder the file is in");let n=ji(s,t);if(process.platform==="win32"&&n.split(/[\\/]/).some(e=>Ui.test(e)||/[ .]$/.test(e)))throw i(`${n} uses a reserved Windows file name`,"rename the file or folder");r.push(t)}return r}async function $i(e,t){await Ei(Vi(e),{recursive:!0});let i=Ri(Vi(e),`.${Li(e)}.${Ni(6).toString("hex")}.tmp`);try{await Ti(i,t,{flag:"wx"}),await Ii(i,e)}catch(e){throw await Pi(i,{force:!0}).catch(()=>{}),e}}async function ss(e,t){let[i]=await Wi(e,[Gi(t)],zi),s=await Ji(i);if(s===null)return null;let r;try{r=JSON.parse(s)}catch{throw zi("The add record is not JSON")}if(!Ki(r)||r.place!==t||r.schema!==1||!Ki(r.files)||!Array.isArray(r.dirs)||!r.dirs.every(e=>is(t,e)))throw zi("The add record does not describe this place");for(let[e,i]of Object.entries(r.files))if(!ts(t,e)||!Ki(i)||!(i.before===null||typeof i.before=="string"&&Buffer.from(i.before,"base64").toString("base64")===i.before)||!(i.after===null||typeof i.after=="string"&&/^[a-f0-9]{64}$/.test(i.after))||!(i.mode===null||Number.isInteger(i.mode)&&i.mode>=0&&i.mode<=511))throw zi("The add record names an invalid file");if(r.pending)throw zi("An earlier add did not finish installing its dependencies");return await Wi(e,[...Object.keys(r.files),...r.dirs],zi),r}async function rs(e,t){let i=await ss(e,t);return i?Object.keys(i.files):null}async function as(e,t,i,s,{dryRun:r=!1,install:a,beforeWrite:n}={}){let o=await ss(e,t),l=[...new Set([...s.keys(),...a?.files??[]])];if(l.some(e=>!ts(t,e)))throw zi("The setup names a file outside its place");let h=await Wi(e,[Gi(t),...l],zi),p=new Map,c={...o?.files},u=new Set(o?.dirs??[]);for(let[t,i]of l.entries()){let r=await Ji(h[t+1]);if(p.set(i,r),c[i]&&Qi(r)!==c[i].after)throw zi(`${i} changed after add wrote it`);c[i]={before:c[i]?c[i].before:r===null?null:r.toString("base64"),mode:c[i]?c[i].mode:r===null?null:(await mi(h[t+1])).mode&511,after:s.has(i)?Hi(s.get(i)):Qi(r)};for(let t=wi(i);t!==".";t=wi(t))try{await mi(ki(e,t))}catch(e){if(e.code==="ENOENT")u.add(t.split(bi).join("/"));else throw e}}if(r)return;if(!l.length){await(n?.());return}let d={schema:1,place:t,version:i,files:c,dirs:[...u]},f=e=>$i(h[0],JSON.stringify({...d,...e&&{pending:!0}},null,2)+`\n`);if(await f(!!a),a){await a.run(),await Wi(e,[Gi(t),...l],zi);for(let t of a.files)c[t].after=Qi(await Ji(ki(e,t)));await f(!1)}await(n?.());let m=await Wi(e,[...s.keys()],zi);for(let t of s.keys())if(Qi(await Ji(ki(e,t)))!==Qi(p.get(t)))throw zi(`${t} changed while add ran`);for(let[e,[t,i]]of[...s].entries())await $i(m[e],i),c[t].mode!==null&&await yi(m[e],c[t].mode)}async function ns(e,t,{cwd:i,stdout:s}){if(t=li(t),t.length===1&&["--help","-h"].includes(t[0])){s(`Usage: ${si} remove ${e} [--dry-run] [--json]`);return}if(t.some(e=>!["--dry-run","--json"].includes(e)))throw oi("JXL_OPTIONS","Unknown remove option",`run npx ${si} remove ${e} --help`);let r=t.includes("--dry-run"),a=await ss(i,e);if(!a)throw zi(`There is no add record for ${e}`);let n=Object.keys(a.files),o=await Wi(i,[...n,Gi(e),...a.dirs],zi),l=[];for(let[e,t]of n.entries()){let i=a.files[t],s=await Ji(o[e]),r=i.before===null?null:Buffer.from(i.before,"base64");if(Qi(s)!==Qi(r)){if(Qi(s)!==i.after)throw zi(`${t} changed after add wrote it; no files were removed`);l.push({file:t,action:r===null?"removed":"restored",original:r,index:e})}}if(!r){for(let e of l){let t=o[e.index],i=a.files[e.file];e.original===null?await gi(t):(await $i(t,e.original),i.mode!==null&&await yi(t,i.mode))}for(let e of[...a.dirs].sort((e,t)=>t.length-e.length))await xi(ki(i,e)).catch(e=>{if(!["ENOENT","ENOTEMPTY","EEXIST"].includes(e.code))throw e});await gi(o[n.length])}let h=l.map(({file:e,action:t})=>({file:e,action:t}));if(t.includes("--json"))s(JSON.stringify({type:"remove",host:e,dryRun:r,changes:h}));else for(let{file:e,action:t}of h)s(`${e}: ${r?"would be ":""}${t}`)}async function cs(e,t){if(e=li(e),e.length===1&&["--help","-h"].includes(e[0])){t.stdout(ls.trimEnd());return}let i,s,r=!1;for(let t=0;t<e.length;t++)if(e[t]==="--package"&&i===void 0&&e[t+1]&&!String(e[t+1]).startsWith("-"))i=e[++t];else if(["--workers-paid","--workers-free"].includes(e[t])&&s===void 0)s=e[t]==="--workers-paid";else if(e[t]==="--dry-run"&&!r)r=!0;else throw Object.assign(ps(os("addOption",{option:e[t]}),ei.addHelpFix),{code:"JXL_OPTIONS"});return Ms({...t,packagePath:i,workersPaid:s,dryRun:r})}async function us(e,t){if(e=li(e),e.length===1&&["--help","-h"].includes(e[0])){t.stdout(hs.trimEnd());return}let i;if(e.length){if(e.length!==2||e[0]!=="--url"||!e[1]||String(e[1]).startsWith("-"))throw Object.assign(ps(os("removeOption",{option:e.find(e=>e!=="--url")??e[0]}),ei.removeHelpFix),{code:"JXL_OPTIONS"});i=e[1]}return qs({...t,url:i})}function ms(e,t){if(e?.type!=="ObjectExpression")throw ps(os("explicitObject",{property:t}));let i=e.properties.filter(e=>ds(e)===t);if(i.length!==1||i[0].kind!=="init"||i[0].method)throw ps(os("explicitProperty",{property:t}));let s=i[0];if(e.properties.slice(e.properties.indexOf(s)+1).some(e=>e.type==="SpreadElement"||e.computed&&ds(e)===null))throw ps(os("laterProperty",{property:t}));return s.value}function xs(e,t){try{return ys(e,!0,{name:t})}catch(e){let t=e?.fix?e.message.slice(0,-e.fix.length-3):String(e?.message??e);throw ps(t,ei.removeFix)}}function ys(e,t,{cpuLimitMs:i,inspect:s=!1,name:r="rapier-jxl"}={}){let a,n=[];try{a=Jt.parse(e,{sourceType:"module",ecmaVersion:"latest",onToken:n})}catch(e){throw ps(os("configSyntax",{detail:e.message}),ei.configSyntaxFix)}let o=a.body.filter(e=>e.type==="ImportDeclaration"),l=(e,t)=>o.flatMap(i=>i.source.value===e?i.specifiers.filter(e=>t==="default"?e.type==="ImportDefaultSpecifier"||e.imported?.name==="default":e.type==="ImportSpecifier"&&(e.imported.name??e.imported.value)===t).map(e=>({name:e.local.name,node:i})):[]),h=l("emdash/astro","default");if(h.length!==1)throw ps(ei.emdashImport);let p=h[0],c=l("astro/config","defineConfig"),u=a.body.find(e=>e.type==="ExportDefaultDeclaration")?.declaration,d=u?.type==="ObjectExpression"?u:u?.arguments?.length===1&&c.some(e=>fs(u,e.name))?u.arguments[0]:null;if(d?.type!=="ObjectExpression")throw ps(ei.configDynamic);let f=ms(d,"integrations");if(f.type!=="ArrayExpression"||f.elements.some(e=>e?.type==="SpreadElement"))throw ps(ei.explicitIntegrations);let m=l("@astrojs/react","default");if(!t&&!f.elements.some(e=>m.some(t=>fs(e,t.name))))throw ps(ei.reactMissing,ei.reactFix);let g=l(`${r}/emdash`,"jxl"),x=e=>g.some(t=>fs(e,t.name))&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===p.name,y=f.elements.filter(e=>fs(e,p.name)||x(e));if(y.length!==1)throw ps(ei.oneIntegration);let w=y[0],k=x(w),b=w.arguments[k?1:0];if(!k&&w.arguments.length!==1||k&&![2,3].includes(w.arguments.length)||b?.type!=="ObjectExpression"||k&&w.arguments.length===3&&w.arguments[2]?.type!=="ObjectExpression")throw ps(ei.explicitOptions);let v=ms(b,"storage"),S=l("emdash/astro","local"),E=l("@emdash-cms/cloudflare","r2"),C=S.some(e=>fs(v,e.name))?"local":E.some(e=>fs(v,e.name))?"r2":null;if(!C)throw ps(ei.explicitStorage);if(s||i!==void 0){if(i!==void 0&&(C!=="r2"||![10,3e4].includes(i)))throw ps(ei.workersChoice,ei.workersChoiceFix);if(s&&C!=="r2")return{storage:C,cpuLimitMs:null};let e=ms(d,"adapter");if(!l("@astrojs/cloudflare","default").some(t=>fs(e,t.name))||e.arguments.length>1||e.arguments.length===1&&e.arguments[0].type!=="ObjectExpression")throw ps(ei.workersEnvironment,ei.workersEnvironmentFix);let t=e=>{if(!(!e||typeof e!="object")){if(e.type==="SpreadElement"||e.type==="Property"&&(e.computed&&ds(e)===null||["config","configPath","wranglerConfig","environment","env"].includes(ds(e))))throw ps(ei.workersEnvironment,ei.workersEnvironmentFix);for(let i of Object.values(e))Array.isArray(i)?i.forEach(t):i&&typeof i=="object"&&t(i)}};e.arguments.forEach(t);let r=k?w.arguments[2]:null;if(r&&r.properties.some(e=>e.type!=="Property"||e.method||e.kind!=="init"||e.computed&&ds(e)===null))throw ps(ei.workersHost,ei.workersHostFix);let a=r?.properties.filter(e=>ds(e)==="cpuLimitMs")??[];if(a.length>1||a.length&&(a[0].value.type!=="Literal"||typeof a[0].value.value!="number"))throw ps(ei.workersHost,ei.workersHostFix);if(s)return{storage:C,cpuLimitMs:a[0]?.value.value??null}}if(t){if(!k)return{source:e,changed:!1,storage:C};let t=g.find(e=>fs(w,e.name)),i=n.find(e=>e.start>=w.callee.end&&e.end<=w.end),s=n.find(e=>e.start>=w.arguments[0].end&&e.end<=b.start&&e.type.label===",");if(i?.type.label!=="("||!s)throw ps(ei.directWrapper);let r=[{start:w.callee.start,end:w.callee.end,text:p.name},{start:i.end,end:s.end+ +(e[s.end]===" "),text:""}];if(w.arguments.length===3){let e=n.find(e=>e.start>=b.end&&e.end<=w.arguments[2].start&&e.type.label===","),t=n.find(e=>e.end===w.end&&e.type.label===")");if(!e||!t)throw ps(ei.directWrapper);r.push({start:e.start,end:t.start,text:""})}if(!n.some(e=>e.type.label==="name"&&e.value===t.name&&!(e.start>=t.node.start&&e.end<=t.node.end)&&!(e.start>=w.callee.start&&e.end<=w.callee.end))){let i=t.node,s=i.specifiers.filter(e=>e.type==="ImportSpecifier"),a=s.findIndex(e=>e.local.name===t.name);if(i.specifiers.length===1){let t=/^\r?\n/.exec(e.slice(i.end))?.[0]??"";r.push({start:i.start,end:i.end+t.length,text:""})}else if(s.length===1){let e=n.find(e=>e.start>=i.start&&e.end<=s[0].start&&e.type.label===","),t=n.find(e=>e.start>=s[0].end&&e.end<=i.source.start&&e.type.label==="}");if(!e||!t)throw ps(ei.explicitWrapperImport);r.push({start:e.start,end:t.end,text:""})}else if(a>0){let e=n.find(e=>e.start>=s[a-1].end&&e.end<=s[a].start&&e.type.label===",");if(!e)throw ps(ei.explicitWrapperImport);r.push({start:e.start,end:s[a].end,text:""})}else{let e=n.find(e=>e.start>=s[a].end&&e.end<=s[a+1].start&&e.type.label===",");if(!e)throw ps(ei.explicitWrapperImport);r.push({start:s[a].start,end:e.end,text:""})}}let a=e;for(let e of r.sort((e,t)=>t.start-e.start))a=a.slice(0,e.start)+e.text+a.slice(e.end);return Jt.parse(a,{sourceType:"module",ecmaVersion:"latest"}),{source:a,changed:!0,storage:C}}if(k&&i===void 0)return{source:e,changed:!1,storage:C};let _=[];if(i!==void 0){let t=k?w.arguments[2]:null;if(t){let s=t.properties.find(e=>ds(e)==="cpuLimitMs");s&&s.value.value!==i?_.push({start:s.value.start,end:s.value.end,text:String(i)}):s||_.push(ks(e,t,`cpuLimitMs: ${i}`))}else{let e=n.find(e=>e.end===w.end&&e.type.label===")");if(!e)throw ps(ei.directWrapper);let t=n[n.indexOf(e)-1];_.push({start:e.start,end:e.start,text:`${t?.type.label===","?"":","} {cpuLimitMs: ${i}}`})}}if(k){let t=ws(e,_);return Jt.parse(t,{sourceType:"module",ecmaVersion:"latest"}),{source:t,changed:t!==e,storage:C}}let A=new Set(n.filter(e=>e.type.label==="name").map(e=>e.value)),I=g[0]?.name??"jxl",P=1;if(!g.length)for(;A.has(I);)I=P===1?"rapierJxl":`rapierJxl${P}`,P++;let T=n.find(e=>e.start>=w.callee.end&&e.end<=w.end);if(T?.type.label!=="(")throw ps(ei.directEmdash);let N=[..._,{start:w.callee.start,end:w.callee.end,text:I},{start:T.end,end:T.end,text:`${p.name}, `}];if(!g.length){let t=e[p.node.source.start]==='"'?'"':"'",i=e.includes(`\r\n`)?`\r\n`:`\n`;N.push({start:p.node.start,end:p.node.start,text:`import {jxl${I==="jxl"?"":` as ${I}`}} from ${t}${r}/emdash${t};${i}`})}let L=e;for(let e of N.sort((e,t)=>t.start-e.start))L=L.slice(0,e.start)+e.text+L.slice(e.end);return Jt.parse(L,{sourceType:"module",ecmaVersion:"latest"}),{source:L,changed:!0,storage:C}}function ws(e,t){for(let i of t.sort((e,t)=>t.start-e.start))e=e.slice(0,i.start)+i.text+e.slice(i.end);return e}function ks(e,t,i){let s=e.slice(t.start,t.end).includes(`\n`),r=e.includes(`\r\n`)?`\r\n`:`\n`,a=t.properties[0],n=a?e.slice(e.lastIndexOf(`\n`,a.start)+1,a.start):"",o=a&&/^[\t ]*$/.test(n)?n:e.includes("\t")?"\t":" ";return{start:t.start+1,end:t.start+1,text:`${s?r+o:""}${i}${t.properties.length?",":""}${s?"":t.properties.length?" ":""}`}}function bs(e,t){let i,s=[];try{t.endsWith(".json")&&JSON.parse(e.replace(/^\ufeff/,"")),i=Jt.parse("("+e+`\n)`,{ecmaVersion:"latest",onToken:s}).body[0]?.expression;let r=t=>{if(t?.type==="ObjectExpression"){let i=new Set;for(let s of t.properties){if(s.type!=="Property"||s.computed||s.method||s.shorthand||s.kind!=="init"||s.key.type!=="Literal"||typeof s.key.value!="string")throw new TypeError;if(JSON.parse(("("+e).slice(s.key.start,s.key.end))!==s.key.value||i.has(s.key.value))throw new TypeError;i.add(s.key.value),r(s.value)}}else if(t?.type==="ArrayExpression")t.elements.forEach(r);else if(t?.type==="Literal"||t?.type==="UnaryExpression"&&t.operator==="-"&&t.argument.type==="Literal"){let i=JSON.parse(("("+e).slice(t.start,t.end));if(i!==null&&!["number","boolean","string"].includes(typeof i)||typeof i=="number"&&!Number.isFinite(i))throw new TypeError}else throw new TypeError};if(i?.type!=="ObjectExpression")throw new TypeError;r(i)}catch{throw ps(ei.workersJson,ei.workersSourceFix)}let r=e=>{if(!(!e||typeof e!="object")){typeof e.start=="number"&&(e.start--,e.end--);for(let t of Object.values(e))Array.isArray(t)?t.forEach(r):t&&typeof t=="object"&&r(t)}};return r(i),s=s.filter(t=>t.start>0&&t.end<=e.length+1).map(e=>({...e,start:e.start-1,end:e.end-1})),{ast:i,tokens:s}}function vs(e,{filename:t="wrangler.jsonc",cpuLimitMs:i}={}){if(!["wrangler.json","wrangler.jsonc"].includes(t)||![10,3e4].includes(i))throw ps(ei.workersSource,ei.workersSourceFix);let{ast:s,tokens:r}=bs(e,t),a=(e,t)=>e.properties.find(e=>e.key.value===t),n=a(s,"env"),o=a(s,"pages_build_output_dir");if(n&&(n.value.type!=="ObjectExpression"||n.value.properties.length)||o)throw ps(ei.workersEnvironment,ei.workersEnvironmentFix);let l=a(s,"limits");if(l&&l.value.type!=="ObjectExpression")throw ps(ei.workersJson,ei.workersSourceFix);let h=l&&a(l.value,"cpu_ms");if(h&&(h.value.type!=="Literal"||typeof h.value.value!="number"||h.value.value<=0))throw ps(ei.workersJson,ei.workersSourceFix);let p=[];if(i===3e4)h&&h.value.value!==3e4?p.push({start:h.value.start,end:h.value.end,text:"30000"}):!h&&l?p.push(ks(e,l.value,'"cpu_ms": 30000')):l||p.push(ks(e,s,'"limits": {"cpu_ms": 30000}'));else if(h){let e=l.value.properties,t=e.indexOf(h),i=r.find(e=>e.type.label===":"&&e.start>=h.key.end&&e.end<=h.value.start);if(!i)throw ps(ei.workersJson,ei.workersSourceFix);if(p.push({start:h.key.start,end:h.key.end,text:""},{start:i.start,end:i.end,text:""},{start:h.value.start,end:h.value.end,text:""}),t>0){let i=r.find(i=>i.type.label===","&&i.start>=e[t-1].end&&i.end<=h.start);if(!i)throw ps(ei.workersJson,ei.workersSourceFix);p.push({start:i.start,end:i.end,text:""})}else{let t=e[1]?.start??l.value.end-1,i=r.find(e=>e.type.label===","&&e.start>=h.end&&e.end<=t);i&&p.push({start:i.start,end:i.end,text:""})}}let c=ws(e,p);return bs(c,t),{source:c,changed:c!==e,cpuLimitMs:i}}async function Ss(t,s,r){if(r.CLOUDFLARE_ENV||r.WRANGLER_ENV||r.WRANGLER_CONFIG||r.WRANGLER_CONFIG_FILE||Object.values(s.scripts??{}).some(e=>typeof e=="string"&&(/\bCLOUDFLARE_ENV\s*=/.test(e)||/\b(?:wrangler|astro|vite)\b/.test(e)&&/(?:--(?:env|config)(?:[=\s]|$)|(?:^|\s)-[ec](?:[=\s]|$))/.test(e))))throw ps(ei.workersEnvironment,ei.workersEnvironmentFix);if(await i(h(t,"cloudflare.config.ts")).catch(()=>null))throw ps(ei.workersSource,ei.workersSourceFix);let a=[];for(let e of["wrangler.jsonc","wrangler.json","wrangler.toml"]){let s=h(t,e),r=await i(s).catch(e=>{if(e.code==="ENOENT")return null;throw e});r&&a.push({path:s,info:r,name:e})}if(a.length!==1||a[0].name==="wrangler.toml"||!a[0].info.isFile()||a[0].info.isSymbolicLink()||a[0].info.nlink!==1)throw ps(ei.workersSource,ei.workersSourceFix);let n=a[0],o=await e(n.path,"utf8");return vs(o,{filename:n.name,cpuLimitMs:10}),{...n,source:o}}async function Es(e,{env:t}){if(!process.stdin.isTTY||!process.stdout.isTTY||t.CI)throw ps(ei.workersChoice,ei.workersChoiceFix);let i=S({input:process.stdin,output:process.stdout});try{let t=(await i.question(e+" [y/N] ")).trim().toLowerCase();if(["yes","y"].includes(t))return!0;if(["no","n",""].includes(t))return!1;throw ps(ei.workersAnswer,ei.workersChoiceFix)}finally{i.close()}}async function Cs({path:t,info:s,source:r},a=!1){let n=await i(t).catch(()=>null);if(!n?.isFile()||n.isSymbolicLink()||n.nlink!==1||n.ino!==s.ino||n.dev!==s.dev||n.mode!==s.mode||await e(t,"utf8")!==r)throw a?ps(ei.workersChanged,ei.workersChangedFix):ps(os("configChanged",{action:ei.setup}),ei.configChangedFix)}async function _s(t){try{return JSON.parse(await e(t,"utf8"))}catch(e){if(e.code==="ENOENT")return null;throw ps(os("manifest",{file:m(t),detail:e.message}),ei.manifestFix)}}async function As(e,t){for(let i=e;;i=p(i)){let e=h(i,"node_modules",t),s=await _s(h(e,"package.json"));if(s)return s.name===t?{root:await r(e),pkg:s}:null;if(p(i)===i)return null}}function Is(e){if(typeof e=="string")return e;if(!e||typeof e!="object"||Array.isArray(e))return null;for(let[t,i]of Object.entries(e))if(["node","import","default"].includes(t)){let e=Is(i);if(e)return e}return null}async function Ts(e,t){let i=Is(e?.pkg.exports?.[t]);if(typeof i!="string"||!i.startsWith("./")||i.includes("\\")||i.split("/").includes(".."))return null;let a=await r(h(e.root,i)).catch(()=>null);return a&&Ps(e.root,a)&&(await s(a).catch(()=>null))?.isFile()?a:null}async function Ns(e){return!!await Ts(e,"./emdash")}async function Ls({cwd:t,url:i,env:s=process.env,signal:r}){let a;try{a=new URL(i??s.EMDASH_URL??"http://localhost:4321")}catch{throw ps(ei.removalUrl,ei.removalUrlFix)}let n=["localhost","127.0.0.1","[::1]"].includes(a.hostname);if(a.username||a.password||a.pathname!=="/"||a.search||a.hash||a.protocol!=="https:"&&!(n&&a.protocol==="http:"))throw ps(ei.removalUrl,ei.removalUrlFix);let o=os("loginFix",{url:a.origin}),l=s.EMDASH_TOKEN,p;if(!l){let i=h(s.XDG_CONFIG_HOME||h(k(),".config"),"emdash","auth.json");try{p=JSON.parse(await e(i,"utf8"))?.[n?`path:${c(t)}`:a.origin]}catch(e){if(e.code!=="ENOENT")throw ps(ei.credentials,o)}if(p){if(typeof p.accessToken!="string"||!p.accessToken||typeof p.expiresAt!="string"||!Number.isFinite(Date.parse(p.expiresAt))||Date.parse(p.expiresAt)<=Date.now())throw ps(ei.credentials,o);l=p.accessToken}}if(!l&&!n||l!==void 0&&typeof l!="string")throw ps(ei.credentials,o);let u=await As(t,"emdash"),d=u&&await Ts(u,"./client"),f=u&&await Ts(u,"./client/cf-access");if(!d||!f)throw ps(ei.removalClient,ei.removalClientFix);let m,g;try{m=await(import(v(d).href)),g=await(import(v(f).href))}catch{throw ps(ei.removalClient,ei.removalClientFix)}if(["createTransport","csrfInterceptor","tokenInterceptor","devBypassInterceptor"].some(e=>typeof m[e]!="function")||typeof g.parseHeaderStrings!="function")throw ps(ei.removalClient,ei.removalClientFix);let x;try{if(p?.customHeaders&&(typeof p.customHeaders!="object"||Array.isArray(p.customHeaders)||Object.values(p.customHeaders).some(e=>typeof e!="string")))throw new TypeError;x=new Headers({...p?.customHeaders,...g.parseHeaderStrings(String(s.EMDASH_HEADERS??"").split(`\n`))})}catch{throw ps(ei.credentialHeader,o)}let y=m.createTransport({interceptors:[m.csrfInterceptor(),l?m.tokenInterceptor(l):m.devBypassInterceptor(a.origin)]});return{origin:a.origin,async request(e,t){r?.throwIfAborted();let i=new Headers(x);i.set("Accept","application/json"),i.set("Content-Type","application/json"),i.set("Origin",a.origin);let s=AbortSignal.timeout(3e4),n=r?AbortSignal.any([r,s]):s,l=new URL("/_emdash/api/plugins/rapier-media/"+e,a),h;try{h=await y.fetch(new Request(l,{method:t===void 0?"GET":"POST",headers:i,...t===void 0?{}:{body:JSON.stringify(t)},redirect:"error",signal:n}))}catch{throw r?.throwIfAborted(),ps(os("requestFailed",{status:"network"}),ei.removeFix)}if(!h.ok)throw ps(os("requestFailed",{status:h.status}),[401,403].includes(h.status)?o:ei.removeFix);let p;try{p=await h.json()}catch{throw ps(ei.responseInvalid,ei.removeFix)}if(p?.success===!0&&p.data===null&&e==="removal-status")return null;if(p?.success!==!0||!p.data||typeof p.data!="object"||Array.isArray(p.data))throw ps(ei.responseInvalid,ei.removeFix);return p.data}}}function Vs(e,t){let i=/^(\d+)\.(\d+)\.(\d+)(?:\+[^ ]+)?$/.exec(e??""),s=t.split(".").map(Number);if(!i)return!1;for(let e=0;e<3;e++)if(+i[e+1]!==s[e])return+i[e+1]>s[e];return!0}function Os(e,t){if(e&&t&&e.pkg.version!==t.pkg.version)throw ps(`EmDash ${e.pkg.version} and @emdash-cms/cloudflare ${t.pkg.version} must match.`,`Install emdash@${e.pkg.version} and @emdash-cms/cloudflare@${e.pkg.version} together.`)}async function js(t,i,s,r,a){let n=i?[i]:String(s.npm_config_package??"").split(`\n\n`).filter(Boolean);if(!i&&n.length>1&&n.some(e=>/\.tgz$/i.test(e)))throw ps(ei.ambiguousPackage,ei.ambiguousPackageFix);let o=n.length===1&&/\.tgz$/i.test(n[0])?n[0]:null;if(i&&!o)throw ps(ei.localPackage,ei.localPackageFix);if(!o)return{spec:`${a}@${r}`,name:a,local:null};let l;try{l=o.startsWith("file://")?b(o):c(t,o.replace(/^file:/,""))}catch(e){throw ps(os("packageRead",{detail:e.message}),ei.packageReadFix)}let h,p,u,d=0;try{let t=await e(l);u=x("sha512").update(t).digest("base64"),h=w(t,{maxOutputLength:Rs});for(let e=0;e+512<=h.length;){let t=h.toString("utf8",e,e+100).replace(/\0.*$/,""),i=h.toString("utf8",e+345,e+500).replace(/\0.*$/,""),s=i?`${i}/${t}`:t;if(!s)break;let r=Number.parseInt(h.toString("ascii",e+124,e+136).replace(/\0.*$/,"").trim(),8);if(!Number.isSafeInteger(r)||r<0||e+512+r>h.length)throw new Error("invalid tar header");if(s.replace(/^\/+/,"")==="package/package.json"){if(++d>1)throw new Error("duplicate package/package.json in tarball");p=JSON.parse(h.toString("utf8",e+512,e+512+r))}e+=512+Math.ceil(r/512)*512}}catch(e){throw ps(os("packageRead",{detail:e.message}),ei.packageReadFix)}if(p?.name!==a||!Is(p.exports?.["./emdash"]))throw ps(ei.packageMissing,ei.packageMissingFix);return{spec:l,name:p.name,local:l,version:p.version,digest:u}}async function Fs(e,t){if(t.packageManager!==void 0&&typeof t.packageManager!="string")throw ps(ei.managerType,ei.managerTypeFix);let i=t.packageManager?.split("@")[0],s=new Set(await ci(e));if(i&&!["npm","pnpm","yarn","bun"].includes(i))throw ps(os("managerUnsupported",{manager:i}),ei.managerUnsupportedFix);if(s.size>1&&!i)throw ps(ei.managerAmbiguous,ei.managerAmbiguousFix);return i??[...s][0]??"npm"}function Ds(e,t,i,s,r=!1){let a=t==="npm"?["install","--save-prod","--save-exact","--no-audit","--no-fund",...i]:t==="pnpm"?["add","--save-prod","--save-exact",...i]:["add","--exact",...i];return new Promise((i,n)=>{let o=g(...di(t,a,{cwd:e,env:s,quiet:r}));o.once("error",e=>n(ps(os("managerRun",{manager:t,detail:e.message}),os("managerRunFix",{manager:t})))),o.once("exit",(e,s)=>e===0?i():n(ps(os("managerExit",{manager:t,reason:s??os("managerExitCode",{code:e})}),ei.managerExitFix)))})}async function Ms({cwd:t,version:s,name:r="rapier-jxl",packagePath:a,workersPaid:n,dryRun:o=!1,confirmWorkersPaid:l=Es,stdout:p,env:c=process.env,quiet:u=!1,installPackages:d=Ds}){let f=h(t,"astro.config.mjs"),g=await i(f).catch(()=>null);if(!g?.isFile()||g.isSymbolicLink()||g.nlink!==1)throw ps(ei.configFile,ei.configFileFix);let y=await e(f,"utf8"),w=await _s(h(t,"package.json")),k=r,b=gs(y,{name:k}),v=null,S,E=e=>w?.dependencies?.[e]??w?.devDependencies?.[e]??w?.optionalDependencies?.[e];if(!w||!E("emdash")||!E("astro"))throw ps(ei.siteMissing,ei.siteMissingFix);if(n!==void 0&&typeof n!="boolean"||b.storage!=="r2"&&n!==void 0)throw ps(ei.workersChoice,ei.workersChoiceFix);if(b.storage==="r2"){let e=ys(y,!1,{inspect:!0});if(e.cpuLimitMs===3e4&&n===!1)throw ps(ei.workersDowngrade,ei.workersDowngradeFix);if(v=await Ss(t,w,c),n===void 0&&[10,3e4].includes(e.cpuLimitMs)&&(n=e.cpuLimitMs===3e4),n===void 0){if(typeof l!="function")throw ps(ei.workersChoice,ei.workersChoiceFix);if(n=await l(ei.workersQuestion,{env:c}),typeof n!="boolean")throw ps(ei.workersAnswer,ei.workersChoiceFix)}S=n?3e4:10,b=gs(y,{cpuLimitMs:S,name:k}),v.plan=vs(v.source,{filename:v.name,cpuLimitMs:S}),await Cs({path:f,info:g,source:y}),await Cs(v,!0)}let C=JSON.stringify(w.scripts??{}),_=async()=>{if(!v)return;let e=await _s(h(t,"package.json"));if(!e||JSON.stringify(e.scripts??{})!==C)throw ps(ei.workersChanged,ei.workersChangedFix);if((await Ss(t,e,c)).path!==v.path)throw ps(ei.workersChanged,ei.workersChangedFix);await Cs(v,!0)},A=await js(t,a,c,s,k);A.name!==k&&(k=A.name,b=gs(y,{cpuLimitMs:S,name:k}));let I=await As(t,k),P=await As(t,"emdash");b.storage==="r2"&&Os(P,await As(t,"@emdash-cms/cloudflare"));let T=P&&await As(P.root,"@emdash-cms/admin"),N=T&&await As(T.root,"@cloudflare/kumo");if(!N||!Vs(N.pkg.version,"2.6.0"))throw ps(ei.adminMissing,ei.adminMissingFix);let L=await As(t,"@cloudflare/kumo");if(w.dependencies?.["@cloudflare/kumo"]&&L&&L.pkg.version!==N.pkg.version)throw ps(os("kumoMismatch",{siteVersion:L.pkg.version,hostVersion:N.pkg.version}),os("kumoMismatchFix",{hostVersion:N.pkg.version}));let V=[["emdash","1.5.0"],["astro","6.0.0"],["@astrojs/react","5.0.0"],["react","18.0.0"],["@cloudflare/kumo","2.6.0"],...b.storage==="r2"?[["@emdash-cms/cloudflare","1.5.0"]]:[]],O=[];(A.local||!w.dependencies?.[k]||!await Ns(I))&&O.push(A.spec),(!w.dependencies?.["@cloudflare/kumo"]||!L)&&O.push(`@cloudflare/kumo@${N.pkg.version}`);for(let[e,i]of V){let s=await As(t,e);if(s&&!Vs(s.pkg.version,i))throw ps(os("dependencyOld",{dependency:e,minimum:i,version:s.pkg.version}),os("dependencyOldFix",{dependency:e}));!s&&!O.length&&O.push(A.spec)}if(o){let e=[...v?.plan.changed?[v.name]:[],...b.changed?["astro.config.mjs"]:[]],t=O.map(e=>e===A.local?ei.tarball:e);return p(os("dryRun",{packages:t.length?t.join(ei.packageSeparator):ei.dryRunNone,files:e.length?e.join(ei.packageSeparator):ei.dryRunNone})),{changed:e.length>0,installed:!1,dryRun:!0,packages:t,files:e,...v?{cpuLimitMs:S}:{}}}let R=[...v?[{...v,worker:!0}]:[],{path:f,info:g,source:y,plan:b,worker:!1}],j=O.length?await Fs(t,w):null,F=new Map(R.filter(e=>e.plan.changed).map(e=>[m(e.path),e.plan.source]));return await as(t,"emdash",s,F,{...O.length&&{install:{files:pi,run:async()=>{p(os("installing",{packages:O.map(e=>e===A.local?ei.tarball:e).join(ei.packageSeparator),manager:j})),await d(t,j,O,c,u)}}},beforeWrite:async()=>{let i=await As(t,k);if(!await Ns(i))throw ps(ei.installedMissing,ei.installedMissingFix);if(A.local&&(i.pkg.version!==A.version||x("sha512").update(await e(A.local)).digest("base64")!==A.digest))throw ps(ei.packageChanged,ei.packageChangedFix);for(let[e,i]of V){let s=await As(t,e);if(!s||!Vs(s.pkg.version,i))throw ps(os("dependencyMissing",{dependency:e,minimum:i}),os("dependencyMissingFix",{dependency:e}))}if(b.storage==="r2"&&Os(await As(t,"emdash"),await As(t,"@emdash-cms/cloudflare")),(await As(t,"@cloudflare/kumo"))?.pkg.version!==N.pkg.version)throw ps(ei.kumoInstalledMismatch,os("kumoInstalledFix",{hostVersion:N.pkg.version}));await _();for(let e of R)await Cs(e,e.worker)}}),v?.plan.changed&&p(os("updatedWrangler",{file:v.name})),p(b.changed?ei.updated:os("alreadyAdded")),p(os("added",{setupAfter:Qt.setupAfter})),p(ei.nativePage),{changed:b.changed||v?.plan.changed===!0,installed:O.length>0,packages:O.map(e=>e===A.local?ei.tarball:e),files:R.filter(e=>e.plan.changed).map(e=>e.worker?v.name:"astro.config.mjs"),...v?{cpuLimitMs:S}:{}}}function Us(e,t){if(!e||typeof e!="object"||Array.isArray(e)||!Bs(e.id)||!Bs(e.siteId)||typeof e.scope!="string"||!e.scope||!["draining","restoring","verifying","complete","blocked"].includes(e.phase)||e.retirementDisabled!==!0||![0,1].includes(e.activeWriters)||e.remaining!==null&&(!Number.isSafeInteger(e.remaining)||e.remaining<0)||!Number.isSafeInteger(e.restored)||e.restored<0||e.error!==null&&(!e.error||typeof e.error!="object"||Array.isArray(e.error)||typeof e.error.code!="string"))throw ps(ei.responseInvalid,ei.removeFix);if(t&&["id","siteId","scope"].some(i=>t[i]!==void 0&&e[i]!==t[i]))throw ps(ei.restorationMismatch,ei.removeFix);if(e.phase==="complete"){let t=e.proof;if(e.remaining!==0||e.activeWriters!==0||e.error!==null||!t||typeof t!="object"||Array.isArray(t)||t.kind!=="originals-restored"||["id","siteId","scope"].some(i=>t[i]!==e[i])||!Bs(t.revision)||t.remaining!==0||t.activeWriters!==0||t.retirementDisabled!==!0)throw ps(ei.restorationFailed,ei.removeFix)}else if(e.proof!==null)throw ps(ei.responseInvalid,ei.removeFix);return e}async function qs({cwd:s,url:r,name:p="rapier-jxl",stdout:c,env:u=process.env,signal:d,connect:f=Ls}){let m=h(s,"astro.config.mjs"),g=await i(m).catch(()=>null);if(!g?.isFile()||g.isSymbolicLink()||g.nlink!==1)throw ps(ei.configFile,ei.removeFix);let x=await e(m,"utf8"),w=xs(x,p),k=await rs(s,"emdash");if(!w.changed&&!k)return c(os("alreadyRemoved")),{changed:!1};let b=e=>ns("emdash",e,{cwd:s,stdout(){}});k&&await b(["--dry-run"]);let v=await _s(h(s,"package.json")),S=e=>v?.dependencies?.[e]??v?.devDependencies?.[e]??v?.optionalDependencies?.[e];if(!v||!S("emdash")||!S("astro"))throw ps(ei.siteMissing,ei.siteMissingFix);let E=await f({cwd:s,url:r,env:u,signal:d}),C=await E.request("removal-status");if(C===null){let e=y().replaceAll("-","");C=Us(await E.request("removal-start",{id:e}),{id:e})}else C=Us(C);let _={id:C.id,siteId:C.siteId,scope:C.scope},A=-1;for(;C.phase!=="complete";){if(d?.throwIfAborted(),C.phase==="blocked"||C.error!==null)throw ps(ei.restorationFailed,ei.removeFix);C.restored!==A&&(A=C.restored,c(os("restoring",{count:A}))),C=Us(await E.request("removal-advance",_),_),C.phase==="draining"&&C.activeWriters>0&&await new Promise((e,t)=>{let i=()=>{clearTimeout(s),d.removeEventListener("abort",i),t(d.reason)},s=setTimeout(()=>{d?.removeEventListener("abort",i),e()},250);d?.addEventListener("abort",i,{once:!0}),d?.aborted&&i()})}let I=Us(await E.request("removal-status"),_);if(I.phase!=="complete")throw ps(ei.restorationFailed,ei.removeFix);d?.throwIfAborted();let P=await i(m).catch(()=>null);if(!P?.isFile()||P.isSymbolicLink()||P.nlink!==1||P.ino!==g.ino||P.dev!==g.dev||P.mode!==g.mode||await e(m,"utf8")!==x)throw ps(os("configChanged",{action:ei.removal}),ei.configChangedFix);if(k&&await b([]),!k?.includes("astro.config.mjs")){let e=await a(h(s,".rapier-jxl-"));try{let i=h(e,"astro.config.mjs");await t(i,w.source,{mode:g.mode&511}),await o(i,g.mode&511),await n(i,m)}finally{await l(e,{recursive:!0,force:!0})}}return c(os("removed")),c(ei.restartRemoved),{changed:!0,origin:E.origin,proof:I.proof}}
1
+ /*! rapier-jxl 8.4.1 | MIT */
2
+ function F(e,t){let i=65536;for(let s=0;s<t.length;s+=2){if(i+=t[s],i>e)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function M(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&R.test(String.fromCharCode(e)):t===!1?!1:F(e,I)}function D(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&j.test(String.fromCharCode(e)):t===!1?!1:F(e,I)||F(e,A)}function U(e,t){return new B(e,{beforeExpr:!0,binop:t})}function G(e,t={}){return t.keyword=e,$[e]=new B(e,t)}function Q(e){return e===10||e===13||e===8232||e===8233}function K(e,t,i=e.length){for(let s=t;s<i;s++){let t=e.charCodeAt(s);if(Q(t))return s<i-1&&t===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}function re(e){return se[e]||(se[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ae(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function he(e,t){for(let i=1,s=0;;){let r=K(e,s,t);if(r<0)return new oe(i,t-s);++i,s=r}}function ue(e){let t={};for(let i in pe)t[i]=e&&te(e,i)?e[i]:pe[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ce&&typeof console=="object"&&console.warn&&(ce=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ie(t.onToken)){let e=t.onToken;t.onToken=t=>e.push(t)}if(ie(t.onComment)&&(t.onComment=de(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function de(e,t){return function(i,s,r,a,n,o){let l={type:i?"Block":"Line",value:s,start:r,end:a};e.locations&&(l.loc=new le(this,n,o)),e.ranges&&(l.range=[r,a]),t.push(l)}}function fe(e,t){return 2|(e?4:0)|(t?8:0)}function Ee(e,t){let i=t+1,s=Math.min(e.input.length,t+11);for(;i<s;){let t=e.fullCharCodeAt(i);if(!D(t,!0))break;i+=t<=65535?1:2}return i===t+2&&e.input.slice(t,i)==="in"||i===t+10&&e.input.slice(t,i)==="instanceof"}function Ve(e,t){let i=t.key.name,s=e[i],r="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(r=(t.static?"s":"i")+t.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(e[i]="true",!1):s?!0:(e[i]=r,!1)}function Oe(e,t){let{computed:i,key:s}=e;return!i&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.value===t)}function Be(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Be(e.expression)}function Ue(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Ue(e.expression)||e.type==="ParenthesizedExpression"&&Ue(e.expression)}function Je(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}function ft(e){let t=dt[e]={binary:re(it[e]+" "+at),binaryOfStrings:re(rt[e]),nonBinary:{General_Category:re(at),Script:re(ut[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}function wt(e){for(let t in e)return!0;return!1}function kt(e){return e===105||e===109||e===115}function bt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}function vt(e){return M(e,!0)||e===36||e===95}function St(e){return D(e,!0)||e===36||e===95||e===8204||e===8205}function Et(e){return e>=65&&e<=90||e>=97&&e<=122}function Ct(e){return e>=0&&e<=1114111}function Pt(e){return e===100||e===68||e===115||e===83||e===119||e===87}function Nt(e){return Et(e)||e===95}function Tt(e){return Nt(e)||Rt(e)}function Lt(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Vt(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}function Ot(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}function Rt(e){return e>=48&&e<=57}function jt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ft(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}function Mt(e){return e>=48&&e<=55}function Ut(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function qt(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}function Gt(e,t){return be.parse(e,t)}function Ht(e,t,i){return be.parseExpressionAt(e,t,i)}function zt(e,t){return be.tokenizer(e,t)}function Kt(e,t={}){return e.replace(/\{(\w+)\}/g,(e,i)=>String(t[i]))}function li(e){if(!Array.isArray(e))throw oi("JXL_OPTIONS","args: array of strings","use: string[]");let t=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s!="string")throw oi("JXL_OPTIONS","arg: string","each: string");t.push(s)}return t}async function ci(e){for(let t=e;;t=ai(t)){let e=[];for(let[i,s]of hi)await ri(ni(t,i)).catch(()=>null)&&e.push(s);if(e.length)return[...new Set(e)];if(ai(t)===t)return[]}}function ui(e){let t=String(e);if(/[%\0\r\n]/.test(t))throw oi("JXL_SETUP",`${t} has % or a line break, which Windows' shell would run`,"rename or move the file so its path has neither");return`"${t.replace(/"/g,'""')}"`}function di(e,t,{cwd:i,env:s=process.env,platform:r=process.platform,execPath:a=process.execPath,quiet:n=!1}){let o=n?["ignore","ignore","inherit"]:"inherit";return e==="npm"&&s.npm_execpath&&/(?:^|[/\\])npm(?:-cli)?\.(?:c?js|mjs)$/.test(s.npm_execpath)?[a,[s.npm_execpath,...t],{cwd:i,env:s,stdio:o,shell:!1}]:r==="win32"?[[e,...t.map(ui)].join(" "),[],{cwd:i,env:s,stdio:o,shell:!0}]:[e,t,{cwd:i,env:s,stdio:o,shell:!1}]}async function qi(e,t=0){if(t>40)throw Object.assign(new Error("Symbolic link loop"),{code:"ELOOP"});try{return await Ai(e)}catch(e){if(!["ENOENT","ENOTDIR"].includes(e.code))throw e}if((await Si(e).catch(()=>null))?.isSymbolicLink())return qi(Fi(Vi(e),await _i(e)),t+1);let i=Vi(e);return i===e?e:Ri(await qi(i,t),Li(e))}async function Wi(e,t,i){let s=await Ai(e),r=[];for(let a of t){if(typeof a!="string"||a.includes("\0"))throw i("A project file path is invalid","use a plain relative path inside this folder");let t;try{t=await qi(Fi(e,a))}catch(t){throw t?.code==="ELOOP"?i(`${ji(e,Fi(e,a))||a} has a symbolic link loop`,"replace the link with a folder or file"):t}if(!Bi(s,t))throw i(`${ji(e,Fi(e,a))||a}: outside folder (${t})`,"replace symlink or run in target folder");let n=ji(s,t);if(process.platform==="win32"&&n.split(/[\\/]/).some(e=>Ui.test(e)||/[ .]$/.test(e)))throw i(`${n} uses a reserved Windows file name`,"rename the file or folder");r.push(t)}return r}async function $i(e,t){await Ei(Vi(e),{recursive:!0});let i=Ri(Vi(e),`.${Li(e)}.${Ti(6).toString("hex")}.tmp`);try{await Ni(i,t,{flag:"wx"}),await Ii(i,e)}catch(e){throw await Pi(i,{force:!0}).catch(()=>{}),e}}async function rs(e,t){let[i]=await Wi(e,[Gi(t)],zi),s=await Ji(i);if(s===null)return null;let r;try{r=JSON.parse(s)}catch{throw zi("The add record is not JSON")}if(!Xi(r)||r.place!==t||r.schema!==1||!Xi(r.files)||!Array.isArray(r.dirs)||!r.dirs.every(e=>ss(t,e)))throw zi("The add record does not describe this place");for(let[e,i]of Object.entries(r.files))if(!is(t,e)||!Xi(i)||!(i.before===null||typeof i.before=="string"&&Buffer.from(i.before,"base64").toString("base64")===i.before)||!(i.after===null||typeof i.after=="string"&&/^[a-f0-9]{64}$/.test(i.after))||!(i.mode===null||Number.isInteger(i.mode)&&i.mode>=0&&i.mode<=511))throw zi("The add record names an invalid file");if(r.pending)throw zi("An earlier add did not finish installing its dependencies");return await Wi(e,[...Object.keys(r.files),...r.dirs],zi),r}async function as(e,t){let i=await rs(e,t);return i?Object.keys(i.files):null}async function ns(e,t,i,s,{dryRun:r=!1,install:a,beforeWrite:n}={}){let o=await rs(e,t),l=[...new Set([...s.keys(),...a?.files??[]])];if(l.some(e=>!is(t,e)))throw zi("The setup names a file outside its place");let h=await Wi(e,[Gi(t),...l],zi),p=new Map,c={...o?.files},u=new Set(o?.dirs??[]);for(let[t,i]of l.entries()){let r=await Ji(h[t+1]);if(p.set(i,r),c[i]&&!Ki(r,c[i].after))throw zi(`${i} changed after add wrote it`);c[i]={before:c[i]?c[i].before:r===null?null:r.toString("base64"),mode:c[i]?c[i].mode:r===null?null:(await mi(h[t+1])).mode&511,after:s.has(i)?Hi(s.get(i)):Qi(r)};for(let t=wi(i);t!==".";t=wi(t))try{await mi(ki(e,t))}catch(e){if(e.code==="ENOENT")u.add(t.split(bi).join("/"));else throw e}}if(r)return;if(!l.length){await(n?.());return}let d={schema:1,place:t,version:i,files:c,dirs:[...u]},f=e=>$i(h[0],JSON.stringify({...d,...e&&{pending:!0}},null,2)+`\n`);if(await f(!!a),a){await a.run(),await Wi(e,[Gi(t),...l],zi);for(let t of a.files)c[t].after=Qi(await Ji(ki(e,t)));await f(!1)}await(n?.());let m=await Wi(e,[...s.keys()],zi);for(let t of s.keys())if(Qi(await Ji(ki(e,t)))!==Qi(p.get(t)))throw zi(`${t} changed while add ran`);for(let[e,[t,i]]of[...s].entries())await $i(m[e],i),c[t].mode!==null&&await yi(m[e],c[t].mode)}async function os(e,t,{cwd:i,stdout:s}){if(t=li(t),t.length===1&&["--help","-h"].includes(t[0])){s(`Usage: ${si} remove ${e} [--dry-run] [--json]`);return}if(t.some(e=>!["--dry-run","--json"].includes(e)))throw oi("JXL_OPTIONS","Unknown remove option",`run npx ${si} remove ${e} --help`);let r=t.includes("--dry-run"),a=await rs(i,e);if(!a)throw zi(`There is no add record for ${e}`);let n=Object.keys(a.files),o=await Wi(i,[...n,Gi(e),...a.dirs],zi),l=[];for(let[e,t]of n.entries()){let i=a.files[t],s=await Ji(o[e]),r=i.before===null?null:Buffer.from(i.before,"base64");if(Qi(s)!==Qi(r)){if(!Ki(s,i.after))throw zi(`${t} changed after add wrote it; no files were removed`);l.push({file:t,action:r===null?"removed":"restored",original:r,index:e})}}if(!r){for(let e of l){let t=o[e.index],i=a.files[e.file];e.original===null?await gi(t):(await $i(t,e.original),i.mode!==null&&await yi(t,i.mode))}for(let e of[...a.dirs].sort((e,t)=>t.length-e.length))await xi(ki(i,e)).catch(e=>{if(!["ENOENT","ENOTEMPTY","EEXIST"].includes(e.code))throw e});await gi(o[n.length])}let h=l.map(({file:e,action:t})=>({file:e,action:t}));if(t.includes("--json"))s(JSON.stringify({type:"remove",host:e,dryRun:r,changes:h}));else for(let{file:e,action:t}of h)s(`${e}: ${r?"would be ":""}${t}`)}async function us(e,t){if(e=li(e),e.length===1&&["--help","-h"].includes(e[0])){t.stdout(hs.trimEnd());return}let i,s,r=!1;for(let t=0;t<e.length;t++)if(e[t]==="--package"&&i===void 0&&e[t+1]&&!String(e[t+1]).startsWith("-"))i=e[++t];else if(["--workers-paid","--workers-free"].includes(e[t])&&s===void 0)s=e[t]==="--workers-paid";else if(e[t]==="--dry-run"&&!r)r=!0;else throw Object.assign(cs(ls("addOption",{option:e[t]}),ei.addHelpFix),{code:"JXL_OPTIONS"});return Bs({...t,packagePath:i,workersPaid:s,dryRun:r})}async function ds(e,t){if(e=li(e),e.length===1&&["--help","-h"].includes(e[0])){t.stdout(ps.trimEnd());return}let i;if(e.length){if(e.length!==2||e[0]!=="--url"||!e[1]||String(e[1]).startsWith("-"))throw Object.assign(cs(ls("removeOption",{option:e.find(e=>e!=="--url")??e[0]}),ei.removeHelpFix),{code:"JXL_OPTIONS"});i=e[1]}return Ws({...t,url:i})}function gs(e,t){if(e?.type!=="ObjectExpression")throw cs(ls("explicitObject",{property:t}));let i=e.properties.filter(e=>fs(e)===t);if(i.length!==1||i[0].kind!=="init"||i[0].method)throw cs(ls("explicitProperty",{property:t}));let s=i[0];if(e.properties.slice(e.properties.indexOf(s)+1).some(e=>e.type==="SpreadElement"||e.computed&&fs(e)===null))throw cs(ls("laterProperty",{property:t}));return s.value}function ys(e,t){try{return ws(e,!0,{name:t})}catch(e){let t=e?.fix?e.message.slice(0,-e.fix.length-2):String(e?.message??e);throw cs(t,ei.removeFix)}}function ws(e,t,{cpuLimitMs:i,inspect:s=!1,name:r="rapier-jxl"}={}){let a,n=[];try{a=Jt.parse(e,{sourceType:"module",ecmaVersion:"latest",onToken:n})}catch(e){throw cs(ls("configSyntax",{detail:e.message}),ei.configSyntaxFix)}let o=a.body.filter(e=>e.type==="ImportDeclaration"),l=(e,t)=>o.flatMap(i=>i.source.value===e?i.specifiers.filter(e=>t==="default"?e.type==="ImportDefaultSpecifier"||e.imported?.name==="default":e.type==="ImportSpecifier"&&(e.imported.name??e.imported.value)===t).map(e=>({name:e.local.name,node:i})):[]),h=l("emdash/astro","default");if(h.length!==1)throw cs(ei.emdashImport);let p=h[0],c=l("astro/config","defineConfig"),u=a.body.find(e=>e.type==="ExportDefaultDeclaration")?.declaration,d=u?.type==="ObjectExpression"?u:u?.arguments?.length===1&&c.some(e=>ms(u,e.name))?u.arguments[0]:null;if(d?.type!=="ObjectExpression")throw cs(ei.configDynamic);let f=gs(d,"integrations");if(f.type!=="ArrayExpression"||f.elements.some(e=>e?.type==="SpreadElement"))throw cs(ei.explicitIntegrations);let m=l("@astrojs/react","default");if(!t&&!f.elements.some(e=>m.some(t=>ms(e,t.name))))throw cs(ei.reactMissing,ei.reactFix);let g=l(`${r}/emdash`,"jxl"),x=e=>g.some(t=>ms(e,t.name))&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===p.name,y=f.elements.filter(e=>ms(e,p.name)||x(e));if(y.length!==1)throw cs(ei.oneIntegration);let w=y[0],k=x(w),b=w.arguments[k?1:0];if(!k&&w.arguments.length!==1||k&&![2,3].includes(w.arguments.length)||b?.type!=="ObjectExpression"||k&&w.arguments.length===3&&w.arguments[2]?.type!=="ObjectExpression")throw cs(ei.explicitOptions);let v=gs(b,"storage"),S=l("emdash/astro","local"),E=l("@emdash-cms/cloudflare","r2"),C=S.some(e=>ms(v,e.name))?"local":E.some(e=>ms(v,e.name))?"r2":null;if(!C)throw cs(ei.explicitStorage);if(s||i!==void 0){if(i!==void 0&&(C!=="r2"||![10,3e4].includes(i)))throw cs(ei.workersChoice,ei.workersChoiceFix);if(s&&C!=="r2")return{storage:C,cpuLimitMs:null};let e=gs(d,"adapter");if(!l("@astrojs/cloudflare","default").some(t=>ms(e,t.name))||e.arguments.length>1||e.arguments.length===1&&e.arguments[0].type!=="ObjectExpression")throw cs(ei.workersEnvironment,ei.workersEnvironmentFix);let t=e=>{if(!(!e||typeof e!="object")){if(e.type==="SpreadElement"||e.type==="Property"&&(e.computed&&fs(e)===null||["config","configPath","wranglerConfig","environment","env"].includes(fs(e))))throw cs(ei.workersEnvironment,ei.workersEnvironmentFix);for(let i of Object.values(e))Array.isArray(i)?i.forEach(t):i&&typeof i=="object"&&t(i)}};e.arguments.forEach(t);let r=k?w.arguments[2]:null;if(r&&r.properties.some(e=>e.type!=="Property"||e.method||e.kind!=="init"||e.computed&&fs(e)===null))throw cs(ei.workersHost,ei.workersHostFix);let a=r?.properties.filter(e=>fs(e)==="cpuLimitMs")??[];if(a.length>1||a.length&&(a[0].value.type!=="Literal"||typeof a[0].value.value!="number"))throw cs(ei.workersHost,ei.workersHostFix);if(s)return{storage:C,cpuLimitMs:a[0]?.value.value??null}}if(t){if(!k)return{source:e,changed:!1,storage:C};let t=g.find(e=>ms(w,e.name)),i=n.find(e=>e.start>=w.callee.end&&e.end<=w.end),s=n.find(e=>e.start>=w.arguments[0].end&&e.end<=b.start&&e.type.label===",");if(i?.type.label!=="("||!s)throw cs(ei.directWrapper);let r=[{start:w.callee.start,end:w.callee.end,text:p.name},{start:i.end,end:s.end+ +(e[s.end]===" "),text:""}];if(w.arguments.length===3){let e=n.find(e=>e.start>=b.end&&e.end<=w.arguments[2].start&&e.type.label===","),t=n.find(e=>e.end===w.end&&e.type.label===")");if(!e||!t)throw cs(ei.directWrapper);r.push({start:e.start,end:t.start,text:""})}if(!n.some(e=>e.type.label==="name"&&e.value===t.name&&!(e.start>=t.node.start&&e.end<=t.node.end)&&!(e.start>=w.callee.start&&e.end<=w.callee.end))){let i=t.node,s=i.specifiers.filter(e=>e.type==="ImportSpecifier"),a=s.findIndex(e=>e.local.name===t.name);if(i.specifiers.length===1){let t=/^\r?\n/.exec(e.slice(i.end))?.[0]??"";r.push({start:i.start,end:i.end+t.length,text:""})}else if(s.length===1){let e=n.find(e=>e.start>=i.start&&e.end<=s[0].start&&e.type.label===","),t=n.find(e=>e.start>=s[0].end&&e.end<=i.source.start&&e.type.label==="}");if(!e||!t)throw cs(ei.explicitWrapperImport);r.push({start:e.start,end:t.end,text:""})}else if(a>0){let e=n.find(e=>e.start>=s[a-1].end&&e.end<=s[a].start&&e.type.label===",");if(!e)throw cs(ei.explicitWrapperImport);r.push({start:e.start,end:s[a].end,text:""})}else{let e=n.find(e=>e.start>=s[a].end&&e.end<=s[a+1].start&&e.type.label===",");if(!e)throw cs(ei.explicitWrapperImport);r.push({start:s[a].start,end:e.end,text:""})}}let a=e;for(let e of r.sort((e,t)=>t.start-e.start))a=a.slice(0,e.start)+e.text+a.slice(e.end);return Jt.parse(a,{sourceType:"module",ecmaVersion:"latest"}),{source:a,changed:!0,storage:C}}if(k&&i===void 0)return{source:e,changed:!1,storage:C};let _=[];if(i!==void 0){let t=k?w.arguments[2]:null;if(t){let s=t.properties.find(e=>fs(e)==="cpuLimitMs");s&&s.value.value!==i?_.push({start:s.value.start,end:s.value.end,text:String(i)}):s||_.push(bs(e,t,`cpuLimitMs: ${i}`))}else{let e=n.find(e=>e.end===w.end&&e.type.label===")");if(!e)throw cs(ei.directWrapper);let t=n[n.indexOf(e)-1];_.push({start:e.start,end:e.start,text:`${t?.type.label===","?"":","} {cpuLimitMs: ${i}}`})}}if(k){let t=ks(e,_);return Jt.parse(t,{sourceType:"module",ecmaVersion:"latest"}),{source:t,changed:t!==e,storage:C}}let A=new Set(n.filter(e=>e.type.label==="name").map(e=>e.value)),I=g[0]?.name??"jxl",P=1;if(!g.length)for(;A.has(I);)I=P===1?"rapierJxl":`rapierJxl${P}`,P++;let N=n.find(e=>e.start>=w.callee.end&&e.end<=w.end);if(N?.type.label!=="(")throw cs(ei.directEmdash);let T=[..._,{start:w.callee.start,end:w.callee.end,text:I},{start:N.end,end:N.end,text:`${p.name}, `}];if(!g.length){let t=e[p.node.source.start]==='"'?'"':"'",i=e.includes(`\r\n`)?`\r\n`:`\n`;T.push({start:p.node.start,end:p.node.start,text:`import {jxl${I==="jxl"?"":` as ${I}`}} from ${t}${r}/emdash${t};${i}`})}let L=e;for(let e of T.sort((e,t)=>t.start-e.start))L=L.slice(0,e.start)+e.text+L.slice(e.end);return Jt.parse(L,{sourceType:"module",ecmaVersion:"latest"}),{source:L,changed:!0,storage:C}}function ks(e,t){for(let i of t.sort((e,t)=>t.start-e.start))e=e.slice(0,i.start)+i.text+e.slice(i.end);return e}function bs(e,t,i){let s=e.slice(t.start,t.end).includes(`\n`),r=e.includes(`\r\n`)?`\r\n`:`\n`,a=t.properties[0],n=a?e.slice(e.lastIndexOf(`\n`,a.start)+1,a.start):"",o=a&&/^[\t ]*$/.test(n)?n:e.includes("\t")?"\t":" ";return{start:t.start+1,end:t.start+1,text:`${s?r+o:""}${i}${t.properties.length?",":""}${s?"":t.properties.length?" ":""}`}}function vs(e,t){let i,s=[];try{t.endsWith(".json")&&JSON.parse(e.replace(/^\ufeff/,"")),i=Jt.parse("("+e+`\n)`,{ecmaVersion:"latest",onToken:s}).body[0]?.expression;let r=t=>{if(t?.type==="ObjectExpression"){let i=new Set;for(let s of t.properties){if(s.type!=="Property"||s.computed||s.method||s.shorthand||s.kind!=="init"||s.key.type!=="Literal"||typeof s.key.value!="string")throw new TypeError;if(JSON.parse(("("+e).slice(s.key.start,s.key.end))!==s.key.value||i.has(s.key.value))throw new TypeError;i.add(s.key.value),r(s.value)}}else if(t?.type==="ArrayExpression")t.elements.forEach(r);else if(t?.type==="Literal"||t?.type==="UnaryExpression"&&t.operator==="-"&&t.argument.type==="Literal"){let i=JSON.parse(("("+e).slice(t.start,t.end));if(i!==null&&!["number","boolean","string"].includes(typeof i)||typeof i=="number"&&!Number.isFinite(i))throw new TypeError}else throw new TypeError};if(i?.type!=="ObjectExpression")throw new TypeError;r(i)}catch{throw cs(ei.workersJson,ei.workersSourceFix)}let r=e=>{if(!(!e||typeof e!="object")){typeof e.start=="number"&&(e.start--,e.end--);for(let t of Object.values(e))Array.isArray(t)?t.forEach(r):t&&typeof t=="object"&&r(t)}};return r(i),s=s.filter(t=>t.start>0&&t.end<=e.length+1).map(e=>({...e,start:e.start-1,end:e.end-1})),{ast:i,tokens:s}}function Ss(e,{filename:t="wrangler.jsonc",cpuLimitMs:i}={}){if(!["wrangler.json","wrangler.jsonc"].includes(t)||![10,3e4].includes(i))throw cs(ei.workersSource,ei.workersSourceFix);let{ast:s,tokens:r}=vs(e,t),a=(e,t)=>e.properties.find(e=>e.key.value===t),n=a(s,"env"),o=a(s,"pages_build_output_dir");if(n&&(n.value.type!=="ObjectExpression"||n.value.properties.length)||o)throw cs(ei.workersEnvironment,ei.workersEnvironmentFix);let l=a(s,"limits");if(l&&l.value.type!=="ObjectExpression")throw cs(ei.workersJson,ei.workersSourceFix);let h=l&&a(l.value,"cpu_ms");if(h&&(h.value.type!=="Literal"||typeof h.value.value!="number"||h.value.value<=0))throw cs(ei.workersJson,ei.workersSourceFix);let p=[];if(i===3e4)h&&h.value.value!==3e4?p.push({start:h.value.start,end:h.value.end,text:"30000"}):!h&&l?p.push(bs(e,l.value,'"cpu_ms": 30000')):l||p.push(bs(e,s,'"limits": {"cpu_ms": 30000}'));else if(h){let e=l.value.properties,t=e.indexOf(h),i=r.find(e=>e.type.label===":"&&e.start>=h.key.end&&e.end<=h.value.start);if(!i)throw cs(ei.workersJson,ei.workersSourceFix);if(p.push({start:h.key.start,end:h.key.end,text:""},{start:i.start,end:i.end,text:""},{start:h.value.start,end:h.value.end,text:""}),t>0){let i=r.find(i=>i.type.label===","&&i.start>=e[t-1].end&&i.end<=h.start);if(!i)throw cs(ei.workersJson,ei.workersSourceFix);p.push({start:i.start,end:i.end,text:""})}else{let t=e[1]?.start??l.value.end-1,i=r.find(e=>e.type.label===","&&e.start>=h.end&&e.end<=t);i&&p.push({start:i.start,end:i.end,text:""})}}let c=ks(e,p);return vs(c,t),{source:c,changed:c!==e,cpuLimitMs:i}}async function Es(t,s,r){if(r.CLOUDFLARE_ENV||r.WRANGLER_ENV||r.WRANGLER_CONFIG||r.WRANGLER_CONFIG_FILE||Object.values(s.scripts??{}).some(e=>typeof e=="string"&&(/\bCLOUDFLARE_ENV\s*=/.test(e)||/\b(?:wrangler|astro|vite)\b/.test(e)&&/(?:--(?:env|config)(?:[=\s]|$)|(?:^|\s)-[ec](?:[=\s]|$))/.test(e))))throw cs(ei.workersEnvironment,ei.workersEnvironmentFix);if(await i(h(t,"cloudflare.config.ts")).catch(()=>null))throw cs(ei.workersSource,ei.workersSourceFix);let a=[];for(let e of["wrangler.jsonc","wrangler.json","wrangler.toml"]){let s=h(t,e),r=await i(s).catch(e=>{if(e.code==="ENOENT")return null;throw e});r&&a.push({path:s,info:r,name:e})}if(a.length!==1||a[0].name==="wrangler.toml"||!a[0].info.isFile()||a[0].info.isSymbolicLink()||a[0].info.nlink!==1)throw cs(ei.workersSource,ei.workersSourceFix);let n=a[0],o=await e(n.path,"utf8");return Ss(o,{filename:n.name,cpuLimitMs:10}),{...n,source:o}}async function Cs(e,{env:t}){if(!process.stdin.isTTY||!process.stdout.isTTY||t.CI)throw cs(ei.workersChoice,ei.workersChoiceFix);let i=S({input:process.stdin,output:process.stdout});try{let t=(await i.question(e+" [y/N] ")).trim().toLowerCase();if(["yes","y"].includes(t))return!0;if(["no","n",""].includes(t))return!1;throw cs(ei.workersAnswer,ei.workersChoiceFix)}finally{i.close()}}async function _s({path:t,info:s,source:r},a=!1){let n=await i(t).catch(()=>null);if(!n?.isFile()||n.isSymbolicLink()||n.nlink!==1||n.ino!==s.ino||n.dev!==s.dev||n.mode!==s.mode||await e(t,"utf8")!==r)throw a?cs(ei.workersChanged,ei.workersChangedFix):cs(ls("configChanged",{action:ei.setup}),ei.configChangedFix)}async function As(t){try{return JSON.parse(await e(t,"utf8"))}catch(e){if(e.code==="ENOENT")return null;throw cs(ls("manifest",{file:m(t),detail:e.message}),ei.manifestFix)}}async function Is(e,t){for(let i=e;;i=p(i)){let e=h(i,"node_modules",t),s=await As(h(e,"package.json"));if(s)return s.name===t?{root:await r(e),pkg:s}:null;if(p(i)===i)return null}}function Ps(e){if(typeof e=="string")return e;if(!e||typeof e!="object"||Array.isArray(e))return null;for(let[t,i]of Object.entries(e))if(["node","import","default"].includes(t)){let e=Ps(i);if(e)return e}return null}async function Ts(e,t){let i=Ps(e?.pkg.exports?.[t]);if(typeof i!="string"||!i.startsWith("./")||i.includes("\\")||i.split("/").includes(".."))return null;let a=await r(h(e.root,i)).catch(()=>null);return a&&Ns(e.root,a)&&(await s(a).catch(()=>null))?.isFile()?a:null}async function Ls(e){return!!await Ts(e,"./emdash")}async function Vs({cwd:t,url:i,env:s=process.env,signal:r}){let a;try{a=new URL(i??s.EMDASH_URL??"http://localhost:4321")}catch{throw cs(ei.removalUrl,ei.removalUrlFix)}let n=["localhost","127.0.0.1","[::1]"].includes(a.hostname);if(a.username||a.password||a.pathname!=="/"||a.search||a.hash||a.protocol!=="https:"&&!(n&&a.protocol==="http:"))throw cs(ei.removalUrl,ei.removalUrlFix);let o=ls("loginFix",{url:a.origin}),l=s.EMDASH_TOKEN,p;if(!l){let i=h(s.XDG_CONFIG_HOME||h(k(),".config"),"emdash","auth.json");try{p=JSON.parse(await e(i,"utf8"))?.[n?`path:${c(t)}`:a.origin]}catch(e){if(e.code!=="ENOENT")throw cs(ei.credentials,o)}if(p){if(typeof p.accessToken!="string"||!p.accessToken||typeof p.expiresAt!="string"||!Number.isFinite(Date.parse(p.expiresAt))||Date.parse(p.expiresAt)<=Date.now())throw cs(ei.credentials,o);l=p.accessToken}}if(!l&&!n||l!==void 0&&typeof l!="string")throw cs(ei.credentials,o);let u=await Is(t,"emdash"),d=u&&await Ts(u,"./client"),f=u&&await Ts(u,"./client/cf-access");if(!d||!f)throw cs(ei.removalClient,ei.removalClientFix);let m,g;try{m=await(import(v(d).href)),g=await(import(v(f).href))}catch{throw cs(ei.removalClient,ei.removalClientFix)}if(["createTransport","csrfInterceptor","tokenInterceptor","devBypassInterceptor"].some(e=>typeof m[e]!="function")||typeof g.parseHeaderStrings!="function")throw cs(ei.removalClient,ei.removalClientFix);let x;try{if(p?.customHeaders&&(typeof p.customHeaders!="object"||Array.isArray(p.customHeaders)||Object.values(p.customHeaders).some(e=>typeof e!="string")))throw new TypeError;x=new Headers({...p?.customHeaders,...g.parseHeaderStrings(String(s.EMDASH_HEADERS??"").split(`\n`))})}catch{throw cs(ei.credentialHeader,o)}let y=m.createTransport({interceptors:[m.csrfInterceptor(),l?m.tokenInterceptor(l):m.devBypassInterceptor(a.origin)]});return{origin:a.origin,async request(e,t){r?.throwIfAborted();let i=new Headers(x);i.set("Accept","application/json"),i.set("Content-Type","application/json"),i.set("Origin",a.origin);let s=AbortSignal.timeout(3e4),n=r?AbortSignal.any([r,s]):s,l=new URL("/_emdash/api/plugins/rapier-media/"+e,a),h;try{h=await y.fetch(new Request(l,{method:t===void 0?"GET":"POST",headers:i,...t===void 0?{}:{body:JSON.stringify(t)},redirect:"error",signal:n}))}catch{throw r?.throwIfAborted(),cs(ls("requestFailed",{status:"network"}),ei.removeFix)}if(!h.ok)throw cs(ls("requestFailed",{status:h.status}),[401,403].includes(h.status)?o:ei.removeFix);let p;try{p=await h.json()}catch{throw cs(ei.responseInvalid,ei.removeFix)}if(p?.success===!0&&p.data===null&&e==="removal-status")return null;if(p?.success!==!0||!p.data||typeof p.data!="object"||Array.isArray(p.data))throw cs(ei.responseInvalid,ei.removeFix);return p.data}}}function Os(e,t){let i=/^(\d+)\.(\d+)\.(\d+)(?:\+[^ ]+)?$/.exec(e??""),s=t.split(".").map(Number);if(!i)return!1;for(let e=0;e<3;e++)if(+i[e+1]!==s[e])return+i[e+1]>s[e];return!0}function Rs(e,t){if(e&&t&&e.pkg.version!==t.pkg.version)throw cs(`emdash: versions ${e.pkg.version} vs ${t.pkg.version}`,`install: emdash@${e.pkg.version} @emdash-cms/cloudflare@${e.pkg.version}`)}async function Fs(t,i,s,r,a){let n=i?[i]:String(s.npm_config_package??"").split(`\n\n`).filter(Boolean);if(!i&&n.length>1&&n.some(e=>/\.tgz$/i.test(e)))throw cs(ei.ambiguousPackage,ei.ambiguousPackageFix);let o=n.length===1&&/\.tgz$/i.test(n[0])?n[0]:null;if(i&&!o)throw cs(ei.localPackage,ei.localPackageFix);if(!o)return{spec:`${a}@${r}`,name:a,local:null};let l;try{l=o.startsWith("file://")?b(o):c(t,o.replace(/^file:/,""))}catch(e){throw cs(ls("packageRead",{detail:e.message}),ei.packageReadFix)}let h,p,u,d=0;try{let t=await e(l);u=x("sha512").update(t).digest("base64"),h=w(t,{maxOutputLength:js});for(let e=0;e+512<=h.length;){let t=h.toString("utf8",e,e+100).replace(/\0.*$/,""),i=h.toString("utf8",e+345,e+500).replace(/\0.*$/,""),s=i?`${i}/${t}`:t;if(!s)break;let r=Number.parseInt(h.toString("ascii",e+124,e+136).replace(/\0.*$/,"").trim(),8);if(!Number.isSafeInteger(r)||r<0||e+512+r>h.length)throw new Error("tar: header");if(s.replace(/^\/+/,"")==="package/package.json"){if(++d>1)throw new Error("duplicate package/package.json in tarball");p=JSON.parse(h.toString("utf8",e+512,e+512+r))}e+=512+Math.ceil(r/512)*512}}catch(e){throw cs(ls("packageRead",{detail:e.message}),ei.packageReadFix)}if(p?.name!==a||!Ps(p.exports?.["./emdash"]))throw cs(ei.packageMissing,ei.packageMissingFix);return{spec:l,name:p.name,local:l,version:p.version,digest:u}}async function Ms(e,t){if(t.packageManager!==void 0&&typeof t.packageManager!="string")throw cs(ei.managerType,ei.managerTypeFix);let i=t.packageManager?.split("@")[0],s=new Set(await ci(e));if(i&&!["npm","pnpm","yarn","bun"].includes(i))throw cs(ls("managerUnsupported",{manager:i}),ei.managerUnsupportedFix);if(s.size>1&&!i)throw cs(ei.managerAmbiguous,ei.managerAmbiguousFix);return i??[...s][0]??"npm"}function Ds(e,t,i,s,r=!1){let a=t==="npm"?["install","--save-prod","--save-exact","--no-audit","--no-fund",...i]:t==="pnpm"?["add","--save-prod","--save-exact",...i]:["add","--exact",...i];return new Promise((i,n)=>{let o=g(...di(t,a,{cwd:e,env:s,quiet:r}));o.once("error",e=>n(cs(ls("managerRun",{manager:t,detail:e.message}),ls("managerRunFix",{manager:t})))),o.once("exit",(e,s)=>e===0?i():n(cs(ls("managerExit",{manager:t,reason:s??ls("managerExitCode",{code:e})}),ei.managerExitFix)))})}async function Bs({cwd:t,version:s,name:r="rapier-jxl",packagePath:a,workersPaid:n,dryRun:o=!1,confirmWorkersPaid:l=Cs,stdout:p,env:c=process.env,quiet:u=!1,installPackages:d=Ds}){let f=h(t,"astro.config.mjs"),g=await i(f).catch(()=>null);if(!g?.isFile()||g.isSymbolicLink()||g.nlink!==1)throw cs(ei.configFile,ei.configFileFix);let y=await e(f,"utf8"),w=await As(h(t,"package.json")),k=r,b=xs(y,{name:k}),v=null,S,E=e=>w?.dependencies?.[e]??w?.devDependencies?.[e]??w?.optionalDependencies?.[e];if(!w||!E("emdash")||!E("astro"))throw cs(ei.siteMissing,ei.siteMissingFix);if(n!==void 0&&typeof n!="boolean"||b.storage!=="r2"&&n!==void 0)throw cs(ei.workersChoice,ei.workersChoiceFix);if(b.storage==="r2"){let e=ws(y,!1,{inspect:!0});if(e.cpuLimitMs===3e4&&n===!1)throw cs(ei.workersDowngrade,ei.workersDowngradeFix);if(v=await Es(t,w,c),n===void 0&&[10,3e4].includes(e.cpuLimitMs)&&(n=e.cpuLimitMs===3e4),n===void 0){if(typeof l!="function")throw cs(ei.workersChoice,ei.workersChoiceFix);if(n=await l(ei.workersQuestion,{env:c}),typeof n!="boolean")throw cs(ei.workersAnswer,ei.workersChoiceFix)}S=n?3e4:10,b=xs(y,{cpuLimitMs:S,name:k}),v.plan=Ss(v.source,{filename:v.name,cpuLimitMs:S}),await _s({path:f,info:g,source:y}),await _s(v,!0)}let C=JSON.stringify(w.scripts??{}),_=async()=>{if(!v)return;let e=await As(h(t,"package.json"));if(!e||JSON.stringify(e.scripts??{})!==C)throw cs(ei.workersChanged,ei.workersChangedFix);if((await Es(t,e,c)).path!==v.path)throw cs(ei.workersChanged,ei.workersChangedFix);await _s(v,!0)},A=await Fs(t,a,c,s,k);A.name!==k&&(k=A.name,b=xs(y,{cpuLimitMs:S,name:k}));let I=await Is(t,k),P=await Is(t,"emdash");b.storage==="r2"&&Rs(P,await Is(t,"@emdash-cms/cloudflare"));let N=P&&await Is(P.root,"@emdash-cms/admin"),T=N&&await Is(N.root,"@cloudflare/kumo");if(!T||!Os(T.pkg.version,"2.6.0"))throw cs(ei.adminMissing,ei.adminMissingFix);let L=await Is(t,"@cloudflare/kumo");if(w.dependencies?.["@cloudflare/kumo"]&&L&&L.pkg.version!==T.pkg.version)throw cs(ls("kumoMismatch",{siteVersion:L.pkg.version,hostVersion:T.pkg.version}),ls("kumoMismatchFix",{hostVersion:T.pkg.version}));let V=[["emdash","1.5.0"],["astro","6.0.0"],["@astrojs/react","5.0.0"],["react","18.0.0"],["@cloudflare/kumo","2.6.0"],...b.storage==="r2"?[["@emdash-cms/cloudflare","1.5.0"]]:[]],O=[];(A.local||!w.dependencies?.[k]||!await Ls(I))&&O.push(A.spec),(!w.dependencies?.["@cloudflare/kumo"]||!L)&&O.push(`@cloudflare/kumo@${T.pkg.version}`);for(let[e,i]of V){let s=await Is(t,e);if(s&&!Os(s.pkg.version,i))throw cs(ls("dependencyOld",{dependency:e,minimum:i,version:s.pkg.version}),ls("dependencyOldFix",{dependency:e}));!s&&!O.length&&O.push(A.spec)}if(o){let e=[...v?.plan.changed?[v.name]:[],...b.changed?["astro.config.mjs"]:[]],t=O.map(e=>e===A.local?ei.tarball:e);return p(ls("dryRun",{packages:t.length?t.join(ei.packageSeparator):ei.dryRunNone,files:e.length?e.join(ei.packageSeparator):ei.dryRunNone})),{changed:e.length>0,installed:!1,dryRun:!0,packages:t,files:e,...v?{cpuLimitMs:S}:{}}}let R=[...v?[{...v,worker:!0}]:[],{path:f,info:g,source:y,plan:b,worker:!1}],j=O.length?await Ms(t,w):null,F=new Map(R.filter(e=>e.plan.changed).map(e=>[m(e.path),e.plan.source]));return await ns(t,"emdash",s,F,{...O.length&&{install:{files:pi,run:async()=>{p(ls("installing",{packages:O.map(e=>e===A.local?ei.tarball:e).join(ei.packageSeparator),manager:j})),await d(t,j,O,c,u)}}},beforeWrite:async()=>{let i=await Is(t,k);if(!await Ls(i))throw cs(ei.installedMissing,ei.installedMissingFix);if(A.local&&(i.pkg.version!==A.version||x("sha512").update(await e(A.local)).digest("base64")!==A.digest))throw cs(ei.packageChanged,ei.packageChangedFix);for(let[e,i]of V){let s=await Is(t,e);if(!s||!Os(s.pkg.version,i))throw cs(ls("dependencyMissing",{dependency:e,minimum:i}),ls("dependencyMissingFix",{dependency:e}))}if(b.storage==="r2"&&Rs(await Is(t,"emdash"),await Is(t,"@emdash-cms/cloudflare")),(await Is(t,"@cloudflare/kumo"))?.pkg.version!==T.pkg.version)throw cs(ei.kumoInstalledMismatch,ls("kumoInstalledFix",{hostVersion:T.pkg.version}));await _();for(let e of R)await _s(e,e.worker)}}),v?.plan.changed&&p(ls("updatedWrangler",{file:v.name})),p(b.changed?ei.updated:ls("alreadyAdded")),p(ls("added",{setupAfter:Qt.setupAfter})),p(ei.nativePage),{changed:b.changed||v?.plan.changed===!0,installed:O.length>0,packages:O.map(e=>e===A.local?ei.tarball:e),files:R.filter(e=>e.plan.changed).map(e=>e.worker?v.name:"astro.config.mjs"),...v?{cpuLimitMs:S}:{}}}function qs(e,t){if(!e||typeof e!="object"||Array.isArray(e)||!Us(e.id)||!Us(e.siteId)||typeof e.scope!="string"||!e.scope||!["draining","restoring","verifying","complete","blocked"].includes(e.phase)||e.retirementDisabled!==!0||![0,1].includes(e.activeWriters)||e.remaining!==null&&(!Number.isSafeInteger(e.remaining)||e.remaining<0)||!Number.isSafeInteger(e.restored)||e.restored<0||e.error!==null&&(!e.error||typeof e.error!="object"||Array.isArray(e.error)||typeof e.error.code!="string"))throw cs(ei.responseInvalid,ei.removeFix);if(t&&["id","siteId","scope"].some(i=>t[i]!==void 0&&e[i]!==t[i]))throw cs(ei.restorationMismatch,ei.removeFix);if(e.phase==="complete"){let t=e.proof;if(e.remaining!==0||e.activeWriters!==0||e.error!==null||!t||typeof t!="object"||Array.isArray(t)||t.kind!=="originals-restored"||["id","siteId","scope"].some(i=>t[i]!==e[i])||!Us(t.revision)||t.remaining!==0||t.activeWriters!==0||t.retirementDisabled!==!0)throw cs(ei.restorationFailed,ei.removeFix)}else if(e.proof!==null)throw cs(ei.responseInvalid,ei.removeFix);return e}async function Ws({cwd:s,url:r,name:p="rapier-jxl",stdout:c,env:u=process.env,signal:d,connect:f=Vs}){let m=h(s,"astro.config.mjs"),g=await i(m).catch(()=>null);if(!g?.isFile()||g.isSymbolicLink()||g.nlink!==1)throw cs(ei.configFile,ei.removeFix);let x=await e(m,"utf8"),w=ys(x,p),k=await as(s,"emdash");if(!w.changed&&!k)return c(ls("alreadyRemoved")),{changed:!1};let b=e=>os("emdash",e,{cwd:s,stdout(){}});k&&await b(["--dry-run"]);let v=await As(h(s,"package.json")),S=e=>v?.dependencies?.[e]??v?.devDependencies?.[e]??v?.optionalDependencies?.[e];if(!v||!S("emdash")||!S("astro"))throw cs(ei.siteMissing,ei.siteMissingFix);let E=await f({cwd:s,url:r,env:u,signal:d}),C=await E.request("removal-status");if(C===null){let e=y().replaceAll("-","");C=qs(await E.request("removal-start",{id:e}),{id:e})}else C=qs(C);let _={id:C.id,siteId:C.siteId,scope:C.scope},A=-1;for(;C.phase!=="complete";){if(d?.throwIfAborted(),C.phase==="blocked"||C.error!==null)throw cs(ei.restorationFailed,ei.removeFix);C.restored!==A&&(A=C.restored,c(ls("restoring",{count:A}))),C=qs(await E.request("removal-advance",_),_),C.phase==="draining"&&C.activeWriters>0&&await new Promise((e,t)=>{let i=()=>{clearTimeout(s),d.removeEventListener("abort",i),t(d.reason)},s=setTimeout(()=>{d?.removeEventListener("abort",i),e()},250);d?.addEventListener("abort",i,{once:!0}),d?.aborted&&i()})}let I=qs(await E.request("removal-status"),_);if(I.phase!=="complete")throw cs(ei.restorationFailed,ei.removeFix);d?.throwIfAborted();let P=await i(m).catch(()=>null);if(!P?.isFile()||P.isSymbolicLink()||P.nlink!==1||P.ino!==g.ino||P.dev!==g.dev||P.mode!==g.mode||await e(m,"utf8")!==x)throw cs(ls("configChanged",{action:ei.removal}),ei.configChangedFix);if(k&&await b([]),!k?.includes("astro.config.mjs")){let e=await a(h(s,".rapier-jxl-"));try{let i=h(e,"astro.config.mjs");await t(i,w.source,{mode:g.mode&511}),await o(i,g.mode&511),await n(i,m)}finally{await l(e,{recursive:!0,force:!0})}}return c(ls("removed")),c(ei.restartRemoved),{changed:!0,origin:E.origin,proof:I.proof}}import{readFile as e,writeFile as t,lstat as i,stat as s,realpath as r,mkdtemp as a,rename as n,chmod as o,rm as l}from"node:fs/promises";import{join as h,dirname as p,resolve as c,relative as u,isAbsolute as d,sep as f,basename as m}from"node:path";import{spawn as g}from"node:child_process";import{createHash as x,randomUUID as y}from"node:crypto";import{gunzipSync as w}from"node:zlib";import{homedir as k}from"node:os";import{fileURLToPath as b,pathToFileURL as v}from"node:url";import{createInterface as S}from"node:readline/promises";var E=Object.defineProperty,C=(e,t)=>{for(var i in t)E(e,i,{get:t[i],enumerable:!0})},_={};C(_,{Node:()=>He,Parser:()=>be,Position:()=>oe,SourceLocation:()=>le,TokContext:()=>je,Token:()=>Dt,TokenType:()=>B,defaultOptions:()=>pe,getLineInfo:()=>he,isIdentifierChar:()=>D,isIdentifierStart:()=>M,isNewLine:()=>Q,keywordTypes:()=>$,lineBreak:()=>z,lineBreakG:()=>J,nonASCIIwhitespace:()=>X,parse:()=>Gt,parseExpressionAt:()=>Ht,tokContexts:()=>Fe,tokTypes:()=>H,tokenizer:()=>zt,version:()=>$t});var A=[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,31,4,33,15,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,7,0,259,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,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,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],I=[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,13,65,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,18,21,18,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,18,0,182,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,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,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,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,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,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,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,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],P="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-׉ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୓-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫰ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",N="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆ՘ՙՠ-ֈ֋֌א-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ₏-₟ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-꟝꟢꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩ꭬꭭ꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",T={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"},L="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",V={5:L,"5module":L+" export import",6:L+" const class extends export import super"},O=/^in(stanceof)?$/,R=new RegExp("["+N+"]"),j=new RegExp("["+N+P+"]");var B=class{constructor(e,t={}){this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null}};var q={beforeExpr:!0},W={startsExpr:!0},$={};var H={num:new B("num",W),regexp:new B("regexp",W),string:new B("string",W),name:new B("name",W),privateId:new B("privateId",W),eof:new B("eof"),bracketL:new B("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new B("]"),braceL:new B("{",{beforeExpr:!0,startsExpr:!0}),braceR:new B("}"),parenL:new B("(",{beforeExpr:!0,startsExpr:!0}),parenR:new B(")"),comma:new B(",",q),semi:new B(";",q),colon:new B(":",q),dot:new B("."),question:new B("?",q),questionDot:new B("?."),arrow:new B("=>",q),template:new B("template"),invalidTemplate:new B("invalidTemplate"),ellipsis:new B("...",q),backQuote:new B("`",W),dollarBraceL:new B("${",{beforeExpr:!0,startsExpr:!0}),eq:new B("=",{beforeExpr:!0,isAssign:!0}),assign:new B("_=",{beforeExpr:!0,isAssign:!0}),incDec:new B("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new B("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:U("||",1),logicalAND:U("&&",2),bitwiseOR:U("|",3),bitwiseXOR:U("^",4),bitwiseAND:U("&",5),equality:U("==/!=/===/!==",6),relational:U("</>/<=/>=",7),bitShift:U("<</>>/>>>",8),plusMin:new B("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:U("%",10),star:U("*",10),slash:U("/",10),starstar:new B("**",{beforeExpr:!0}),coalesce:U("??",1),_break:G("break"),_case:G("case",q),_catch:G("catch"),_continue:G("continue"),_debugger:G("debugger"),_default:G("default",q),_do:G("do",{isLoop:!0,beforeExpr:!0}),_else:G("else",q),_finally:G("finally"),_for:G("for",{isLoop:!0}),_function:G("function",W),_if:G("if"),_return:G("return",q),_switch:G("switch"),_throw:G("throw",q),_try:G("try"),_var:G("var"),_const:G("const"),_while:G("while",{isLoop:!0}),_with:G("with"),_new:G("new",{beforeExpr:!0,startsExpr:!0}),_this:G("this",W),_super:G("super",W),_class:G("class",W),_extends:G("extends",q),_export:G("export"),_import:G("import",W),_null:G("null",W),_true:G("true",W),_false:G("false",W),_in:G("in",{beforeExpr:!0,binop:7}),_instanceof:G("instanceof",{beforeExpr:!0,binop:7}),_typeof:G("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:G("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:G("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},z=/\r\n?|\n|\u2028|\u2029/,J=new RegExp(z.source,"g");var X=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Y=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,{hasOwnProperty:Z,toString:ee}=Object.prototype,te=Object.hasOwn,ie=Array.isArray,se=Object.create(null);var ne=/[\uD800-\uDFFF]/u,oe=class e{constructor(e,t){this.line=e,this.column=t}offset(t){return new e(this.line,this.column+t)}},le=class{constructor(e,t,i){this.start=t,this.end=i,e.sourceFile!==null&&(this.source=e.sourceFile)}};var pe={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},ce=!1;var me=0,ge=1,xe=2,ye=3,we=4,ke=5,be=class{constructor(e,t,i){this.options=e=ue(e),this.sourceFile=e.sourceFile,this.keywords=re(V[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);let s="";e.allowReserved!==!0&&(s=T[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module"&&(s+=" await")),this.reservedWords=re(s);let r=(s?s+" ":"")+T.strict;this.reservedWordsStrict=re(r),this.reservedWordsStrictBind=re(r+" "+T.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=i||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):i?(this.lineStart=this.input.lastIndexOf(`\n`,i-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(z).length)):this.lineStart=0,this.type=H.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?2:1),this.regexpState=null,this.privateNameStack=[]}parse(){let e=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(()=>this.parseTopLevel(e))}get inFunction(){return(this.currentVarScope().flags&2)>0}get inGenerator(){return(this.currentVarScope().flags&8)>0}get inAsync(){return(this.currentVarScope().flags&4)>0}get canAwait(){for(let e=this.scopeStack.length-1;e>=0;e--){let{flags:t}=this.scopeStack[e];if(t&768)return!1;if(t&2)return(t&4)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction}get allowReturn(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&1)}get allowSuper(){let{flags:e}=this.currentThisScope();return(e&64)>0||this.options.allowSuperOutsideMethod}get allowDirectSuper(){return(this.currentThisScope().flags&128)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}get allowNewDotTarget(){for(let e=this.scopeStack.length-1;e>=0;e--){let{flags:t}=this.scopeStack[e];if(t&768||t&2&&!(t&16))return!0}return!1}get allowUsing(){let{flags:e}=this.currentScope();return!(e&1024||!this.inModule&&e&1)}get inClassStaticBlock(){return(this.currentVarScope().flags&256)>0}static extend(...e){let t=this;for(let i=0;i<e.length;i++)t=e[i](t);return t}static parse(e,t){return new this(t,e).parse()}static parseExpressionAt(e,t,i){let s=new this(i,e,t);return s.nextToken(),s.parseExpression()}static tokenizer(e,t){return new this(t,e)}},ve=be.prototype,Se=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;ve.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){Y.lastIndex=e,e+=Y.exec(this.input)[0].length;let t=Se.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){Y.lastIndex=e+t[0].length;let i=Y.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||z.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="="||r==="i"&&Ee(this,s))}e+=t[0].length,Y.lastIndex=e,e+=Y.exec(this.input)[0].length,this.input[e]===";"&&e++}};ve.eat=function(e){return this.type===e?(this.next(),!0):!1};ve.isContextual=function(e){return this.type===H.name&&this.value===e&&!this.containsEsc};ve.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};ve.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,"Not enough stack space to parse input");else throw e}};ve.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};ve.canInsertSemicolon=function(){return this.type===H.eof||this.type===H.braceR||z.test(this.input.slice(this.lastTokEnd,this.start))};ve.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};ve.semicolon=function(){!this.eat(H.semi)&&!this.insertSemicolon()&&this.unexpected()};ve.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};ve.expect=function(e){this.eat(e)||this.unexpected()};ve.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Ce=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};ve.checkPatternErrors=function(e,t){if(!e)return;e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");let i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")};ve.checkExpressionErrors=function(e,t){if(!e)return!1;let{shorthandAssign:i,doubleProto:s}=e;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};ve.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};ve.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var _e=be.prototype;_e.parseTopLevel=function(e){let t=Object.create(null);for(e.body||(e.body=[]);this.type!==H.eof;){let i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(let e of Object.keys(this.undefinedExports))this.raiseRecoverable(this.undefinedExports[e].start,`Export '${e}' is not defined`);return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var Ae={kind:"loop"},Ie={kind:"switch"};_e.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Y.lastIndex=this.pos;let t=Y.exec(this.input),i=this.pos+t[0].length,s=this.fullCharCodeAt(i);if(s===91||s===92)return!0;if(e)return!1;if(s===123)return!0;if(M(s)){let e=i;do{i+=s<=65535?1:2}while(D(s=this.fullCharCodeAt(i)));if(s===92)return!0;let t=this.input.slice(e,i);if(!O.test(t))return!0}return!1};_e.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Y.lastIndex=this.pos;let e=Y.exec(this.input),t=this.pos+e[0].length,i;return!z.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(D(i=this.fullCharCodeAt(t+8))||i===92))};_e.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;Y.lastIndex=this.pos;let i=Y.exec(this.input),s=this.pos+i[0].length;if(z.test(this.input.slice(this.pos,s)))return!1;if(e){let e=s+5,t;if(this.input.slice(s,e)!=="using"||e===this.input.length||D(t=this.fullCharCodeAt(e))||t===92)return!1;Y.lastIndex=e;let i=Y.exec(this.input);if(s=e+i[0].length,i&&z.test(this.input.slice(e,s)))return!1}let r=this.fullCharCodeAt(s);if(!M(r)&&r!==92)return!1;let a=s;do{s+=r<=65535?1:2}while(D(r=this.fullCharCodeAt(s)));if(r===92)return!0;let n=this.input.slice(a,s);if(O.test(n))return!1;if(t&&!e&&n==="of"){Y.lastIndex=s;let e=Y.exec(this.input);if(s=s+e[0].length,this.input.charCodeAt(s)!==61||(r=this.input.charCodeAt(s+1))===61||r===62)return!1}return!0};_e.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};_e.isUsing=function(e){return this.isUsingKeyword(!1,e)};_e.parseStatement=function(e,t,i){let s=this.type,r=this.startNode(),a;switch(this.isLet(e)&&(s=H._var,a="let"),s){case H._break:case H._continue:return this.parseBreakContinueStatement(r,s.keyword);case H._debugger:return this.parseDebuggerStatement(r);case H._do:return this.parseDoStatement(r);case H._for:return this.parseForStatement(r);case H._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case H._class:return e&&this.unexpected(),this.parseClass(r,!0);case H._if:return this.parseIfStatement(r);case H._return:return this.parseReturnStatement(r);case H._switch:return this.parseSwitchStatement(r);case H._throw:return this.parseThrowStatement(r);case H._try:return this.parseTryStatement(r);case H._const:case H._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(r,a);case H._while:return this.parseWhileStatement(r);case H._with:return this.parseWithStatement(r);case H.braceL:return this.parseBlock(!0,r);case H.semi:return this.parseEmptyStatement(r);case H._export:case H._import:if(this.options.ecmaVersion>10&&s===H._import){Y.lastIndex=this.pos;let e=Y.exec(this.input),t=this.pos+e[0].length,i=this.input.charCodeAt(t);if(i===40||i===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===H._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);let n=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(n)return 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"),e&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),n==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,n),this.semicolon(),this.finishNode(r,"VariableDeclaration");let o=this.value,l=this.parseExpression();return s===H.name&&l.type==="Identifier"&&this.eat(H.colon)?this.parseLabeledStatement(r,o,l,e):this.parseExpressionStatement(r,l)}};_e.parseBreakContinueStatement=function(e,t){let i=t==="break";this.next(),this.eat(H.semi)||this.insertSemicolon()?e.label=null:this.type!==H.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());let s=0;for(;s<this.labels.length;++s){let t=this.labels[s];if((e.label==null||t.name===e.label.name)&&(t.kind!=null&&(i||t.kind==="loop")||e.label&&i))break}return s===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};_e.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};_e.parseDoStatement=function(e){return this.next(),this.labels.push(Ae),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(H._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(H.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};_e.parseForStatement=function(e){this.next();let t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ae),this.enterScope(0),this.expect(H.parenL),this.type===H.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);let i=this.isLet();if(this.type===H._var||this.type===H._const||i){let s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(e,s,t)}let s=this.isContextual("let"),r=!1,a=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(a){let i=this.startNode();return this.next(),a==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(i,!0,a),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(e,i,t)}let n=this.containsEsc,o=new Ce,l=this.start,h=t>-1?this.parseExprSubscripts(o,"await"):this.parseExpression(!0,o);return this.type===H._in||(r=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===H._in&&this.unexpected(t),e.await=!0):r&&this.options.ecmaVersion>=8&&(h.start===l&&!n&&h.type==="Identifier"&&h.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),s&&r&&this.raise(h.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(h,!1,o),this.checkLValPattern(h),this.parseForIn(e,h)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,h))};_e.parseForAfterInit=function(e,t,i){return(this.type===H._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.type===H._in?((t.kind==="using"||t.kind==="await using")&&!t.declarations[0].init&&this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&i>-1&&this.unexpected(i)):this.options.ecmaVersion>=9&&(e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))};_e.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Ne|(i?0:Te),!1,t)};_e.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(H._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};_e.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(H.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};_e.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(H.braceL),this.labels.push(Ie),this.enterScope(1024);let t;for(let i=!1;this.type!==H.braceR;)if(this.type===H._case||this.type===H._default){let s=this.type===H._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(H.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};_e.parseThrowStatement=function(e){return this.next(),z.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Pe=[];_e.parseCatchClauseParam=function(){let e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?32:0),this.checkLValPattern(e,t?we:xe),this.expect(H.parenR),e};_e.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===H._catch){let t=this.startNode();this.next(),this.eat(H.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(H._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};_e.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};_e.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ae),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};_e.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};_e.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};_e.parseLabeledStatement=function(e,t,i,s){for(let e of this.labels)e.name===t&&this.raise(i.start,"Label '"+t+"' is already declared");let r=this.type.isLoop?"loop":this.type===H._switch?"switch":null;for(let t=this.labels.length-1;t>=0;t--){let i=this.labels[t];if(i.statementStart===e.start)i.statementStart=this.start,i.kind=r;else break}return this.labels.push({name:t,kind:r,statementStart:this.start}),e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};_e.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};_e.parseBlock=function(e=!0,t=this.startNode(),i){for(t.body=[],this.expect(H.braceL),e&&this.enterScope(0);this.type!==H.braceR;){let e=this.parseStatement(null);t.body.push(e)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};_e.parseFor=function(e,t){return e.init=t,this.expect(H.semi),e.test=this.type===H.semi?null:this.parseExpression(),this.expect(H.semi),e.update=this.type===H.parenR?null:this.parseExpression(),this.expect(H.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};_e.parseForIn=function(e,t){let i=this.type===H._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,`${i?"for-in":"for-of"} loop variable declaration may not have an initializer`),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(H.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};_e.parseVar=function(e,t,i,s){for(e.declarations=[],e.kind=i;;){let r=this.startNode();if(this.parseVarId(r,i),this.eat(H.eq)?r.init=this.parseMaybeAssign(t):!s&&i==="const"&&!(this.type===H._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==H._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,`Missing initializer in ${i} declaration`):!s&&r.id.type!=="Identifier"&&!(t&&(this.type===H._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(H.comma))break}return e};_e.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?ge:xe,!1)};var Ne=1,Te=2,Le=4;_e.parseFunction=function(e,t,i,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===H.star&&t&Te&&this.unexpected(),e.generator=this.eat(H.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&Ne&&(e.id=t&Le&&this.type!==H.name?null:this.parseIdent(),e.id&&!(t&Te)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?ge:xe:ye));let a=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(fe(e.async,e.generator)),t&Ne||(e.id=this.type===H.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,r),this.yieldPos=a,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(e,t&Ne?"FunctionDeclaration":"FunctionExpression")};_e.parseFunctionParams=function(e){this.expect(H.parenL),e.params=this.parseBindingList(H.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};_e.parseClass=function(e,t){this.next();let i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);let s=this.enterClassBody(),r=this.startNode(),a=!1;for(r.body=[],this.expect(H.braceL);this.type!==H.braceR;){let t=this.parseClassElement(e.superClass!==null);t&&(r.body.push(t),t.type==="MethodDefinition"&&t.kind==="constructor"?(a&&this.raiseRecoverable(t.start,"Duplicate constructor in the same class"),a=!0):t.key&&t.key.type==="PrivateIdentifier"&&Ve(s,t)&&this.raiseRecoverable(t.key.start,`Identifier '#${t.key.name}' has already been declared`))}return this.strict=i,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};_e.parseClassElement=function(e){if(this.eat(H.semi))return null;let t=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,a=!1,n="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(H.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===H.star?o=!0:s="static"}if(i.static=o,!s&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===H.star)&&!this.canInsertSemicolon()?a=!0:s="async"),!s&&(t>=9||!a)&&this.eat(H.star)&&(r=!0),!s&&!a&&!r){let e=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?n=e:s=e)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===H.parenL||n!=="method"||r||a){let t=!i.static&&Oe(i,"constructor"),s=t&&e;t&&n!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=t?"constructor":n,this.parseClassMethod(i,r,a,s)}else this.parseClassField(i);return i};_e.isClassElementNameStart=function(){return this.type===H.name||this.type===H.privateId||this.type===H.num||this.type===H.string||this.type===H.bracketL||this.type.keyword};_e.parseClassElementName=function(e){this.type===H.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};_e.parseClassMethod=function(e,t,i,s){let r=e.key;e.kind==="constructor"?(t&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):e.static&&Oe(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");let a=e.value=this.parseMethod(t,i,s);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};_e.parseClassField=function(e){return Oe(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Oe(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(H.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};_e.parseClassStaticBlock=function(e){e.body=[];let t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==H.braceR;){let t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};_e.parseClassId=function(e,t){this.type===H.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,xe,!1)):(t===!0&&this.unexpected(),e.id=null)};_e.parseClassSuper=function(e){e.superClass=this.eat(H._extends)?this.parseExprSubscripts(null,!1):null};_e.enterClassBody=function(){let e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};_e.exitClassBody=function(){let{declared:e,used:t}=this.privateNameStack.pop();if(!this.options.checkPrivateFields)return;let i=this.privateNameStack.length,s=i===0?null:this.privateNameStack[i-1];for(let i=0;i<t.length;++i){let r=t[i];te(e,r.name)||(s?s.used.push(r):this.raiseRecoverable(r.start,`Private field '#${r.name}' must be declared in an enclosing class`))}};_e.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==H.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};_e.parseExport=function(e,t){if(this.next(),this.eat(H.star))return this.parseExportAllDeclaration(e,t);if(this.eat(H._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==H.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(let t of e.specifiers)this.checkUnreserved(t.local),this.checkLocalExport(t.local),t.local.type==="Literal"&&this.raise(t.local.start,"A string literal cannot be used as an exported binding without `from`.");e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};_e.parseExportDeclaration=function(e){return this.parseStatement(null)};_e.parseExportDefaultDeclaration=function(){let e;if(this.type===H._function||(e=this.isAsyncFunction())){let t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Ne|Le,!1,e)}else if(this.type===H._class){let e=this.startNode();return this.parseClass(e,"nullableID")}else{let e=this.parseMaybeAssign();return this.semicolon(),e}};_e.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),te(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};_e.checkPatternExport=function(e,t){let i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(let i of t.properties)this.checkPatternExport(e,i);else if(i==="ArrayPattern")for(let i of t.elements)i&&this.checkPatternExport(e,i);else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)};_e.checkVariableExport=function(e,t){if(e)for(let i of t)this.checkPatternExport(e,i.id)};_e.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};_e.parseExportSpecifier=function(e){let t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};_e.parseExportSpecifiers=function(e){let t=[],i=!0;for(this.expect(H.braceL);!this.eat(H.braceR);){if(i)i=!1;else if(this.expect(H.comma),this.afterTrailingComma(H.braceR))break;t.push(this.parseExportSpecifier(e))}return t};_e.parseImport=function(e){return this.next(),this.type===H.string?(e.specifiers=Pe,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===H.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};_e.parseImportSpecifier=function(){let e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,xe),this.finishNode(e,"ImportSpecifier")};_e.parseImportDefaultSpecifier=function(){let e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,xe),this.finishNode(e,"ImportDefaultSpecifier")};_e.parseImportNamespaceSpecifier=function(){let e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,xe),this.finishNode(e,"ImportNamespaceSpecifier")};_e.parseImportSpecifiers=function(){let e=[],t=!0;if(this.type===H.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(H.comma)))return e;if(this.type===H.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(H.braceL);!this.eat(H.braceR);){if(t)t=!1;else if(this.expect(H.comma),this.afterTrailingComma(H.braceR))break;e.push(this.parseImportSpecifier())}return e};_e.parseWithClause=function(){let e=[];if(!this.eat(H._with))return e;this.expect(H.braceL);let t={},i=!0;for(;!this.eat(H.braceR);){if(i)i=!1;else if(this.expect(H.comma),this.afterTrailingComma(H.braceR))break;let s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;te(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e};_e.parseImportAttribute=function(){let e=this.startNode();return e.key=this.type===H.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(H.colon),this.type!==H.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};_e.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===H.string){let e=this.parseLiteral(this.value);return ne.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};_e.adaptDirectivePrologue=function(e){for(let t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};_e.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Re=be.prototype;Re.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(let i of e.properties)this.toAssignable(i,t),i.type==="RestElement"&&(i.argument.type==="ArrayPattern"||i.argument.type==="ObjectPattern")&&this.raise(i.argument.start,"Unexpected token");break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};Re.toAssignableList=function(e,t){let i=e.length;for(let s=0;s<i;s++){let i=e[s];i&&this.toAssignable(i,t)}if(i){let s=e[i-1];this.options.ecmaVersion===6&&t&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return e};Re.parseSpread=function(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};Re.parseRestBinding=function(){let e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==H.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};Re.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case H.bracketL:let e=this.startNode();return this.next(),e.elements=this.parseBindingList(H.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case H.braceL:return this.parseObj(!0)}return this.parseIdent()};Re.parseBindingList=function(e,t,i,s){let r=[],a=!0;for(;!this.eat(e);)if(a?a=!1:this.expect(H.comma),t&&this.type===H.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===H.ellipsis){let t=this.parseRestBinding();this.parseBindingListItem(t),r.push(t),this.type===H.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else r.push(this.parseAssignableListItem(s))}return r};Re.parseAssignableListItem=function(e){let t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};Re.parseBindingListItem=function(e){return e};Re.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(H.eq))return i;let s=this.startNodeAt(e,t);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};Re.checkLValSimple=function(e,t=me,i){let s=t!==me;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode"),s&&(t===xe&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(te(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==ke&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}};Re.checkLValPattern=function(e,t=me,i){switch(e.type){case"ObjectPattern":for(let s of e.properties)this.checkLValInnerPattern(s,t,i);break;case"ArrayPattern":for(let s of e.elements)s&&this.checkLValInnerPattern(s,t,i);break;default:this.checkLValSimple(e,t,i)}};Re.checkLValInnerPattern=function(e,t=me,i){switch(e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var je=class{constructor(e,t,i,s,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=s,this.generator=!!r}},Fe={b_stat:new je("{",!1),b_expr:new je("{",!0),b_tmpl:new je("${",!1),p_stat:new je("(",!1),p_expr:new je("(",!0),q_tmpl:new je("`",!0,!0,e=>e.tryReadTemplateToken()),f_stat:new je("function",!1),f_expr:new je("function",!0),f_expr_gen:new je("function",!0,!1,null,!0),f_gen:new je("function",!1,!1,null,!0)},Me=be.prototype;Me.initialContext=function(){return[Fe.b_stat]};Me.curContext=function(){return this.context[this.context.length-1]};Me.braceIsBlock=function(e){let t=this.curContext();return t===Fe.f_expr||t===Fe.f_stat?!0:e===H.colon&&(t===Fe.b_stat||t===Fe.b_expr)?!t.isExpr:e===H._return||e===H.name&&this.exprAllowed?z.test(this.input.slice(this.lastTokEnd,this.start)):e===H._else||e===H.semi||e===H.eof||e===H.parenR||e===H.arrow?!0:e===H.braceL?t===Fe.b_stat:e===H._var||e===H._const||e===H.name?!1:!this.exprAllowed};Me.inGeneratorContext=function(){for(let e=this.context.length-1;e>=1;e--){let t=this.context[e];if(t.token==="function")return t.generator}return!1};Me.updateContext=function(e){let t,i=this.type;i.keyword&&e===H.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};Me.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};H.parenR.updateContext=H.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}let e=this.context.pop();e===Fe.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};H.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Fe.b_stat:Fe.b_expr),this.exprAllowed=!0};H.dollarBraceL.updateContext=function(){this.context.push(Fe.b_tmpl),this.exprAllowed=!0};H.parenL.updateContext=function(e){let t=e===H._if||e===H._for||e===H._with||e===H._while;this.context.push(t?Fe.p_stat:Fe.p_expr),this.exprAllowed=!0};H.incDec.updateContext=function(){};H._function.updateContext=H._class.updateContext=function(e){e.beforeExpr&&e!==H._else&&!(e===H.semi&&this.curContext()!==Fe.p_stat)&&!(e===H._return&&z.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===H.colon||e===H.braceL)&&this.curContext()===Fe.b_stat)?this.context.push(Fe.f_expr):this.context.push(Fe.f_stat),this.exprAllowed=!1};H.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};H.backQuote.updateContext=function(){this.curContext()===Fe.q_tmpl?this.context.pop():this.context.push(Fe.q_tmpl),this.exprAllowed=!1};H.star.updateContext=function(e){if(e===H._function){let e=this.context.length-1;this.context[e]===Fe.f_expr?this.context[e]=Fe.f_expr_gen:this.context[e]=Fe.f_gen}this.exprAllowed=!0};H.name.updateContext=function(e){let t=!1;this.options.ecmaVersion>=6&&e!==H.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var De=be.prototype;De.checkPropClash=function(e,t,i){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement"||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))return;let{key:s}=e,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}let{kind:a}=e;if(this.options.ecmaVersion>=6){r==="__proto__"&&a==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),t.proto=!0);return}r="$"+r;let n=t[r];if(n){let e;a==="init"?e=this.strict&&n.init||n.get||n.set:e=n.init||n[a],e&&this.raiseRecoverable(s.start,"Redefinition of property")}else n=t[r]={init:!1,get:!1,set:!1};n[a]=!0};De.parseExpression=function(e,t){return this.catchStackOverflow(()=>{let i=this.start,s=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===H.comma){let a=this.startNodeAt(i,s);for(a.expressions=[r];this.eat(H.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,"SequenceExpression")}return r})};De.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}let s=!1,r=-1,a=-1,n=-1;t?(r=t.parenthesizedAssign,a=t.trailingComma,n=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Ce,s=!0);let o=this.start,l=this.startLoc;(this.type===H.parenL||this.type===H.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");let h=this.parseMaybeConditional(e,t);if(i&&(h=i.call(this,h,o,l)),this.type.isAssign){let i=this.startNodeAt(o,l);return i.operator=this.value,this.type===H.eq&&(h=this.toAssignable(h,!1,t)),s||(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=h.start&&(t.shorthandAssign=-1),t.doubleProto>=h.start&&(t.doubleProto=-1)),this.type===H.eq?this.checkLValPattern(h):this.checkLValSimple(h),i.left=h,this.next(),i.right=this.parseMaybeAssign(e),n>-1&&(t.doubleProto=n),this.finishNode(i,"AssignmentExpression")}else s&&this.checkExpressionErrors(t,!0);return r>-1&&(t.parenthesizedAssign=r),a>-1&&(t.trailingComma=a),h};De.parseMaybeConditional=function(e,t){let i=this.start,s=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(!(r.type==="ArrowFunctionExpression"&&r.start===i)&&this.eat(H.question)){let t=this.startNodeAt(i,s);return t.test=r,t.consequent=this.parseMaybeAssign(),this.expect(H.colon),t.alternate=this.parseMaybeAssign(e),this.finishNode(t,"ConditionalExpression")}return r};De.parseExprOps=function(e,t){let i=this.start,s=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||r.start===i&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,i,s,-1,e)};De.parseExprOp=function(e,t,i,s,r){let a=this.type.binop;if(a!=null&&(!r||this.type!==H._in)&&a>s){let n=this.type===H.logicalOR||this.type===H.logicalAND,o=this.type===H.coalesce;o&&(a=H.logicalAND.binop);let l=this.value;this.next();let h=this.start,p=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),h,p,a,r),u=this.buildBinary(t,i,e,c,l,n||o);return(n&&this.type===H.coalesce||o&&(this.type===H.logicalOR||this.type===H.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,t,i,s,r)}return e};De.buildBinary=function(e,t,i,s,r,a){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");let n=this.startNodeAt(e,t);return n.left=i,n.operator=r,n.right=s,this.finishNode(n,a?"LogicalExpression":"BinaryExpression")};De.parseMaybeUnary=function(e,t,i,s){let r=this.start,a=this.startLoc,n;if(this.isContextual("await")&&this.canAwait)n=this.parseAwait(s),t=!0;else if(this.type.prefix){let i=this.startNode(),r=this.type===H.incDec;i.operator=this.value,i.prefix=!0,this.next(),i.argument=this.parseMaybeUnary(null,!0,r,s),this.checkExpressionErrors(e,!0),r?this.checkLValSimple(i.argument):this.strict&&i.operator==="delete"&&Be(i.argument)?this.raiseRecoverable(i.start,"Deleting local variable in strict mode"):i.operator==="delete"&&Ue(i.argument)?this.raiseRecoverable(i.start,"Private fields can not be deleted"):t=!0,n=this.finishNode(i,r?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===H.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),n=this.parsePrivateIdent(),this.type!==H._in&&this.unexpected();else{if(n=this.parseExprSubscripts(e,s),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){let e=this.startNodeAt(r,a);e.operator=this.value,e.prefix=!1,e.argument=n,this.checkLValSimple(n),this.next(),n=this.finishNode(e,"UpdateExpression")}}if(!i&&!(n.type==="ArrowFunctionExpression"&&n.start===r)&&this.eat(H.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(r,a,n,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return n};De.parseExprSubscripts=function(e,t){let i=this.start,s=this.startLoc,r=-1,a=-1;e&&(r=e.doubleProto,a=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1);let n=this.parseExprAtom(e,t);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return n;let o=this.parseSubscripts(n,i,s,!1,t);return e&&(o.end>n.end&&(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=o.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=o.start&&(e.parenthesizedBind=-1),e.trailingComma>=o.start&&(e.trailingComma=-1)),r>-1&&(e.doubleProto=r),a>-1&&(e.shorthandAssign=a)),o};De.parseSubscripts=function(e,t,i,s,r){let a=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,n=!1;for(;;){let o=this.parseSubscript(e,t,i,s,a,n,r);if(o.optional&&(n=!0),o.end===e.end||o.type==="ArrowFunctionExpression"){if(n){let e=this.startNodeAt(t,i);e.expression=o,o=this.finishNode(e,"ChainExpression")}return o}e=o,a=!1}};De.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(H.arrow)};De.parseSubscriptAsyncArrow=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,s)};De.parseSubscript=function(e,t,i,s,r,a,n){let o=this.options.ecmaVersion>=11,l=o&&this.eat(H.questionDot);s&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let h=this.eat(H.bracketL);if(h||l&&this.type!==H.parenL&&this.type!==H.backQuote||this.eat(H.dot)){let s=this.startNodeAt(t,i);s.object=e,h?(s.property=this.parseExpression(),this.expect(H.bracketR)):this.type===H.privateId&&e.type!=="Super"?s.property=this.parsePrivateIdent():s.property=this.parseIdent(this.options.allowReserved!=="never"),s.computed=!!h,o&&(s.optional=l),e=this.finishNode(s,"MemberExpression")}else if(!s&&this.eat(H.parenL)){let s=new Ce,a=this.yieldPos,h=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let c=this.parseExprList(H.parenR,this.options.ecmaVersion>=8,!1,s);if(r&&!l&&this.shouldParseAsyncArrow())return this.checkPatternErrors(s,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=a,this.awaitPos=h,this.awaitIdentPos=p,this.parseSubscriptAsyncArrow(t,i,c,n);this.checkExpressionErrors(s,!0),this.yieldPos=a||this.yieldPos,this.awaitPos=h||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;let u=this.startNodeAt(t,i);u.callee=e,u.arguments=c,o&&(u.optional=l),e=this.finishNode(u,"CallExpression")}else if(this.type===H.backQuote){(l||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let s=this.startNodeAt(t,i);s.tag=e,s.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(s,"TaggedTemplateExpression")}return e};De.parseExprAtom=function(e,t,i){this.type===H.slash&&this.readRegexp();let s,r=this.potentialArrowAt===this.start;switch(this.type){case H._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===H.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==H.dot&&this.type!==H.bracketL&&this.type!==H.parenL&&this.unexpected(),this.finishNode(s,"Super");case H._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case H.name:let a=this.start,n=this.startLoc,o=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&l.name==="async"&&!this.canInsertSemicolon()&&this.eat(H._function))return this.overrideContext(Fe.f_expr),this.parseFunction(this.startNodeAt(a,n),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(H.arrow))return this.parseArrowExpression(this.startNodeAt(a,n),[l],!1,t);if(this.options.ecmaVersion>=8&&l.name==="async"&&this.type===H.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return l=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(H.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,n),[l],!0,t)}return l;case H.regexp:let h=this.value;return s=this.parseLiteral(h.value),s.regex={pattern:h.pattern,flags:h.flags},s;case H.num:case H.string:return this.parseLiteral(this.value);case H._null:case H._true:case H._false:return s=this.startNode(),s.value=this.type===H._null?null:this.type===H._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case H.parenL:let p=this.start,c=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),c;case H.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(H.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case H.braceL:return this.overrideContext(Fe.b_expr),this.parseObj(!1,e);case H._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case H._class:return this.parseClass(this.startNode(),!1);case H._new:return this.parseNew();case H.backQuote:return this.parseTemplate();case H._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};De.parseExprAtomDefault=function(){this.unexpected()};De.parseExprImport=function(e){let t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===H.parenL&&!e)return this.parseDynamicImport(t);if(this.type===H.dot){let e=this.startNodeAt(t.start,t.loc&&t.loc.start);return e.name="import",t.meta=this.finishNode(e,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};De.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(H.parenR)?e.options=null:(this.expect(H.comma),this.afterTrailingComma(H.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(H.parenR)||(this.expect(H.comma),this.afterTrailingComma(H.parenR)||this.unexpected())));else if(!this.eat(H.parenR)){let e=this.start;this.eat(H.comma)&&this.eat(H.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(e,"ImportExpression")};De.parseImportMeta=function(e){this.next();let t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};De.parseLiteral=function(e){let t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};De.parseParenExpression=function(){this.expect(H.parenL);let e=this.parseExpression();return this.expect(H.parenR),e};De.shouldParseArrow=function(e){return!this.canInsertSemicolon()};De.parseParenAndDistinguishExpression=function(e,t){let i=this.start,s=this.startLoc,r,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();let n=this.start,o=this.startLoc,l=[],h=!0,p=!1,c=new Ce,u=this.yieldPos,d=this.awaitPos,f;for(this.yieldPos=0,this.awaitPos=0;this.type!==H.parenR;)if(h?h=!1:this.expect(H.comma),a&&this.afterTrailingComma(H.parenR,!0)){p=!0;break}else if(this.type===H.ellipsis){f=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===H.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else l.push(this.parseMaybeAssign(!1,c,this.parseParenItem));let m=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(H.parenR),e&&this.shouldParseArrow(l)&&this.eat(H.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=d,this.parseParenArrowList(i,s,l,t);(!l.length||p)&&this.unexpected(this.lastTokStart),f&&this.unexpected(f),this.checkExpressionErrors(c,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,l.length>1?(r=this.startNodeAt(n,o),r.expressions=l,this.finishNodeAt(r,"SequenceExpression",m,g)):r=l[0]}else r=this.parseParenExpression();if(this.options.preserveParens){let e=this.startNodeAt(i,s);return e.expression=r,this.finishNode(e,"ParenthesizedExpression")}else return r};De.parseParenItem=function(e){return e};De.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var qe=[];De.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");let e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===H.dot){let t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();let i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}let t=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),t,i,!0,!1),e.callee.type==="Super"&&this.raiseRecoverable(t,"Invalid use of 'super'"),this.eat(H.parenL)?e.arguments=this.parseExprList(H.parenR,this.options.ecmaVersion>=8,!1):e.arguments=qe,this.finishNode(e,"NewExpression")};De.parseTemplateElement=function({isTagged:e}){let t=this.startNode();return this.type===H.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value.replace(/\r\n?/g,`\n`),cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`\n`),cooked:this.value},this.next(),t.tail=this.type===H.backQuote,this.finishNode(t,"TemplateElement")};De.parseTemplate=function({isTagged:e=!1}={}){let t=this.startNode();this.next(),t.expressions=[];let i=this.parseTemplateElement({isTagged:e});for(t.quasis=[i];!i.tail;)this.type===H.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(H.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(H.braceR),t.quasis.push(i=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(t,"TemplateLiteral")};De.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===H.name||this.type===H.num||this.type===H.string||this.type===H.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===H.star)&&!z.test(this.input.slice(this.lastTokEnd,this.start))};De.parseObj=function(e,t){let i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(H.braceR);){if(s)s=!1;else if(this.expect(H.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(H.braceR))break;let a=this.parseProperty(e,t);e||this.checkPropClash(a,r,t),i.properties.push(a)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};De.parseProperty=function(e,t){let i=this.startNode(),s,r,a,n;if(this.options.ecmaVersion>=9&&this.eat(H.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===H.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===H.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(a=this.start,n=this.startLoc),e||(s=this.eat(H.star)));let o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(H.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,e,s,r,a,n,t,o),this.finishNode(i,"Property")};De.parseGetterSetter=function(e){let t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;let i=e.kind==="get"?0:1;if(e.value.params.length!==i){let t=e.value.start;e.kind==="get"?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};De.parsePropertyValue=function(e,t,i,s,r,a,n,o){(i||s)&&this.type===H.colon&&this.unexpected(),this.eat(H.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),e.kind="init"):this.options.ecmaVersion>=6&&this.type===H.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(i,s),e.kind="init"):!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==H.comma&&this.type!==H.braceR&&this.type!==H.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),t?e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key)):this.type===H.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected()};De.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(H.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(H.bracketR),e.key;e.computed=!1}return e.key=this.type===H.num||this.type===H.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};De.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};De.parseMethod=function(e,t,i){let s=this.startNode(),r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(fe(t,s.generator)|64|(i?128:0)),this.expect(H.parenL),s.params=this.parseBindingList(H.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(s,"FunctionExpression")};De.parseArrowExpression=function(e,t,i,s){let r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.enterScope(fe(i,!1)|16),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(e,"ArrowFunctionExpression")};De.parseFunctionBody=function(e,t,i,s){let r=t&&this.type!==H.braceL,a=this.strict,n=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{let s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(n=this.strictDirective(this.end),n&&s&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));let r=this.labels;this.labels=[],n&&(this.strict=!0),this.checkParams(e,!a&&!n&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,ke),e.body=this.parseBlock(!1,void 0,n&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=r}this.exitScope()};De.isSimpleParamList=function(e){for(let t of e)if(t.type!=="Identifier")return!1;return!0};De.checkParams=function(e,t){let i=Object.create(null);for(let s of e.params)this.checkLValInnerPattern(s,ge,t?null:i)};De.parseExprList=function(e,t,i,s){let r=[],a=!0;for(;!this.eat(e);){if(a)a=!1;else if(this.expect(H.comma),t&&this.afterTrailingComma(e))break;let n;i&&this.type===H.comma?n=null:this.type===H.ellipsis?(n=this.parseSpread(s),s&&this.type===H.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):n=this.parseMaybeAssign(!1,s),r.push(n)}return r};De.checkUnreserved=function({start:e,end:t,name:i}){this.inGenerator&&i==="yield"&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&i==="await"&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&259)&&i==="arguments"&&this.raiseRecoverable(e,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(i==="arguments"||i==="await")&&this.raise(e,`Cannot use ${i} in class static initialization block`),this.keywords.test(i)&&this.raise(e,`Unexpected keyword '${i}'`),!(this.options.ecmaVersion<6&&this.input.slice(e,t).indexOf("\\")!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(!this.inAsync&&i==="await"&&this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,`The keyword '${i}' is reserved`))};De.parseIdent=function(e){let t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};De.parseIdentNode=function(){let e=this.startNode();return this.type===H.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=H.name):this.unexpected(),e};De.parsePrivateIdent=function(){let e=this.startNode();return this.type===H.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#${e.name}' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};De.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);let t=this.startNode();return this.next(),this.type===H.semi||this.canInsertSemicolon()||this.type!==H.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(H.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};De.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);let t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var We=be.prototype;We.raise=function(e,t){let i=he(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);let s=new SyntaxError(t);throw s.pos=e,s.loc=i,s.raisedAt=this.pos,s};We.raiseRecoverable=We.raise;We.curPosition=function(){if(this.options.locations)return new oe(this.curLine,this.pos-this.lineStart)};var $e=be.prototype,Ge=class{constructor(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]}};$e.enterScope=function(e){this.scopeStack.push(new Ge(e))};$e.exitScope=function(){this.scopeStack.pop()};$e.treatFunctionsAsVarInScope=function(e){return e.flags&2||!this.inModule&&e.flags&1};$e.declareName=function(e,t,i){let s=!1;if(t===xe){let t=this.currentScope();s=t.lexical.indexOf(e)>-1||t.functions.indexOf(e)>-1||t.var.indexOf(e)>-1,t.lexical.push(e),this.inModule&&t.flags&1&&delete this.undefinedExports[e]}else if(t===we)this.currentScope().lexical.push(e);else if(t===ye){let t=this.currentScope();this.treatFunctionsAsVar?s=t.lexical.indexOf(e)>-1:s=t.lexical.indexOf(e)>-1||t.var.indexOf(e)>-1,t.functions.push(e)}else for(let t=this.scopeStack.length-1;t>=0;--t){let i=this.scopeStack[t];if(i.lexical.indexOf(e)>-1&&!(i.flags&32&&i.lexical[0]===e)||!this.treatFunctionsAsVarInScope(i)&&i.functions.indexOf(e)>-1){s=!0;break}if(i.var.push(e),this.inModule&&i.flags&1&&delete this.undefinedExports[e],i.flags&259)break}s&&this.raiseRecoverable(i,`Identifier '${e}' has already been declared`)};$e.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};$e.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};$e.currentVarScope=function(){for(let e=this.scopeStack.length-1;;e--){let t=this.scopeStack[e];if(t.flags&771)return t}};$e.currentThisScope=function(){for(let e=this.scopeStack.length-1;;e--){let t=this.scopeStack[e];if(t.flags&771&&!(t.flags&16))return t}};var He=class{constructor(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new le(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])}},ze=be.prototype;ze.startNode=function(){return new He(this,this.start,this.startLoc)};ze.startNodeAt=function(e,t){return new He(this,e,t)};ze.finishNode=function(e,t){return Je.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ze.finishNodeAt=function(e,t,i,s){return Je.call(this,e,t,i,s)};ze.copyNode=function(e){let t=new He(this,e.start,this.startLoc);for(let i in e)t[i]=e[i];return t};var Qe="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",Ke="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",Xe=Ke+" Extended_Pictographic",Ye=Xe,Ze=Ye+" EBase EComp EMod EPres ExtPict",et=Ze,tt=et,it={9:Ke,10:Xe,11:Ye,12:Ze,13:et,14:tt},st="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",rt={9:"",10:"",11:"",12:"",13:"",14:st},at="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",nt="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",ot=nt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",lt=ot+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ht=lt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",pt=ht+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ct=pt+" "+Qe,ut={9:nt,10:ot,11:lt,12:ht,13:pt,14:ct},dt={};for(let e of[9,10,11,12,13,14])ft(e);var mt=dt,gt=be.prototype,xt=class e{constructor(e,t){this.parent=e,this.base=t||this}separatedFrom(e){for(let t=this;t;t=t.parent)for(let i=e;i;i=i.parent)if(t.base===i.base&&t!==i)return!0;return!1}sibling(){return new e(this.parent,this.base)}},yt=class{constructor(e){this.parser=e,this.validFlags=`gim${e.options.ecmaVersion>=6?"uy":""}${e.options.ecmaVersion>=9?"s":""}${e.options.ecmaVersion>=13?"d":""}${e.options.ecmaVersion>=15?"v":""}`,this.unicodeProperties=mt[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null}reset(e,t,i){let s=i.indexOf("v")!==-1,r=i.indexOf("u")!==-1;this.start=e|0,this.source=t+"",this.flags=i,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)}raise(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /${this.source}/: ${e}`)}at(e,t=!1){let i=this.source,s=i.length;if(e>=s)return-1;let r=i.charCodeAt(e);if(!(t||this.switchU)||r<=55295||r>=57344||e+1>=s)return r;let a=i.charCodeAt(e+1);return a>=56320&&a<=57343?(r<<10)+a-56613888:r}nextIndex(e,t=!1){let i=this.source,s=i.length;if(e>=s)return s;let r=i.charCodeAt(e),a;return!(t||this.switchU)||r<=55295||r>=57344||e+1>=s||(a=i.charCodeAt(e+1))<56320||a>57343?e+1:e+2}current(e=!1){return this.at(this.pos,e)}lookahead(e=!1){return this.at(this.nextIndex(this.pos,e),e)}advance(e=!1){this.pos=this.nextIndex(this.pos,e)}eat(e,t=!1){return this.current(t)===e?(this.advance(t),!0):!1}eatChars(e,t=!1){let i=this.pos;for(let s of e){let e=this.at(i,t);if(e===-1||e!==s)return!1;i=this.nextIndex(i,t)}return this.pos=i,!0}};gt.validateRegExpFlags=function(e){let t=e.validFlags,i=e.flags,s=!1,r=!1;for(let a=0;a<i.length;a++){let n=i.charAt(a);t.indexOf(n)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(n,a+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),n==="u"&&(s=!0),n==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")};gt.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&wt(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};gt.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(let t of e.backReferenceNames)e.groupNames[t]||e.raise("Invalid named capture referenced")};gt.regexp_disjunction=function(e){let t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new xt(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};gt.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};gt.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};gt.regexp_eatAssertion=function(e){let t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){let t=!1;if(this.options.ecmaVersion>=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=t,!1};gt.regexp_eatQuantifier=function(e,t=!1){return this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};gt.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};gt.regexp_eatBracedQuantifier=function(e,t){let i=e.pos;if(e.eat(123)){let s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return r!==-1&&r<s&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};gt.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};gt.regexp_eatReverseSolidusAtomEscape=function(e){let t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};gt.regexp_eatUncapturingGroup=function(e){let t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){let t=this.regexp_eatModifiers(e),i=e.eat(45);if(t||i){for(let i=0;i<t.length;i++){let s=t.charAt(i);t.indexOf(s,i+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(i){let i=this.regexp_eatModifiers(e);!t&&!i&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(let s=0;s<i.length;s++){let r=i.charAt(s);(i.indexOf(r,s+1)>-1||t.indexOf(r)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};gt.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};gt.regexp_eatModifiers=function(e){let t="",i=0;for(;(i=e.current())!==-1&&kt(i);)t+=ae(i),e.advance();return t};gt.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};gt.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};gt.regexp_eatSyntaxCharacter=function(e){let t=e.current();return bt(t)?(e.lastIntValue=t,e.advance(),!0):!1};gt.regexp_eatPatternCharacters=function(e){let t=e.pos,i=0;for(;(i=e.current())!==-1&&!bt(i);)e.advance();return e.pos!==t};gt.regexp_eatExtendedPatternCharacter=function(e){let t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};gt.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");let t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(let t of i)t.separatedFrom(e.branchID)||e.raise("Duplicate capture group name");else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}};gt.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};gt.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ae(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ae(e.lastIntValue);return!0}return!1};gt.regexp_eatRegExpIdentifierStart=function(e){let t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),vt(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};gt.regexp_eatRegExpIdentifierPart=function(e){let t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),St(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};gt.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};gt.regexp_eatBackReference=function(e){let t=e.pos;if(this.regexp_eatDecimalEscape(e)){let i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};gt.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};gt.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};gt.regexp_eatCControlLetter=function(e){let t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};gt.regexp_eatZero=function(e){return e.current()===48&&!Rt(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};gt.regexp_eatControlEscape=function(e){let t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};gt.regexp_eatControlLetter=function(e){let t=e.current();return Et(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};gt.regexp_eatRegExpUnicodeEscapeSequence=function(e,t=!1){let i=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){let t=e.lastIntValue;if(s&&t>=55296&&t<=56319){let i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){let i=e.lastIntValue;if(i>=56320&&i<=57343)return e.lastIntValue=(t-55296)*1024+(i-56320)+65536,!0}e.pos=i,e.lastIntValue=t}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ct(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=i}return!1};gt.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;let t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};gt.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;let t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};var _t=0,At=1,It=2;gt.regexp_eatCharacterClassEscape=function(e){let t=e.current();if(Pt(t))return e.lastIntValue=-1,e.advance(),At;let i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();let t;if(e.eat(123)&&(t=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&t===It&&e.raise("Invalid property name"),t;e.raise("Invalid property name")}return _t};gt.regexp_eatUnicodePropertyValueExpression=function(e){let t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){let t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){let i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,i),At}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){let t=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,t)}return _t};gt.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){te(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};gt.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return At;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return It;e.raise("Invalid property name")};gt.regexp_eatUnicodePropertyName=function(e){let t=0;for(e.lastStringValue="";Nt(t=e.current());)e.lastStringValue+=ae(t),e.advance();return e.lastStringValue!==""};gt.regexp_eatUnicodePropertyValue=function(e){let t=0;for(e.lastStringValue="";Tt(t=e.current());)e.lastStringValue+=ae(t),e.advance();return e.lastStringValue!==""};gt.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};gt.regexp_eatCharacterClass=function(e){if(e.eat(91)){let t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===It&&e.raise("Negated character class may contain strings"),!0}return!1};gt.regexp_classContents=function(e){return e.current()===93?At:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),At)};gt.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){let t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){let i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};gt.regexp_eatClassAtom=function(e){let t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){let t=e.current();(t===99||Mt(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}let i=e.current();return i!==93?(e.lastIntValue=i,e.advance(),!0):!1};gt.regexp_eatClassEscape=function(e){let t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};gt.regexp_classSetExpression=function(e){let t=At,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===It&&(t=It);let s=e.pos;for(;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==It&&(t=At);continue}e.raise("Invalid character in character class")}if(s!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===It&&(t=It)}};gt.regexp_eatClassSetRange=function(e){let t=e.pos;if(this.regexp_eatClassSetCharacter(e)){let i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){let t=e.lastIntValue;return i!==-1&&t!==-1&&i>t&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};gt.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?At:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};gt.regexp_eatNestedClass=function(e){let t=e.pos;if(e.eat(91)){let i=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return i&&s===It&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){let i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null};gt.regexp_eatClassStringDisjunction=function(e){let t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){let t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=t}return null};gt.regexp_classStringDisjunctionContents=function(e){let t=this.regexp_classString(e);for(;e.eat(124);)this.regexp_classString(e)===It&&(t=It);return t};gt.regexp_classString=function(e){let t=0;for(;this.regexp_eatClassSetCharacter(e);)t++;return t===1?At:It};gt.regexp_eatClassSetCharacter=function(e){let t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);let i=e.current();return i<0||i===e.lookahead()&&Lt(i)||Vt(i)?!1:(e.advance(),e.lastIntValue=i,!0)};gt.regexp_eatClassSetReservedPunctuator=function(e){let t=e.current();return Ot(t)?(e.lastIntValue=t,e.advance(),!0):!1};gt.regexp_eatClassControlLetter=function(e){let t=e.current();return Rt(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};gt.regexp_eatHexEscapeSequence=function(e){let t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};gt.regexp_eatDecimalDigits=function(e){let t=e.pos,i=0;for(e.lastIntValue=0;Rt(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};gt.regexp_eatHexDigits=function(e){let t=e.pos,i=0;for(e.lastIntValue=0;jt(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ft(i),e.advance();return e.pos!==t};gt.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){let t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){let i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};gt.regexp_eatOctalDigit=function(e){let t=e.current();return Mt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};gt.regexp_eatFixedHexDigits=function(e,t){let i=e.pos;e.lastIntValue=0;for(let s=0;s<t;++s){let t=e.current();if(!jt(t))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Ft(t),e.advance()}return!0};var Dt=class{constructor(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new le(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])}},Bt=be.prototype;Bt.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Dt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};Bt.getToken=function(){return this.next(),new Dt(this)};typeof Symbol<"u"&&(Bt[Symbol.iterator]=function(){return{next:()=>{let e=this.getToken();return{done:e.type===H.eof,value:e}}}});Bt.nextToken=function(){let e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(H.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};Bt.readToken=function(e){return M(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};Bt.fullCharCodeAt=function(e){let t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;let i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888};Bt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};Bt.skipBlockComment=function(){let e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(let e,i=t;(e=K(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=e;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};Bt.skipLineComment=function(e){let t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);for(;this.pos<this.input.length&&!Q(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};Bt.skipSpace=function(){e:for(;this.pos<this.input.length;){let e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++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(e>8&&e<14||e>=5760&&X.test(String.fromCharCode(e)))++this.pos;else break e}}};Bt.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());let i=this.type;this.type=e,this.value=t,this.updateContext(i)};Bt.readToken_dot=function(){let e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);let t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(H.ellipsis)):(++this.pos,this.finishToken(H.dot))};Bt.readToken_slash=function(){let e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(H.assign,2):this.finishOp(H.slash,1)};Bt.readToken_mult_modulo_exp=function(e){let t=this.input.charCodeAt(this.pos+1),i=1,s=e===42?H.star:H.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,s=H.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(H.assign,i+1):this.finishOp(s,i)};Bt.readToken_pipe_amp=function(e){let t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(H.assign,3):this.finishOp(e===124?H.logicalOR:H.logicalAND,2):t===61?this.finishOp(H.assign,2):this.finishOp(e===124?H.bitwiseOR:H.bitwiseAND,1)};Bt.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(H.assign,2):this.finishOp(H.bitwiseXOR,1)};Bt.readToken_plus_min=function(e){let t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||z.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(H.incDec,2):t===61?this.finishOp(H.assign,2):this.finishOp(H.plusMin,1)};Bt.readToken_lt_gt=function(e){let t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(H.assign,i+1):this.finishOp(H.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(H.relational,i))};Bt.readToken_eq_excl=function(e){let t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(H.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(H.arrow)):this.finishOp(e===61?H.eq:H.prefix,1)};Bt.readToken_question=function(){let e=this.options.ecmaVersion;if(e>=11){let t=this.input.charCodeAt(this.pos+1);if(t===46){let e=this.input.charCodeAt(this.pos+2);if(e<48||e>57)return this.finishOp(H.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(H.assign,3):this.finishOp(H.coalesce,2)}return this.finishOp(H.question,1)};Bt.readToken_numberSign=function(){let e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),M(t,!0)||t===92))return this.finishToken(H.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ae(t)+"'")};Bt.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(H.parenL);case 41:return++this.pos,this.finishToken(H.parenR);case 59:return++this.pos,this.finishToken(H.semi);case 44:return++this.pos,this.finishToken(H.comma);case 91:return++this.pos,this.finishToken(H.bracketL);case 93:return++this.pos,this.finishToken(H.bracketR);case 123:return++this.pos,this.finishToken(H.braceL);case 125:return++this.pos,this.finishToken(H.braceR);case 58:return++this.pos,this.finishToken(H.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(H.backQuote);case 48:let t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===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(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(H.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ae(e)+"'")};Bt.finishOp=function(e,t){let i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};Bt.readRegexp=function(){let e,t,i=this.pos;for(;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");let s=this.input.charAt(this.pos);if(z.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(s==="[")t=!0;else if(s==="]"&&t)t=!1;else if(s==="/"&&!t)break;e=s==="\\"}++this.pos}let s=this.input.slice(i,this.pos);++this.pos;let r=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(r);let n=this.regexpState||(this.regexpState=new yt(this));n.reset(i,s,a),this.validateRegExpFlags(n),this.validateRegExpPattern(n);let o=null;try{o=new RegExp(s,a)}catch{}return this.finishToken(H.regexp,{pattern:s,flags:a,value:o})};Bt.readInt=function(e,t,i){let s=this.options.ecmaVersion>=12&&t===void 0,r=i&&this.input.charCodeAt(this.pos)===48,a=this.pos,n=0,o=0;for(let i=0,a=t??1/0;i<a;++i,++this.pos){let t=this.input.charCodeAt(this.pos),a;if(s&&t===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),i===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=t;continue}if(t>=97?a=t-97+10:t>=65?a=t-65+10:t>=48&&t<=57?a=t-48:a=1/0,a>=e)break;o=t,n=n*e+a}return s&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||t!=null&&this.pos-a!==t?null:n};Bt.readRadixNumber=function(e){let t=this.pos;this.pos+=2;let i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=qt(this.input.slice(t,this.pos)),++this.pos):M(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(H.num,i)};Bt.readNumber=function(e){let t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");let i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");let s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&s===110){let e=qt(this.input.slice(t,this.pos));return++this.pos,M(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(H.num,e)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),M(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");let r=Ut(this.input.slice(t,this.pos),i);return this.finishToken(H.num,r)};Bt.readCodePoint=function(){let e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();let e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t};Bt.readString=function(e){let t="",i=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let s=this.input.charCodeAt(this.pos);if(s===e)break;s===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Q(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(H.string,t)};var Wt={};Bt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Wt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};Bt.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Wt;this.raise(e,t)};Bt.readTmplToken=function(){let e="",t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");let i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===H.template||this.type===H.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(H.dollarBraceL)):(++this.pos,this.finishToken(H.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(H.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Q(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`\n`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};Bt.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(H.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`\n`&&++this.pos;case`\n`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};Bt.readEscapedChar=function(e){let t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`\n`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ae(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){let e=this.pos-1;this.invalidStringToken(e,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){let i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(i,8);return s>255&&(i=i.slice(0,-1),s=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),(i!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Q(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};Bt.readHexChar=function(e){let t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};Bt.readWord1=function(){this.containsEsc=!1;let e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;for(;this.pos<this.input.length;){let r=this.fullCharCodeAtPos();if(D(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);let r=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;let a=this.readCodePoint();(t?M:D)(a,s)||this.invalidStringToken(r,"Invalid Unicode escape"),e+=ae(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};Bt.readWord=function(){let e=this.readWord1(),t=H.name;return this.keywords.test(e)&&(t=$[e]),this.finishToken(t,e)};var $t="8.19.0";be.acorn={Parser:be,version:$t,defaultOptions:pe,Position:oe,SourceLocation:le,getLineInfo:he,Node:He,TokenType:B,tokTypes:H,keywordTypes:$,TokContext:je,tokContexts:Fe,isIdentifierChar:D,isIdentifierStart:M,Token:Dt,isNewLine:Q,lineBreak:z,lineBreakG:J,nonASCIIwhitespace:X};var Jt={..._};var Qt={name:"JPEG XL Image Optimizer",listing:"JPEG XL copies for EmDash media. Text stays exact; photos use a chosen quality. Other browsers receive the original.",listingEncoder:"rapier-jxl encodes JPEG XL with WebAssembly. Efforts 6–9 measure photo quality; efforts 1–5 predict it.",listingFamily:"rapier-jxl is the encoder inside [rapier.website](https://rapier.website), the free Markdown editor and painting app. Rapier is also a free [Android app](https://play.google.com/store/apps/details?id=app.rapier&referrer=utm_source%3Demdash) that opens and converts JPEG XL pictures.",listingNew:"New in 8.4.0: EmDash 1.5's `<Image formats>` offers JPEG XL first. A replaced image is converted at once. Phone photos with long headers work on Workers Free. WordPress libraries convert faster and resume where they stopped.",titleInfo:"Every upload gets a JPEG XL copy, served to compatible browsers. Browsers which cannot display it get served the original file.",saved:"{size} saved",images:"{count} images · {percent}% smaller",image:"{count} image · {percent}% smaller",convertOlder:"Convert {count} older images",convertOlderOne:"Convert {count} older image",serverNote:"Runs on your server.",allConverted:"All images converted.",imagesLabel:"Your images",mode:"Mode",modeInfo:"Same look: looks like the original, much smaller. Exact: Lossless. Size limit: fits under the size limit you set.",sameLook:"Same look",exact:"Exact",sizeLimit:"Size limit",sizeLimitInfo:"Each image fits under this size, at the best possible quality.",quality:"Quality",qualityInfo:"1 to 100. 90 suits most photos.",effort:"Effort",effortInfo:"1 to 9. Higher: smaller files, slower.",sizes:"Sizes",sizesInfo:"Smaller copies for small screens.",sizeCount:"{count} sizes",sizeCountOne:"{count} size",widths:"Widths",widthsDescription:"Widths of responsive image copies, in pixels.",widthsError:"Use up to 16 widths, from 16 to 8192 pixels.",recent:"Recent",originals:"Keep original JPEG files",originalsInfo:"JPEGs are kept as JPEG XL, then converted back losslessly when needed. Other formats always keep the original file.",originalsPaid:"Needs the Workers Paid plan.",about:"About {label}",decrease:"Decrease {label}",increase:"Increase {label}",infoGlyph:"i",minusGlyph:"−",plusGlyph:"+",arrowGlyph:"›",menuGlyph:"⋯",percentSaved:"−{percent}%",deliverySizes:"{before} → {after}",bytes:"B",kilobytes:"KB",megabytes:"MB",downloadOriginal:"Download original",useOriginal:"Use original",makeSmaller:"Make smaller",actionsFor:"Actions for {name}",cancelImage:"Cancel {name}",showMore:"Show more",cancel:"Cancel",pause:"Pause",resume:"Resume",continue:"Continue",retry:"Retry",close:"Close",loadingImages:"Reading your images…",emptyImages:"No images yet. Upload images in ",media:"Media",sentenceEnd:".",emptyRecent:"Your images will appear here.",imagesError:"Your images could not be refreshed.",loadingSettings:"Loading settings…",settingsNotSaved:"Settings not saved",settingsUnavailable:"Settings unavailable",limitError:"Enter a positive size in KB.",pausing:"Pausing…",preparing:"Preparing images…",convertingImages:"Converting images",paused:"Paused",canceling:"Canceling…",countOfTotal:"{count} of {total}",queueError:"The conversion queue could not be refreshed.",convertingBrowser:"Converting in this browser",savingCopy:"Saving the copy",converting:"Converting",original:"Original",done:"Done",canceled:"Canceled",waiting:"Waiting",alreadySmall:"Already small",notExact:"Not exact",tooLarge:"Too large",changed:"Changed",missing:"Missing",notSupported:"Not supported",overTarget:"Over target",notPicture:"Not a picture",failed:"Could not convert",linksNotUpdated:"Links not updated",importSiteExport:"Import a site export",importDescription:"Choose your old site's export file. EmDash imports the original images and updates links in your posts.",chooseExport:"Choose export",foundImages:"{count} images",foundImage:"{count} image",importCount:"Import {count}",importingImages:"Importing images…",updatingLinks:"Updating post links…",importedImages:"{count} images imported. Post links are updated.",importedImage:"{count} image imported. Post links are updated.",importLinksError:"Images were imported, but post links were not updated.",cancelImport:"Cancel import",setupIntro:"Just run this in your site's folder:",setupCommandTab:"Command",setupAgentTab:"Coding agent",setupManualTab:"By hand",setupCommand:"npx jpegxl add emdash",setupAgent:"Add jpegxl to my EmDash site with npx jpegxl add emdash.",setupInstall:`npm install jpegxl \\\n @cloudflare/kumo@2.6.0`,setupManual:`import {jxl}\n from 'jpegxl/emdash';\n\njxl(emdash, {\n // Your existing EmDash options.\n})`,setupOpen:"open the optimizer",setupAfter:"Then open the optimizer and remove this guide.",faqWhatQuestion:"What does this plug-in do?",faqWhatAnswer:"It makes a JPEG XL copy of every image in your media library. Browsers that show JPEG XL get the copy. Incompatible browsers are served your original file.",faqFormatQuestion:"Which browsers show JPEG XL?",faqFormatAnswer:"Chrome, Firefox and Safari all now support JXL by default.",faqSmallerQuestion:"How much smaller will my images be?",faqSmallerAnswer:'File size depends on the picture and effort. "Exact" preserves every pixel. "Same look" aims at the selected quality.',faqLookQuestion:"Will my images look worse?",faqLookAnswer:'"Same look" uses SSIMULACRA 2: efforts 6–9 measure the result; efforts 1–5 predict it. "Exact" preserves every pixel.',faqOriginalQuestion:"What happens to my original files?",faqOriginalAnswer:"Nothing is ever lost. JPEGs are kept as JPEG XL, then converted back losslessly into the identical JPEG when needed. Other formats always keep the original file.",faqPrivateQuestion:"Do I need an account, key or a subscription?",faqPrivateAnswer:"No. Images are converted on your own server, or in your own browser where the server cannot handle it. Nothing is uploaded and there are no usage limits.",faqOlderQuestion:"What about older images or an imported site?",faqOlderAnswer:`The plug-in's page converts older images in the background. "Import a site export" brings in the images from your old site's export file and updates the links in your posts.`,faqWhereQuestion:"Which images does it convert?",faqWhereAnswer:"JPEG, PNG, WebP and AVIF. GIF and SVG are left as they are.",faqEffortQuestion:"What is Effort?",faqEffortAnswer:"Effort is how much work the encoder does to find a smaller file, from 1 to 9. The default is 7.",faqSizesQuestion:"Does it work with responsive images and CDNs?",faqSizesAnswer:"Yes. Sizes makes JPEG XL copies up to 3840 pixels wide, and image responses carry `Vary: Accept`.",faqCacheQuestion:"Does it work with my CDN or page cache?",faqCacheAnswer:"Image responses carry `Vary: Accept`, so any cache that honors it keeps the JPEG XL copy and the original separate.",faqHowQuestion:"How does it work?",faqHowAnswer:"rapier-jxl encodes JPEG XL on the site's server or in the browser. It keeps an original JPEG losslessly when possible. Photo quality is measured at efforts 6–9 and predicted at efforts 1–5.",faqRemovalQuestion:"How do I remove it?",faqRemovalSteps:"Run `npx jpegxl remove emdash`. It restores every original JPEG, then removes the plug-in.",faqRemovalAnswer:"`npx jpegxl remove emdash` restores every original file.",faqStorageQuestion:"What storage works?",faqStorageAnswer:"Cloudflare R2 and Node local storage."};var Xt="jpegxl",Yt=Qt.setupCommand,Zt=Qt.faqRemovalAnswer,ei={addHelp:`Usage: ${Xt} add emdash [--package <tarball>] [--workers-paid | --workers-free]\n\nAdd {name} to an EmDash site.\n${Qt.setupIntro}\n${Yt}\n\nKeeps its adapter, database, media storage and other plugins.\n\nOptions:\n --package <tarball> Install a local jpegxl package\n --workers-paid Use Workers Paid with a 30,000 ms CPU allowance\n --workers-free Use Workers Free and keep uploaded JPEG originals\n --dry-run Say what would change, and change nothing\n --json One JSON object: what changed\n -h, --help Show this help\n\nCloudflare setup asks Workers Paid? once when no allowance is recorded.\nUse an explicit Workers flag when running without an interactive terminal.\n`,removeHelp:`Usage: ${Xt} remove emdash [--url <site>]\n\n${Zt}\nKeep the site running until this command finishes.\n\nOptions:\n --url <site> EmDash URL (EMDASH_URL or http://localhost:4321)\n -h, --help Show this help\n\nUses EMDASH_TOKEN or the matching EmDash login.\n`,manual:"import {jxl} from 'jpegxl/emdash'; use jxl(emdash, {...})",removeFix:`restore JPEGs before disable; run npx ${Xt} remove emdash`,addOption:"unknown option: {option}",addHelpFix:`run: npx ${Xt} add emdash --help`,workersQuestion:"Workers Paid?",workersChoice:"workers: --workers-paid or --workers-free",workersChoiceFix:"flags: --workers-paid or --workers-free; Node: omit flags",workersAnswer:"workers: yes or no",workersDowngrade:"workers-free: restore JPEGs first",workersDowngradeFix:`run: npx ${Xt} remove emdash; then npx ${Xt} add emdash --workers-free`,workersHost:"cpuLimitMs: explicit number",workersHostFix:"cpuLimitMs: set third jxl() argument",workersSource:"wrangler: one source json/jsonc",workersSourceFix:"Paid: cpuLimitMs 30000, limits.cpu_ms 30000; Free: cpuLimitMs 10, no limits.cpu_ms",workersEnvironment:"worker environment: explicit selection",workersEnvironmentFix:"worker: configure matching environment and CPU allowance",workersJson:"wrangler: single JSON/JSONC object",workersChanged:"wrangler: changed during setup",workersChangedFix:"finish config edit; rerun setup",updatedWrangler:"Updated {file}.",removeOption:"unknown option: {option}",removeHelpFix:`run: npx ${Xt} remove emdash --help`,explicitObject:"{property}: explicit object",explicitProperty:"{property}: one explicit property",laterProperty:"{property}: later spread/computed key",configSyntax:"astro.config.mjs: unreadable",configSyntaxFix:"fix JavaScript syntax; rerun",emdashImport:"import: one emdash/astro",configDynamic:"config: static object or defineConfig({...})",explicitIntegrations:"integrations: array without spreads",reactMissing:"integrations: react() needed",reactFix:`add @astrojs/react; run npx ${Xt} add emdash`,oneIntegration:"integrations: one EmDash",explicitOptions:"EmDash options: explicit object",explicitStorage:"storage: local() or r2()",directWrapper:"wrapper: direct call",explicitWrapperImport:"wrapper: explicit import",directEmdash:"EmDash: direct call",manifest:"{file}: unreadable",manifestFix:"fix {file}; rerun",ambiguousPackage:"package: ambiguous npx source",ambiguousPackageFix:`run: ${Xt} add emdash --package <jpegxl.tgz>`,localPackage:"--package: local .tgz",localPackageFix:"use npm pack tarball",packageRead:"tarball: unreadable",packageReadFix:"use intact npm pack tarball",packageMissing:"tarball: missing jpegxl/emdash",packageMissingFix:"pack build with jpegxl/emdash",managerType:"packageManager: string",managerTypeFix:"set packageManager in package.json",managerUnsupported:"package manager: {manager} unsupported",managerUnsupportedFix:"install jpegxl and @cloudflare/kumo with {manager}",managerAmbiguous:"lockfiles: multiple package managers",managerAmbiguousFix:"set packageManager in package.json",managerRun:"{manager}: run failed",managerRunFix:"install jpegxl and @cloudflare/kumo with {manager}",managerExit:"{manager}: install failed ({reason})",managerExitCode:"exit: {code}",managerExitFix:`fix install; run npx ${Xt} add emdash`,configFile:"astro.config.mjs: regular unlinked file",configFileFix:"run in EmDash site; otherwise configure jxl() manually",siteMissing:"site: EmDash and Astro dependencies",siteMissingFix:"run in EmDash site folder",adminMissing:"@cloudflare/kumo: >=2.6.0",adminMissingFix:`install EmDash dependencies; run npx ${Xt} add emdash`,kumoMismatch:"@cloudflare/kumo: {siteVersion} vs {hostVersion}",kumoMismatchFix:`install @cloudflare/kumo@{hostVersion}; run npx ${Xt} add emdash`,dependencyOld:"{dependency}: >= {minimum}, got {version}",dependencyOldFix:`update {dependency}; run npx ${Xt} add emdash`,installing:"Installing {packages} with {manager}…",dryRun:"Dry run, nothing changed. Would install: {packages}. Would update: {files}.",dryRunNone:"nothing",tarball:"the jpegxl tarball",packageSeparator:" and ",installedMissing:"package: missing jpegxl/emdash",installedMissingFix:"reinstall jpegxl; rerun",packageChanged:"package: changed during setup",packageChangedFix:"finish packing; rerun setup",dependencyMissing:"{dependency}: >= {minimum} required",dependencyMissingFix:"install {dependency}; rerun",kumoInstalledMismatch:"@cloudflare/kumo: admin mismatch",kumoInstalledFix:"install @cloudflare/kumo@{hostVersion}; rerun",configChanged:"astro.config.mjs: changed during {action}",configChangedFix:"review config; rerun",setup:"setup",removal:"removal",updated:"Updated astro.config.mjs. The site keeps its existing storage and plugins.",alreadyAdded:"{name} is already set up.",added:"Restart the site. {setupAfter}",nativePage:"Optimizer: /_emdash/admin/plugins/rapier-media/jpeg-xl",alreadyRemoved:"{name} is not enabled in astro.config.mjs.",removed:Zt+" Removed {name} from astro.config.mjs.",restartRemoved:"Rebuild and redeploy the site to finish removal.",removalUrl:"url: HTTPS or localhost HTTP",removalUrlFix:"--url: origin only; no credentials/path/query/fragment",removalClient:"EmDash transport: unavailable",removalClientFix:"install EmDash dependencies; rerun",credentials:"login: expired or missing",loginFix:"run: npx emdash login --url {url}; or EMDASH_TOKEN",credentialHeader:"login: invalid custom headers",requestFailed:"restoration request: {status}",responseInvalid:"restoration response: invalid",restorationMismatch:"restoration response: wrong site/backend/operation",restorationFailed:"JPEG restoration: incomplete",restoring:"Restoring JPEGs: {count}"};import{readFile as ti}from"node:fs/promises";var ii=["jpegxl","rapier-jxl"],si=ii[0];import{stat as ri}from"node:fs/promises";import{dirname as ai,join as ni}from"node:path";var oi=(e,t,i)=>Object.assign(new Error(`${t}; ${i}`),{code:e,fix:i});var hi=[["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"]],pi=["package.json",...hi.map(([e])=>e)];import{readFile as fi,stat as mi,rm as gi,rmdir as xi,chmod as yi}from"node:fs/promises";import{dirname as wi,join as ki,sep as bi}from"node:path";import{createHash as vi}from"node:crypto";import{lstat as Si,mkdir as Ei,readFile as Ci,readlink as _i,realpath as Ai,rename as Ii,rm as Pi,writeFile as Ni}from"node:fs/promises";import{randomBytes as Ti}from"node:crypto";import{basename as Li,dirname as Vi,isAbsolute as Oi,join as Ri,relative as ji,resolve as Fi,sep as Mi}from"node:path";var Di=e=>process.platform==="win32"?e.toLowerCase():e,Bi=(e,t)=>{let i=ji(Di(e),Di(t));return i===""||i!==".."&&!i.startsWith(".."+Mi)&&!Oi(i)},Ui=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;var Gi=e=>e==="emdash"?".rapier-jxl-emdash.json":".rapier-jxl-add.json",Hi=e=>vi("sha256").update(e).digest("hex"),zi=e=>oi("JXL_SETUP",e,"restore the files recorded by add, then try again"),Ji=e=>fi(e).catch(e=>{if(e.code==="ENOENT")return null;throw e}),Qi=e=>e===null?null:Hi(e),Ki=(e,t)=>Qi(e)===t||e!==null&&Hi(Buffer.from(e.toString("latin1").replace(/\r\n/g,`\n`),"latin1"))===t,Xi=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Yi=(e,t)=>t.map(t=>e+".config."+t),Zi=["rapier-jxl-files.mjs"],es=[...Zi,"rapier-jxl-vite.mjs","rapier-jxl-vite.d.mts","rapier-jxl-images.d.ts","src/rapier-jxl-images.d.ts"],ts={vite:[...es,...Yi("vite",["ts","mts","js","mjs"])],sveltekit:[...es,...Yi("vite",["ts","mts","js","mjs"])],nuxt:[...es,...Yi("nuxt",["ts","mts","js","mjs"])],webpack:[...Zi,"rapier-jxl-webpack.mjs","rapier-jxl-webpack.d.mts",...["webpack","rspack"].flatMap(e=>Yi(e,["js","mjs","cjs","ts"]))],next:[...Zi,"rapier-jxl-next.mjs","rapier-jxl-next-proxy.mjs","rapier-jxl-next-loader.mjs","package.json",".gitignore",...["","src/"].flatMap(e=>["proxy","middleware"].flatMap(t=>["js","mjs","ts"].map(i=>e+t+"."+i)))],netlify:["netlify.toml",...["index.mjs","edge.mjs","manifest.yml","package.json","rapier-jxl-files.mjs"].map(e=>"netlify/plugins/rapier-jxl/"+e)],astro:[...Yi("astro",["mjs","js","ts","mts","cjs","cts"]),"src/jxl/service.mjs","src/jxl/service-workers.mjs","src/jxl/index.mjs","src/jxl/options.mjs","package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock"],workers:["jxl-worker.mjs","wrangler.json","wrangler.jsonc","wrangler.toml","package.json"],emdash:["astro.config.mjs","wrangler.json","wrangler.jsonc",...pi]},is=(e,t)=>Object.hasOwn(ts,e)&&ts[e].includes(t),ss=(e,t)=>typeof t=="string"&&ts[e]?.some(e=>e.startsWith(t+"/"));var ls=(e,t)=>Kt(ei[e],{name:Qt.name,...t}),hs=ls("addHelp"),ps=ls("removeHelp"),cs=(e,t=ei.manual)=>oi("JXL_SETUP",e,t);var fs=e=>e.type==="Property"?e.computed?e.key.type==="Literal"?e.key.value:null:e.key.name??e.key.value:null,ms=(e,t)=>e?.type==="CallExpression"&&!e.optional&&e.callee.type==="Identifier"&&e.callee.name===t;var xs=(e,t)=>ws(e,!1,t);var Ns=(e,t)=>{let i=u(e,t);return i!==""&&i!==".."&&!i.startsWith(".."+f)&&!d(i)};var js=256*1024*1024;var Us=e=>typeof e=="string"&&/^[a-f0-9]{32}$/.test(e);export{hs as ADD_EMDASH_HELP,ps as REMOVE_EMDASH_HELP,Bs as addEmdash,Vs as emdashConnection,xs as planEmdashConfig,ys as planEmdashRemoval,Ss as planWranglerAllowance,Ws as removeEmdash,us as runAddEmdash,ds as runRemoveEmdash};