UNPKG

@regele/devtools

Version:

A collection of developer utilities for code processing and text analysis

1 lines 850 kB
"use strict";var e,t,n=require("fs"),i=require("fast-glob"),s=require("tty"),r=require("util"),a=require("os"),o=require("chalk"),l=require("ora"),c=require("commander"),p=require("path");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 exports.FileType.JavaScript;if(["jsx"].includes(e))return exports.FileType.JSX;if(["ts"].includes(e))return exports.FileType.TypeScript;if(["tsx"].includes(e))return exports.FileType.TSX;if(["json"].includes(e))return exports.FileType.JSON;if(["yaml","yml"].includes(e))return exports.FileType.YAML;if(["css"].includes(e))return exports.FileType.CSS;if(["scss","sass"].includes(e))return exports.FileType.SCSS;if(["less"].includes(e))return exports.FileType.LESS;if(["html","htm","xhtml","jsp","asp","aspx","cshtml","razor","ejs","hbs","handlebars","pug","jade"].includes(e))return exports.FileType.HTML;if(["xml","xsd","xsl","xslt"].includes(e))return exports.FileType.XML;if(["svg"].includes(e))return exports.FileType.SVG;if(["py","pyw"].includes(e))return exports.FileType.Python;if(["rb"].includes(e))return exports.FileType.Ruby;if(["php","php5","phtml","inc"].includes(e))return exports.FileType.PHP;if(["java"].includes(e))return exports.FileType.Java;if(["cs"].includes(e))return exports.FileType.CSharp;if(["c","h"].includes(e))return exports.FileType.C;if(["cpp","hpp","cc","cxx","c++"].includes(e))return exports.FileType.CPP;if(["go"].includes(e))return exports.FileType.Go;if(["swift"].includes(e))return exports.FileType.Swift;if(["kt"].includes(e))return exports.FileType.Kotlin;if(["rs"].includes(e))return exports.FileType.Rust;if(["sh","bash","zsh","fish","ksh"].includes(e))return exports.FileType.Shell;if(["ps1"].includes(e))return exports.FileType.PowerShell;if(["bat","cmd"].includes(e))return exports.FileType.Batch;if(["sql","mysql","pgsql","sqlite","plsql"].includes(e))return exports.FileType.SQL;if(["md","markdown"].includes(e))return exports.FileType.Markdown;if(["txt"].includes(e))return exports.FileType.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("<>")?exports.FileType.TSX:exports.FileType.TypeScript:i.includes("JSX")||i.includes("<>")?exports.FileType.JSX:exports.FileType.JavaScript:i.startsWith("{")&&i.includes('"')||i.startsWith("[")&&i.includes('"')?exports.FileType.JSON:i.match(/^[a-zA-Z0-9_-]+:\s*[^\s]/)||i.match(/^\s+- [a-zA-Z0-9_-]+:/)?exports.FileType.YAML:i.includes("{")&&i.includes("}")&&i.includes(":")&&(i.includes(";")||i.includes("px")||i.includes("em"))?exports.FileType.CSS:i.match(/<html|<!DOCTYPE|<head|<body|<div/i)?exports.FileType.HTML:i.match(/<\?xml|<[a-zA-Z0-9_-]+>[\s\S]*?<\/[a-zA-Z0-9_-]+>/)?exports.FileType.XML:i.includes("<svg")||i.includes("xmlns:svg=")?exports.FileType.SVG:i.match(/^(import|from|def|class)\s/m)||i.includes('if __name__ == "__main__"')||i.match(/^\s*#.*$/m)?exports.FileType.Python:i.match(/^(require|class|def|module)\s/m)||i.includes("do |")||i.includes("end")?exports.FileType.Ruby:i.includes("<?php")||i.match(/^\s*<\?/)?exports.FileType.PHP:i.match(/public\s+(class|interface|enum)/)||i.match(/import\s+java\./)||i.match(/package\s+[a-z0-9_.]+;/)?exports.FileType.Java:i.match(/using\s+System;/)||i.match(/namespace\s+[A-Za-z0-9_.]+/)||i.includes("public class ")?exports.FileType.CSharp:i.match(/#include\s+[<"].*[>"]/)?i.includes("std::")||i.includes("namespace ")?exports.FileType.CPP:exports.FileType.C:i.match(/package\s+[a-z0-9_]+/)||i.match(/import\s+\(/)||i.match(/func\s+[A-Za-z0-9_]+\(/)?exports.FileType.Go:i.match(/import\s+Foundation/)||i.match(/class\s+[A-Za-z0-9_]+\s*:/)||i.match(/func\s+[a-zA-Z0-9_]+\(/)?exports.FileType.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_]+:/)?exports.FileType.Kotlin:i.match(/^#!/)||i.match(/^\s*#.*$/m)||i.match(/echo\s+["']/)||i.match(/export\s+[A-Z_]+=/)?exports.FileType.Shell:i.includes("function ")&&i.includes("param(")?exports.FileType.PowerShell:i.match(/^@echo off/i)||i.match(/^REM\s/i)||i.match(/^(set|echo|if|goto)\s/im)?exports.FileType.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)?exports.FileType.SQL:i.match(/^#\s+/)||i.match(/\n#{1,6}\s+/)||i.match(/\[.*\]\(.*\)/)||i.match(/\*\*.*\*\*/)?exports.FileType.Markdown:i.split("\n").length>1||i.length>0?exports.FileType.Text:exports.FileType.Unknown}function h(e){return[exports.FileType.JavaScript,exports.FileType.TypeScript,exports.FileType.JSX,exports.FileType.TSX].includes(e)?exports.FileGroup.JavaScript:[exports.FileType.HTML,exports.FileType.SVG].includes(e)?exports.FileGroup.HTML:e===exports.FileType.XML?exports.FileGroup.XML:[exports.FileType.CSS,exports.FileType.SCSS,exports.FileType.LESS].includes(e)?exports.FileGroup.CSS:e===exports.FileType.JSON?exports.FileGroup.JSON:e===exports.FileType.YAML?exports.FileGroup.YAML:e===exports.FileType.Python?exports.FileGroup.Python:e===exports.FileType.Ruby?exports.FileGroup.Ruby:e===exports.FileType.PHP?exports.FileGroup.PHP:[exports.FileType.Java,exports.FileType.CSharp,exports.FileType.C,exports.FileType.CPP,exports.FileType.Go,exports.FileType.Swift,exports.FileType.Kotlin,exports.FileType.Rust].includes(e)?exports.FileGroup.CStyle:[exports.FileType.Shell,exports.FileType.PowerShell,exports.FileType.Batch].includes(e)?exports.FileGroup.Shell:e===exports.FileType.SQL?exports.FileGroup.SQL:e===exports.FileType.Markdown?exports.FileGroup.Markdown:e===exports.FileType.Text?exports.FileGroup.Text:exports.FileGroup.Unknown}exports.FileType=void 0,(e=exports.FileType||(exports.FileType={})).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",exports.FileGroup=void 0,(t=exports.FileGroup||(exports.FileGroup={})).JavaScript="js",t.HTML="html",t.CSS="css",t.JSON="json",t.XML="xml",t.Python="python",t.Ruby="ruby",t.PHP="php",t.CStyle="cstyle",t.Shell="shell",t.SQL="sql",t.Markdown="markdown",t.YAML="yaml",t.Text="text",t.Unknown="unknown";const d=["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/package-lock.json","**/yarn.lock","**/*.min.js","**/*.min.css","**/*.bundle.js"];async function f(e,t={}){const n=[...d,...t.ignore||[]],s=(Array.isArray(e)?e:[e]).map((e=>e.replace(/\\/g,"/")));return await i(s,{ignore:n,onlyFiles:!0,absolute:!0,followSymbolicLinks:!1})}function m(e){try{const t=n.readFileSync(e,"utf8");return{content:t,fileType:u(t,e)}}catch(t){throw new Error(`Failed to read file ${e}: ${t.message}`)}}function y(e,t){try{return n.writeFileSync(e,t,"utf8"),!0}catch(t){throw new Error(`Failed to write file ${e}: ${t.message}`)}}async function T(e,t,n={}){try{const{content:i,fileType:s}=m(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&&y(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 g(e,t,n={}){const i=await f(e,n),s=[];for(const e of i){const i=await T(e,t,n);s.push(i)}return s}class S{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 exports.FileType?t:u(e));try{switch(n){case exports.FileGroup.JavaScript:return this.removeJavaScriptComments(e);case exports.FileGroup.HTML:return this.removeHTMLComments(e);case exports.FileGroup.CSS:return this.removeCSSComments(e);case exports.FileGroup.JSON:return this.removeJavaScriptComments(e);case exports.FileGroup.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 g(e,(async(e,t)=>this.removeComments(e,t)),t)}}class x{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 exports.FileType?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 exports.FileType.JavaScript:case exports.FileType.JSX:return"babel";case exports.FileType.TypeScript:case exports.FileType.TSX:return"typescript";case exports.FileType.JSON:return"json";case exports.FileType.CSS:return"css";case exports.FileType.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 g(e,(async(e,t)=>this.format(e,t)),t)}}class b{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 E{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 b(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 f(e,t),i=[];for(const e of n)try{const{content:t,fileType:n}=m(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 P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A={};function C(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(A,"__esModule",{value:!0});class w{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 I{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 N(e,t){const{line:n,column:i,index:s}=e;return new w(n,i+t,s+t)}const k="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var O={ImportMetaOutsideModule:{message:"import.meta may appear only with 'sourceType: \"module\"'",code:k},ImportOutsideModule:{message:"'import' and 'export' may appear only with 'sourceType: \"module\"'",code:k}};const D={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"},L=e=>"UpdateExpression"===e.type?D.UpdateExpression[`${e.prefix}`]:D[e.type];var _={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 ${L(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${L(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${L(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 M=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]);var F=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 ${L({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 B=["message"];function j(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n})}function R({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),j(l,"clone",(function(e={}){var t;const{line:n,column:i,index:s}=null!=(t=e.loc)?t:a;return r(new w(n,i,s),Object.assign({},o,e.details))})),j(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 U(e,t){if(Array.isArray(e))return t=>U(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=C(r,B),l="string"==typeof a?()=>a:a;n[i]=R(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:i,toMessage:l},t?{syntaxPlugin:t}:{},o))}return n}const K=Object.assign({},U(O),U(_),U({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."}),U`pipelineOperator`(F));const{defineProperty:V}=Object,W=(e,t)=>{e&&V(e,t,{enumerable:!1,value:e[t]})};function q(e){return W(e.loc.start,"index"),W(e.loc.end,"index"),e}class ${constructor(e,t){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!t}}const J={brace:new $("{"),j_oTag:new $("<tag"),j_cTag:new $("</tag"),j_expr:new $("<tag>...</tag>",!0)};J.template=new $("`",!0);const Y=!0,X=!0,z=!0,H=!0,G=!0;class Q{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 Z=new Map;function ee(e,t={}){t.keyword=e;const n=ce(e,t);return Z.set(e,n),n}function te(e,t){return ce(e,{beforeExpr:Y,binop:t})}let ne=-1;const ie=[],se=[],re=[],ae=[],oe=[],le=[];function ce(e,t={}){var n,i,s,r;return++ne,se.push(e),re.push(null!=(n=t.binop)?n:-1),ae.push(null!=(i=t.beforeExpr)&&i),oe.push(null!=(s=t.startsExpr)&&s),le.push(null!=(r=t.prefix)&&r),ie.push(new Q(e,t)),ne}function pe(e,t={}){var n,i,s,r;return++ne,Z.set(e,ne),se.push(e),re.push(null!=(n=t.binop)?n:-1),ae.push(null!=(i=t.beforeExpr)&&i),oe.push(null!=(s=t.startsExpr)&&s),le.push(null!=(r=t.prefix)&&r),ie.push(new Q("name",t)),ne}const ue={bracketL:ce("[",{beforeExpr:Y,startsExpr:X}),bracketHashL:ce("#[",{beforeExpr:Y,startsExpr:X}),bracketBarL:ce("[|",{beforeExpr:Y,startsExpr:X}),bracketR:ce("]"),bracketBarR:ce("|]"),braceL:ce("{",{beforeExpr:Y,startsExpr:X}),braceBarL:ce("{|",{beforeExpr:Y,startsExpr:X}),braceHashL:ce("#{",{beforeExpr:Y,startsExpr:X}),braceR:ce("}"),braceBarR:ce("|}"),parenL:ce("(",{beforeExpr:Y,startsExpr:X}),parenR:ce(")"),comma:ce(",",{beforeExpr:Y}),semi:ce(";",{beforeExpr:Y}),colon:ce(":",{beforeExpr:Y}),doubleColon:ce("::",{beforeExpr:Y}),dot:ce("."),question:ce("?",{beforeExpr:Y}),questionDot:ce("?."),arrow:ce("=>",{beforeExpr:Y}),template:ce("template"),ellipsis:ce("...",{beforeExpr:Y}),backQuote:ce("`",{startsExpr:X}),dollarBraceL:ce("${",{beforeExpr:Y,startsExpr:X}),templateTail:ce("...`",{startsExpr:X}),templateNonTail:ce("...${",{beforeExpr:Y,startsExpr:X}),at:ce("@"),hash:ce("#",{startsExpr:X}),interpreterDirective:ce("#!..."),eq:ce("=",{beforeExpr:Y,isAssign:H}),assign:ce("_=",{beforeExpr:Y,isAssign:H}),slashAssign:ce("_=",{beforeExpr:Y,isAssign:H}),xorAssign:ce("_=",{beforeExpr:Y,isAssign:H}),moduloAssign:ce("_=",{beforeExpr:Y,isAssign:H}),incDec:ce("++/--",{prefix:G,postfix:!0,startsExpr:X}),bang:ce("!",{beforeExpr:Y,prefix:G,startsExpr:X}),tilde:ce("~",{beforeExpr:Y,prefix:G,startsExpr:X}),doubleCaret:ce("^^",{startsExpr:X}),doubleAt:ce("@@",{startsExpr:X}),pipeline:te("|>",0),nullishCoalescing:te("??",1),logicalOR:te("||",1),logicalAND:te("&&",2),bitwiseOR:te("|",3),bitwiseXOR:te("^",4),bitwiseAND:te("&",5),equality:te("==/!=/===/!==",6),lt:te("</>/<=/>=",7),gt:te("</>/<=/>=",7),relational:te("</>/<=/>=",7),bitShift:te("<</>>/>>>",8),bitShiftL:te("<</>>/>>>",8),bitShiftR:te("<</>>/>>>",8),plusMin:ce("+/-",{beforeExpr:Y,binop:9,prefix:G,startsExpr:X}),modulo:ce("%",{binop:10,startsExpr:X}),star:ce("*",{binop:10}),slash:te("/",10),exponent:ce("**",{beforeExpr:Y,binop:11,rightAssociative:!0}),_in:ee("in",{beforeExpr:Y,binop:7}),_instanceof:ee("instanceof",{beforeExpr:Y,binop:7}),_break:ee("break"),_case:ee("case",{beforeExpr:Y}),_catch:ee("catch"),_continue:ee("continue"),_debugger:ee("debugger"),_default:ee("default",{beforeExpr:Y}),_else:ee("else",{beforeExpr:Y}),_finally:ee("finally"),_function:ee("function",{startsExpr:X}),_if:ee("if"),_return:ee("return",{beforeExpr:Y}),_switch:ee("switch"),_throw:ee("throw",{beforeExpr:Y,prefix:G,startsExpr:X}),_try:ee("try"),_var:ee("var"),_const:ee("const"),_with:ee("with"),_new:ee("new",{beforeExpr:Y,startsExpr:X}),_this:ee("this",{startsExpr:X}),_super:ee("super",{startsExpr:X}),_class:ee("class",{startsExpr:X}),_extends:ee("extends",{beforeExpr:Y}),_export:ee("export"),_import:ee("import",{startsExpr:X}),_null:ee("null",{startsExpr:X}),_true:ee("true",{startsExpr:X}),_false:ee("false",{startsExpr:X}),_typeof:ee("typeof",{beforeExpr:Y,prefix:G,startsExpr:X}),_void:ee("void",{beforeExpr:Y,prefix:G,startsExpr:X}),_delete:ee("delete",{beforeExpr:Y,prefix:G,startsExpr:X}),_do:ee("do",{isLoop:z,beforeExpr:Y}),_for:ee("for",{isLoop:z}),_while:ee("while",{isLoop:z}),_as:pe("as",{startsExpr:X}),_assert:pe("assert",{startsExpr:X}),_async:pe("async",{startsExpr:X}),_await:pe("await",{startsExpr:X}),_defer:pe("defer",{startsExpr:X}),_from:pe("from",{startsExpr:X}),_get:pe("get",{startsExpr:X}),_let:pe("let",{startsExpr:X}),_meta:pe("meta",{startsExpr:X}),_of:pe("of",{startsExpr:X}),_sent:pe("sent",{startsExpr:X}),_set:pe("set",{startsExpr:X}),_source:pe("source",{startsExpr:X}),_static:pe("static",{startsExpr:X}),_using:pe("using",{startsExpr:X}),_yield:pe("yield",{startsExpr:X}),_asserts:pe("asserts",{startsExpr:X}),_checks:pe("checks",{startsExpr:X}),_exports:pe("exports",{startsExpr:X}),_global:pe("global",{startsExpr:X}),_implements:pe("implements",{startsExpr:X}),_intrinsic:pe("intrinsic",{startsExpr:X}),_infer:pe("infer",{startsExpr:X}),_is:pe("is",{startsExpr:X}),_mixins:pe("mixins",{startsExpr:X}),_proto:pe("proto",{startsExpr:X}),_require:pe("require",{startsExpr:X}),_satisfies:pe("satisfies",{startsExpr:X}),_keyof:pe("keyof",{startsExpr:X}),_readonly:pe("readonly",{startsExpr:X}),_unique:pe("unique",{startsExpr:X}),_abstract:pe("abstract",{startsExpr:X}),_declare:pe("declare",{startsExpr:X}),_enum:pe("enum",{startsExpr:X}),_module:pe("module",{startsExpr:X}),_namespace:pe("namespace",{startsExpr:X}),_interface:pe("interface",{startsExpr:X}),_type:pe("type",{startsExpr:X}),_opaque:pe("opaque",{startsExpr:X}),name:ce("name",{startsExpr:X}),placeholder:ce("%%",{startsExpr:!0}),string:ce("string",{startsExpr:X}),num:ce("num",{startsExpr:X}),bigint:ce("bigint",{startsExpr:X}),decimal:ce("decimal",{startsExpr:X}),regexp:ce("regexp",{startsExpr:X}),privateName:ce("#name",{startsExpr:X}),eof:ce("eof"),jsxName:ce("jsxName"),jsxText:ce("jsxText",{beforeExpr:!0}),jsxTagStart:ce("jsxTagStart",{startsExpr:!0}),jsxTagEnd:ce("jsxTagEnd")};function he(e){return e>=93&&e<=133}function de(e){return e>=58&&e<=133}function fe(e){return e>=58&&e<=137}function me(e){return oe[e]}function ye(e){return e>=129&&e<=131}function Te(e){return e>=58&&e<=92}function ge(e){return se[e]}function Se(e){return re[e]}function xe(e){return e>=24&&e<=25}function be(e){return ie[e]}ie[8].updateContext=e=>{e.pop()},ie[5].updateContext=ie[7].updateContext=ie[23].updateContext=e=>{e.push(J.brace)},ie[22].updateContext=e=>{e[e.length-1]===J.template?e.pop():e.push(J.template)},ie[143].updateContext=e=>{e.push(J.j_expr,J.j_oTag)};let Ee="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Pe="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";const ve=new RegExp("["+Ee+"]"),Ae=new RegExp("["+Ee+Pe+"]");Ee=Pe=null;const Ce=[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],we=[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 Ie(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 Ne(e){return e<65?36===e:e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&ve.test(String.fromCharCode(e)):Ie(e,Ce)))}function ke(e){return e<48?36===e:e<58||!(e<65)&&(e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&Ae.test(String.fromCharCode(e)