@regele/devtools
Version:
A collection of developer utilities for code processing and text analysis
1 lines • 846 kB
JavaScript
import e from"fs";import t from"fast-glob";import n from"tty";import i from"util";import s from"os";import r from"chalk";import a from"ora";import{Command as o}from"commander";import l from"path";var c,p;function u(e,t){var n;if(t){const e=(null===(n=t.split(".").pop())||void 0===n?void 0:n.toLowerCase())||"";if(["js","cjs","mjs"].includes(e))return c.JavaScript;if(["jsx"].includes(e))return c.JSX;if(["ts"].includes(e))return c.TypeScript;if(["tsx"].includes(e))return c.TSX;if(["json"].includes(e))return c.JSON;if(["yaml","yml"].includes(e))return c.YAML;if(["css"].includes(e))return c.CSS;if(["scss","sass"].includes(e))return c.SCSS;if(["less"].includes(e))return c.LESS;if(["html","htm","xhtml","jsp","asp","aspx","cshtml","razor","ejs","hbs","handlebars","pug","jade"].includes(e))return c.HTML;if(["xml","xsd","xsl","xslt"].includes(e))return c.XML;if(["svg"].includes(e))return c.SVG;if(["py","pyw"].includes(e))return c.Python;if(["rb"].includes(e))return c.Ruby;if(["php","php5","phtml","inc"].includes(e))return c.PHP;if(["java"].includes(e))return c.Java;if(["cs"].includes(e))return c.CSharp;if(["c","h"].includes(e))return c.C;if(["cpp","hpp","cc","cxx","c++"].includes(e))return c.CPP;if(["go"].includes(e))return c.Go;if(["swift"].includes(e))return c.Swift;if(["kt"].includes(e))return c.Kotlin;if(["rs"].includes(e))return c.Rust;if(["sh","bash","zsh","fish","ksh"].includes(e))return c.Shell;if(["ps1"].includes(e))return c.PowerShell;if(["bat","cmd"].includes(e))return c.Batch;if(["sql","mysql","pgsql","sqlite","plsql"].includes(e))return c.SQL;if(["md","markdown"].includes(e))return c.Markdown;if(["txt"].includes(e))return c.Text}const i=e.slice(0,1e3).trim();return i.includes("import React")||i.includes('from "react"')||i.includes("from 'react'")||i.match(/<\w+(\s+\w+=".*?")*\s*\/?>/)||i.includes("</")?i.includes(": ")||i.includes("interface ")||i.includes("type ")||i.match(/:\s*[A-Za-z]+[<>]/)||i.includes("as ")?i.includes("JSX")||i.includes("<>")?c.TSX:c.TypeScript:i.includes("JSX")||i.includes("<>")?c.JSX:c.JavaScript:i.startsWith("{")&&i.includes('"')||i.startsWith("[")&&i.includes('"')?c.JSON:i.match(/^[a-zA-Z0-9_-]+:\s*[^\s]/)||i.match(/^\s+- [a-zA-Z0-9_-]+:/)?c.YAML:i.includes("{")&&i.includes("}")&&i.includes(":")&&(i.includes(";")||i.includes("px")||i.includes("em"))?c.CSS:i.match(/<html|<!DOCTYPE|<head|<body|<div/i)?c.HTML:i.match(/<\?xml|<[a-zA-Z0-9_-]+>[\s\S]*?<\/[a-zA-Z0-9_-]+>/)?c.XML:i.includes("<svg")||i.includes("xmlns:svg=")?c.SVG:i.match(/^(import|from|def|class)\s/m)||i.includes('if __name__ == "__main__"')||i.match(/^\s*#.*$/m)?c.Python:i.match(/^(require|class|def|module)\s/m)||i.includes("do |")||i.includes("end")?c.Ruby:i.includes("<?php")||i.match(/^\s*<\?/)?c.PHP:i.match(/public\s+(class|interface|enum)/)||i.match(/import\s+java\./)||i.match(/package\s+[a-z0-9_.]+;/)?c.Java:i.match(/using\s+System;/)||i.match(/namespace\s+[A-Za-z0-9_.]+/)||i.includes("public class ")?c.CSharp:i.match(/#include\s+[<"].*[>"]/)?i.includes("std::")||i.includes("namespace ")?c.CPP:c.C:i.match(/package\s+[a-z0-9_]+/)||i.match(/import\s+\(/)||i.match(/func\s+[A-Za-z0-9_]+\(/)?c.Go:i.match(/import\s+Foundation/)||i.match(/class\s+[A-Za-z0-9_]+\s*:/)||i.match(/func\s+[a-zA-Z0-9_]+\(/)?c.Swift:i.match(/fun\s+[a-zA-Z0-9_]+\(/)||i.match(/val\s+[a-zA-Z0-9_]+:/)||i.match(/var\s+[a-zA-Z0-9_]+:/)?c.Kotlin:i.match(/^#!/)||i.match(/^\s*#.*$/m)||i.match(/echo\s+["']/)||i.match(/export\s+[A-Z_]+=/)?c.Shell:i.includes("function ")&&i.includes("param(")?c.PowerShell:i.match(/^@echo off/i)||i.match(/^REM\s/i)||i.match(/^(set|echo|if|goto)\s/im)?c.Batch:i.match(/SELECT\s+.*\s+FROM/i)||i.match(/CREATE\s+TABLE/i)||i.match(/INSERT\s+INTO/i)||i.match(/UPDATE\s+.*\s+SET/i)?c.SQL:i.match(/^#\s+/)||i.match(/\n#{1,6}\s+/)||i.match(/\[.*\]\(.*\)/)||i.match(/\*\*.*\*\*/)?c.Markdown:i.split("\n").length>1||i.length>0?c.Text:c.Unknown}function h(e){return[c.JavaScript,c.TypeScript,c.JSX,c.TSX].includes(e)?p.JavaScript:[c.HTML,c.SVG].includes(e)?p.HTML:e===c.XML?p.XML:[c.CSS,c.SCSS,c.LESS].includes(e)?p.CSS:e===c.JSON?p.JSON:e===c.YAML?p.YAML:e===c.Python?p.Python:e===c.Ruby?p.Ruby:e===c.PHP?p.PHP:[c.Java,c.CSharp,c.C,c.CPP,c.Go,c.Swift,c.Kotlin,c.Rust].includes(e)?p.CStyle:[c.Shell,c.PowerShell,c.Batch].includes(e)?p.Shell:e===c.SQL?p.SQL:e===c.Markdown?p.Markdown:e===c.Text?p.Text:p.Unknown}function d(e){const t=e.split("").filter((e=>{const t=e.charCodeAt(0);return t<9||t>13&&t<32&&27!==t})).length;return t>.05*e.length}!function(e){e.JavaScript="javascript",e.TypeScript="typescript",e.JSX="jsx",e.TSX="tsx",e.HTML="html",e.CSS="css",e.SCSS="scss",e.LESS="less",e.JSON="json",e.XML="xml",e.SVG="svg",e.Python="python",e.Ruby="ruby",e.PHP="php",e.Java="java",e.CSharp="csharp",e.CPP="cpp",e.C="c",e.Go="go",e.Swift="swift",e.Kotlin="kotlin",e.Rust="rust",e.Shell="shell",e.PowerShell="powershell",e.Batch="batch",e.SQL="sql",e.Markdown="markdown",e.YAML="yaml",e.Text="text",e.Unknown="unknown"}(c||(c={})),function(e){e.JavaScript="js",e.HTML="html",e.CSS="css",e.JSON="json",e.XML="xml",e.Python="python",e.Ruby="ruby",e.PHP="php",e.CStyle="cstyle",e.Shell="shell",e.SQL="sql",e.Markdown="markdown",e.YAML="yaml",e.Text="text",e.Unknown="unknown"}(p||(p={}));const f=["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/package-lock.json","**/yarn.lock","**/*.min.js","**/*.min.css","**/*.bundle.js"];async function m(e,n={}){const i=[...f,...n.ignore||[]],s=(Array.isArray(e)?e:[e]).map((e=>e.replace(/\\/g,"/")));return await t(s,{ignore:i,onlyFiles:!0,absolute:!0,followSymbolicLinks:!1})}function y(t){try{const n=e.readFileSync(t,"utf8");return{content:n,fileType:u(n,t)}}catch(e){throw new Error(`Failed to read file ${t}: ${e.message}`)}}function T(t,n){try{return e.writeFileSync(t,n,"utf8"),!0}catch(e){throw new Error(`Failed to write file ${t}: ${e.message}`)}}async function g(e,t,n={}){try{const{content:i,fileType:s}=y(e),r=i.length;if(!i.trim())return{path:e,success:!0,fileType:s,originalSize:r,newSize:r,diffSize:0,diffPercentage:0};const a=await t(i,s),o=a.length,l=r-o,c=r>0?l/r*100:0;return n.write&&T(e,a),{path:e,success:!0,fileType:s,originalSize:r,newSize:o,diffSize:l,diffPercentage:c}}catch(t){return{path:e,success:!1,error:t.message}}}async function S(e,t,n={}){const i=await m(e,n),s=[];for(const e of i){const i=await g(e,t,n);s.push(i)}return s}function x(e){const t=e.filter((e=>e.success)),n=e.length-t.length,i=t.reduce(((e,t)=>e+(t.originalSize||0)),0),s=t.reduce(((e,t)=>e+(t.newSize||0)),0),r=i-s,a=t.length>0?t.reduce(((e,t)=>e+(t.diffPercentage||0)),0)/t.length:0;return{totalFiles:e.length,successCount:t.length,errorCount:n,totalOriginalSize:i,totalNewSize:s,totalDiffSize:r,averageDiffPercentage:a}}class b{constructor(e){this.options={singleLine:!0,multiLine:!0,jsxComments:!0,emptyLines:!0,...e}}removeComments(e,t){if(!e.trim())return"";const n=h("string"==typeof t&&t in c?t:u(e));try{switch(n){case p.JavaScript:return this.removeJavaScriptComments(e);case p.HTML:return this.removeHTMLComments(e);case p.CSS:return this.removeCSSComments(e);case p.JSON:return this.removeJavaScriptComments(e);case p.Text:return e;default:return this.removeJavaScriptComments(e)}}catch(e){throw new Error(`Failed during comment removal: ${e.message}`)}}removeJavaScriptComments(e){let t=e;try{const e=[];let n=0;t=t.replace(/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/(?:[gimuy]+\b)?/g,(t=>{const i=`__PRESERVED_ITEM_${n}__`;return e[n]=t,n++,i})),this.options.jsxComments&&(t=t.replace(/\{\/\*[\s\S]*?\*\/\}/g,"")),this.options.multiLine&&(t=t.replace(/\/\*[\s\S]*?\*\//g,"")),this.options.singleLine&&(t=t.replace(/^[ \t]*\/\/.*$/gm,""),t=t.replace(/([^:/])\/\/.*$/gm,"$1"));for(let i=0;i<n;i++){const n=`__PRESERVED_ITEM_${i}__`,s=new RegExp(n,"g");t=t.replace(s,(()=>e[i]))}return this.options.emptyLines&&(t=this.removeEmptyLines(t)),t.trim()}catch(e){throw new Error(`JavaScript comment removal failed: ${e.message}`)}}removeHTMLComments(e){let t=e;try{const e=[];let n=0;t=t.replace(/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/g,(t=>{const i=`__PRESERVED_ITEM_${n}__`;return e[n]=t,n++,i})),this.options.multiLine&&(t=t.replace(/<!--[\s\S]*?-->/g,""));for(let i=0;i<n;i++){const n=`__PRESERVED_ITEM_${i}__`,s=new RegExp(n,"g");t=t.replace(s,(()=>e[i]))}return this.options.emptyLines&&(t=this.removeEmptyLines(t)),t.trim()}catch(e){throw new Error(`HTML comment removal failed: ${e.message}`)}}removeCSSComments(e){let t=e;try{const e=[];let n=0;t=t.replace(/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/g,(t=>{const i=`__PRESERVED_ITEM_${n}__`;return e[n]=t,n++,i})),this.options.multiLine&&(t=t.replace(/\/\*[\s\S]*?\*\//g,""));for(let i=0;i<n;i++){const n=`__PRESERVED_ITEM_${i}__`,s=new RegExp(n,"g");t=t.replace(s,(()=>e[i]))}return this.options.emptyLines&&(t=this.removeEmptyLines(t)),t.trim()}catch(e){throw new Error(`CSS comment removal failed: ${e.message}`)}}removeEmptyLines(e){let t=e.replace(/^\s*[\r\n]/gm,"");return t=t.replace(/\n(\s*)\n(\s*)\n/g,"\n$2\n"),t=t.replace(/^(\s*\n)+/,""),t=t.replace(/(\n\s*)+$/,""),t}updateOptions(e){this.options={...this.options,...e}}getOptions(){return{...this.options}}async cleanFiles(e,t={}){return S(e,(async(e,t)=>this.removeComments(e,t)),t)}}class E{constructor(e,t){this.options={semi:!0,singleQuote:!1,tabWidth:2,useTabs:!1,trailingComma:"es5",bracketSpacing:!0,arrowParens:"always",...e},this.prettier=t}async format(e,t){if(!e.trim())return"";const n="string"==typeof t&&t in c?t:u(e);try{return this.prettier?this.formatWithPrettier(e,n):"undefined"!=typeof window&&window.prettier?this.formatWithBrowserPrettier(e,n):this.formatWithSimpleFormatters(e)}catch(t){return console.warn("Formatting error:",t),e}}formatWithPrettier(e,t){const n=this.getPrettierParser(t);return this.prettier.format(e,{parser:n,...this.options})}formatWithBrowserPrettier(e,t){const n=this.getPrettierParser(t);return window.prettier.format(e,{parser:n,plugins:window.prettierPlugins?Object.values(window.prettierPlugins):void 0,...this.options})}getPrettierParser(e){switch(e){case c.JavaScript:case c.JSX:return"babel";case c.TypeScript:case c.TSX:return"typescript";case c.JSON:return"json";case c.CSS:return"css";case c.HTML:return"html";default:return"babel"}}formatWithSimpleFormatters(e){let t=e;return t=this.indentCode(t),t=this.formatQuotes(t),t=this.formatSemicolons(t),t}indentCode(e){const t=e.split("\n");let n=0;const i=this.options.useTabs?"\t":" ".repeat(this.options.tabWidth);return t.map((e=>{const t=e.trim();if(!t)return"";t.includes("}")&&n>0&&n--;const s=i.repeat(n)+t;return t.includes("{")&&n++,s})).join("\n")}formatQuotes(e){return this.options.singleQuote?e.replace(/"([^"\\]*(?:\\.[^"\\]*)*)"/g,((e,t)=>t.includes("'")?e:`'${t}'`)):e.replace(/'([^'\\]*(?:\\.[^'\\]*)*)'/g,((e,t)=>t.includes('"')?e:`"${t}"`))}formatSemicolons(e){return this.options.semi?e.replace(/(\w+|\)|\}|\])\s*(\n|$)/g,((e,t,n)=>t.endsWith(";")?e:`${t};${n}`)):e.replace(/;(\s*(\n|$))/g,"$1")}updateOptions(e){this.options={...this.options,...e}}getOptions(){return{...this.options}}setPrettier(e){this.prettier=e}async formatFiles(e,t={}){return S(e,(async(e,t)=>this.format(e,t)),t)}}class P{constructor(e){this.startTime=0,this.elapsedTime=0,this.isRunning=!1,this.intervalId=null,this.sessionHistory=[],this.currentSession=null,this.onTickCallback=null,this.onTickCallback=(null==e?void 0:e.onTick)||null,this.tickInterval=(null==e?void 0:e.tickInterval)||100}start(){this.isRunning||(this.startTime=Date.now()-this.elapsedTime,this.isRunning=!0,this.startInterval(),this.currentSession||(this.currentSession={id:Date.now(),startTime:new Date,duration:0,textSnapshots:[]}))}pause(){this.isRunning&&(this.clearInterval(),this.isRunning=!1,this.currentSession&&(this.currentSession.duration=this.elapsedTime))}stop(){this.clearInterval(),this.isRunning=!1,this.currentSession&&(this.currentSession.duration=this.elapsedTime,this.currentSession.endTime=new Date,this.sessionHistory.push(this.currentSession),this.currentSession=null),this.elapsedTime=0}reset(){this.clearInterval(),this.isRunning=!1,this.elapsedTime=0,this.currentSession=null}takeTextSnapshot(e){this.currentSession&&this.currentSession.textSnapshots.push({timestamp:new Date,text:e,elapsedTime:this.elapsedTime})}calculateWritingSpeed(){if(!this.currentSession||this.currentSession.textSnapshots.length<2)return{wordsPerMinute:0,charactersPerMinute:0,totalWords:0,totalCharacters:0,elapsedTimeMs:this.elapsedTime};const e=this.currentSession.textSnapshots,t=e[0],n=e[e.length-1],i=(n.elapsedTime-t.elapsedTime)/6e4;if(i<=0)return{wordsPerMinute:0,charactersPerMinute:0,totalWords:0,totalCharacters:0,elapsedTimeMs:this.elapsedTime};const s=""===t.text.trim()?0:t.text.trim().split(/\s+/).length,r=""===n.text.trim()?0:n.text.trim().split(/\s+/).length,a=Math.max(0,r-s),o=t.text.length,l=n.text.length,c=Math.max(0,l-o);return{wordsPerMinute:Math.round(a/i),charactersPerMinute:Math.round(c/i),totalWords:a,totalCharacters:c,elapsedTimeMs:this.elapsedTime}}get wpm(){const e=this.calculateWritingSpeed();return e?e.wordsPerMinute:0}get words(){const e=this.calculateWritingSpeed();return e?e.totalWords:0}getSessionHistory(){return[...this.sessionHistory]}getElapsedTime(){return this.elapsedTime}getFormattedTime(){return this.formatTime(this.elapsedTime)}isTimerRunning(){return this.isRunning}onTick(e){this.onTickCallback=e}formatTime(e){const t=Math.floor(e/1e3),n=Math.floor(t/3600),i=Math.floor(t%3600/60),s=t%60;return`${String(n).padStart(2,"0")}:${String(i).padStart(2,"0")}:${String(s).padStart(2,"0")}`}startInterval(){this.intervalId=setInterval((()=>{this.elapsedTime=Date.now()-this.startTime,this.onTickCallback&&this.onTickCallback(this.elapsedTime)}),this.tickInterval)}clearInterval(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}}class v{constructor(e="",t=200,n=25,i=60,s){this.text=e,this.wordsPerMinute=t,this.handwritingWpm=n,this.keyboardWpm=i,this.stats=this.calculateStats(),this.handwritingTimer=new P(s)}setText(e){this.text=e,this.stats=this.calculateStats()}getText(){return this.text}setReadingSpeed(e){this.wordsPerMinute=e,this.stats=this.calculateStats()}getReadingSpeed(){return this.wordsPerMinute}getStats(){return{...this.stats}}getCharacterCount(){return this.stats.characters}getCharacterCountNoSpaces(){return this.stats.charactersNoSpaces}getWordCount(){return this.stats.words}getSentenceCount(){return this.stats.sentences}getParagraphCount(){return this.stats.paragraphs}getReadingTime(){return this.stats.readingTime}getHandwritingTime(){return this.stats.handwritingTime||"~0 min"}getKeyboardTime(){return this.stats.keyboardTime||"~0 min"}setHandwritingSpeed(e){this.handwritingWpm=e,this.stats=this.calculateStats()}getHandwritingSpeed(){return this.handwritingWpm}setKeyboardSpeed(e){this.keyboardWpm=e,this.stats=this.calculateStats()}getKeyboardSpeed(){return this.keyboardWpm}calculateStats(){const e=this.text.length,t=this.text.replace(/\s/g,"").length,n=""===this.text.trim()?0:this.text.trim().split(/\s+/).length,i=""===this.text?0:this.text.split(/[.!?]+/).filter((e=>e.trim().length>0)).length,s=""===this.text?0:this.text.split(/\n\s*\n/).filter((e=>e.trim().length>0)).length,r=(e,t)=>{if(0===e)return"~0 min";const n=e/t;return this.formatTimeValue(n)};return{characters:e,charactersNoSpaces:t,words:n,sentences:i,paragraphs:s,readingTime:r(n,this.wordsPerMinute),handwritingTime:this.estimateHandwritingTime(n,e),keyboardTime:r(n,this.keyboardWpm)}}formatTimeValue(e){if(e<1)return"< 1 min";if(e<60)return`~${Math.ceil(e)} min`;return`~${Math.floor(e/60)}h ${Math.ceil(e%60)}m`}estimateHandwritingTime(e,t){const n=e>0?t/e:0,i=e/(this.handwritingWpm/(1*Math.min(1.5,Math.max(1,n/5))));return this.formatTimeValue(i)}getWordFrequency(){if(!this.text.trim())return{};const e={},t=this.text.toLowerCase().replace(/[^\w\s]/g,"").split(/\s+/).filter((e=>e.length>0));for(const n of t)e[n]=(e[n]||0)+1;return e}getMostFrequentWords(e=10){const t=this.getWordFrequency();return Object.entries(t).sort(((e,t)=>t[1]-e[1])).slice(0,e)}getReadabilityScore(){if(!this.text.trim())return 100;const e=this.stats.words,t=this.stats.sentences;if(0===e||0===t)return 100;const n=206.835-e/t*1.015-this.countSyllables()/e*84.6;return Math.max(0,Math.min(100,n))}countSyllables(){var e;if(!this.text.trim())return 0;const t=this.text.toLowerCase().replace(/[^\w\s]/g,"").split(/\s+/).filter((e=>e.length>0));let n=0;for(const i of t){let t=(null===(e=i.match(/[aeiouy]{1,2}/g))||void 0===e?void 0:e.length)||0;i.length>3&&i.endsWith("e")&&t--,n+=Math.max(1,t)}return n}startWritingSession(){this.handwritingTimer.start()}pauseWritingSession(){this.handwritingTimer.pause()}stopWritingSession(){this.handwritingTimer.stop()}resetWritingSession(){this.handwritingTimer.reset()}updateText(e){this.handwritingTimer.takeTextSnapshot(e),this.setText(e)}getWritingSpeed(){return this.handwritingTimer.calculateWritingSpeed()}getWritingSessionHistory(){return this.handwritingTimer.getSessionHistory()}getElapsedTime(){return this.handwritingTimer.getElapsedTime()}getFormattedElapsedTime(){return this.handwritingTimer.getFormattedTime()}isTimerRunning(){return this.handwritingTimer.isTimerRunning()}onTimerTick(e){this.handwritingTimer.onTick(e)}async analyzeFiles(e,t={}){const n=await m(e,t),i=[];for(const e of n)try{const{content:t,fileType:n}=y(e),s=t.length;if(!t.trim()){i.push({path:e,success:!0,fileType:n,originalSize:s,newSize:s,diffSize:0,diffPercentage:0,stats:{characters:0,charactersNoSpaces:0,words:0,sentences:0,paragraphs:0,readingTime:"0 min",handwritingTime:"0 min",keyboardTime:"0 min"},frequentWords:[],readabilityScore:100});continue}this.setText(t);const r=this.getStats(),a=this.getMostFrequentWords(10),o=this.getReadabilityScore();i.push({path:e,success:!0,fileType:n,originalSize:s,newSize:s,diffSize:0,diffPercentage:0,stats:r,frequentWords:a,readabilityScore:o})}catch(t){i.push({path:e,success:!1,error:t.message})}return i}}var A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function C(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w={};function I(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}Object.defineProperty(w,"__esModule",{value:!0});class N{constructor(e,t,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=t,this.index=n}}class k{constructor(e,t){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=t}}function O(e,t){const{line:n,column:i,index:s}=e;return new N(n,i+t,s+t)}const D="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var _={ImportMetaOutsideModule:{message:"import.meta may appear only with 'sourceType: \"module\"'",code:D},ImportOutsideModule:{message:"'import' and 'export' may appear only with 'sourceType: \"module\"'",code:D}};const L={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},M=e=>"UpdateExpression"===e.type?L.UpdateExpression[`${e.prefix}`]:L[e.type];var F={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:e})=>`'import.${e}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:e,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:e})=>`'${"ForInStatement"===e?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:e})=>`Unsyntactic ${"BreakStatement"===e?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${M(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${M(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${M(e)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map((e=>JSON.stringify(e))).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map((e=>JSON.stringify(e))).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${e?`, expected "${e}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."};const B=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]);var j=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${M({type:e})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'});const R=["message"];function U(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n})}function K({toMessage:e,code:t,reasonCode:n,syntaxPlugin:i}){const s="MissingPlugin"===n||"MissingOneOfPlugins"===n;{const e={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};e[n]&&(n=e[n])}return function r(a,o){const l=new SyntaxError;return l.code=t,l.reasonCode=n,l.loc=a,l.pos=a.index,l.syntaxPlugin=i,s&&(l.missingPlugin=o.missingPlugin),U(l,"clone",(function(e={}){var t;const{line:n,column:i,index:s}=null!=(t=e.loc)?t:a;return r(new N(n,i,s),Object.assign({},o,e.details))})),U(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){const t=`${e(o)} (${a.line}:${a.column})`;return this.message=t,t},set(e){Object.defineProperty(this,"message",{value:e,writable:!0})}}),l}}function V(e,t){if(Array.isArray(e))return t=>V(t,e[0]);const n={};for(const i of Object.keys(e)){const s=e[i],r="string"==typeof s?{message:()=>s}:"function"==typeof s?{message:s}:s,{message:a}=r,o=I(r,R),l="string"==typeof a?()=>a:a;n[i]=K(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:i,toMessage:l},t?{syntaxPlugin:t}:{},o))}return n}const W=Object.assign({},V(_),V(F),V({StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."}),V`pipelineOperator`(j));const{defineProperty:$}=Object,q=(e,t)=>{e&&$(e,t,{enumerable:!1,value:e[t]})};function J(e){return q(e.loc.start,"index"),q(e.loc.end,"index"),e}class Y{constructor(e,t){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!t}}const X={brace:new Y("{"),j_oTag:new Y("<tag"),j_cTag:new Y("</tag"),j_expr:new Y("<tag>...</tag>",!0)};X.template=new Y("`",!0);const z=!0,H=!0,G=!0,Q=!0,Z=!0;class ee{constructor(e,t={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=null!=t.binop?t.binop:null,this.updateContext=null}}const te=new Map;function ne(e,t={}){t.keyword=e;const n=ue(e,t);return te.set(e,n),n}function ie(e,t){return ue(e,{beforeExpr:z,binop:t})}let se=-1;const re=[],ae=[],oe=[],le=[],ce=[],pe=[];function ue(e,t={}){var n,i,s,r;return++se,ae.push(e),oe.push(null!=(n=t.binop)?n:-1),le.push(null!=(i=t.beforeExpr)&&i),ce.push(null!=(s=t.startsExpr)&&s),pe.push(null!=(r=t.prefix)&&r),re.push(new ee(e,t)),se}function he(e,t={}){var n,i,s,r;return++se,te.set(e,se),ae.push(e),oe.push(null!=(n=t.binop)?n:-1),le.push(null!=(i=t.beforeExpr)&&i),ce.push(null!=(s=t.startsExpr)&&s),pe.push(null!=(r=t.prefix)&&r),re.push(new ee("name",t)),se}const de={bracketL:ue("[",{beforeExpr:z,startsExpr:H}),bracketHashL:ue("#[",{beforeExpr:z,startsExpr:H}),bracketBarL:ue("[|",{beforeExpr:z,startsExpr:H}),bracketR:ue("]"),bracketBarR:ue("|]"),braceL:ue("{",{beforeExpr:z,startsExpr:H}),braceBarL:ue("{|",{beforeExpr:z,startsExpr:H}),braceHashL:ue("#{",{beforeExpr:z,startsExpr:H}),braceR:ue("}"),braceBarR:ue("|}"),parenL:ue("(",{beforeExpr:z,startsExpr:H}),parenR:ue(")"),comma:ue(",",{beforeExpr:z}),semi:ue(";",{beforeExpr:z}),colon:ue(":",{beforeExpr:z}),doubleColon:ue("::",{beforeExpr:z}),dot:ue("."),question:ue("?",{beforeExpr:z}),questionDot:ue("?."),arrow:ue("=>",{beforeExpr:z}),template:ue("template"),ellipsis:ue("...",{beforeExpr:z}),backQuote:ue("`",{startsExpr:H}),dollarBraceL:ue("${",{beforeExpr:z,startsExpr:H}),templateTail:ue("...`",{startsExpr:H}),templateNonTail:ue("...${",{beforeExpr:z,startsExpr:H}),at:ue("@"),hash:ue("#",{startsExpr:H}),interpreterDirective:ue("#!..."),eq:ue("=",{beforeExpr:z,isAssign:Q}),assign:ue("_=",{beforeExpr:z,isAssign:Q}),slashAssign:ue("_=",{beforeExpr:z,isAssign:Q}),xorAssign:ue("_=",{beforeExpr:z,isAssign:Q}),moduloAssign:ue("_=",{beforeExpr:z,isAssign:Q}),incDec:ue("++/--",{prefix:Z,postfix:!0,startsExpr:H}),bang:ue("!",{beforeExpr:z,prefix:Z,startsExpr:H}),tilde:ue("~",{beforeExpr:z,prefix:Z,startsExpr:H}),doubleCaret:ue("^^",{startsExpr:H}),doubleAt:ue("@@",{startsExpr:H}),pipeline:ie("|>",0),nullishCoalescing:ie("??",1),logicalOR:ie("||",1),logicalAND:ie("&&",2),bitwiseOR:ie("|",3),bitwiseXOR:ie("^",4),bitwiseAND:ie("&",5),equality:ie("==/!=/===/!==",6),lt:ie("</>/<=/>=",7),gt:ie("</>/<=/>=",7),relational:ie("</>/<=/>=",7),bitShift:ie("<</>>/>>>",8),bitShiftL:ie("<</>>/>>>",8),bitShiftR:ie("<</>>/>>>",8),plusMin:ue("+/-",{beforeExpr:z,binop:9,prefix:Z,startsExpr:H}),modulo:ue("%",{binop:10,startsExpr:H}),star:ue("*",{binop:10}),slash:ie("/",10),exponent:ue("**",{beforeExpr:z,binop:11,rightAssociative:!0}),_in:ne("in",{beforeExpr:z,binop:7}),_instanceof:ne("instanceof",{beforeExpr:z,binop:7}),_break:ne("break"),_case:ne("case",{beforeExpr:z}),_catch:ne("catch"),_continue:ne("continue"),_debugger:ne("debugger"),_default:ne("default",{beforeExpr:z}),_else:ne("else",{beforeExpr:z}),_finally:ne("finally"),_function:ne("function",{startsExpr:H}),_if:ne("if"),_return:ne("return",{beforeExpr:z}),_switch:ne("switch"),_throw:ne("throw",{beforeExpr:z,prefix:Z,startsExpr:H}),_try:ne("try"),_var:ne("var"),_const:ne("const"),_with:ne("with"),_new:ne("new",{beforeExpr:z,startsExpr:H}),_this:ne("this",{startsExpr:H}),_super:ne("super",{startsExpr:H}),_class:ne("class",{startsExpr:H}),_extends:ne("extends",{beforeExpr:z}),_export:ne("export"),_import:ne("import",{startsExpr:H}),_null:ne("null",{startsExpr:H}),_true:ne("true",{startsExpr:H}),_false:ne("false",{startsExpr:H}),_typeof:ne("typeof",{beforeExpr:z,prefix:Z,startsExpr:H}),_void:ne("void",{beforeExpr:z,prefix:Z,startsExpr:H}),_delete:ne("delete",{beforeExpr:z,prefix:Z,startsExpr:H}),_do:ne("do",{isLoop:G,beforeExpr:z}),_for:ne("for",{isLoop:G}),_while:ne("while",{isLoop:G}),_as:he("as",{startsExpr:H}),_assert:he("assert",{startsExpr:H}),_async:he("async",{startsExpr:H}),_await:he("await",{startsExpr:H}),_defer:he("defer",{startsExpr:H}),_from:he("from",{startsExpr:H}),_get:he("get",{startsExpr:H}),_let:he("let",{startsExpr:H}),_meta:he("meta",{startsExpr:H}),_of:he("of",{startsExpr:H}),_sent:he("sent",{startsExpr:H}),_set:he("set",{startsExpr:H}),_source:he("source",{startsExpr:H}),_static:he("static",{startsExpr:H}),_using:he("using",{startsExpr:H}),_yield:he("yield",{startsExpr:H}),_asserts:he("asserts",{startsExpr:H}),_checks:he("checks",{startsExpr:H}),_exports:he("exports",{startsExpr:H}),_global:he("global",{startsExpr:H}),_implements:he("implements",{startsExpr:H}),_intrinsic:he("intrinsic",{startsExpr:H}),_infer:he("infer",{startsExpr:H}),_is:he("is",{startsExpr:H}),_mixins:he("mixins",{startsExpr:H}),_proto:he("proto",{startsExpr:H}),_require:he("require",{startsExpr:H}),_satisfies:he("satisfies",{startsExpr:H}),_keyof:he("keyof",{startsExpr:H}),_readonly:he("readonly",{startsExpr:H}),_unique:he("unique",{startsExpr:H}),_abstract:he("abstract",{startsExpr:H}),_declare:he("declare",{startsExpr:H}),_enum:he("enum",{startsExpr:H}),_module:he("module",{startsExpr:H}),_namespace:he("namespace",{startsExpr:H}),_interface:he("interface",{startsExpr:H}),_type:he("type",{startsExpr:H}),_opaque:he("opaque",{startsExpr:H}),name:ue("name",{startsExpr:H}),placeholder:ue("%%",{startsExpr:!0}),string:ue("string",{startsExpr:H}),num:ue("num",{startsExpr:H}),bigint:ue("bigint",{startsExpr:H}),decimal:ue("decimal",{startsExpr:H}),regexp:ue("regexp",{startsExpr:H}),privateName:ue("#name",{startsExpr:H}),eof:ue("eof"),jsxName:ue("jsxName"),jsxText:ue("jsxText",{beforeExpr:!0}),jsxTagStart:ue("jsxTagStart",{startsExpr:!0}),jsxTagEnd:ue("jsxTagEnd")};function fe(e){return e>=93&&e<=133}function me(e){return e>=58&&e<=133}function ye(e){return e>=58&&e<=137}function Te(e){return ce[e]}function ge(e){return e>=129&&e<=131}function Se(e){return e>=58&&e<=92}function xe(e){return ae[e]}function be(e){return oe[e]}function Ee(e){return e>=24&&e<=25}function Pe(e){return re[e]}re[8].updateContext=e=>{e.pop()},re[5].updateContext=re[7].updateContext=re[23].updateContext=e=>{e.push(X.brace)},re[22].updateContext=e=>{e[e.length-1]===X.template?e.pop():e.push(X.template)},re[143].updateContext=e=>{e.push(X.j_expr,X.j_oTag)};let ve="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ae="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";const Ce=new RegExp("["+ve+"]"),we=new RegExp("["+ve+Ae+"]");ve=Ae=null;const Ie=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,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,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,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,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Ne=[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,80,3,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,343,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,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function ke(e,t){let n=65536;for(let i=0,s=t.length;i<s;i+=2){if(n+=t[i],n>e)return!1;if(n+=t[i+1],n>=e)return!0}return!1}function Oe(e){return e<65?36===e:e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&Ce.test(String.fromCharCode(e)):ke(e,Ie)))}function De(e){return e<48?36===e:e<58||!(e<65)&&(e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&we.test(String.fromCharCode(e)):ke(e,Ie)||ke(e,Ne))))}const _e=["implements","interface","let","package","private","protected","public","static","yield"],Le=["eval","arguments"],Me=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"]),Fe=new Set(_e),Be=new Set(Le);function je(e,t){return t&&"await"===e||"enum"===e}function Re(e,t){return je(e,t)||Fe.has(e)}function Ue(e){return Be.has(e)}function Ke(e,t){return Re(e,t)||Ue(e)}const Ve=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);class We{constructor(e){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=e}}class $e{constructor(e,t){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=e,this.inM