monocart-reporter 1.7.13 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -26
- package/lib/generate-data.js +7 -19
- package/lib/generate-report.js +13 -6
- package/lib/index.d.ts +5 -51
- package/lib/index.js +1 -4
- package/lib/index.mjs +0 -1
- package/lib/packages/monocart-common.js +1 -0
- package/lib/packages/monocart-network.js +1 -0
- package/lib/packages/monocart-reporter.js +1 -0
- package/lib/packages/monocart-vendor.js +22 -0
- package/lib/platform/share.js +0 -5
- package/lib/plugins/audit/audit.js +2 -2
- package/lib/plugins/coverage/coverage.js +63 -249
- package/lib/plugins/network/network.js +17 -13
- package/lib/plugins/state/client.js +1 -1
- package/lib/plugins/state/state.js +1 -1
- package/lib/utils/parse-source.js +1 -1
- package/lib/utils/util.js +25 -38
- package/lib/visitor.js +6 -26
- package/package.json +10 -8
- package/lib/plugins/coverage/converter/collect-source-maps.js +0 -194
- package/lib/plugins/coverage/converter/converter.js +0 -565
- package/lib/plugins/coverage/converter/dedupe.js +0 -110
- package/lib/plugins/coverage/converter/find-original-range.js +0 -581
- package/lib/plugins/coverage/converter/info-branch.js +0 -30
- package/lib/plugins/coverage/converter/info-function.js +0 -29
- package/lib/plugins/coverage/converter/info-line.js +0 -20
- package/lib/plugins/coverage/converter/position-mapping.js +0 -183
- package/lib/plugins/coverage/converter/source-path.js +0 -140
- package/lib/plugins/coverage/istanbul/istanbul-summary.js +0 -49
- package/lib/plugins/coverage/istanbul/istanbul.js +0 -171
- package/lib/plugins/coverage/v8/v8-summary.js +0 -80
- package/lib/plugins/coverage/v8/v8.js +0 -260
- package/lib/runtime/monocart-code-viewer.js +0 -1
- package/lib/runtime/monocart-common.js +0 -1
- package/lib/runtime/monocart-coverage.js +0 -14
- package/lib/runtime/monocart-formatter.js +0 -1
- package/lib/runtime/monocart-network.js +0 -1
- package/lib/runtime/monocart-reporter.js +0 -1
- package/lib/runtime/monocart-v8.js +0 -1
- package/lib/runtime/monocart-vendor.js +0 -22
- package/lib/utils/decode-mappings.js +0 -49
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var no=Object.create;var wt=Object.defineProperty;var oo=Object.getOwnPropertyDescriptor;var uo=Object.getOwnPropertyNames;var lo=Object.getPrototypeOf,co=Object.prototype.hasOwnProperty;var S=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),ho=(i,t)=>{for(var e in t)wt(i,e,{get:t[e],enumerable:!0})},Ir=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of uo(t))!co.call(i,r)&&r!==e&&wt(i,r,{get:()=>t[r],enumerable:!(s=oo(t,r))||s.enumerable});return i};var te=(i,t,e)=>(e=i!=null?no(lo(i)):{},Ir(t||!i||!i.__esModule?wt(e,"default",{value:i,enumerable:!0}):e,i)),po=i=>Ir(wt({},"__esModule",{value:!0}),i);var Nr=S((Mh,kr)=>{"use strict";var fo=/[|\\{}()[\]^$+*?.-]/g;kr.exports=i=>{if(typeof i!="string")throw new TypeError("Expected a string");return i.replace(fo,"\\$&")}});var Lr=S((Oh,Or)=>{"use strict";var mo=Nr(),yo=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",Mr=[].concat(require("module").builtinModules,"bootstrap_node","node").map(i=>new RegExp(`(?:\\((?:node:)?${i}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${i}(?:\\.js)?:\\d+:\\d+$)`));Mr.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var ns=class i{constructor(t){t={ignoredPackages:[],...t},"internals"in t||(t.internals=i.nodeInternals()),"cwd"in t||(t.cwd=yo),this._cwd=t.cwd.replace(/\\/g,"/"),this._internals=[].concat(t.internals,xo(t.ignoredPackages)),this._wrapCallSite=t.wrapCallSite||!1}static nodeInternals(){return[...Mr]}clean(t,e=0){e=" ".repeat(e),Array.isArray(t)||(t=t.split(`
|
|
2
|
-
`)),!/^\s*at /.test(t[0])&&/^\s*at /.test(t[1])&&(t=t.slice(1));let s=!1,r=null,a=[];return t.forEach(n=>{if(n=n.replace(/\\/g,"/"),this._internals.some(u=>u.test(n)))return;let o=/^\s*at /.test(n);s?n=n.trimEnd().replace(/^(\s+)at /,"$1"):(n=n.trim(),o&&(n=n.slice(3))),n=n.replace(`${this._cwd}/`,""),n&&(o?(r&&(a.push(r),r=null),a.push(n)):(s=!0,r=n))}),a.map(n=>`${e}${n}
|
|
3
|
-
`).join("")}captureString(t,e=this.captureString){typeof t=="function"&&(e=t,t=1/0);let{stackTraceLimit:s}=Error;t&&(Error.stackTraceLimit=t);let r={};Error.captureStackTrace(r,e);let{stack:a}=r;return Error.stackTraceLimit=s,this.clean(a)}capture(t,e=this.capture){typeof t=="function"&&(e=t,t=1/0);let{prepareStackTrace:s,stackTraceLimit:r}=Error;Error.prepareStackTrace=(o,u)=>this._wrapCallSite?u.map(this._wrapCallSite):u,t&&(Error.stackTraceLimit=t);let a={};Error.captureStackTrace(a,e);let{stack:n}=a;return Object.assign(Error,{prepareStackTrace:s,stackTraceLimit:r}),n}at(t=this.at){let[e]=this.capture(1,t);if(!e)return{};let s={line:e.getLineNumber(),column:e.getColumnNumber()};_r(s,e.getFileName(),this._cwd),e.isConstructor()&&Object.defineProperty(s,"constructor",{value:!0,configurable:!0}),e.isEval()&&(s.evalOrigin=e.getEvalOrigin()),e.isNative()&&(s.native=!0);let r;try{r=e.getTypeName()}catch{}r&&r!=="Object"&&r!=="[object Object]"&&(s.type=r);let a=e.getFunctionName();a&&(s.function=a);let n=e.getMethodName();return n&&a!==n&&(s.method=n),s}parseLine(t){let e=t&&t.match(go);if(!e)return null;let s=e[1]==="new",r=e[2],a=e[3],n=e[4],o=Number(e[5]),u=Number(e[6]),l=e[7],c=e[8],p=e[9],f=e[10]==="native",d=e[11]===")",m,y={};if(c&&(y.line=Number(c)),p&&(y.column=Number(p)),d&&l){let v=0;for(let A=l.length-1;A>0;A--)if(l.charAt(A)===")")v++;else if(l.charAt(A)==="("&&l.charAt(A-1)===" "&&(v--,v===-1&&l.charAt(A-1)===" ")){let _=l.slice(0,A-1);l=l.slice(A+1),r+=` (${_}`;break}}if(r){let v=r.match(bo);v&&(r=v[1],m=v[2])}return _r(y,l,this._cwd),s&&Object.defineProperty(y,"constructor",{value:!0,configurable:!0}),a&&(y.evalOrigin=a,y.evalLine=o,y.evalColumn=u,y.evalFile=n&&n.replace(/\\/g,"/")),f&&(y.native=!0),r&&(y.function=r),m&&r!==m&&(y.method=m),y}};function _r(i,t,e){t&&(t=t.replace(/\\/g,"/"),t.startsWith(`${e}/`)&&(t=t.slice(e.length+1)),i.file=t)}function xo(i){if(i.length===0)return[];let t=i.map(e=>mo(e));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var go=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),bo=/^(.*?) \[as (.*?)\]$/;Or.exports=ns});var Dr=S(At=>{Object.defineProperty(At,"__esModule",{value:!0});At.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;At.matchToToken=function(i){var t={type:"invalid",value:i[0],closed:void 0};return i[1]?(t.type="string",t.closed=!!(i[3]||i[4])):i[5]?t.type="comment":i[6]?(t.type="comment",t.closed=!!i[7]):i[8]?t.type="regex":i[9]?t.type="number":i[10]?t.type="name":i[11]?t.type="punctuator":i[12]&&(t.type="whitespace"),t}});var jr=S(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.isIdentifierChar=Ur;Ke.isIdentifierName=wo;Ke.isIdentifierStart=Rr;var us="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Br="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F",Po=new RegExp("["+us+"]"),vo=new RegExp("["+us+Br+"]");us=Br=null;var Fr=[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,68,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,349,41,7,1,79,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,159,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,264,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,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,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,757,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,3104,541,1507,4938,6,4191],To=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,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,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,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,406,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,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,983,6,110,6,6,9,4759,9,787719,239];function os(i,t){let e=65536;for(let s=0,r=t.length;s<r;s+=2){if(e+=t[s],e>i)return!1;if(e+=t[s+1],e>=i)return!0}return!1}function Rr(i){return i<65?i===36:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&Po.test(String.fromCharCode(i)):os(i,Fr)}function Ur(i){return i<48?i===36:i<58?!0:i<65?!1:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&vo.test(String.fromCharCode(i)):os(i,Fr)||os(i,To)}function wo(i){let t=!0;for(let e=0;e<i.length;e++){let s=i.charCodeAt(e);if((s&64512)===55296&&e+1<i.length){let r=i.charCodeAt(++e);(r&64512)===56320&&(s=65536+((s&1023)<<10)+(r&1023))}if(t){if(t=!1,!Rr(s))return!1}else if(!Ur(s))return!1}return!t}});var Vr=S(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.isKeyword=Io;xe.isReservedWord=$r;xe.isStrictBindOnlyReservedWord=Wr;xe.isStrictBindReservedWord=Eo;xe.isStrictReservedWord=qr;var ls={keyword:["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"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Ao=new Set(ls.keyword),So=new Set(ls.strict),Co=new Set(ls.strictBind);function $r(i,t){return t&&i==="await"||i==="enum"}function qr(i,t){return $r(i,t)||So.has(i)}function Wr(i){return Co.has(i)}function Eo(i,t){return qr(i,t)||Wr(i)}function Io(i){return Ao.has(i)}});var zr=S(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Object.defineProperty(Y,"isIdentifierChar",{enumerable:!0,get:function(){return cs.isIdentifierChar}});Object.defineProperty(Y,"isIdentifierName",{enumerable:!0,get:function(){return cs.isIdentifierName}});Object.defineProperty(Y,"isIdentifierStart",{enumerable:!0,get:function(){return cs.isIdentifierStart}});Object.defineProperty(Y,"isKeyword",{enumerable:!0,get:function(){return Ge.isKeyword}});Object.defineProperty(Y,"isReservedWord",{enumerable:!0,get:function(){return Ge.isReservedWord}});Object.defineProperty(Y,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return Ge.isStrictBindOnlyReservedWord}});Object.defineProperty(Y,"isStrictBindReservedWord",{enumerable:!0,get:function(){return Ge.isStrictBindReservedWord}});Object.defineProperty(Y,"isStrictReservedWord",{enumerable:!0,get:function(){return Ge.isStrictReservedWord}});var cs=jr(),Ge=Vr()});var Kr=S((Rh,Hr)=>{"use strict";var ko=/[|\\{}()[\]^$+*?.]/g;Hr.exports=function(i){if(typeof i!="string")throw new TypeError("Expected a string");return i.replace(ko,"\\$&")}});var Xr=S((Uh,Gr)=>{"use strict";Gr.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var hs=S((jh,Zr)=>{var ge=Xr(),Qr={};for(St in ge)ge.hasOwnProperty(St)&&(Qr[ge[St]]=St);var St,b=Zr.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(q in b)if(b.hasOwnProperty(q)){if(!("channels"in b[q]))throw new Error("missing channels property: "+q);if(!("labels"in b[q]))throw new Error("missing channel labels property: "+q);if(b[q].labels.length!==b[q].channels)throw new Error("channel and label counts mismatch: "+q);Jr=b[q].channels,Yr=b[q].labels,delete b[q].channels,delete b[q].labels,Object.defineProperty(b[q],"channels",{value:Jr}),Object.defineProperty(b[q],"labels",{value:Yr})}var Jr,Yr,q;b.rgb.hsl=function(i){var t=i[0]/255,e=i[1]/255,s=i[2]/255,r=Math.min(t,e,s),a=Math.max(t,e,s),n=a-r,o,u,l;return a===r?o=0:t===a?o=(e-s)/n:e===a?o=2+(s-t)/n:s===a&&(o=4+(t-e)/n),o=Math.min(o*60,360),o<0&&(o+=360),l=(r+a)/2,a===r?u=0:l<=.5?u=n/(a+r):u=n/(2-a-r),[o,u*100,l*100]};b.rgb.hsv=function(i){var t,e,s,r,a,n=i[0]/255,o=i[1]/255,u=i[2]/255,l=Math.max(n,o,u),c=l-Math.min(n,o,u),p=function(f){return(l-f)/6/c+1/2};return c===0?r=a=0:(a=c/l,t=p(n),e=p(o),s=p(u),n===l?r=s-e:o===l?r=1/3+t-s:u===l&&(r=2/3+e-t),r<0?r+=1:r>1&&(r-=1)),[r*360,a*100,l*100]};b.rgb.hwb=function(i){var t=i[0],e=i[1],s=i[2],r=b.rgb.hsl(i)[0],a=1/255*Math.min(t,Math.min(e,s));return s=1-1/255*Math.max(t,Math.max(e,s)),[r,a*100,s*100]};b.rgb.cmyk=function(i){var t=i[0]/255,e=i[1]/255,s=i[2]/255,r,a,n,o;return o=Math.min(1-t,1-e,1-s),r=(1-t-o)/(1-o)||0,a=(1-e-o)/(1-o)||0,n=(1-s-o)/(1-o)||0,[r*100,a*100,n*100,o*100]};function No(i,t){return Math.pow(i[0]-t[0],2)+Math.pow(i[1]-t[1],2)+Math.pow(i[2]-t[2],2)}b.rgb.keyword=function(i){var t=Qr[i];if(t)return t;var e=1/0,s;for(var r in ge)if(ge.hasOwnProperty(r)){var a=ge[r],n=No(i,a);n<e&&(e=n,s=r)}return s};b.keyword.rgb=function(i){return ge[i]};b.rgb.xyz=function(i){var t=i[0]/255,e=i[1]/255,s=i[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=t*.4124+e*.3576+s*.1805,a=t*.2126+e*.7152+s*.0722,n=t*.0193+e*.1192+s*.9505;return[r*100,a*100,n*100]};b.rgb.lab=function(i){var t=b.rgb.xyz(i),e=t[0],s=t[1],r=t[2],a,n,o;return e/=95.047,s/=100,r/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,a=116*s-16,n=500*(e-s),o=200*(s-r),[a,n,o]};b.hsl.rgb=function(i){var t=i[0]/360,e=i[1]/100,s=i[2]/100,r,a,n,o,u;if(e===0)return u=s*255,[u,u,u];s<.5?a=s*(1+e):a=s+e-s*e,r=2*s-a,o=[0,0,0];for(var l=0;l<3;l++)n=t+1/3*-(l-1),n<0&&n++,n>1&&n--,6*n<1?u=r+(a-r)*6*n:2*n<1?u=a:3*n<2?u=r+(a-r)*(2/3-n)*6:u=r,o[l]=u*255;return o};b.hsl.hsv=function(i){var t=i[0],e=i[1]/100,s=i[2]/100,r=e,a=Math.max(s,.01),n,o;return s*=2,e*=s<=1?s:2-s,r*=a<=1?a:2-a,o=(s+e)/2,n=s===0?2*r/(a+r):2*e/(s+e),[t,n*100,o*100]};b.hsv.rgb=function(i){var t=i[0]/60,e=i[1]/100,s=i[2]/100,r=Math.floor(t)%6,a=t-Math.floor(t),n=255*s*(1-e),o=255*s*(1-e*a),u=255*s*(1-e*(1-a));switch(s*=255,r){case 0:return[s,u,n];case 1:return[o,s,n];case 2:return[n,s,u];case 3:return[n,o,s];case 4:return[u,n,s];case 5:return[s,n,o]}};b.hsv.hsl=function(i){var t=i[0],e=i[1]/100,s=i[2]/100,r=Math.max(s,.01),a,n,o;return o=(2-e)*s,a=(2-e)*r,n=e*r,n/=a<=1?a:2-a,n=n||0,o/=2,[t,n*100,o*100]};b.hwb.rgb=function(i){var t=i[0]/360,e=i[1]/100,s=i[2]/100,r=e+s,a,n,o,u;r>1&&(e/=r,s/=r),a=Math.floor(6*t),n=1-s,o=6*t-a,a&1&&(o=1-o),u=e+o*(n-e);var l,c,p;switch(a){default:case 6:case 0:l=n,c=u,p=e;break;case 1:l=u,c=n,p=e;break;case 2:l=e,c=n,p=u;break;case 3:l=e,c=u,p=n;break;case 4:l=u,c=e,p=n;break;case 5:l=n,c=e,p=u;break}return[l*255,c*255,p*255]};b.cmyk.rgb=function(i){var t=i[0]/100,e=i[1]/100,s=i[2]/100,r=i[3]/100,a,n,o;return a=1-Math.min(1,t*(1-r)+r),n=1-Math.min(1,e*(1-r)+r),o=1-Math.min(1,s*(1-r)+r),[a*255,n*255,o*255]};b.xyz.rgb=function(i){var t=i[0]/100,e=i[1]/100,s=i[2]/100,r,a,n;return r=t*3.2406+e*-1.5372+s*-.4986,a=t*-.9689+e*1.8758+s*.0415,n=t*.0557+e*-.204+s*1.057,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*12.92,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),n=Math.min(Math.max(0,n),1),[r*255,a*255,n*255]};b.xyz.lab=function(i){var t=i[0],e=i[1],s=i[2],r,a,n;return t/=95.047,e/=100,s/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,r=116*e-16,a=500*(t-e),n=200*(e-s),[r,a,n]};b.lab.xyz=function(i){var t=i[0],e=i[1],s=i[2],r,a,n;a=(t+16)/116,r=e/500+a,n=a-s/200;var o=Math.pow(a,3),u=Math.pow(r,3),l=Math.pow(n,3);return a=o>.008856?o:(a-16/116)/7.787,r=u>.008856?u:(r-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,r*=95.047,a*=100,n*=108.883,[r,a,n]};b.lab.lch=function(i){var t=i[0],e=i[1],s=i[2],r,a,n;return r=Math.atan2(s,e),a=r*360/2/Math.PI,a<0&&(a+=360),n=Math.sqrt(e*e+s*s),[t,n,a]};b.lch.lab=function(i){var t=i[0],e=i[1],s=i[2],r,a,n;return n=s/360*2*Math.PI,r=e*Math.cos(n),a=e*Math.sin(n),[t,r,a]};b.rgb.ansi16=function(i){var t=i[0],e=i[1],s=i[2],r=1 in arguments?arguments[1]:b.rgb.hsv(i)[2];if(r=Math.round(r/50),r===0)return 30;var a=30+(Math.round(s/255)<<2|Math.round(e/255)<<1|Math.round(t/255));return r===2&&(a+=60),a};b.hsv.ansi16=function(i){return b.rgb.ansi16(b.hsv.rgb(i),i[2])};b.rgb.ansi256=function(i){var t=i[0],e=i[1],s=i[2];if(t===e&&e===s)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var r=16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(s/255*5);return r};b.ansi16.rgb=function(i){var t=i%10;if(t===0||t===7)return i>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var e=(~~(i>50)+1)*.5,s=(t&1)*e*255,r=(t>>1&1)*e*255,a=(t>>2&1)*e*255;return[s,r,a]};b.ansi256.rgb=function(i){if(i>=232){var t=(i-232)*10+8;return[t,t,t]}i-=16;var e,s=Math.floor(i/36)/5*255,r=Math.floor((e=i%36)/6)/5*255,a=e%6/5*255;return[s,r,a]};b.rgb.hex=function(i){var t=((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255),e=t.toString(16).toUpperCase();return"000000".substring(e.length)+e};b.hex.rgb=function(i){var t=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var e=t[0];t[0].length===3&&(e=e.split("").map(function(o){return o+o}).join(""));var s=parseInt(e,16),r=s>>16&255,a=s>>8&255,n=s&255;return[r,a,n]};b.rgb.hcg=function(i){var t=i[0]/255,e=i[1]/255,s=i[2]/255,r=Math.max(Math.max(t,e),s),a=Math.min(Math.min(t,e),s),n=r-a,o,u;return n<1?o=a/(1-n):o=0,n<=0?u=0:r===t?u=(e-s)/n%6:r===e?u=2+(s-t)/n:u=4+(t-e)/n+4,u/=6,u%=1,[u*360,n*100,o*100]};b.hsl.hcg=function(i){var t=i[1]/100,e=i[2]/100,s=1,r=0;return e<.5?s=2*t*e:s=2*t*(1-e),s<1&&(r=(e-.5*s)/(1-s)),[i[0],s*100,r*100]};b.hsv.hcg=function(i){var t=i[1]/100,e=i[2]/100,s=t*e,r=0;return s<1&&(r=(e-s)/(1-s)),[i[0],s*100,r*100]};b.hcg.rgb=function(i){var t=i[0]/360,e=i[1]/100,s=i[2]/100;if(e===0)return[s*255,s*255,s*255];var r=[0,0,0],a=t%1*6,n=a%1,o=1-n,u=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=n,r[2]=0;break;case 1:r[0]=o,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=n;break;case 3:r[0]=0,r[1]=o,r[2]=1;break;case 4:r[0]=n,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=o}return u=(1-e)*s,[(e*r[0]+u)*255,(e*r[1]+u)*255,(e*r[2]+u)*255]};b.hcg.hsv=function(i){var t=i[1]/100,e=i[2]/100,s=t+e*(1-t),r=0;return s>0&&(r=t/s),[i[0],r*100,s*100]};b.hcg.hsl=function(i){var t=i[1]/100,e=i[2]/100,s=e*(1-t)+.5*t,r=0;return s>0&&s<.5?r=t/(2*s):s>=.5&&s<1&&(r=t/(2*(1-s))),[i[0],r*100,s*100]};b.hcg.hwb=function(i){var t=i[1]/100,e=i[2]/100,s=t+e*(1-t);return[i[0],(s-t)*100,(1-s)*100]};b.hwb.hcg=function(i){var t=i[1]/100,e=i[2]/100,s=1-e,r=s-t,a=0;return r<1&&(a=(s-r)/(1-r)),[i[0],r*100,a*100]};b.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]};b.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]};b.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]};b.gray.hsl=b.gray.hsv=function(i){return[0,0,i[0]]};b.gray.hwb=function(i){return[0,100,i[0]]};b.gray.cmyk=function(i){return[0,0,0,i[0]]};b.gray.lab=function(i){return[i[0],0,0]};b.gray.hex=function(i){var t=Math.round(i[0]/100*255)&255,e=(t<<16)+(t<<8)+t,s=e.toString(16).toUpperCase();return"000000".substring(s.length)+s};b.rgb.gray=function(i){var t=(i[0]+i[1]+i[2])/3;return[t/255*100]}});var ti=S(($h,ei)=>{var Ct=hs();function _o(){for(var i={},t=Object.keys(Ct),e=t.length,s=0;s<e;s++)i[t[s]]={distance:-1,parent:null};return i}function Mo(i){var t=_o(),e=[i];for(t[i].distance=0;e.length;)for(var s=e.pop(),r=Object.keys(Ct[s]),a=r.length,n=0;n<a;n++){var o=r[n],u=t[o];u.distance===-1&&(u.distance=t[s].distance+1,u.parent=s,e.unshift(o))}return t}function Oo(i,t){return function(e){return t(i(e))}}function Lo(i,t){for(var e=[t[i].parent,i],s=Ct[t[i].parent][i],r=t[i].parent;t[r].parent;)e.unshift(t[r].parent),s=Oo(Ct[t[r].parent][r],s),r=t[r].parent;return s.conversion=e,s}ei.exports=function(i){for(var t=Mo(i),e={},s=Object.keys(t),r=s.length,a=0;a<r;a++){var n=s[a],o=t[n];o.parent!==null&&(e[n]=Lo(n,t))}return e}});var ri=S((qh,si)=>{var ps=hs(),Do=ti(),Ce={},Bo=Object.keys(ps);function Fo(i){var t=function(e){return e==null?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),i(e))};return"conversion"in i&&(t.conversion=i.conversion),t}function Ro(i){var t=function(e){if(e==null)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var s=i(e);if(typeof s=="object")for(var r=s.length,a=0;a<r;a++)s[a]=Math.round(s[a]);return s};return"conversion"in i&&(t.conversion=i.conversion),t}Bo.forEach(function(i){Ce[i]={},Object.defineProperty(Ce[i],"channels",{value:ps[i].channels}),Object.defineProperty(Ce[i],"labels",{value:ps[i].labels});var t=Do(i),e=Object.keys(t);e.forEach(function(s){var r=t[s];Ce[i][s]=Ro(r),Ce[i][s].raw=Fo(r)})});si.exports=Ce});var ai=S((Wh,ii)=>{"use strict";var Ee=ri(),Et=(i,t)=>function(){return`\x1B[${i.apply(Ee,arguments)+t}m`},It=(i,t)=>function(){let e=i.apply(Ee,arguments);return`\x1B[${38+t};5;${e}m`},kt=(i,t)=>function(){let e=i.apply(Ee,arguments);return`\x1B[${38+t};2;${e[0]};${e[1]};${e[2]}m`};function Uo(){let i=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(let r of Object.keys(t)){let a=t[r];for(let n of Object.keys(a)){let o=a[n];t[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},a[n]=t[n],i.set(o[0],o[1])}Object.defineProperty(t,r,{value:a,enumerable:!1}),Object.defineProperty(t,"codes",{value:i,enumerable:!1})}let e=r=>r,s=(r,a,n)=>[r,a,n];t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi={ansi:Et(e,0)},t.color.ansi256={ansi256:It(e,0)},t.color.ansi16m={rgb:kt(s,0)},t.bgColor.ansi={ansi:Et(e,10)},t.bgColor.ansi256={ansi256:It(e,10)},t.bgColor.ansi16m={rgb:kt(s,10)};for(let r of Object.keys(Ee)){if(typeof Ee[r]!="object")continue;let a=Ee[r];r==="ansi16"&&(r="ansi"),"ansi16"in a&&(t.color.ansi[r]=Et(a.ansi16,0),t.bgColor.ansi[r]=Et(a.ansi16,10)),"ansi256"in a&&(t.color.ansi256[r]=It(a.ansi256,0),t.bgColor.ansi256[r]=It(a.ansi256,10)),"rgb"in a&&(t.color.ansi16m[r]=kt(a.rgb,0),t.bgColor.ansi16m[r]=kt(a.rgb,10))}return t}Object.defineProperty(ii,"exports",{enumerable:!0,get:Uo})});var oi=S((Vh,ni)=>{"use strict";ni.exports=(i,t)=>{t=t||process.argv;let e=i.startsWith("-")?"":i.length===1?"-":"--",s=t.indexOf(e+i),r=t.indexOf("--");return s!==-1&&(r===-1?!0:s<r)}});var li=S((zh,ui)=>{"use strict";var jo=require("os"),K=oi(),R=process.env,Ie;K("no-color")||K("no-colors")||K("color=false")?Ie=!1:(K("color")||K("colors")||K("color=true")||K("color=always"))&&(Ie=!0);"FORCE_COLOR"in R&&(Ie=R.FORCE_COLOR.length===0||parseInt(R.FORCE_COLOR,10)!==0);function $o(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function qo(i){if(Ie===!1)return 0;if(K("color=16m")||K("color=full")||K("color=truecolor"))return 3;if(K("color=256"))return 2;if(i&&!i.isTTY&&Ie!==!0)return 0;let t=Ie?1:0;if(process.platform==="win32"){let e=jo.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in R)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in R)||R.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in R)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(R.TEAMCITY_VERSION)?1:0;if(R.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in R){let e=parseInt((R.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(R.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(R.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(R.TERM)||"COLORTERM"in R?1:(R.TERM==="dumb",t)}function fs(i){let t=qo(i);return $o(t)}ui.exports={supportsColor:fs,stdout:fs(process.stdout),stderr:fs(process.stderr)}});var di=S((Hh,fi)=>{"use strict";var Wo=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,ci=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Vo=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,zo=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,Ho=new Map([["n",`
|
|
4
|
-
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function pi(i){return i[0]==="u"&&i.length===5||i[0]==="x"&&i.length===3?String.fromCharCode(parseInt(i.slice(1),16)):Ho.get(i)||i}function Ko(i,t){let e=[],s=t.trim().split(/\s*,\s*/g),r;for(let a of s)if(!isNaN(a))e.push(Number(a));else if(r=a.match(Vo))e.push(r[2].replace(zo,(n,o,u)=>o?pi(o):u));else throw new Error(`Invalid Chalk template style argument: ${a} (in style '${i}')`);return e}function Go(i){ci.lastIndex=0;let t=[],e;for(;(e=ci.exec(i))!==null;){let s=e[1];if(e[2]){let r=Ko(s,e[2]);t.push([s].concat(r))}else t.push([s])}return t}function hi(i,t){let e={};for(let r of t)for(let a of r.styles)e[a[0]]=r.inverse?null:a.slice(1);let s=i;for(let r of Object.keys(e))if(Array.isArray(e[r])){if(!(r in s))throw new Error(`Unknown Chalk style: ${r}`);e[r].length>0?s=s[r].apply(s,e[r]):s=s[r]}return s}fi.exports=(i,t)=>{let e=[],s=[],r=[];if(t.replace(Wo,(a,n,o,u,l,c)=>{if(n)r.push(pi(n));else if(u){let p=r.join("");r=[],s.push(e.length===0?p:hi(i,e)(p)),e.push({inverse:o,styles:Go(u)})}else if(l){if(e.length===0)throw new Error("Found extraneous } in Chalk template literal");s.push(hi(i,e)(r.join(""))),r=[],e.pop()}else r.push(c)}),s.push(r.join("")),e.length>0){let a=`Chalk template literal is missing ${e.length} closing bracket${e.length===1?"":"s"} (\`}\`)`;throw new Error(a)}return s.join("")}});var bi=S((Kh,Je)=>{"use strict";var ms=Kr(),O=ai(),ds=li().stdout,Xo=di(),yi=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),xi=["ansi","ansi","ansi256","ansi16m"],gi=new Set(["gray"]),ke=Object.create(null);function mi(i,t){t=t||{};let e=ds?ds.level:0;i.level=t.level===void 0?e:t.level,i.enabled="enabled"in t?t.enabled:i.level>0}function Xe(i){if(!this||!(this instanceof Xe)||this.template){let t={};return mi(t,i),t.template=function(){let e=[].slice.call(arguments);return Qo.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,Xe.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=Xe,t.template}mi(this,i)}yi&&(O.blue.open="\x1B[94m");for(let i of Object.keys(O))O[i].closeRe=new RegExp(ms(O[i].close),"g"),ke[i]={get(){let t=O[i];return Nt.call(this,this._styles?this._styles.concat(t):[t],this._empty,i)}};ke.visible={get(){return Nt.call(this,this._styles||[],!0,"visible")}};O.color.closeRe=new RegExp(ms(O.color.close),"g");for(let i of Object.keys(O.color.ansi))gi.has(i)||(ke[i]={get(){let t=this.level;return function(){let s={open:O.color[xi[t]][i].apply(null,arguments),close:O.color.close,closeRe:O.color.closeRe};return Nt.call(this,this._styles?this._styles.concat(s):[s],this._empty,i)}}});O.bgColor.closeRe=new RegExp(ms(O.bgColor.close),"g");for(let i of Object.keys(O.bgColor.ansi)){if(gi.has(i))continue;let t="bg"+i[0].toUpperCase()+i.slice(1);ke[t]={get(){let e=this.level;return function(){let r={open:O.bgColor[xi[e]][i].apply(null,arguments),close:O.bgColor.close,closeRe:O.bgColor.closeRe};return Nt.call(this,this._styles?this._styles.concat(r):[r],this._empty,i)}}}}var Jo=Object.defineProperties(()=>{},ke);function Nt(i,t,e){let s=function(){return Yo.apply(s,arguments)};s._styles=i,s._empty=t;let r=this;return Object.defineProperty(s,"level",{enumerable:!0,get(){return r.level},set(a){r.level=a}}),Object.defineProperty(s,"enabled",{enumerable:!0,get(){return r.enabled},set(a){r.enabled=a}}),s.hasGrey=this.hasGrey||e==="gray"||e==="grey",s.__proto__=Jo,s}function Yo(){let i=arguments,t=i.length,e=String(arguments[0]);if(t===0)return"";if(t>1)for(let r=1;r<t;r++)e+=" "+i[r];if(!this.enabled||this.level<=0||!e)return this._empty?"":e;let s=O.dim.open;yi&&this.hasGrey&&(O.dim.open="");for(let r of this._styles.slice().reverse())e=r.open+e.replace(r.closeRe,r.open)+r.close,e=e.replace(/\r?\n/g,`${r.close}$&${r.open}`);return O.dim.open=s,e}function Qo(i,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");let e=[].slice.call(arguments,2),s=[t.raw[0]];for(let r=1;r<t.length;r++)s.push(String(e[r-1]).replace(/[{}\\]/g,"\\$&")),s.push(String(t.raw[r]));return Xo(i,s.join(""))}Object.defineProperties(Xe.prototype,ke);Je.exports=Xe();Je.exports.supportsColor=ds;Je.exports.default=Je.exports});var Ci=S(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=au;Ye.shouldHighlight=Ai;var Pi=Dr(),vi=zr(),xs=Zo(bi(),!0);function Ti(i){if(typeof WeakMap!="function")return null;var t=new WeakMap,e=new WeakMap;return(Ti=function(s){return s?e:t})(i)}function Zo(i,t){if(!t&&i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var e=Ti(t);if(e&&e.has(i))return e.get(i);var s={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var n=r?Object.getOwnPropertyDescriptor(i,a):null;n&&(n.get||n.set)?Object.defineProperty(s,a,n):s[a]=i[a]}return s.default=i,e&&e.set(i,s),s}var eu=new Set(["as","async","from","get","of","set"]);function tu(i){return{keyword:i.cyan,capitalized:i.yellow,jsxIdentifier:i.yellow,punctuator:i.yellow,number:i.magenta,string:i.green,regex:i.magenta,comment:i.grey,invalid:i.white.bgRed.bold}}var su=/\r\n|[\n\r\u2028\u2029]/,ru=/^[()[\]{}]$/,wi;{let i=/^[a-z][\w-]*$/i,t=function(e,s,r){if(e.type==="name"){if((0,vi.isKeyword)(e.value)||(0,vi.isStrictReservedWord)(e.value,!0)||eu.has(e.value))return"keyword";if(i.test(e.value)&&(r[s-1]==="<"||r.slice(s-2,s)=="</"))return"jsxIdentifier";if(e.value[0]!==e.value[0].toLowerCase())return"capitalized"}return e.type==="punctuator"&&ru.test(e.value)?"bracket":e.type==="invalid"&&(e.value==="@"||e.value==="#")?"punctuator":e.type};wi=function*(e){let s;for(;s=Pi.default.exec(e);){let r=Pi.matchToToken(s);yield{type:t(r,s.index,e),value:r.value}}}}function iu(i,t){let e="";for(let{type:s,value:r}of wi(t)){let a=i[s];a?e+=r.split(su).map(n=>a(n)).join(`
|
|
5
|
-
`):e+=r}return e}function Ai(i){return xs.default.level>0||i.forceColor}var ys;function Si(i){if(i){var t;return(t=ys)!=null||(ys=new xs.default.constructor({enabled:!0,level:1})),ys}return xs.default}Ye.getChalk=i=>Si(i.forceColor);function au(i,t={}){if(i!==""&&Ai(t)){let e=tu(Si(t.forceColor));return iu(e,i)}else return i}});var Ii=S((Xh,Ei)=>{"use strict";var nu=/[|\\{}()[\]^$+*?.]/g;Ei.exports=function(i){if(typeof i!="string")throw new TypeError("Expected a string");return i.replace(nu,"\\$&")}});var Ni=S((Jh,ki)=>{"use strict";ki.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var gs=S((Yh,Li)=>{var be=Ni(),Oi={};for(_t in be)be.hasOwnProperty(_t)&&(Oi[be[_t]]=_t);var _t,P=Li.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(W in P)if(P.hasOwnProperty(W)){if(!("channels"in P[W]))throw new Error("missing channels property: "+W);if(!("labels"in P[W]))throw new Error("missing channel labels property: "+W);if(P[W].labels.length!==P[W].channels)throw new Error("channel and label counts mismatch: "+W);_i=P[W].channels,Mi=P[W].labels,delete P[W].channels,delete P[W].labels,Object.defineProperty(P[W],"channels",{value:_i}),Object.defineProperty(P[W],"labels",{value:Mi})}var _i,Mi,W;P.rgb.hsl=function(i){var t=i[0]/255,e=i[1]/255,s=i[2]/255,r=Math.min(t,e,s),a=Math.max(t,e,s),n=a-r,o,u,l;return a===r?o=0:t===a?o=(e-s)/n:e===a?o=2+(s-t)/n:s===a&&(o=4+(t-e)/n),o=Math.min(o*60,360),o<0&&(o+=360),l=(r+a)/2,a===r?u=0:l<=.5?u=n/(a+r):u=n/(2-a-r),[o,u*100,l*100]};P.rgb.hsv=function(i){var t,e,s,r,a,n=i[0]/255,o=i[1]/255,u=i[2]/255,l=Math.max(n,o,u),c=l-Math.min(n,o,u),p=function(f){return(l-f)/6/c+1/2};return c===0?r=a=0:(a=c/l,t=p(n),e=p(o),s=p(u),n===l?r=s-e:o===l?r=1/3+t-s:u===l&&(r=2/3+e-t),r<0?r+=1:r>1&&(r-=1)),[r*360,a*100,l*100]};P.rgb.hwb=function(i){var t=i[0],e=i[1],s=i[2],r=P.rgb.hsl(i)[0],a=1/255*Math.min(t,Math.min(e,s));return s=1-1/255*Math.max(t,Math.max(e,s)),[r,a*100,s*100]};P.rgb.cmyk=function(i){var t=i[0]/255,e=i[1]/255,s=i[2]/255,r,a,n,o;return o=Math.min(1-t,1-e,1-s),r=(1-t-o)/(1-o)||0,a=(1-e-o)/(1-o)||0,n=(1-s-o)/(1-o)||0,[r*100,a*100,n*100,o*100]};function ou(i,t){return Math.pow(i[0]-t[0],2)+Math.pow(i[1]-t[1],2)+Math.pow(i[2]-t[2],2)}P.rgb.keyword=function(i){var t=Oi[i];if(t)return t;var e=1/0,s;for(var r in be)if(be.hasOwnProperty(r)){var a=be[r],n=ou(i,a);n<e&&(e=n,s=r)}return s};P.keyword.rgb=function(i){return be[i]};P.rgb.xyz=function(i){var t=i[0]/255,e=i[1]/255,s=i[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=t*.4124+e*.3576+s*.1805,a=t*.2126+e*.7152+s*.0722,n=t*.0193+e*.1192+s*.9505;return[r*100,a*100,n*100]};P.rgb.lab=function(i){var t=P.rgb.xyz(i),e=t[0],s=t[1],r=t[2],a,n,o;return e/=95.047,s/=100,r/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,a=116*s-16,n=500*(e-s),o=200*(s-r),[a,n,o]};P.hsl.rgb=function(i){var t=i[0]/360,e=i[1]/100,s=i[2]/100,r,a,n,o,u;if(e===0)return u=s*255,[u,u,u];s<.5?a=s*(1+e):a=s+e-s*e,r=2*s-a,o=[0,0,0];for(var l=0;l<3;l++)n=t+1/3*-(l-1),n<0&&n++,n>1&&n--,6*n<1?u=r+(a-r)*6*n:2*n<1?u=a:3*n<2?u=r+(a-r)*(2/3-n)*6:u=r,o[l]=u*255;return o};P.hsl.hsv=function(i){var t=i[0],e=i[1]/100,s=i[2]/100,r=e,a=Math.max(s,.01),n,o;return s*=2,e*=s<=1?s:2-s,r*=a<=1?a:2-a,o=(s+e)/2,n=s===0?2*r/(a+r):2*e/(s+e),[t,n*100,o*100]};P.hsv.rgb=function(i){var t=i[0]/60,e=i[1]/100,s=i[2]/100,r=Math.floor(t)%6,a=t-Math.floor(t),n=255*s*(1-e),o=255*s*(1-e*a),u=255*s*(1-e*(1-a));switch(s*=255,r){case 0:return[s,u,n];case 1:return[o,s,n];case 2:return[n,s,u];case 3:return[n,o,s];case 4:return[u,n,s];case 5:return[s,n,o]}};P.hsv.hsl=function(i){var t=i[0],e=i[1]/100,s=i[2]/100,r=Math.max(s,.01),a,n,o;return o=(2-e)*s,a=(2-e)*r,n=e*r,n/=a<=1?a:2-a,n=n||0,o/=2,[t,n*100,o*100]};P.hwb.rgb=function(i){var t=i[0]/360,e=i[1]/100,s=i[2]/100,r=e+s,a,n,o,u;r>1&&(e/=r,s/=r),a=Math.floor(6*t),n=1-s,o=6*t-a,a&1&&(o=1-o),u=e+o*(n-e);var l,c,p;switch(a){default:case 6:case 0:l=n,c=u,p=e;break;case 1:l=u,c=n,p=e;break;case 2:l=e,c=n,p=u;break;case 3:l=e,c=u,p=n;break;case 4:l=u,c=e,p=n;break;case 5:l=n,c=e,p=u;break}return[l*255,c*255,p*255]};P.cmyk.rgb=function(i){var t=i[0]/100,e=i[1]/100,s=i[2]/100,r=i[3]/100,a,n,o;return a=1-Math.min(1,t*(1-r)+r),n=1-Math.min(1,e*(1-r)+r),o=1-Math.min(1,s*(1-r)+r),[a*255,n*255,o*255]};P.xyz.rgb=function(i){var t=i[0]/100,e=i[1]/100,s=i[2]/100,r,a,n;return r=t*3.2406+e*-1.5372+s*-.4986,a=t*-.9689+e*1.8758+s*.0415,n=t*.0557+e*-.204+s*1.057,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*12.92,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),n=Math.min(Math.max(0,n),1),[r*255,a*255,n*255]};P.xyz.lab=function(i){var t=i[0],e=i[1],s=i[2],r,a,n;return t/=95.047,e/=100,s/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,r=116*e-16,a=500*(t-e),n=200*(e-s),[r,a,n]};P.lab.xyz=function(i){var t=i[0],e=i[1],s=i[2],r,a,n;a=(t+16)/116,r=e/500+a,n=a-s/200;var o=Math.pow(a,3),u=Math.pow(r,3),l=Math.pow(n,3);return a=o>.008856?o:(a-16/116)/7.787,r=u>.008856?u:(r-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,r*=95.047,a*=100,n*=108.883,[r,a,n]};P.lab.lch=function(i){var t=i[0],e=i[1],s=i[2],r,a,n;return r=Math.atan2(s,e),a=r*360/2/Math.PI,a<0&&(a+=360),n=Math.sqrt(e*e+s*s),[t,n,a]};P.lch.lab=function(i){var t=i[0],e=i[1],s=i[2],r,a,n;return n=s/360*2*Math.PI,r=e*Math.cos(n),a=e*Math.sin(n),[t,r,a]};P.rgb.ansi16=function(i){var t=i[0],e=i[1],s=i[2],r=1 in arguments?arguments[1]:P.rgb.hsv(i)[2];if(r=Math.round(r/50),r===0)return 30;var a=30+(Math.round(s/255)<<2|Math.round(e/255)<<1|Math.round(t/255));return r===2&&(a+=60),a};P.hsv.ansi16=function(i){return P.rgb.ansi16(P.hsv.rgb(i),i[2])};P.rgb.ansi256=function(i){var t=i[0],e=i[1],s=i[2];if(t===e&&e===s)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var r=16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(s/255*5);return r};P.ansi16.rgb=function(i){var t=i%10;if(t===0||t===7)return i>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var e=(~~(i>50)+1)*.5,s=(t&1)*e*255,r=(t>>1&1)*e*255,a=(t>>2&1)*e*255;return[s,r,a]};P.ansi256.rgb=function(i){if(i>=232){var t=(i-232)*10+8;return[t,t,t]}i-=16;var e,s=Math.floor(i/36)/5*255,r=Math.floor((e=i%36)/6)/5*255,a=e%6/5*255;return[s,r,a]};P.rgb.hex=function(i){var t=((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255),e=t.toString(16).toUpperCase();return"000000".substring(e.length)+e};P.hex.rgb=function(i){var t=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var e=t[0];t[0].length===3&&(e=e.split("").map(function(o){return o+o}).join(""));var s=parseInt(e,16),r=s>>16&255,a=s>>8&255,n=s&255;return[r,a,n]};P.rgb.hcg=function(i){var t=i[0]/255,e=i[1]/255,s=i[2]/255,r=Math.max(Math.max(t,e),s),a=Math.min(Math.min(t,e),s),n=r-a,o,u;return n<1?o=a/(1-n):o=0,n<=0?u=0:r===t?u=(e-s)/n%6:r===e?u=2+(s-t)/n:u=4+(t-e)/n+4,u/=6,u%=1,[u*360,n*100,o*100]};P.hsl.hcg=function(i){var t=i[1]/100,e=i[2]/100,s=1,r=0;return e<.5?s=2*t*e:s=2*t*(1-e),s<1&&(r=(e-.5*s)/(1-s)),[i[0],s*100,r*100]};P.hsv.hcg=function(i){var t=i[1]/100,e=i[2]/100,s=t*e,r=0;return s<1&&(r=(e-s)/(1-s)),[i[0],s*100,r*100]};P.hcg.rgb=function(i){var t=i[0]/360,e=i[1]/100,s=i[2]/100;if(e===0)return[s*255,s*255,s*255];var r=[0,0,0],a=t%1*6,n=a%1,o=1-n,u=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=n,r[2]=0;break;case 1:r[0]=o,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=n;break;case 3:r[0]=0,r[1]=o,r[2]=1;break;case 4:r[0]=n,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=o}return u=(1-e)*s,[(e*r[0]+u)*255,(e*r[1]+u)*255,(e*r[2]+u)*255]};P.hcg.hsv=function(i){var t=i[1]/100,e=i[2]/100,s=t+e*(1-t),r=0;return s>0&&(r=t/s),[i[0],r*100,s*100]};P.hcg.hsl=function(i){var t=i[1]/100,e=i[2]/100,s=e*(1-t)+.5*t,r=0;return s>0&&s<.5?r=t/(2*s):s>=.5&&s<1&&(r=t/(2*(1-s))),[i[0],r*100,s*100]};P.hcg.hwb=function(i){var t=i[1]/100,e=i[2]/100,s=t+e*(1-t);return[i[0],(s-t)*100,(1-s)*100]};P.hwb.hcg=function(i){var t=i[1]/100,e=i[2]/100,s=1-e,r=s-t,a=0;return r<1&&(a=(s-r)/(1-r)),[i[0],r*100,a*100]};P.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]};P.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]};P.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]};P.gray.hsl=P.gray.hsv=function(i){return[0,0,i[0]]};P.gray.hwb=function(i){return[0,100,i[0]]};P.gray.cmyk=function(i){return[0,0,0,i[0]]};P.gray.lab=function(i){return[i[0],0,0]};P.gray.hex=function(i){var t=Math.round(i[0]/100*255)&255,e=(t<<16)+(t<<8)+t,s=e.toString(16).toUpperCase();return"000000".substring(s.length)+s};P.rgb.gray=function(i){var t=(i[0]+i[1]+i[2])/3;return[t/255*100]}});var Bi=S((Qh,Di)=>{var Mt=gs();function uu(){for(var i={},t=Object.keys(Mt),e=t.length,s=0;s<e;s++)i[t[s]]={distance:-1,parent:null};return i}function lu(i){var t=uu(),e=[i];for(t[i].distance=0;e.length;)for(var s=e.pop(),r=Object.keys(Mt[s]),a=r.length,n=0;n<a;n++){var o=r[n],u=t[o];u.distance===-1&&(u.distance=t[s].distance+1,u.parent=s,e.unshift(o))}return t}function cu(i,t){return function(e){return t(i(e))}}function hu(i,t){for(var e=[t[i].parent,i],s=Mt[t[i].parent][i],r=t[i].parent;t[r].parent;)e.unshift(t[r].parent),s=cu(Mt[t[r].parent][r],s),r=t[r].parent;return s.conversion=e,s}Di.exports=function(i){for(var t=lu(i),e={},s=Object.keys(t),r=s.length,a=0;a<r;a++){var n=s[a],o=t[n];o.parent!==null&&(e[n]=hu(n,t))}return e}});var Ri=S((Zh,Fi)=>{var bs=gs(),pu=Bi(),Ne={},fu=Object.keys(bs);function du(i){var t=function(e){return e==null?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),i(e))};return"conversion"in i&&(t.conversion=i.conversion),t}function mu(i){var t=function(e){if(e==null)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var s=i(e);if(typeof s=="object")for(var r=s.length,a=0;a<r;a++)s[a]=Math.round(s[a]);return s};return"conversion"in i&&(t.conversion=i.conversion),t}fu.forEach(function(i){Ne[i]={},Object.defineProperty(Ne[i],"channels",{value:bs[i].channels}),Object.defineProperty(Ne[i],"labels",{value:bs[i].labels});var t=pu(i),e=Object.keys(t);e.forEach(function(s){var r=t[s];Ne[i][s]=mu(r),Ne[i][s].raw=du(r)})});Fi.exports=Ne});var ji=S((ep,Ui)=>{"use strict";var _e=Ri(),Ot=(i,t)=>function(){return`\x1B[${i.apply(_e,arguments)+t}m`},Lt=(i,t)=>function(){let e=i.apply(_e,arguments);return`\x1B[${38+t};5;${e}m`},Dt=(i,t)=>function(){let e=i.apply(_e,arguments);return`\x1B[${38+t};2;${e[0]};${e[1]};${e[2]}m`};function yu(){let i=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(let r of Object.keys(t)){let a=t[r];for(let n of Object.keys(a)){let o=a[n];t[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},a[n]=t[n],i.set(o[0],o[1])}Object.defineProperty(t,r,{value:a,enumerable:!1}),Object.defineProperty(t,"codes",{value:i,enumerable:!1})}let e=r=>r,s=(r,a,n)=>[r,a,n];t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi={ansi:Ot(e,0)},t.color.ansi256={ansi256:Lt(e,0)},t.color.ansi16m={rgb:Dt(s,0)},t.bgColor.ansi={ansi:Ot(e,10)},t.bgColor.ansi256={ansi256:Lt(e,10)},t.bgColor.ansi16m={rgb:Dt(s,10)};for(let r of Object.keys(_e)){if(typeof _e[r]!="object")continue;let a=_e[r];r==="ansi16"&&(r="ansi"),"ansi16"in a&&(t.color.ansi[r]=Ot(a.ansi16,0),t.bgColor.ansi[r]=Ot(a.ansi16,10)),"ansi256"in a&&(t.color.ansi256[r]=Lt(a.ansi256,0),t.bgColor.ansi256[r]=Lt(a.ansi256,10)),"rgb"in a&&(t.color.ansi16m[r]=Dt(a.rgb,0),t.bgColor.ansi16m[r]=Dt(a.rgb,10))}return t}Object.defineProperty(Ui,"exports",{enumerable:!0,get:yu})});var qi=S((tp,$i)=>{"use strict";$i.exports=(i,t)=>{t=t||process.argv;let e=i.startsWith("-")?"":i.length===1?"-":"--",s=t.indexOf(e+i),r=t.indexOf("--");return s!==-1&&(r===-1?!0:s<r)}});var Vi=S((sp,Wi)=>{"use strict";var xu=require("os"),G=qi(),U=process.env,Me;G("no-color")||G("no-colors")||G("color=false")?Me=!1:(G("color")||G("colors")||G("color=true")||G("color=always"))&&(Me=!0);"FORCE_COLOR"in U&&(Me=U.FORCE_COLOR.length===0||parseInt(U.FORCE_COLOR,10)!==0);function gu(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function bu(i){if(Me===!1)return 0;if(G("color=16m")||G("color=full")||G("color=truecolor"))return 3;if(G("color=256"))return 2;if(i&&!i.isTTY&&Me!==!0)return 0;let t=Me?1:0;if(process.platform==="win32"){let e=xu.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in U)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in U)||U.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in U)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(U.TEAMCITY_VERSION)?1:0;if(U.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in U){let e=parseInt((U.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(U.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(U.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(U.TERM)||"COLORTERM"in U?1:(U.TERM==="dumb",t)}function Ps(i){let t=bu(i);return gu(t)}Wi.exports={supportsColor:Ps,stdout:Ps(process.stdout),stderr:Ps(process.stderr)}});var Xi=S((rp,Gi)=>{"use strict";var Pu=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,zi=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,vu=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Tu=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,wu=new Map([["n",`
|
|
6
|
-
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Ki(i){return i[0]==="u"&&i.length===5||i[0]==="x"&&i.length===3?String.fromCharCode(parseInt(i.slice(1),16)):wu.get(i)||i}function Au(i,t){let e=[],s=t.trim().split(/\s*,\s*/g),r;for(let a of s)if(!isNaN(a))e.push(Number(a));else if(r=a.match(vu))e.push(r[2].replace(Tu,(n,o,u)=>o?Ki(o):u));else throw new Error(`Invalid Chalk template style argument: ${a} (in style '${i}')`);return e}function Su(i){zi.lastIndex=0;let t=[],e;for(;(e=zi.exec(i))!==null;){let s=e[1];if(e[2]){let r=Au(s,e[2]);t.push([s].concat(r))}else t.push([s])}return t}function Hi(i,t){let e={};for(let r of t)for(let a of r.styles)e[a[0]]=r.inverse?null:a.slice(1);let s=i;for(let r of Object.keys(e))if(Array.isArray(e[r])){if(!(r in s))throw new Error(`Unknown Chalk style: ${r}`);e[r].length>0?s=s[r].apply(s,e[r]):s=s[r]}return s}Gi.exports=(i,t)=>{let e=[],s=[],r=[];if(t.replace(Pu,(a,n,o,u,l,c)=>{if(n)r.push(Ki(n));else if(u){let p=r.join("");r=[],s.push(e.length===0?p:Hi(i,e)(p)),e.push({inverse:o,styles:Su(u)})}else if(l){if(e.length===0)throw new Error("Found extraneous } in Chalk template literal");s.push(Hi(i,e)(r.join(""))),r=[],e.pop()}else r.push(c)}),s.push(r.join("")),e.length>0){let a=`Chalk template literal is missing ${e.length} closing bracket${e.length===1?"":"s"} (\`}\`)`;throw new Error(a)}return s.join("")}});var ea=S((ip,Ze)=>{"use strict";var Ts=Ii(),L=ji(),vs=Vi().stdout,Cu=Xi(),Yi=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),Qi=["ansi","ansi","ansi256","ansi16m"],Zi=new Set(["gray"]),Oe=Object.create(null);function Ji(i,t){t=t||{};let e=vs?vs.level:0;i.level=t.level===void 0?e:t.level,i.enabled="enabled"in t?t.enabled:i.level>0}function Qe(i){if(!this||!(this instanceof Qe)||this.template){let t={};return Ji(t,i),t.template=function(){let e=[].slice.call(arguments);return ku.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,Qe.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=Qe,t.template}Ji(this,i)}Yi&&(L.blue.open="\x1B[94m");for(let i of Object.keys(L))L[i].closeRe=new RegExp(Ts(L[i].close),"g"),Oe[i]={get(){let t=L[i];return Bt.call(this,this._styles?this._styles.concat(t):[t],this._empty,i)}};Oe.visible={get(){return Bt.call(this,this._styles||[],!0,"visible")}};L.color.closeRe=new RegExp(Ts(L.color.close),"g");for(let i of Object.keys(L.color.ansi))Zi.has(i)||(Oe[i]={get(){let t=this.level;return function(){let s={open:L.color[Qi[t]][i].apply(null,arguments),close:L.color.close,closeRe:L.color.closeRe};return Bt.call(this,this._styles?this._styles.concat(s):[s],this._empty,i)}}});L.bgColor.closeRe=new RegExp(Ts(L.bgColor.close),"g");for(let i of Object.keys(L.bgColor.ansi)){if(Zi.has(i))continue;let t="bg"+i[0].toUpperCase()+i.slice(1);Oe[t]={get(){let e=this.level;return function(){let r={open:L.bgColor[Qi[e]][i].apply(null,arguments),close:L.bgColor.close,closeRe:L.bgColor.closeRe};return Bt.call(this,this._styles?this._styles.concat(r):[r],this._empty,i)}}}}var Eu=Object.defineProperties(()=>{},Oe);function Bt(i,t,e){let s=function(){return Iu.apply(s,arguments)};s._styles=i,s._empty=t;let r=this;return Object.defineProperty(s,"level",{enumerable:!0,get(){return r.level},set(a){r.level=a}}),Object.defineProperty(s,"enabled",{enumerable:!0,get(){return r.enabled},set(a){r.enabled=a}}),s.hasGrey=this.hasGrey||e==="gray"||e==="grey",s.__proto__=Eu,s}function Iu(){let i=arguments,t=i.length,e=String(arguments[0]);if(t===0)return"";if(t>1)for(let r=1;r<t;r++)e+=" "+i[r];if(!this.enabled||this.level<=0||!e)return this._empty?"":e;let s=L.dim.open;Yi&&this.hasGrey&&(L.dim.open="");for(let r of this._styles.slice().reverse())e=r.open+e.replace(r.closeRe,r.open)+r.close,e=e.replace(/\r?\n/g,`${r.close}$&${r.open}`);return L.dim.open=s,e}function ku(i,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");let e=[].slice.call(arguments,2),s=[t.raw[0]];for(let r=1;r<t.length;r++)s.push(String(e[r-1]).replace(/[{}\\]/g,"\\$&")),s.push(String(t.raw[r]));return Cu(i,s.join(""))}Object.defineProperties(Qe.prototype,Oe);Ze.exports=Qe();Ze.exports.supportsColor=vs;Ze.exports.default=Ze.exports});var oa=S(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.codeFrameColumns=na;Ft.default=Lu;var ta=Ci(),sa=Nu(ea(),!0);function aa(i){if(typeof WeakMap!="function")return null;var t=new WeakMap,e=new WeakMap;return(aa=function(s){return s?e:t})(i)}function Nu(i,t){if(!t&&i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var e=aa(t);if(e&&e.has(i))return e.get(i);var s={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var n=r?Object.getOwnPropertyDescriptor(i,a):null;n&&(n.get||n.set)?Object.defineProperty(s,a,n):s[a]=i[a]}return s.default=i,e&&e.set(i,s),s}var ws;function _u(i){if(i){var t;return(t=ws)!=null||(ws=new sa.default.constructor({enabled:!0,level:1})),ws}return sa.default}var ra=!1;function Mu(i){return{gutter:i.grey,marker:i.red.bold,message:i.red.bold}}var ia=/\r\n|[\n\r\u2028\u2029]/;function Ou(i,t,e){let s=Object.assign({column:0,line:-1},i.start),r=Object.assign({},s,i.end),{linesAbove:a=2,linesBelow:n=3}=e||{},o=s.line,u=s.column,l=r.line,c=r.column,p=Math.max(o-(a+1),0),f=Math.min(t.length,l+n);o===-1&&(p=0),l===-1&&(f=t.length);let d=l-o,m={};if(d)for(let y=0;y<=d;y++){let v=y+o;if(!u)m[v]=!0;else if(y===0){let A=t[v-1].length;m[v]=[u,A-u+1]}else if(y===d)m[v]=[0,c];else{let A=t[v-y].length;m[v]=[0,A]}}else u===c?u?m[o]=[u,0]:m[o]=!0:m[o]=[u,c-u];return{start:p,end:f,markerLines:m}}function na(i,t,e={}){let s=(e.highlightCode||e.forceColor)&&(0,ta.shouldHighlight)(e),r=_u(e.forceColor),a=Mu(r),n=(y,v)=>s?y(v):v,o=i.split(ia),{start:u,end:l,markerLines:c}=Ou(t,o,e),p=t.start&&typeof t.start.column=="number",f=String(l).length,m=(s?(0,ta.default)(i,e):i).split(ia,l).slice(u,l).map((y,v)=>{let A=u+1+v,$=` ${` ${A}`.slice(-f)} |`,B=c[A],vt=!c[A+1];if(B){let ye="";if(Array.isArray(B)){let Tt=y.slice(0,Math.max(B[0]-1,0)).replace(/[^\t]/g," "),He=B[1]||1;ye=[`
|
|
7
|
-
`,n(a.gutter,$.replace(/\d/g," "))," ",Tt,n(a.marker,"^").repeat(He)].join(""),vt&&e.message&&(ye+=" "+n(a.message,e.message))}return[n(a.marker,">"),n(a.gutter,$),y.length>0?` ${y}`:"",ye].join("")}else return` ${n(a.gutter,$)}${y.length>0?` ${y}`:""}`}).join(`
|
|
8
|
-
`);return e.message&&!p&&(m=`${" ".repeat(f+1)}${e.message}
|
|
9
|
-
${m}`),s?r.reset(m):m}function Lu(i,t,e,s={}){if(!ra){ra=!0;let a="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(a,"DeprecationWarning");else{let n=new Error(a);n.name="DeprecationWarning",console.warn(new Error(a))}}return e=Math.max(e,0),na(i,{start:{column:e,line:t}},s)}});var qa=S(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});function Wt(i,t){if(i==null)return{};var e={},s=Object.keys(i),r,a;for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&(e[r]=i[r]);return e}var Z=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},Ue=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function z(i,t){let{line:e,column:s,index:r}=i;return new Z(e,s+t,r+t)}var ua="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Du={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:ua},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:ua}},la={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"},ks=({type:i,prefix:t})=>i==="UpdateExpression"?la.UpdateExpression[String(t)]:la[i],Bu={AccessorIsGenerator:({kind:i})=>`A ${i}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.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",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:i})=>`Missing initializer in ${i} 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.",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:i})=>`\`${i}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:i,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
10
|
-
- Did you mean \`export { '${i}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:i})=>`'${i==="ForInStatement"?"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:i})=>`Unsyntactic ${i==="BreakStatement"?"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 `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",ImportBindingIsString:({importName:i})=>`A string literal cannot be used as an imported binding.
|
|
11
|
-
- Did you mean \`import { "${i}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:i})=>`\`import()\` requires exactly ${i===1?"one argument":"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:i})=>`Expected number in radix ${i}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:i})=>`Escape sequence in keyword ${i}.`,InvalidIdentifier:({identifierName:i})=>`Invalid identifier ${i}.`,InvalidLhs:({ancestor:i})=>`Invalid left-hand side in ${ks(i)}.`,InvalidLhsBinding:({ancestor:i})=>`Binding invalid left-hand side in ${ks(i)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:i})=>`Unexpected character '${i}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:i})=>`Private name #${i} 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:i})=>`Label '${i}' 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:i})=>`This experimental syntax requires enabling the parser plugin: ${i.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:i})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${i.map(t=>JSON.stringify(t)).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:i})=>`Duplicate key "${i}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:i})=>`An export name cannot include a lone surrogate, found '\\u${i.toString(16)}'.`,ModuleExportUndefined:({localName:i})=>`Export '${i}' 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:i})=>`Private names are only allowed in property accesses (\`obj.#${i}\`) or in \`in\` expressions (\`#${i} in obj\`).`,PrivateNameRedeclaration:({identifierName:i})=>`Duplicate private name #${i}.`,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.",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:i})=>`Unexpected keyword '${i}'.`,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:i})=>`Unexpected reserved word '${i}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:i,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${i?`, expected "${i}"`:""}`,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:i,onlyValidPropertyName:t})=>`The only valid meta property for ${i} is ${i}.${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.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:i})=>`Identifier '${i}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Fu={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:i})=>`Assigning to '${i}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:i})=>`Binding '${i}' 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."},Ru=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Uu={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:i})=>`Invalid topic token ${i}. In order to use ${i} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${i}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:i})=>`Hack-style pipe body cannot be an unparenthesized ${ks({type:i})}; 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.'},ju=["toMessage"],$u=["message"];function ca(i,t,e){Object.defineProperty(i,t,{enumerable:!1,configurable:!0,value:e})}function qu(i){let{toMessage:t}=i,e=Wt(i,ju);return function s({loc:r,details:a}){let n=new SyntaxError;return Object.assign(n,e,{loc:r,pos:r.index}),"missingPlugin"in a&&Object.assign(n,{missingPlugin:a.missingPlugin}),ca(n,"clone",function(u={}){var l;let{line:c,column:p,index:f}=(l=u.loc)!=null?l:r;return s({loc:new Z(c,p,f),details:Object.assign({},a,u.details)})}),ca(n,"details",a),Object.defineProperty(n,"message",{configurable:!0,get(){let o=`${t(a)} (${r.line}:${r.column})`;return this.message=o,o},set(o){Object.defineProperty(this,"message",{value:o,writable:!0})}}),n}}function ae(i,t){if(Array.isArray(i))return s=>ae(s,i[0]);let e={};for(let s of Object.keys(i)){let r=i[s],a=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:n}=a,o=Wt(a,$u),u=typeof n=="string"?()=>n:n;e[s]=qu(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:s,toMessage:u},t?{syntaxPlugin:t}:{},o))}return e}var h=Object.assign({},ae(Du),ae(Bu),ae(Fu),ae`pipelineOperator`(Uu)),{defineProperty:Wu}=Object,ha=(i,t)=>Wu(i,t,{enumerable:!1,value:i[t]});function et(i){return i.loc.start&&ha(i.loc.start,"index"),i.loc.end&&ha(i.loc.end,"index"),i}var Vu=i=>class extends i{parse(){let e=et(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(et)),e}parseRegExpLiteral({pattern:e,flags:s}){let r=null;try{r=new RegExp(e,s)}catch{}let a=this.estreeParseLiteral(r);return a.regex={pattern:e,flags:s},a}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let r=this.estreeParseLiteral(s);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){let r=this.estreeParseLiteral(null);return r.decimal=String(r.value||e),r}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){let s=e.value;delete e.value,s.type="Literal",s.raw=s.extra.raw,s.value=s.extra.expressionValue;let r=e;return r.type="ExpressionStatement",r.expression=s,r.directive=s.extra.rawValue,delete s.extra,r}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,r,a,n){super.parseBlockBody(e,s,r,a,n);let o=e.directives.map(u=>this.directiveToStmt(u));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,s,r,a,n,o){this.parseMethod(s,r,a,n,o,"ClassMethod",!0),s.typeParameters&&(s.value.typeParameters=s.typeParameters,delete s.typeParameters),e.body.push(s)}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){let r=super.parseLiteral(e,s);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,s,r=!1){super.parseFunctionBody(e,s,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,r,a,n,o,u=!1){let l=this.startNode();return l.kind=e.kind,l=super.parseMethod(l,s,r,a,n,o,u),l.type="FunctionExpression",delete l.kind,e.value=l,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition",s.computed=!1),s}parseObjectMethod(e,s,r,a,n){let o=super.parseObjectMethod(e,s,r,a,n);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,s,r,a){let n=super.parseObjectProperty(e,s,r,a);return n&&(n.kind="init",n.type="Property"),n}isValidLVal(e,s,r){return e==="Property"?"value":super.isValidLVal(e,s,r)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:r,value:a}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(a,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,r){e.kind==="get"||e.kind==="set"?this.raise(h.PatternHasAccessor,{at:e.key}):e.method?this.raise(h.PatternHasMethod,{at:e.key}):super.toAssignableObjectExpressionProp(e,s,r)}finishCallExpression(e,s){let r=super.finishCallExpression(e,s);if(r.callee.type==="Import"){if(r.type="ImportExpression",r.source=r.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var a;r.attributes=(a=r.arguments[1])!=null?a:null}delete r.arguments,delete r.callee}return r}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let r=this.state.lastTokStartLoc,a=super.parseExport(e,s);switch(a.type){case"ExportAllDeclaration":a.exported=null;break;case"ExportNamedDeclaration":a.specifiers.length===1&&a.specifiers[0].type==="ExportNamespaceSpecifier"&&(a.type="ExportAllDeclaration",a.exported=a.specifiers[0].exported,delete a.specifiers);case"ExportDefaultDeclaration":{var n;let{declaration:o}=a;(o==null?void 0:o.type)==="ClassDeclaration"&&((n=o.decorators)==null?void 0:n.length)>0&&o.start===a.start&&this.resetStartLocation(a,r)}break}return a}parseSubscript(e,s,r,a){let n=super.parseSubscript(e,s,r,a);if(a.optionalChainMember){if((n.type==="OptionalMemberExpression"||n.type==="OptionalCallExpression")&&(n.type=n.type.substring(8)),a.stop){let o=this.startNodeAtNode(n);return o.expression=n,this.finishNode(o,"ChainExpression")}}else(n.type==="MemberExpression"||n.type==="CallExpression")&&(n.optional=!1);return n}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.method||e.kind==="get"||e.kind==="set"}finishNodeAt(e,s,r){return et(super.finishNodeAt(e,s,r))}resetStartLocation(e,s){super.resetStartLocation(e,s),et(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),et(e)}},Te=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},N={brace:new Te("{"),j_oTag:new Te("<tag"),j_cTag:new Te("</tag"),j_expr:new Te("<tag>...</tag>",!0)};N.template=new Te("`",!0);var C=!0,x=!0,As=!0,tt=!0,ce=!0,zu=!0,Vt=class{constructor(t,e={}){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=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},Js=new Map;function I(i,t={}){t.keyword=i;let e=T(i,t);return Js.set(i,e),e}function V(i,t){return T(i,{beforeExpr:C,binop:t})}var at=-1,re=[],Ys=[],Qs=[],Zs=[],er=[],tr=[];function T(i,t={}){var e,s,r,a;return++at,Ys.push(i),Qs.push((e=t.binop)!=null?e:-1),Zs.push((s=t.beforeExpr)!=null?s:!1),er.push((r=t.startsExpr)!=null?r:!1),tr.push((a=t.prefix)!=null?a:!1),re.push(new Vt(i,t)),at}function E(i,t={}){var e,s,r,a;return++at,Js.set(i,at),Ys.push(i),Qs.push((e=t.binop)!=null?e:-1),Zs.push((s=t.beforeExpr)!=null?s:!1),er.push((r=t.startsExpr)!=null?r:!1),tr.push((a=t.prefix)!=null?a:!1),re.push(new Vt("name",t)),at}var Hu={bracketL:T("[",{beforeExpr:C,startsExpr:x}),bracketHashL:T("#[",{beforeExpr:C,startsExpr:x}),bracketBarL:T("[|",{beforeExpr:C,startsExpr:x}),bracketR:T("]"),bracketBarR:T("|]"),braceL:T("{",{beforeExpr:C,startsExpr:x}),braceBarL:T("{|",{beforeExpr:C,startsExpr:x}),braceHashL:T("#{",{beforeExpr:C,startsExpr:x}),braceR:T("}"),braceBarR:T("|}"),parenL:T("(",{beforeExpr:C,startsExpr:x}),parenR:T(")"),comma:T(",",{beforeExpr:C}),semi:T(";",{beforeExpr:C}),colon:T(":",{beforeExpr:C}),doubleColon:T("::",{beforeExpr:C}),dot:T("."),question:T("?",{beforeExpr:C}),questionDot:T("?."),arrow:T("=>",{beforeExpr:C}),template:T("template"),ellipsis:T("...",{beforeExpr:C}),backQuote:T("`",{startsExpr:x}),dollarBraceL:T("${",{beforeExpr:C,startsExpr:x}),templateTail:T("...`",{startsExpr:x}),templateNonTail:T("...${",{beforeExpr:C,startsExpr:x}),at:T("@"),hash:T("#",{startsExpr:x}),interpreterDirective:T("#!..."),eq:T("=",{beforeExpr:C,isAssign:tt}),assign:T("_=",{beforeExpr:C,isAssign:tt}),slashAssign:T("_=",{beforeExpr:C,isAssign:tt}),xorAssign:T("_=",{beforeExpr:C,isAssign:tt}),moduloAssign:T("_=",{beforeExpr:C,isAssign:tt}),incDec:T("++/--",{prefix:ce,postfix:zu,startsExpr:x}),bang:T("!",{beforeExpr:C,prefix:ce,startsExpr:x}),tilde:T("~",{beforeExpr:C,prefix:ce,startsExpr:x}),doubleCaret:T("^^",{startsExpr:x}),doubleAt:T("@@",{startsExpr:x}),pipeline:V("|>",0),nullishCoalescing:V("??",1),logicalOR:V("||",1),logicalAND:V("&&",2),bitwiseOR:V("|",3),bitwiseXOR:V("^",4),bitwiseAND:V("&",5),equality:V("==/!=/===/!==",6),lt:V("</>/<=/>=",7),gt:V("</>/<=/>=",7),relational:V("</>/<=/>=",7),bitShift:V("<</>>/>>>",8),bitShiftL:V("<</>>/>>>",8),bitShiftR:V("<</>>/>>>",8),plusMin:T("+/-",{beforeExpr:C,binop:9,prefix:ce,startsExpr:x}),modulo:T("%",{binop:10,startsExpr:x}),star:T("*",{binop:10}),slash:V("/",10),exponent:T("**",{beforeExpr:C,binop:11,rightAssociative:!0}),_in:I("in",{beforeExpr:C,binop:7}),_instanceof:I("instanceof",{beforeExpr:C,binop:7}),_break:I("break"),_case:I("case",{beforeExpr:C}),_catch:I("catch"),_continue:I("continue"),_debugger:I("debugger"),_default:I("default",{beforeExpr:C}),_else:I("else",{beforeExpr:C}),_finally:I("finally"),_function:I("function",{startsExpr:x}),_if:I("if"),_return:I("return",{beforeExpr:C}),_switch:I("switch"),_throw:I("throw",{beforeExpr:C,prefix:ce,startsExpr:x}),_try:I("try"),_var:I("var"),_const:I("const"),_with:I("with"),_new:I("new",{beforeExpr:C,startsExpr:x}),_this:I("this",{startsExpr:x}),_super:I("super",{startsExpr:x}),_class:I("class",{startsExpr:x}),_extends:I("extends",{beforeExpr:C}),_export:I("export"),_import:I("import",{startsExpr:x}),_null:I("null",{startsExpr:x}),_true:I("true",{startsExpr:x}),_false:I("false",{startsExpr:x}),_typeof:I("typeof",{beforeExpr:C,prefix:ce,startsExpr:x}),_void:I("void",{beforeExpr:C,prefix:ce,startsExpr:x}),_delete:I("delete",{beforeExpr:C,prefix:ce,startsExpr:x}),_do:I("do",{isLoop:As,beforeExpr:C}),_for:I("for",{isLoop:As}),_while:I("while",{isLoop:As}),_as:E("as",{startsExpr:x}),_assert:E("assert",{startsExpr:x}),_async:E("async",{startsExpr:x}),_await:E("await",{startsExpr:x}),_from:E("from",{startsExpr:x}),_get:E("get",{startsExpr:x}),_let:E("let",{startsExpr:x}),_meta:E("meta",{startsExpr:x}),_of:E("of",{startsExpr:x}),_sent:E("sent",{startsExpr:x}),_set:E("set",{startsExpr:x}),_static:E("static",{startsExpr:x}),_using:E("using",{startsExpr:x}),_yield:E("yield",{startsExpr:x}),_asserts:E("asserts",{startsExpr:x}),_checks:E("checks",{startsExpr:x}),_exports:E("exports",{startsExpr:x}),_global:E("global",{startsExpr:x}),_implements:E("implements",{startsExpr:x}),_intrinsic:E("intrinsic",{startsExpr:x}),_infer:E("infer",{startsExpr:x}),_is:E("is",{startsExpr:x}),_mixins:E("mixins",{startsExpr:x}),_proto:E("proto",{startsExpr:x}),_require:E("require",{startsExpr:x}),_satisfies:E("satisfies",{startsExpr:x}),_keyof:E("keyof",{startsExpr:x}),_readonly:E("readonly",{startsExpr:x}),_unique:E("unique",{startsExpr:x}),_abstract:E("abstract",{startsExpr:x}),_declare:E("declare",{startsExpr:x}),_enum:E("enum",{startsExpr:x}),_module:E("module",{startsExpr:x}),_namespace:E("namespace",{startsExpr:x}),_interface:E("interface",{startsExpr:x}),_type:E("type",{startsExpr:x}),_opaque:E("opaque",{startsExpr:x}),name:T("name",{startsExpr:x}),string:T("string",{startsExpr:x}),num:T("num",{startsExpr:x}),bigint:T("bigint",{startsExpr:x}),decimal:T("decimal",{startsExpr:x}),regexp:T("regexp",{startsExpr:x}),privateName:T("#name",{startsExpr:x}),eof:T("eof"),jsxName:T("jsxName"),jsxText:T("jsxText",{beforeExpr:!0}),jsxTagStart:T("jsxTagStart",{startsExpr:!0}),jsxTagEnd:T("jsxTagEnd"),placeholder:T("%%",{startsExpr:!0})};function k(i){return i>=93&&i<=130}function Ku(i){return i<=92}function X(i){return i>=58&&i<=130}function Aa(i){return i>=58&&i<=134}function Gu(i){return Zs[i]}function Ns(i){return er[i]}function Xu(i){return i>=29&&i<=33}function pa(i){return i>=127&&i<=129}function Ju(i){return i>=90&&i<=92}function sr(i){return i>=58&&i<=92}function Yu(i){return i>=39&&i<=59}function Qu(i){return i===34}function Zu(i){return tr[i]}function el(i){return i>=119&&i<=121}function tl(i){return i>=122&&i<=128}function pe(i){return Ys[i]}function jt(i){return Qs[i]}function sl(i){return i===57}function zt(i){return i>=24&&i<=25}function se(i){return re[i]}re[8].updateContext=i=>{i.pop()},re[5].updateContext=re[7].updateContext=re[23].updateContext=i=>{i.push(N.brace)},re[22].updateContext=i=>{i[i.length-1]===N.template?i.pop():i.push(N.template)},re[140].updateContext=i=>{i.push(N.j_expr,N.j_oTag)};var rr="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Sa="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F",rl=new RegExp("["+rr+"]"),il=new RegExp("["+rr+Sa+"]");rr=Sa=null;var Ca=[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,68,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,349,41,7,1,79,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,159,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,264,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,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,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,757,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,3104,541,1507,4938,6,4191],al=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,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,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,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,406,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,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,983,6,110,6,6,9,4759,9,787719,239];function _s(i,t){let e=65536;for(let s=0,r=t.length;s<r;s+=2){if(e+=t[s],e>i)return!1;if(e+=t[s+1],e>=i)return!0}return!1}function ie(i){return i<65?i===36:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&rl.test(String.fromCharCode(i)):_s(i,Ca)}function Be(i){return i<48?i===36:i<58?!0:i<65?!1:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&il.test(String.fromCharCode(i)):_s(i,Ca)||_s(i,al)}var ir={keyword:["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"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},nl=new Set(ir.keyword),ol=new Set(ir.strict),ul=new Set(ir.strictBind);function Ea(i,t){return t&&i==="await"||i==="enum"}function Ia(i,t){return Ea(i,t)||ol.has(i)}function ka(i){return ul.has(i)}function Na(i,t){return Ia(i,t)||ka(i)}function ll(i){return nl.has(i)}function cl(i,t,e){return i===64&&t===64&&ie(e)}var hl=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"]);function pl(i){return hl.has(i)}var ot=class{constructor(t){this.var=new Set,this.lexical=new Set,this.functions=new Set,this.flags=t}},ut=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new ot(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let r=this.currentScope();if(e&8||e&16)this.checkRedeclarationInScope(r,t,e,s),e&16?r.functions.add(t):r.lexical.add(t),e&8&&this.maybeExportDefined(r,t);else if(e&4)for(let a=this.scopeStack.length-1;a>=0&&(r=this.scopeStack[a],this.checkRedeclarationInScope(r,t,e,s),r.var.add(t),this.maybeExportDefined(r,t),!(r.flags&387));--a);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,r){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(h.VarRedeclaration,{at:r,identifierName:e})}isRedeclaredInScope(t,e,s){return s&1?s&8?t.lexical.has(e)||t.functions.has(e)||t.var.has(e):s&16?t.lexical.has(e)||!this.treatFunctionsAsVarInScope(t)&&t.var.has(e):t.lexical.has(e)&&!(t.flags&8&&t.lexical.values().next().value===e)||!this.treatFunctionsAsVarInScope(t)&&t.functions.has(e):!1}checkLocalExport(t){let{name:e}=t,s=this.scopeStack[0];!s.lexical.has(e)&&!s.var.has(e)&&!s.functions.has(e)&&this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&387)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&451&&!(e&4))return e}}},Ms=class extends ot{constructor(...t){super(...t),this.declareFunctions=new Set}},Os=class extends ut{createScope(t){return new Ms(t)}declareName(t,e,s){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,t,e,s),this.maybeExportDefined(r,t),r.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){return super.isRedeclaredInScope(t,e,s)?!0:s&2048?!t.declareFunctions.has(e)&&(t.lexical.has(e)||t.functions.has(e)):!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},Ls=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let a of Object.keys(s))if((r==null?void 0:r[a])!==s[a])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function _a(i,t){i.trailingComments===void 0?i.trailingComments=t:i.trailingComments.unshift(...t)}function fl(i,t){i.leadingComments===void 0?i.leadingComments=t:i.leadingComments.unshift(...t)}function lt(i,t){i.innerComments===void 0?i.innerComments=t:i.innerComments.unshift(...t)}function st(i,t,e){let s=null,r=t.length;for(;s===null&&r>0;)s=t[--r];s===null||s.start>e.start?lt(i,e.comments):_a(s,e.comments)}var Ds=class extends Ls{addComment(t){this.filename&&(t.loc.filename=this.filename),this.state.comments.push(t)}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let r=s-1,a=e[r];a.start===t.end&&(a.leadingNode=t,r--);let{start:n}=t;for(;r>=0;r--){let o=e[r],u=o.end;if(u>n)o.containingNode=t,this.finalizeComment(o),e.splice(r,1);else{u===n&&(o.trailingNode=t);break}}}finalizeComment(t){let{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&_a(t.leadingNode,e),t.trailingNode!==null&&fl(t.trailingNode,e);else{let{containingNode:s,start:r}=t;if(this.input.charCodeAt(r-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":st(s,s.properties,t);break;case"CallExpression":case"OptionalCallExpression":st(s,s.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":st(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":st(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":st(s,s.specifiers,t);break;default:lt(s,e)}else lt(s,e)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let r=e[s-1];r.leadingNode===t&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(t){let{commentStack:e}=this.state,{length:s}=e;s!==0&&(e[s-1].trailingNode===t?e[s-1].trailingNode=null:s>=2&&e[s-2].trailingNode===t&&(e[s-2].trailingNode=null))}takeSurroundingComments(t,e,s){let{commentStack:r}=this.state,a=r.length;if(a===0)return;let n=a-1;for(;n>=0;n--){let o=r[n],u=o.end;if(o.start===s)o.leadingNode=t;else if(u===e)o.trailingNode=t;else if(u<e)break}}},Ma=/\r\n?|[\n\u2028\u2029]/,Rt=new RegExp(Ma.source,"g");function nt(i){switch(i){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}var Ss=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,$t=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g,fa=new RegExp("(?=("+$t.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y");function dl(i){switch(i){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var Bs=class i{constructor(){this.strict=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.maybeInArrowParameters=!1,this.inType=!1,this.noAnonFunctionType=!1,this.hasFlowComment=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inDisallowConditionalTypesContext=!1,this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.soloAwait=!1,this.inFSharpPipelineDirectBody=!1,this.labels=[],this.comments=[],this.commentStack=[],this.pos=0,this.type=137,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.lastTokStart=0,this.context=[N.brace],this.canStartJSXElement=!0,this.containsEsc=!1,this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}init({strictMode:t,sourceType:e,startLine:s,startColumn:r}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.curLine=s,this.lineStart=-r,this.startLoc=this.endLoc=new Z(s,r,0)}curPosition(){return new Z(this.curLine,this.pos-this.lineStart,this.pos)}clone(t){let e=new i,s=Object.keys(this);for(let r=0,a=s.length;r<a;r++){let n=s[r],o=this[n];!t&&Array.isArray(o)&&(o=o.slice()),e[n]=o}return e}},ml=function(t){return t>=48&&t<=57},da={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Ut={bin:i=>i===48||i===49,oct:i=>i>=48&&i<=55,dec:i=>i>=48&&i<=57,hex:i=>i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102};function ma(i,t,e,s,r,a){let n=e,o=s,u=r,l="",c=null,p=e,{length:f}=t;for(;;){if(e>=f){a.unterminated(n,o,u),l+=t.slice(p,e);break}let d=t.charCodeAt(e);if(yl(i,d,t,e)){l+=t.slice(p,e);break}if(d===92){l+=t.slice(p,e);let m=xl(t,e,s,r,i==="template",a);m.ch===null&&!c?c={pos:e,lineStart:s,curLine:r}:l+=m.ch,{pos:e,lineStart:s,curLine:r}=m,p=e}else d===8232||d===8233?(++e,++r,s=e):d===10||d===13?i==="template"?(l+=t.slice(p,e)+`
|
|
12
|
-
`,++e,d===13&&t.charCodeAt(e)===10&&++e,++r,p=s=e):a.unterminated(n,o,u):++e}return{pos:e,str:l,firstInvalidLoc:c,lineStart:s,curLine:r,containsInvalid:!!c}}function yl(i,t,e,s){return i==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(i==="double"?34:39)}function xl(i,t,e,s,r,a){let n=!r;t++;let o=l=>({pos:t,ch:l,lineStart:e,curLine:s}),u=i.charCodeAt(t++);switch(u){case 110:return o(`
|
|
13
|
-
`);case 114:return o("\r");case 120:{let l;return{code:l,pos:t}=Fs(i,t,e,s,2,!1,n,a),o(l===null?null:String.fromCharCode(l))}case 117:{let l;return{code:l,pos:t}=La(i,t,e,s,n,a),o(l===null?null:String.fromCodePoint(l))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:i.charCodeAt(t)===10&&++t;case 10:e=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(r)return o(null);a.strictNumericEscape(t-1,e,s);default:if(u>=48&&u<=55){let l=t-1,p=i.slice(l,t+2).match(/^[0-7]+/)[0],f=parseInt(p,8);f>255&&(p=p.slice(0,-1),f=parseInt(p,8)),t+=p.length-1;let d=i.charCodeAt(t);if(p!=="0"||d===56||d===57){if(r)return o(null);a.strictNumericEscape(l,e,s)}return o(String.fromCharCode(f))}return o(String.fromCharCode(u))}}function Fs(i,t,e,s,r,a,n,o){let u=t,l;return{n:l,pos:t}=Oa(i,t,e,s,16,r,a,!1,o,!n),l===null&&(n?o.invalidEscapeSequence(u,e,s):t=u-1),{code:l,pos:t}}function Oa(i,t,e,s,r,a,n,o,u,l){let c=t,p=r===16?da.hex:da.decBinOct,f=r===16?Ut.hex:r===10?Ut.dec:r===8?Ut.oct:Ut.bin,d=!1,m=0;for(let y=0,v=a??1/0;y<v;++y){let A=i.charCodeAt(t),_;if(A===95&&o!=="bail"){let $=i.charCodeAt(t-1),B=i.charCodeAt(t+1);if(o){if(Number.isNaN(B)||!f(B)||p.has($)||p.has(B)){if(l)return{n:null,pos:t};u.unexpectedNumericSeparator(t,e,s)}}else{if(l)return{n:null,pos:t};u.numericSeparatorInEscapeSequence(t,e,s)}++t;continue}if(A>=97?_=A-97+10:A>=65?_=A-65+10:ml(A)?_=A-48:_=1/0,_>=r){if(_<=9&&l)return{n:null,pos:t};if(_<=9&&u.invalidDigit(t,e,s,r))_=0;else if(n)_=0,d=!0;else break}++t,m=m*r+_}return t===c||a!=null&&t-c!==a||d?{n:null,pos:t}:{n:m,pos:t}}function La(i,t,e,s,r,a){let n=i.charCodeAt(t),o;if(n===123){if(++t,{code:o,pos:t}=Fs(i,t,e,s,i.indexOf("}",t)-t,!0,r,a),++t,o!==null&&o>1114111)if(r)a.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=Fs(i,t,e,s,4,!1,r,a));return{code:o,pos:t}}var gl=["at"],bl=["at"];function rt(i,t,e){return new Z(e,i-t,i)}var Pl=new Set([103,109,115,105,121,117,100,118]),Q=class{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new Ue(t.startLoc,t.endLoc)}},Rs=class extends Ds{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,r,a,n)=>this.options.errorRecovery?(this.raise(h.InvalidDigit,{at:rt(s,r,a),radix:n}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(h.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(h.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(h.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(h.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,r,a)=>{this.recordStrictModeErrors(h.StrictNumericEscape,{at:rt(s,r,a)})},unterminated:(s,r,a)=>{throw this.raise(h.UnterminatedString,{at:rt(s-1,r,a)})}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(h.StrictNumericEscape),unterminated:(s,r,a)=>{throw this.raise(h.UnterminatedTemplate,{at:rt(s,r,a)})}}),this.state=new Bs,this.state.init(t),this.input=e,this.length=e.length,this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new Q(this.state)),this.state.lastTokStart=this.state.start,this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return Ss.lastIndex=t,Ss.test(this.input)?Ss.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return $t.lastIndex=t,$t.test(this.input)?$t.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++t<this.input.length){let s=this.input.charCodeAt(t);(s&64512)===56320&&(e=65536+((e&1023)<<10)+(s&1023))}return e}setStrict(t){this.state.strict=t,t&&(this.state.strictErrors.forEach(([e,s])=>this.raise(e,{at:s})),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(137);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,r=this.input.indexOf(t,s+2);if(r===-1)throw this.raise(h.UnterminatedComment,{at:this.state.curPosition()});for(this.state.pos=r+t.length,Rt.lastIndex=s+2;Rt.test(this.input)&&Rt.lastIndex<=r;)++this.state.curLine,this.state.lineStart=Rt.lastIndex;if(this.isLookahead)return;let a={type:"CommentBlock",value:this.input.slice(s+2,r),start:s,end:r+t.length,loc:new Ue(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(a),a}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=t);if(this.state.pos<this.length)for(;!nt(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let a=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+t,a),start:e,end:a,loc:new Ue(s,this.state.curPosition())};return this.options.tokens&&this.pushToken(o),o}skipSpace(){let t=this.state.pos,e=[];e:for(;this.state.pos<this.length;){let s=this.input.charCodeAt(this.state.pos);switch(s){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let r=this.skipBlockComment("*/");r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}case 47:{let r=this.skipLineComment(2);r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}default:break e}break;default:if(dl(s))++this.state.pos;else if(s===45&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===45&&this.input.charCodeAt(r+2)===62&&(t===0||this.state.lineStart>t)){let a=this.skipLineComment(3);a!==void 0&&(this.addComment(a),this.options.attachComment&&e.push(a))}else break e}else if(s===60&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){let a=this.skipLineComment(4);a!==void 0&&(this.addComment(a),this.options.attachComment&&e.push(a))}else break e}else break e}}if(e.length>0){let s=this.state.pos,r={start:t,end:s,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(h.UnexpectedDigitAfterHash,{at:this.state.curPosition()});if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?h.RecordExpressionHashIncorrectStartSyntaxType:h.TupleExpressionHashIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else ie(e)?(++this.state.pos,this.finishToken(136,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(136,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!nt(t)&&++this.state.pos<this.length;)t=this.input.charCodeAt(this.state.pos);let s=this.input.slice(e+2,this.state.pos);return this.finishToken(28,s),!0}readToken_mult_modulo(t){let e=t===42?55:54,s=1,r=this.input.charCodeAt(this.state.pos+1);t===42&&r===42&&(s++,r=this.input.charCodeAt(this.state.pos+2),e=57),r===61&&!this.state.inType&&(s++,e=t===37?33:30),this.finishOp(e,s)}readToken_pipe_amp(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(t===124?41:42,2);return}if(t===124){if(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(h.RecordExpressionBarIncorrectEndSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(h.TupleExpressionBarIncorrectEndSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(4);return}}if(e===61){this.finishOp(30,2);return}this.finishOp(t===124?43:45,1)}readToken_caret(){let t=this.input.charCodeAt(this.state.pos+1);t===61&&!this.state.inType?this.finishOp(32,2):t===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:t}=this.state,e=this.input.charCodeAt(t+1);if(e===60){if(this.input.charCodeAt(t+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(e===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:t}=this.state,e=this.input.charCodeAt(t+1);if(e===62){let s=this.input.charCodeAt(t+2)===62?3:2;if(this.input.charCodeAt(t+s)===61){this.finishOp(30,s+1);return}this.finishOp(52,s);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(t===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(t===61?29:35,1)}readToken_question(){let t=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);t===63?e===61?this.finishOp(30,3):this.finishOp(40,2):t===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(h.TupleExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(h.RecordExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(ie(t)){this.readWord(t);return}}throw this.raise(h.InvalidOrUnexpectedToken,{at:this.state.curPosition(),unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,r,{pos:a}=this.state;for(;;++a){if(a>=this.length)throw this.raise(h.UnterminatedRegExp,{at:z(t,1)});let l=this.input.charCodeAt(a);if(nt(l))throw this.raise(h.UnterminatedRegExp,{at:z(t,1)});if(s)s=!1;else{if(l===91)r=!0;else if(l===93&&r)r=!1;else if(l===47&&!r)break;s=l===92}}let n=this.input.slice(e,a);++a;let o="",u=()=>z(t,a+2-e);for(;a<this.length;){let l=this.codePointAtPos(a),c=String.fromCharCode(l);if(Pl.has(l))l===118?o.includes("u")&&this.raise(h.IncompatibleRegExpUVFlags,{at:u()}):l===117&&o.includes("v")&&this.raise(h.IncompatibleRegExpUVFlags,{at:u()}),o.includes(c)&&this.raise(h.DuplicateRegExpFlags,{at:u()});else if(Be(l)||l===92)this.raise(h.MalformedRegExpFlags,{at:u()});else break;++a,o+=c}this.state.pos=a,this.finishToken(135,{pattern:n,flags:o})}readInt(t,e,s=!1,r=!0){let{n:a,pos:n}=Oa(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,e,s,r,this.errorHandlers_readInt,!1);return this.state.pos=n,a}readRadixNumber(t){let e=this.state.curPosition(),s=!1;this.state.pos+=2;let r=this.readInt(t);r==null&&this.raise(h.InvalidDigit,{at:z(e,2),radix:t});let a=this.input.charCodeAt(this.state.pos);if(a===110)++this.state.pos,s=!0;else if(a===109)throw this.raise(h.InvalidDecimal,{at:e});if(ie(this.codePointAtPos(this.state.pos)))throw this.raise(h.NumberIdentifier,{at:this.state.curPosition()});if(s){let n=this.input.slice(e.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(133,n);return}this.finishToken(132,r)}readNumber(t){let e=this.state.pos,s=this.state.curPosition(),r=!1,a=!1,n=!1,o=!1,u=!1;!t&&this.readInt(10)===null&&this.raise(h.InvalidNumber,{at:this.state.curPosition()});let l=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(l){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(h.StrictOctalLiteral,{at:s}),!this.state.strict){let m=d.indexOf("_");m>0&&this.raise(h.ZeroDigitNumericSeparator,{at:z(s,m)})}u=l&&!/[89]/.test(d)}let c=this.input.charCodeAt(this.state.pos);if(c===46&&!u&&(++this.state.pos,this.readInt(10),r=!0,c=this.input.charCodeAt(this.state.pos)),(c===69||c===101)&&!u&&(c=this.input.charCodeAt(++this.state.pos),(c===43||c===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(h.InvalidOrMissingExponent,{at:s}),r=!0,o=!0,c=this.input.charCodeAt(this.state.pos)),c===110&&((r||l)&&this.raise(h.InvalidBigIntLiteral,{at:s}),++this.state.pos,a=!0),c===109&&(this.expectPlugin("decimal",this.state.curPosition()),(o||l)&&this.raise(h.InvalidDecimal,{at:s}),++this.state.pos,n=!0),ie(this.codePointAtPos(this.state.pos)))throw this.raise(h.NumberIdentifier,{at:this.state.curPosition()});let p=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(a){this.finishToken(133,p);return}if(n){this.finishToken(134,p);return}let f=u?parseInt(p,8):parseFloat(p);this.finishToken(132,f)}readCodePoint(t){let{code:e,pos:s}=La(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:r,lineStart:a}=ma(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=a,this.state.curLine=r,this.finishToken(131,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:r,curLine:a,lineStart:n}=ma("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=n,this.state.curLine=a,s&&(this.state.firstInvalidTemplateEscapePos=new Z(s.curLine,s.pos-s.lineStart,s.pos)),this.input.codePointAt(r)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,{at:e}){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,{at:e}):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,r=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos<this.length;){let a=this.codePointAtPos(this.state.pos);if(Be(a))this.state.pos+=a<=65535?1:2;else if(a===92){this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);let n=this.state.curPosition(),o=this.state.pos===s?ie:Be;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(h.MissingUnicodeEscape,{at:this.state.curPosition()}),r=this.state.pos-1;continue}++this.state.pos;let u=this.readCodePoint(!0);u!==null&&(o(u)||this.raise(h.EscapedCharNotAnIdentifier,{at:n}),e+=String.fromCodePoint(u)),r=this.state.pos}else break}return e+this.input.slice(r,this.state.pos)}readWord(t){let e=this.readWord1(t),s=Js.get(e);s!==void 0?this.finishToken(s,pe(s)):this.finishToken(130,e)}checkKeywordEscapes(){let{type:t}=this.state;sr(t)&&this.state.containsEsc&&this.raise(h.InvalidEscapedReservedWord,{at:this.state.startLoc,reservedWord:pe(t)})}raise(t,e){let{at:s}=e,r=Wt(e,gl),a=s instanceof Z?s:s.loc.start,n=t({loc:a,details:r});if(!this.options.errorRecovery)throw n;return this.isLookahead||this.state.errors.push(n),n}raiseOverwrite(t,e){let{at:s}=e,r=Wt(e,bl),a=s instanceof Z?s:s.loc.start,n=a.index,o=this.state.errors;for(let u=o.length-1;u>=0;u--){let l=o[u];if(l.loc.index===n)return o[u]=t({loc:a,details:r});if(l.loc.index<n)break}return this.raise(t,e)}updateContext(t){}unexpected(t,e){throw this.raise(h.UnexpectedToken,{expected:e?pe(e):null,at:t??this.state.startLoc})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(h.MissingPlugin,{at:e??this.state.startLoc,missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(h.MissingOneOfPlugins,{at:this.state.startLoc,missingPlugin:t})}errorBuilder(t){return(e,s,r)=>{this.raise(t,{at:rt(e,s,r)})}}},Us=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},js=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Us)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,r]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,r):this.parser.raise(h.InvalidPrivateFieldResolution,{at:r,identifierName:s})}declarePrivateName(t,e,s){let{privateNames:r,loneAccessors:a,undefinedPrivateNames:n}=this.current(),o=r.has(t);if(e&3){let u=o&&a.get(t);if(u){let l=u&4,c=e&4,p=u&3,f=e&3;o=p===f||l!==c,o||a.delete(t)}else o||a.set(t,e)}o&&this.parser.raise(h.PrivateNameRedeclaration,{at:s,identifierName:t}),r.add(t),n.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(h.InvalidPrivateFieldResolution,{at:e,identifierName:t})}},je=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Ht=class extends je{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,{at:e}){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},$s=class{constructor(t){this.parser=void 0,this.stack=[new je],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,{at:e}){let s={at:e.loc.start},{stack:r}=this,a=r.length-1,n=r[a];for(;!n.isCertainlyParameterDeclaration();){if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(t,s);else return;n=r[--a]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,{at:e}){let{stack:s}=this,r=s[s.length-1],a={at:e.loc.start};if(r.isCertainlyParameterDeclaration())this.parser.raise(t,a);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(t,a);else return}recordAsyncArrowParametersError({at:t}){let{stack:e}=this,s=e.length-1,r=e[s];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(h.AwaitBindingIdentifier,{at:t}),r=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,r])=>{this.parser.raise(s,{at:r});let a=t.length-2,n=t[a];for(;n.canBeArrowParameterDeclaration();)n.clearDeclarationError(r.index),n=t[--a]})}};function vl(){return new je(3)}function Tl(){return new Ht(1)}function wl(){return new Ht(2)}function Da(){return new je}var Fe=0,Ba=1,Gt=2,Fa=4,Le=8,qs=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&Gt)>0}get hasYield(){return(this.currentFlags()&Ba)>0}get hasReturn(){return(this.currentFlags()&Fa)>0}get hasIn(){return(this.currentFlags()&Le)>0}};function qt(i,t){return(i?Gt:0)|(t?Ba:0)}var Ws=class extends Rs{addExtra(t,e,s,r=!0){if(!t)return;let a=t.extra=t.extra||{};r?a[e]=s:Object.defineProperty(a,e,{enumerable:r,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){let s=t+e.length;if(this.input.slice(t,s)===e){let r=this.input.charCodeAt(s);return!(Be(r)||(r&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,{at:this.state.startLoc});this.unexpected(null,t)}}canInsertSemicolon(){return this.match(137)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Ma.test(this.input.slice(this.state.lastTokEndLoc.index,this.state.start))}hasFollowingLineBreak(){return fa.lastIndex=this.state.end,fa.test(this.input)}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(h.MissingSemicolon,{at:this.state.lastTokEndLoc})}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let r=t((a=null)=>{throw s.node=a,s});if(this.state.errors.length>e.errors.length){let a=this.state;return this.state=e,this.state.tokensLength=a.tokensLength,{node:r,error:a.errors[e.errors.length],thrown:!1,aborted:!1,failState:a}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){let a=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:a};if(r===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:a};throw r}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:r,privateKeyLoc:a,optionalParametersLoc:n}=t,o=!!s||!!r||!!n||!!a;if(!e)return o;s!=null&&this.raise(h.InvalidCoverInitializedName,{at:s}),r!=null&&this.raise(h.DuplicateProto,{at:r}),a!=null&&this.raise(h.UnexpectedPrivateField,{at:a}),n!=null&&this.unexpected(n)}isLiteralPropertyName(){return Aa(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=t;let a=this.scope,n=this.getScopeHandler();this.scope=new n(this,t);let o=this.prodParam;this.prodParam=new qs;let u=this.classScope;this.classScope=new js(this);let l=this.expressionScope;return this.expressionScope=new $s(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=r,this.scope=a,this.prodParam=o,this.classScope=u,this.expressionScope=l}}enterInitialScopes(){let t=Fe;this.inModule&&(t|=Gt),this.scope.enter(1),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},Re=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},$e=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new Ue(s),t!=null&&t.options.ranges&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},ar=$e.prototype;ar.__clone=function(){let i=new $e(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;e<s;e++){let r=t[e];r!=="leadingComments"&&r!=="trailingComments"&&r!=="innerComments"&&(i[r]=this[r])}return i};function Al(i){return ne(i)}function ne(i){let{type:t,start:e,end:s,loc:r,range:a,extra:n,name:o}=i,u=Object.create(ar);return u.type=t,u.start=e,u.end=s,u.loc=r,u.range=a,u.extra=n,u.name=o,t==="Placeholder"&&(u.expectedNode=i.expectedNode),u}function Sl(i){let{type:t,start:e,end:s,loc:r,range:a,extra:n}=i;if(t==="Placeholder")return Al(i);let o=Object.create(ar);return o.type=t,o.start=e,o.end=s,o.loc=r,o.range=a,i.raw!==void 0?o.raw=i.raw:o.extra=n,o.value=i.value,o}var Vs=class extends Ws{startNode(){return new $e(this,this.state.start,this.state.startLoc)}startNodeAt(t){return new $e(this,t.index,t)}startNodeAtNode(t){return this.startNodeAt(t.loc.start)}finishNode(t,e){return this.finishNodeAt(t,e,this.state.lastTokEndLoc)}finishNodeAt(t,e,s){return t.type=e,t.end=s.index,t.loc.end=s,this.options.ranges&&(t.range[1]=s.index),this.options.attachComment&&this.processComment(t),t}resetStartLocation(t,e){t.start=e.index,t.loc.start=e,this.options.ranges&&(t.range[0]=e.index)}resetEndLocation(t,e=this.state.lastTokEndLoc){t.end=e.index,t.loc.end=e,this.options.ranges&&(t.range[1]=e.index)}resetStartLocationFromNode(t,e){this.resetStartLocation(t,e.loc.start)}},Cl=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),w=ae`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:i})=>`Cannot overwrite reserved type ${i}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:i,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${i} = true,\` or \`${i} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:i,enumName:t})=>`Enum member names need to be unique, but the name \`${i}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:i})=>`Enum \`${i}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:i,enumName:t})=>`Enum type \`${i}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:i})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${i}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:i,memberName:t,explicitType:e})=>`Enum \`${i}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:i,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${i}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:i,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${i}\`.`,EnumInvalidMemberName:({enumName:i,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${i}\`.`,EnumNumberMemberNotInitialized:({enumName:i,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${i}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:i})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${i}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:i})=>`Unexpected reserved type ${i}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:i,suggestion:t})=>`\`declare export ${i}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function El(i){return i.type==="DeclareExportAllDeclaration"||i.type==="DeclareExportDeclaration"&&(!i.declaration||i.declaration.type!=="TypeAlias"&&i.declaration.type!=="InterfaceDeclaration")}function ya(i){return i.importKind==="type"||i.importKind==="typeof"}var Il={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function kl(i,t){let e=[],s=[];for(let r=0;r<i.length;r++)(t(i[r],r,i)?e:s).push(i[r]);return[e,s]}var Nl=/\*?\s*@((?:no)?flow)\b/,_l=i=>class extends i{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return Os}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}shouldParseEnums(){return!!this.getPluginOption("flow","enums")}finishToken(e,s){e!==131&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=Nl.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let r=this.flowParseType();return this.state.inType=s,r}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(108),this.state.lastTokStart>s.index+1&&this.raise(w.UnexpectedSpaceBetweenModuloChecks,{at:s}),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[s,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),r=this.startNode(),a=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);let n=this.flowParseFunctionTypeParams();return r.params=n.params,r.rest=n.rest,r.this=n._this,this.expect(11),[r.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),a.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(a,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(125))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(w.NestedDeclareModule,{at:this.state.lastTokStartLoc}),this.flowParseDeclareModule(e));if(this.isContextual(128))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(129))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(127))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(131)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),r=s.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(128)&&!this.match(87)&&this.raise(w.InvalidNonTypeImportInDeclareModule,{at:this.state.lastTokStartLoc}),super.parseImport(o)):(this.expectContextual(123,w.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),r.push(o)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let a=null,n=!1;return r.forEach(o=>{El(o)?(a==="CommonJS"&&this.raise(w.AmbiguousDeclareModuleKind,{at:o}),a="ES"):o.type==="DeclareModuleExports"&&(n&&this.raise(w.DuplicateDeclareModuleExports,{at:o}),a==="ES"&&this.raise(w.AmbiguousDeclareModuleKind,{at:o}),a="CommonJS",n=!0)}),e.kind=a||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(128)||this.isContextual(127))&&!s){let r=this.state.value;throw this.raise(w.UnsupportedDeclareExportKind,{at:this.state.startLoc,unsupportedExportKind:r,suggestion:Il[r]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(129))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(127)||this.isContextual(128)||this.isContextual(129))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(109),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return s.type="DeclareTypeAlias",s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return s.type="DeclareOpaqueType",s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(115))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(111))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(w.UnexpectedReservedUnderscore,{at:this.state.startLoc})}checkReservedType(e,s,r){Cl.has(e)&&this.raise(r?w.AssignReservedType:w.UnexpectedReservedType,{at:s,reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(128),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let s=this.state.startLoc,r=this.startNode(),a=this.flowParseVariance(),n=this.flowParseTypeAnnotatableIdentifier();return r.name=n.name,r.variance=a,r.bound=n.typeAnnotation,this.match(29)?(this.eat(29),r.default=this.flowParseType()):e&&this.raise(w.MissingTypeParamDefault,{at:s}),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(140)?this.next():this.unexpected();let r=!1;do{let a=this.flowParseTypeParameter(r);s.params.push(a),a.default&&(r=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);let r=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);return this.state.noAnonFunctionType=r,this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(127),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(132)||this.match(131)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,r){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let r=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:r,allowProto:a,allowInexact:n}){let o=this.state.inType;this.state.inType=!0;let u=this.startNode();u.callProperties=[],u.properties=[],u.indexers=[],u.internalSlots=[];let l,c,p=!1;for(s&&this.match(6)?(this.expect(6),l=9,c=!0):(this.expect(5),l=8,c=!1),u.exact=c;!this.match(l);){let d=!1,m=null,y=null,v=this.startNode();if(a&&this.isContextual(116)){let _=this.lookahead();_.type!==14&&_.type!==17&&(this.next(),m=this.state.startLoc,e=!1)}if(e&&this.isContextual(104)){let _=this.lookahead();_.type!==14&&_.type!==17&&(this.next(),d=!0)}let A=this.flowParseVariance();if(this.eat(0))m!=null&&this.unexpected(m),this.eat(0)?(A&&this.unexpected(A.loc.start),u.internalSlots.push(this.flowParseObjectTypeInternalSlot(v,d))):u.indexers.push(this.flowParseObjectTypeIndexer(v,d,A));else if(this.match(10)||this.match(47))m!=null&&this.unexpected(m),A&&this.unexpected(A.loc.start),u.callProperties.push(this.flowParseObjectTypeCallProperty(v,d));else{let _="init";if(this.isContextual(98)||this.isContextual(103)){let B=this.lookahead();Aa(B.type)&&(_=this.state.value,this.next())}let $=this.flowParseObjectTypeProperty(v,d,m,A,_,r,n??!c);$===null?(p=!0,y=this.state.lastTokStartLoc):u.properties.push($)}this.flowObjectTypeSemicolon(),y&&!this.match(8)&&!this.match(9)&&this.raise(w.UnexpectedExplicitInexactInObject,{at:y})}this.expect(l),r&&(u.inexact=p);let f=this.finishNode(u,"ObjectTypeAnnotation");return this.state.inType=o,f}flowParseObjectTypeProperty(e,s,r,a,n,o,u){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?u||this.raise(w.InexactInsideExact,{at:this.state.lastTokStartLoc}):this.raise(w.InexactInsideNonObject,{at:this.state.lastTokStartLoc}),a&&this.raise(w.InexactVariance,{at:a}),null):(o||this.raise(w.UnexpectedSpreadType,{at:this.state.lastTokStartLoc}),r!=null&&this.unexpected(r),a&&this.raise(w.SpreadVariance,{at:a}),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=r!=null,e.kind=n;let l=!1;return this.match(47)||this.match(10)?(e.method=!0,r!=null&&this.unexpected(r),a&&this.unexpected(a.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(n==="get"||n==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(w.ThisParamBannedInConstructor,{at:e.value.this})):(n!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(l=!0),e.value=this.flowParseTypeInitialiser(),e.variance=a),e.optional=l,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?w.GetterMayNotHaveThisParam:w.SetterMayNotHaveThisParam,{at:e.value.this}),r!==s&&this.raise(e.kind==="get"?h.BadGetterArity:h.BadSetterArity,{at:e}),e.kind==="set"&&e.value.rest&&this.raise(h.BadSetterRestParameter,{at:e})}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){var r;(r=e)!=null||(e=this.state.startLoc);let a=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let n=this.startNodeAt(e);n.qualification=a,n.id=this.flowParseRestrictedIdentifier(!0),a=this.finishNode(n,"QualifiedTypeIdentifier")}return a}flowParseGenericType(e,s){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let s=null,r=!1,a=null,n=this.startNode(),o=this.lookahead(),u=this.state.type===78;return o.type===14||o.type===17?(u&&!e&&this.raise(w.ThisParamMustBeFirst,{at:n}),s=this.parseIdentifier(u),this.eat(17)&&(r=!0,u&&this.raise(w.ThisParamMayNotBeOptional,{at:n})),a=this.flowParseTypeInitialiser()):a=this.flowParseType(),n.name=s,n.optional=r,n.typeAnnotation=a,this.finishNode(n,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let s=this.startNodeAt(e.loc.start);return s.name=null,s.optional=!1,s.typeAnnotation=e,this.finishNode(s,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let s=null,r=null;for(this.match(78)&&(r=this.flowParseFunctionTypeParam(!0),r.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(s=this.flowParseFunctionTypeParam(!1)),{params:e,rest:s,_this:r}}flowIdentToTypeAnnotation(e,s,r){switch(r.name){case"any":return this.finishNode(s,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(s,"BooleanTypeAnnotation");case"mixed":return this.finishNode(s,"MixedTypeAnnotation");case"empty":return this.finishNode(s,"EmptyTypeAnnotation");case"number":return this.finishNode(s,"NumberTypeAnnotation");case"string":return this.finishNode(s,"StringTypeAnnotation");case"symbol":return this.finishNode(s,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(r.name),this.flowParseGenericType(e,r)}}flowParsePrimaryType(){let e=this.state.startLoc,s=this.startNode(),r,a,n=!1,o=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,a=this.flowParseTupleType(),this.state.noAnonFunctionType=o,a;case 47:return s.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),r=this.flowParseFunctionTypeParams(),s.params=r.params,s.rest=r.rest,s.this=r._this,this.expect(11),this.expect(19),s.returnType=this.flowParseType(),this.finishNode(s,"FunctionTypeAnnotation");case 10:if(this.next(),!this.match(11)&&!this.match(21))if(k(this.state.type)||this.match(78)){let u=this.lookahead().type;n=u!==17&&u!==14}else n=!0;if(n){if(this.state.noAnonFunctionType=!1,a=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),a;this.eat(12)}return a?r=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(a)]):r=this.flowParseFunctionTypeParams(),s.params=r.params,s.rest=r.rest,s.this=r._this,this.expect(11),this.expect(19),s.returnType=this.flowParseType(),s.typeParameters=null,this.finishNode(s,"FunctionTypeAnnotation");case 131:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return s.value=this.match(85),this.next(),this.finishNode(s,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(132))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",s);if(this.match(133))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",s);throw this.raise(w.UnexpectedSubtractionOperand,{at:this.state.startLoc})}this.unexpected();return;case 132:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 133:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(s,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(s,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(s,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(s,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(sr(this.state.type)){let u=pe(this.state.type);return this.next(),super.createIdentifier(s,u)}else if(k(this.state.type))return this.isContextual(127)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,s,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,s=this.flowParsePrimaryType(),r=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let a=this.startNodeAt(e),n=this.eat(18);r=r||n,this.expect(0),!n&&this.match(3)?(a.elementType=s,this.next(),s=this.finishNode(a,"ArrayTypeAnnotation")):(a.objectType=s,a.indexType=this.flowParseType(),this.expect(3),r?(a.optional=n,s=this.finishNode(a,"OptionalIndexedAccessType")):s=this.finishNode(a,"IndexedAccessType"))}return s}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let s=this.startNodeAt(e.loc.start);return s.params=[this.reinterpretTypeAsFunctionTypeParam(e)],s.rest=null,s.this=null,s.returnType=this.flowParseType(),s.typeParameters=null,this.finishNode(s,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let s=this.flowParseAnonFunctionWithoutParens();for(e.types=[s];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?s:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let s=this.flowParseIntersectionType();for(e.types=[s];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?s:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let s=this.flowParseUnionType();return this.state.inType=e,s}flowParseTypeOrImplicitInstantiation(){if(this.state.type===130&&this.state.value==="_"){let e=this.state.startLoc,s=this.parseIdentifier();return this.flowParseGenericType(e,s)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let s=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(s.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(s)),s}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,s,r=!1){if(s){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,s,r=!1){if(this.match(14)){let a=this.startNode();[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=a.typeAnnotation?this.finishNode(a,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(127)){let r=this.lookahead();if(X(r.type)){let a=this.startNode();return this.next(),this.flowParseInterface(a)}}else if(this.shouldParseEnums()&&this.isContextual(124)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,r){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||k(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(k(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return pa(e)||this.shouldParseEnums()&&e===124?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return pa(e)||this.shouldParseEnums()&&e===124?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.shouldParseEnums()&&this.isContextual(124)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(r),e}this.expect(17);let a=this.state.clone(),n=this.state.noArrowAt,o=this.startNodeAt(s),{consequent:u,failed:l}=this.tryParseConditionalConsequent(),[c,p]=this.getArrowLikeExpressions(u);if(l||p.length>0){let f=[...n];if(p.length>0){this.state=a,this.state.noArrowAt=f;for(let d=0;d<p.length;d++)f.push(p[d].start);({consequent:u,failed:l}=this.tryParseConditionalConsequent()),[c,p]=this.getArrowLikeExpressions(u)}l&&c.length>1&&this.raise(w.AmbiguousConditionalArrow,{at:a.startLoc}),l&&c.length===1&&(this.state=a,f.push(c[0].start),this.state.noArrowAt=f,{consequent:u,failed:l}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(u,!0),this.state.noArrowAt=n,this.expect(14),o.test=e,o.consequent=u,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let r=[e],a=[];for(;r.length!==0;){let n=r.pop();n.type==="ArrowFunctionExpression"?(n.typeParameters||!n.returnType?this.finishArrowValidation(n):a.push(n),r.push(n.body)):n.type==="ConditionalExpression"&&(r.push(n.consequent),r.push(n.alternate))}return s?(a.forEach(n=>this.finishArrowValidation(n)),[a,[]]):kl(a,n=>n.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let r;return this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1?(this.state.noArrowParamsConversionAt.push(this.state.start),r=s(),this.state.noArrowParamsConversionAt.pop()):r=s(),r}parseParenItem(e,s){if(e=super.parseParenItem(e,s),this.eat(17)&&(e.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=e,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return e}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(128)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(127)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.shouldParseEnums()&&this.isContextual(124)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(128)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(s),r}parseClassId(e,s,r){super.parseClassId(e,s,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,r){let{startLoc:a}=this.state;if(this.isContextual(123)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,r),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(w.DeclareClassElement,{at:a}):s.value&&this.raise(w.DeclareClassFieldInitializer,{at:s.value}))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(h.InvalidIdentifier,{at:this.state.curPosition(),identifierName:s}),this.finishToken(130,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):cl(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,r){for(let a=0;a<e.length;a++){let n=e[a];(n==null?void 0:n.type)==="TypeCastExpression"&&(e[a]=this.typeCastToParameter(n))}super.toAssignableList(e,s,r)}toReferencedList(e,s){for(let a=0;a<e.length;a++){var r;let n=e[a];n&&n.type==="TypeCastExpression"&&!((r=n.extra)!=null&&r.parenthesized)&&(e.length>1||!s)&&this.raise(w.TypeCastInPattern,{at:n.typeAnnotation})}return e}parseArrayLike(e,s,r,a){let n=super.parseArrayLike(e,s,r,a);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(n.elements),n}isValidLVal(e,s,r){return e==="TypeCastExpression"||super.isValidLVal(e,s,r)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,r,a,n,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,r,a,n,o),s.params&&n){let u=s.params;u.length>0&&this.isThisParam(u[0])&&this.raise(w.ThisParamBannedInConstructor,{at:s})}else if(s.type==="MethodDefinition"&&n&&s.value.params){let u=s.value.params;u.length>0&&this.isThisParam(u[0])&&this.raise(w.ThisParamBannedInConstructor,{at:s})}}pushClassPrivateMethod(e,s,r,a){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,r,a)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(111)){this.next();let s=e.implements=[];do{let r=this.startNode();r.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,s.push(this.finishNode(r,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let r=s[0];this.isThisParam(r)&&e.kind==="get"?this.raise(w.GetterMayNotHaveThisParam,{at:r}):this.isThisParam(r)&&this.raise(w.SetterMayNotHaveThisParam,{at:r})}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,r,a,n,o,u){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let l;this.match(47)&&!o&&(l=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let c=super.parseObjPropValue(e,s,r,a,n,o,u);return l&&((c.value||c).typeParameters=l),c}parseAssignableListItemTypes(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(w.PatternIsOptional,{at:e}),this.isThisParam(e)&&this.raise(w.ThisParamMayNotBeOptional,{at:e}),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(w.ThisParamAnnotationRequired,{at:e}),this.match(29)&&this.isThisParam(e)&&this.raise(w.ThisParamNoDefault,{at:e}),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(w.TypeBeforeInitializer,{at:r.typeAnnotation}),r}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(w.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}parseImportSpecifierLocal(e,s,r){s.local=ya(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(s,r))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(128)){if(!e)return!0;let s=this.lookaheadCharCode();return s===123||s===42}return!e&&this.isContextual(87)}applyImportPhase(e,s,r,a){if(super.applyImportPhase(e,s,r,a),s){if(!r&&this.match(65))return;e.exportKind=r==="type"?r:"value"}else r==="type"&&this.match(55)&&this.unexpected(),e.importKind=r==="type"||r==="typeof"?r:"value"}parseImportSpecifier(e,s,r,a,n){let o=e.imported,u=null;o.type==="Identifier"&&(o.name==="type"?u="type":o.name==="typeof"&&(u="typeof"));let l=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let p=this.parseIdentifier(!0);u!==null&&!X(this.state.type)?(e.imported=p,e.importKind=u,e.local=ne(p)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(u!==null&&X(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=u;else{if(s)throw this.raise(h.ImportBindingIsString,{at:e,importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(l=!0,e.local=ne(e.imported))}let c=ya(e);return r&&c&&this.raise(w.ImportTypeShorthandOnlyInPureImport,{at:e}),(r||c)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),l&&!r&&!c&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,s){let r=e.kind;r!=="get"&&r!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){if(this.match(14)){let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=r}return super.parseAsyncArrowFromCallExpression(e,s)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,s){var r;let a=null,n;if(this.hasPlugin("jsx")&&(this.match(140)||this.match(47))){if(a=this.state.clone(),n=this.tryParse(()=>super.parseMaybeAssign(e,s),a),!n.error)return n.node;let{context:l}=this.state,c=l[l.length-1];(c===N.j_oTag||c===N.j_expr)&&l.pop()}if((r=n)!=null&&r.error||this.match(47)){var o,u;a=a||this.state.clone();let l,c=this.tryParse(f=>{var d;l=this.flowParseTypeParameterDeclaration();let m=this.forwardNoArrowParamsConversionAt(l,()=>{let v=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(v,l),v});(d=m.extra)!=null&&d.parenthesized&&f();let y=this.maybeUnwrapTypeCastExpression(m);return y.type!=="ArrowFunctionExpression"&&f(),y.typeParameters=l,this.resetStartLocationFromNode(y,l),m},a),p=null;if(c.node&&this.maybeUnwrapTypeCastExpression(c.node).type==="ArrowFunctionExpression"){if(!c.error&&!c.aborted)return c.node.async&&this.raise(w.UnexpectedTypeParameterBeforeAsyncArrowFunction,{at:l}),c.node;p=c.node}if((o=n)!=null&&o.node)return this.state=n.failState,n.node;if(p)return this.state=c.failState,p;throw(u=n)!=null&&u.thrown?n.error:c.thrown?c.error:this.raise(w.UnexpectedTokenAfterTypeParameter,{at:l})}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let a=this.startNode();return[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=r,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),a});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,r,a=!0){if(!(r&&this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1)){for(let n=0;n<e.params.length;n++)this.isThisParam(e.params[n])&&n>0&&this.raise(w.ThisParamMustBeFirst,{at:e.params[n]});super.checkParams(e,s,r,a)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&this.state.noArrowAt.indexOf(this.state.start)===-1)}parseSubscripts(e,s,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.indexOf(s.index)!==-1){this.next();let a=this.startNodeAt(s);a.callee=e,a.arguments=super.parseCallExpressionArguments(11,!1),e=this.finishNode(a,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let a=this.state.clone(),n=this.tryParse(u=>this.parseAsyncArrowWithTypeParameters(s)||u(),a);if(!n.error&&!n.aborted)return n.node;let o=this.tryParse(()=>super.parseSubscripts(e,s,r),a);if(o.node&&!o.error)return o.node;if(n.node)return this.state=n.failState,n.node;if(o.node)return this.state=o.failState,o.node;throw n.error||o.error}return super.parseSubscripts(e,s,r)}parseSubscript(e,s,r,a){if(this.match(18)&&this.isLookaheadToken_lt()){if(a.optionalChainMember=!0,r)return a.stop=!0,e;this.next();let n=this.startNodeAt(s);return n.callee=e,n.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),n.arguments=this.parseCallExpressionArguments(11,!1),n.optional=!0,this.finishCallExpression(n,!0)}else if(!r&&this.shouldParseTypes()&&this.match(47)){let n=this.startNodeAt(s);n.callee=e;let o=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),n.arguments=super.parseCallExpressionArguments(11,!1),a.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,a.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,s,r,a)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let r=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(w.UnterminatedFlowComment,{at:this.state.curPosition()}),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(w.NestedFlowComment,{at:this.state.startLoc});this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let r=this.input.charCodeAt(s+e),a=this.input.charCodeAt(s+e+1);return r===58&&a===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:r===58&&a!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(h.UnterminatedComment,{at:this.state.curPosition()})}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:r}){this.raise(w.EnumBooleanMemberNotInitialized,{at:e,memberName:r,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?w.EnumInvalidMemberInitializerSymbolType:w.EnumInvalidMemberInitializerPrimaryType:w.EnumInvalidMemberInitializerUnknownType,Object.assign({at:e},s))}flowEnumErrorNumberMemberNotInitialized(e,{enumName:s,memberName:r}){this.raise(w.EnumNumberMemberNotInitialized,{at:e,enumName:s,memberName:r})}flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:s}){this.raise(w.EnumStringMemberInconsistentlyInitialized,{at:e,enumName:s})}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 132:{let r=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 131:{let r=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{let r=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),r=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:r}}flowEnumCheckExplicitTypeMismatch(e,s,r){let{explicitType:a}=s;a!==null&&a!==r&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let r=new Set,a={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},n=!1;for(;!this.match(8);){if(this.eat(21)){n=!0;break}let o=this.startNode(),{id:u,init:l}=this.flowEnumMemberRaw(),c=u.name;if(c==="")continue;/^[a-z]/.test(c)&&this.raise(w.EnumInvalidMemberName,{at:u,memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),r.has(c)&&this.raise(w.EnumDuplicateMemberName,{at:u,memberName:c,enumName:e}),r.add(c);let p={enumName:e,explicitType:s,memberName:c};switch(o.id=u,l.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(l.loc,p,"boolean"),o.init=l.value,a.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(l.loc,p,"number"),o.init=l.value,a.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(l.loc,p,"string"),o.init=l.value,a.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(l.loc,p);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(l.loc,p);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(l.loc,p);break;default:a.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:a,hasUnknownMembers:n}}flowEnumStringMembers(e,s,{enumName:r}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let a of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:r});return s}else{for(let a of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(101))return null;if(!k(this.state.type))throw this.raise(w.EnumInvalidExplicitTypeUnknownSupplied,{at:this.state.startLoc,enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(w.EnumInvalidExplicitType,{at:this.state.startLoc,enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let r=s.name,a=s.loc.start,n=this.flowEnumParseExplicitType({enumName:r});this.expect(5);let{members:o,hasUnknownMembers:u}=this.flowEnumMembers({enumName:r,explicitType:n});switch(e.hasUnknownMembers=u,n){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let l=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let c=o.booleanMembers.length,p=o.numberMembers.length,f=o.stringMembers.length,d=o.defaultedMembers.length;if(!c&&!p&&!f&&!d)return l();if(!c&&!p)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!p&&!f&&c>=d){for(let m of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(m.loc.start,{enumName:r,memberName:m.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!c&&!f&&p>=d){for(let m of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(m.loc.start,{enumName:r,memberName:m.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(w.EnumInconsistentMemberValues,{at:a,enumName:r}),l()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},Ml={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},Pe=ae`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:i})=>`Expected corresponding JSX closing tag for <${i}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:i,HTMLEntity:t})=>`Unexpected token \`${i}\`. Did you mean \`${t}\` or \`{'${i}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function he(i){return i?i.type==="JSXOpeningFragment"||i.type==="JSXClosingFragment":!1}function De(i){if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return De(i.object)+"."+De(i.property);throw new Error("Node had unexpected type: "+i.type)}var Ol=i=>class extends i{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Pe.UnterminatedJsxContent,{at:this.state.startLoc});let r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:if(this.state.pos===this.state.start){r===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(140)):super.getTokenFromCode(r);return}e+=this.input.slice(s,this.state.pos),this.finishToken(139,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:nt(r)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?`
|
|
14
|
-
`:`\r
|
|
15
|
-
`):r=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let s="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(h.UnterminatedString,{at:this.state.startLoc});let a=this.input.charCodeAt(this.state.pos);if(a===e)break;a===38?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadEntity(),r=this.state.pos):nt(a)?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}s+=this.input.slice(r,this.state.pos++),this.finishToken(131,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let r=this.readInt(s,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let s=0,r=!1;for(;s++<10&&this.state.pos<this.length&&!(r=this.codePointAtPos(this.state.pos)==59);)++this.state.pos;if(r){let a=this.input.slice(e,this.state.pos),n=Ml[a];if(++this.state.pos,n)return n}}return this.state.pos=e,"&"}jsxReadWord(){let e,s=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(Be(e)||e===45);this.finishToken(138,this.input.slice(s,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(138)?e.name=this.state.value:sr(this.state.type)?e.name=pe(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,s=this.jsxParseIdentifier();if(!this.eat(14))return s;let r=this.startNodeAt(e);return r.namespace=s,r.name=this.jsxParseIdentifier(),this.finishNode(r,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,s=this.jsxParseNamespacedName();if(s.type==="JSXNamespacedName")return s;for(;this.eat(16);){let r=this.startNodeAt(e);r.object=s,r.property=this.jsxParseIdentifier(),s=this.finishNode(r,"JSXMemberExpression")}return s}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext(N.brace),this.next(),e=this.jsxParseExpressionContainer(e,N.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(Pe.AttributeIsEmpty,{at:e}),e;case 140:case 131:return this.parseExprAtom();default:throw this.raise(Pe.UnsupportedJsxValue,{at:this.state.startLoc})}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(N.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,s){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let r=this.parseExpression();e.expression=r}return this.setContext(s),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(N.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(N.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsxParseOpeningElementAt(e){let s=this.startNodeAt(e);return this.eat(141)?this.finishNode(s,"JSXOpeningFragment"):(s.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(s))}jsxParseOpeningElementAfterName(e){let s=[];for(;!this.match(56)&&!this.match(141);)s.push(this.jsxParseAttribute());return e.attributes=s,e.selfClosing=this.eat(56),this.expect(141),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let s=this.startNodeAt(e);return this.eat(141)?this.finishNode(s,"JSXClosingFragment"):(s.name=this.jsxParseElementName(),this.expect(141),this.finishNode(s,"JSXClosingElement"))}jsxParseElementAt(e){let s=this.startNodeAt(e),r=[],a=this.jsxParseOpeningElementAt(e),n=null;if(!a.selfClosing){e:for(;;)switch(this.state.type){case 140:if(e=this.state.startLoc,this.next(),this.eat(56)){n=this.jsxParseClosingElementAt(e);break e}r.push(this.jsxParseElementAt(e));break;case 139:r.push(this.parseExprAtom());break;case 5:{let o=this.startNode();this.setContext(N.brace),this.next(),this.match(21)?r.push(this.jsxParseSpreadChild(o)):r.push(this.jsxParseExpressionContainer(o,N.j_expr));break}default:this.unexpected()}he(a)&&!he(n)&&n!==null?this.raise(Pe.MissingClosingTagFragment,{at:n}):!he(a)&&he(n)?this.raise(Pe.MissingClosingTagElement,{at:n,openingTagName:De(a.name)}):!he(a)&&!he(n)&&De(n.name)!==De(a.name)&&this.raise(Pe.MissingClosingTagElement,{at:n,openingTagName:De(a.name)})}if(he(a)?(s.openingFragment=a,s.closingFragment=n):(s.openingElement=a,s.closingElement=n),s.children=r,this.match(47))throw this.raise(Pe.UnwrappedAdjacentJSXElements,{at:this.state.startLoc});return he(a)?this.finishNode(s,"JSXFragment"):this.finishNode(s,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:s}=this.state;s[s.length-1]=e}parseExprAtom(e){return this.match(139)?this.parseLiteral(this.state.value,"JSXText"):this.match(140)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(140),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let s=this.curContext();if(s===N.j_expr){this.jsxReadToken();return}if(s===N.j_oTag||s===N.j_cTag){if(ie(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(141);return}if((e===34||e===39)&&s===N.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(140);return}super.getTokenFromCode(e)}updateContext(e){let{context:s,type:r}=this.state;if(r===56&&e===140)s.splice(-2,2,N.j_cTag),this.state.canStartJSXElement=!1;else if(r===140)s.push(N.j_oTag);else if(r===141){let a=s[s.length-1];a===N.j_oTag&&e===56||a===N.j_cTag?(s.pop(),this.state.canStartJSXElement=s[s.length-1]===N.j_expr):(this.setContext(N.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Gu(r)}},zs=class extends ot{constructor(...t){super(...t),this.types=new Set,this.enums=new Set,this.constEnums=new Set,this.classes=new Set,this.exportOnlyBindings=new Set}},Hs=class extends ut{constructor(...t){super(...t),this.importsStack=[]}createScope(t){return this.importsStack.push(new Set),new zs(t)}enter(t){t==256&&this.importsStack.push(new Set),super.enter(t)}exit(){let t=super.exit();return t==256&&this.importsStack.pop(),t}hasImport(t,e){let s=this.importsStack.length;if(this.importsStack[s-1].has(t))return!0;if(!e&&s>1){for(let r=0;r<s-1;r++)if(this.importsStack[r].has(t))return!0}return!1}declareName(t,e,s){if(e&4096){this.hasImport(t,!0)&&this.parser.raise(h.VarRedeclaration,{at:s,identifierName:t}),this.importsStack[this.importsStack.length-1].add(t);return}let r=this.currentScope();if(e&1024){this.maybeExportDefined(r,t),r.exportOnlyBindings.add(t);return}super.declareName(t,e,s),e&2&&(e&1||(this.checkRedeclarationInScope(r,t,e,s),this.maybeExportDefined(r,t)),r.types.add(t)),e&256&&r.enums.add(t),e&512&&r.constEnums.add(t),e&128&&r.classes.add(t)}isRedeclaredInScope(t,e,s){if(t.enums.has(e)){if(s&256){let r=!!(s&512),a=t.constEnums.has(e);return r!==a}return!0}return s&128&&t.classes.has(e)?t.lexical.has(e)?!!(s&1):!1:s&2&&t.types.has(e)?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let r=s-1;r>=0;r--){let a=this.scopeStack[r];if(a.types.has(e)||a.exportOnlyBindings.has(e))return}super.checkLocalExport(t)}},Ll=(i,t)=>Object.hasOwnProperty.call(i,t)&&i[t],Ra=i=>i.type==="ParenthesizedExpression"?Ra(i.expression):i,Ks=class extends Vs{toAssignable(t,e=!1){var s,r;let a;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(a=Ra(t),e?a.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(h.InvalidParenthesizedAssignment,{at:t}):a.type!=="MemberExpression"&&this.raise(h.InvalidParenthesizedAssignment,{at:t}):this.raise(h.InvalidParenthesizedAssignment,{at:t})),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let o=0,u=t.properties.length,l=u-1;o<u;o++){var n;let c=t.properties[o],p=o===l;this.toAssignableObjectExpressionProp(c,p,e),p&&c.type==="RestElement"&&(n=t.extra)!=null&&n.trailingCommaLoc&&this.raise(h.RestTrailingComma,{at:t.extra.trailingCommaLoc})}break;case"ObjectProperty":{let{key:o,value:u}=t;this.isPrivateName(o)&&this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start),this.toAssignable(u,e);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":t.type="ArrayPattern",this.toAssignableList(t.elements,(r=t.extra)==null?void 0:r.trailingCommaLoc,e);break;case"AssignmentExpression":t.operator!=="="&&this.raise(h.MissingEqInAssignment,{at:t.left.loc.end}),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(a,e);break}}toAssignableObjectExpressionProp(t,e,s){if(t.type==="ObjectMethod")this.raise(t.kind==="get"||t.kind==="set"?h.PatternHasAccessor:h.PatternHasMethod,{at:t.key});else if(t.type==="SpreadElement"){t.type="RestElement";let r=t.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,s),e||this.raise(h.RestTrailingComma,{at:t})}else this.toAssignable(t,s)}toAssignableList(t,e,s){let r=t.length-1;for(let a=0;a<=r;a++){let n=t[a];if(n){if(n.type==="SpreadElement"){n.type="RestElement";let o=n.argument;this.checkToRestConversion(o,!0),this.toAssignable(o,s)}else this.toAssignable(n,s);n.type==="RestElement"&&(a<r?this.raise(h.RestTrailingComma,{at:n}):e&&this.raise(h.RestTrailingComma,{at:e}))}}}isAssignable(t,e){switch(t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let s=t.properties.length-1;return t.properties.every((r,a)=>r.type!=="ObjectMethod"&&(a===s||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let s of t)(s==null?void 0:s.type)==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){let r=s&1,a=[],n=!0;for(;!this.eat(t);)if(n?n=!1:this.expect(12),r&&this.match(12))a.push(null);else{if(this.eat(t))break;if(this.match(21)){if(a.push(this.parseAssignableListItemTypes(this.parseRestBinding(),s)),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(h.UnsupportedParameterDecorator,{at:this.state.startLoc});this.match(26);)o.push(this.parseDecorator());a.push(this.parseAssignableListItem(s,o))}}return a}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let t=this.startNode(),{type:e,startLoc:s}=this.state;return e===21?this.parseBindingRestProperty(t):(e===136?(this.expectPlugin("destructuringPrivate",s),this.classScope.usePrivateName(this.state.value,s),t.key=this.parsePrivateName()):this.parsePropertyName(t),t.method=!1,this.parseObjPropValue(t,s,!1,!1,!0,!1))}parseAssignableListItem(t,e){let s=this.parseMaybeDefault();this.parseAssignableListItemTypes(s,t);let r=this.parseMaybeDefault(s.loc.start,s);return e.length&&(s.decorators=e),r}parseAssignableListItemTypes(t,e){return t}parseMaybeDefault(t,e){var s,r;if((s=t)!=null||(t=this.state.startLoc),e=(r=e)!=null?r:this.parseBindingAtom(),!this.eat(29))return e;let a=this.startNodeAt(t);return a.left=e,a.right=this.parseMaybeAssignAllowIn(),this.finishNode(a,"AssignmentPattern")}isValidLVal(t,e,s){return Ll({AssignmentPattern:"left",RestElement:"argument",ObjectProperty:"value",ParenthesizedExpression:"expression",ArrayPattern:"elements",ObjectPattern:"properties"},t)}checkLVal(t,{in:e,binding:s=64,checkClashes:r=!1,strictModeChanged:a=!1,hasParenthesizedAncestor:n=!1}){var o;let u=t.type;if(this.isObjectMethod(t))return;if(u==="MemberExpression"){s!==64&&this.raise(h.InvalidPropertyBindingPattern,{at:t});return}if(u==="Identifier"){this.checkIdentifier(t,s,a);let{name:d}=t;r&&(r.has(d)?this.raise(h.ParamDupe,{at:t}):r.add(d));return}let l=this.isValidLVal(u,!(n||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",s);if(l===!0)return;if(l===!1){let d=s===64?h.InvalidLhs:h.InvalidLhsBinding;this.raise(d,{at:t,ancestor:e});return}let[c,p]=Array.isArray(l)?l:[l,u==="ParenthesizedExpression"],f=u==="ArrayPattern"||u==="ObjectPattern"||u==="ParenthesizedExpression"?{type:u}:e;for(let d of[].concat(t[c]))d&&this.checkLVal(d,{in:f,binding:s,checkClashes:r,strictModeChanged:a,hasParenthesizedAncestor:p})}checkIdentifier(t,e,s=!1){this.state.strict&&(s?Na(t.name,this.inModule):ka(t.name))&&(e===64?this.raise(h.StrictEvalArguments,{at:t,referenceName:t.name}):this.raise(h.StrictEvalArgumentsBinding,{at:t,bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(h.LetInLexicalBinding,{at:t}),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(h.InvalidRestAssignmentPattern,{at:t})}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?h.RestTrailingComma:h.ElementAfterRest,{at:this.state.startLoc}),!0):!1}},Dl=(i,t)=>Object.hasOwnProperty.call(i,t)&&i[t];function Bl(i){if(i==null)throw new Error(`Unexpected ${i} value.`);return i}function xa(i){if(!i)throw new Error("Assert fail")}var g=ae`typescript`({AbstractMethodHasImplementation:({methodName:i})=>`Method '${i}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:i})=>`Property '${i}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:i})=>`'declare' is not allowed in ${i}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:i})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:i})=>`Duplicate modifier: '${i}'.`,EmptyHeritageClauseType:({token:i})=>`'${i}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:i})=>`'${i[0]}' modifier cannot be used with '${i[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:i})=>`Index signatures cannot have an accessibility modifier ('${i}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:i})=>`'${i}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:i})=>`'${i}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:i})=>`'${i}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:i})=>`'${i[0]}' modifier must precede '${i[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",MixedLabeledAndUnlabeledElements:"Tuple members must all have names or all not have names.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:i})=>`Private elements cannot have an accessibility modifier ('${i}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:i})=>`Single type parameter ${i} should have a trailing comma. Example usage: <${i},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:i})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${i}.`});function Fl(i){switch(i){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function ga(i){return i==="private"||i==="public"||i==="protected"}function Rl(i){return i==="in"||i==="out"}var Ul=i=>class extends i{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:g.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:g.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:g.InvalidModifierOnTypeParameter})}getScopeHandler(){return Hs}tsIsIdentifier(){return k(this.state.type)}tsTokenCanFollowModifier(){return(this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(136)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(),this.tsTokenCanFollowModifier()}tsParseModifier(e,s){if(!k(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.indexOf(r)!==-1){if(s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:r,errorTemplate:a=g.InvalidModifierOnTypeMember},n){let o=(l,c,p,f)=>{c===p&&n[f]&&this.raise(g.InvalidModifiersOrder,{at:l,orderedModifiers:[p,f]})},u=(l,c,p,f)=>{(n[p]&&c===f||n[f]&&c===p)&&this.raise(g.IncompatibleModifiers,{at:l,modifiers:[p,f]})};for(;;){let{startLoc:l}=this.state,c=this.tsParseModifier(e.concat(s??[]),r);if(!c)break;ga(c)?n.accessibility?this.raise(g.DuplicateAccessibilityModifier,{at:l,modifier:c}):(o(l,c,c,"override"),o(l,c,c,"static"),o(l,c,c,"readonly"),n.accessibility=c):Rl(c)?(n[c]&&this.raise(g.DuplicateModifier,{at:l,modifier:c}),n[c]=!0,o(l,c,"in","out")):(Object.hasOwnProperty.call(n,c)?this.raise(g.DuplicateModifier,{at:l,modifier:c}):(o(l,c,"static","readonly"),o(l,c,"static","override"),o(l,c,"override","readonly"),o(l,c,"abstract","override"),u(l,c,"declare","override"),u(l,c,"static","abstract")),n[c]=!0),s!=null&&s.includes(c)&&this.raise(a,{at:l,modifier:c})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){let r=[];for(;!this.tsIsListTerminator(e);)r.push(s());return r}tsParseDelimitedList(e,s,r){return Bl(this.tsParseDelimitedListWorker(e,s,!0,r))}tsParseDelimitedListWorker(e,s,r,a){let n=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let u=s();if(u==null)return;if(n.push(u),this.eat(12)){o=this.state.lastTokStart;continue}if(this.tsIsListTerminator(e))break;r&&this.expect(12);return}return a&&(a.value=o),n}tsParseBracketedList(e,s,r,a,n){a||(r?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,s,n);return r?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(131)||this.raise(g.UnsupportedImportTypeArgument,{at:this.state.startLoc}),e.argument=super.parseExprAtom(),this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName()),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e=!0){let s=this.parseIdentifier(e);for(;this.eat(16);){let r=this.startNodeAtNode(s);r.left=s,r.right=this.parseIdentifier(e),s=this.finishNode(r,"TSQualifiedName")}return s}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(47)||this.match(140)?this.next():this.unexpected();let r={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),s.params.length===0&&this.raise(g.EmptyTypeParameters,{at:s}),r.value!==-1&&this.addExtra(s,"trailingComma",r.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let r=e===19,a="parameters",n="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[a]=this.tsParseBindingListForSignature(),r?s[n]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[n]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:r}=s;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(g.UnsupportedSignatureParameterKind,{at:s,type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),k(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){this.eat(17)&&(e.optional=!0);let r=e;if(this.match(10)||this.match(47)){s&&this.raise(g.ReadonlyForMethodSignature,{at:e});let a=r;a.kind&&this.match(47)&&this.raise(g.AccesorCannotHaveTypeParameters,{at:this.state.curPosition()}),this.tsFillSignature(14,a),this.tsParseTypeMemberSemicolon();let n="parameters",o="typeAnnotation";if(a.kind==="get")a[n].length>0&&(this.raise(h.BadGetterArity,{at:this.state.curPosition()}),this.isThisParam(a[n][0])&&this.raise(g.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}));else if(a.kind==="set"){if(a[n].length!==1)this.raise(h.BadSetterArity,{at:this.state.curPosition()});else{let u=a[n][0];this.isThisParam(u)&&this.raise(g.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}),u.type==="Identifier"&&u.optional&&this.raise(g.SetAccesorCannotHaveOptionalParameter,{at:this.state.curPosition()}),u.type==="RestElement"&&this.raise(g.SetAccesorCannotHaveRestParameter,{at:this.state.curPosition()})}a[o]&&this.raise(g.SetAccesorCannotHaveReturnType,{at:a[o]})}else a.kind="method";return this.finishNode(a,"TSMethodSignature")}else{let a=r;s&&(a.readonly=!0);let n=this.tsTryParseTypeAnnotation();return n&&(a.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(a,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let r=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(r,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let s=this.tsTryParseIndexSignature(e);return s||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(120):(this.isContextual(120)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedTypeParameter(){let e=this.startNode();return e.name=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(58),this.finishNode(e,"TSTypeParameter")}tsParseMappedType(){let e=this.startNode();return this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(120)):this.eatContextual(120)&&(e.readonly=!0),this.expect(0),e.typeParameter=this.tsParseMappedTypeParameter(),e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1,r=null;return e.elementTypes.forEach(a=>{var n;let{type:o}=a;s&&o!=="TSRestType"&&o!=="TSOptionalType"&&!(o==="TSNamedTupleMember"&&a.optional)&&this.raise(g.OptionalTypeBeforeRequired,{at:a}),s||(s=o==="TSNamedTupleMember"&&a.optional||o==="TSOptionalType");let u=o;o==="TSRestType"&&(a=a.typeAnnotation,u=a.type);let l=u==="TSNamedTupleMember";(n=r)!=null||(r=l),r!==l&&this.raise(g.MixedLabeledAndUnlabeledElements,{at:a})}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,s=this.eat(21),r,a,n,o,l=X(this.state.type)?this.lookaheadCharCode():null;if(l===58)r=!0,n=!1,a=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(l===63){n=!0;let c=this.state.startLoc,p=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,a=this.createIdentifier(this.startNodeAt(c),p),this.expect(17),this.expect(14),o=this.tsParseType()):(r=!1,o=f,this.expect(17))}else o=this.tsParseType(),n=this.eat(17),r=this.eat(14);if(r){let c;a?(c=this.startNodeAtNode(a),c.optional=n,c.label=a,c.elementType=o,this.eat(17)&&(c.optional=!0,this.raise(g.TupleOptionalAfterType,{at:this.state.lastTokStartLoc}))):(c=this.startNodeAtNode(o),c.optional=n,this.raise(g.InvalidTupleMemberLabel,{at:o}),c.label=o,c.elementType=this.tsParseType()),o=this.finishNode(c,"TSNamedTupleMember")}else if(n){let c=this.startNodeAtNode(o);c.typeAnnotation=o,o=this.finishNode(c,"TSOptionalType")}if(s){let c=this.startNodeAt(e);c.typeAnnotation=o,o=this.finishNode(c,"TSRestType")}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){let r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 132:case 133:case 131:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(114)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 131:case 132:case 133:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==132&&s.type!==133&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(k(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Fl(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let s=this.startNodeAtNode(e);s.elementType=e,this.expect(3),e=this.finishNode(s,"TSArrayType")}else{let s=this.startNodeAtNode(e);s.objectType=e,s.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(s,"TSIndexedAccessType")}return e}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(g.UnexpectedReadonly,{at:e})}}tsParseInferType(){let e=this.startNode();this.expectContextual(113);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return el(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(113)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,r){let a=this.startNode(),n=this.eat(r),o=[];do o.push(s());while(this.eat(r));return o.length===1&&!n?o[0]:(a.types=o,this.finishNode(a,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(k(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let s=this.startNode();this.expect(e);let r=this.startNode(),a=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(a&&this.match(78)){let u=this.tsParseThisTypeOrThisTypePredicate();return u.type==="TSThisType"?(r.parameterName=u,r.asserts=!0,r.typeAnnotation=null,u=this.finishNode(r,"TSTypePredicate")):(this.resetStartLocationFromNode(u,r),u.asserts=!0),s.typeAnnotation=u,this.finishNode(s,"TSTypeAnnotation")}let n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return a?(r.parameterName=this.parseIdentifier(),r.asserts=a,r.typeAnnotation=null,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let o=this.tsParseTypeAnnotation(!1);return r.parameterName=n,r.typeAnnotation=o,r.asserts=a,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(114)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==107)return!1;let e=this.state.containsEsc;return this.next(),!k(this.state.type)&&!this.match(78)?!1:(e&&this.raise(h.InvalidEscapedReservedWord,{at:this.state.lastTokStartLoc,reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){xa(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(122)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(g.ReservedTypeAssertion,{at:this.state.startLoc});let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{let a=this.startNode();return a.expression=this.tsParseEntityName(),this.match(47)&&(a.typeParameters=this.tsParseTypeArguments()),this.finishNode(a,"TSExpressionWithTypeArguments")});return r.length||this.raise(g.EmptyHeritageClauseType,{at:s,token:e}),r}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(127),s.declare&&(e.declare=!0),k(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(g.MissingInterfaceName,{at:this.state.startLoc})),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let r=this.startNode();return r.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(r,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(112)&&this.lookahead().type!==16){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(131)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(124),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){let r=this.startNode();this.tsParseModuleOrNamespaceDeclaration(r,!0),e.body=r}else this.scope.enter(256),this.prodParam.enter(Fe),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(110)?(e.global=!0,e.id=this.parseIdentifier()):this.match(131)?e.id=super.parseStringLiteral(this.state.value):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(Fe),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,r){e.isExport=r||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let a=this.tsParseModuleReference();return e.importKind==="type"&&a.type!=="TSExternalModuleReference"&&this.raise(g.ImportAliasHasImportType,{at:a}),e.moduleReference=a,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(117)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(117),this.expect(10),this.match(131)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),r=e();return this.state=s,r}tsTryParseAndCatch(e){let s=this.tryParse(r=>e()||r());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type,r;return this.isContextual(99)&&(s=74,r="let"),this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 124:return this.tsParseEnumDeclaration(e,{declare:!0});case 110:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,r||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 127:{let a=this.tsParseInterfaceDeclaration(e,{declare:!0});if(a)return a}default:if(k(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,r){switch(s.name){case"declare":{let a=this.tsTryParseDeclare(e);return a&&(a.declare=!0),a}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(Fe);let a=e;return a.global=!0,a.id=s,a.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(a,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,r)}}tsParseDeclaration(e,s,r,a){switch(s){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||k(this.state.type)))return this.tsParseAbstractDeclaration(e,a);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(131))return this.tsParseAmbientExternalModuleDeclaration(e);if(k(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&k(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(r)&&k(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let r=this.tsTryParseAndCatch(()=>{let a=this.startNodeAt(e);return a.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(a),a.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),a});if(this.state.maybeInArrowParameters=s,!!r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(g.EmptyTypeArguments,{at:e}):!this.state.inType&&this.curContext()===N.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return tl(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,s){let r=this.state.startLoc,a={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},a);let n=a.accessibility,o=a.override,u=a.readonly;!(e&4)&&(n||u||o)&&this.raise(g.UnexpectedParameterModifier,{at:r});let l=this.parseMaybeDefault();this.parseAssignableListItemTypes(l,e);let c=this.parseMaybeDefault(l.loc.start,l);if(n||u||o){let p=this.startNodeAt(r);return s.length&&(p.decorators=s),n&&(p.accessibility=n),u&&(p.readonly=u),o&&(p.override=o),c.type!=="Identifier"&&c.type!=="AssignmentPattern"&&this.raise(g.UnsupportedParameterPropertyKind,{at:p}),p.parameter=c,this.finishNode(p,"TSParameterProperty")}return s.length&&(l.decorators=s),c}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(g.PatternIsOptional,{at:s})}setArrowFunctionParameters(e,s,r){super.setArrowFunctionParameters(e,s,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let a=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return a&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,a):a==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(g.DeclareFunctionHasImplementation,{at:e}),e.declare)?super.parseFunctionBodyAndFinish(e,a,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(g.UnexpectedTypeAnnotation,{at:s.typeAnnotation})})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,r,a){let n=super.parseArrayLike(e,s,r,a);return n.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,s,r,a){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(s);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let n=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(r)return a.stop=!0,e;a.optionalChainMember=n=!0,this.next()}if(this.match(47)||this.match(51)){let o,u=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let f=this.tsTryParseGenericAsyncArrowFunction(s);if(f)return f}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(n&&!this.match(10)){o=this.state.curPosition();return}if(zt(this.state.type)){let f=super.parseTaggedTemplateExpression(e,s,a);return f.typeParameters=l,f}if(!r&&this.eat(10)){let f=this.startNodeAt(s);return f.callee=e,f.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=l,a.optionalChainMember&&(f.optional=n),this.finishCallExpression(f,a.optionalChainMember)}let c=this.state.type;if(c===48||c===52||c!==10&&Ns(c)&&!this.hasPrecedingLineBreak())return;let p=this.startNodeAt(s);return p.expression=e,p.typeParameters=l,this.finishNode(p,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),u)return u.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(g.InvalidPropertyAccessAfterInstantiationExpression,{at:this.state.startLoc}),u}return super.parseSubscript(e,s,r,a)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:r}=e;r.type==="TSInstantiationExpression"&&!((s=r.extra)!=null&&s.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,s,r){let a;if(jt(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(a=this.isContextual(118)))){let n=this.startNodeAt(s);return n.expression=e,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(a&&this.raise(h.UnexpectedKeyword,{at:this.state.startLoc,keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(n,a?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(n,s,r)}return super.parseExprOp(e,s,r)}checkReservedWord(e,s,r,a){this.state.isAmbientContext||super.checkReservedWord(e,s,r,a)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(g.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(128)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,r,a){super.applyImportPhase(e,s,r,a),s?e.exportKind=r==="type"?"type":"value":e.importKind=r==="type"||r==="typeof"?r:"value"}parseImport(e){if(this.match(131))return e.importKind="value",super.parseImport(e);let s;if(k(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(128)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,r);s=super.parseImportSpecifiersAndAfter(e,r)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(g.TypeImportCannotSpecifyDefaultAndNamed,{at:s}),s}parseExport(e,s){if(this.match(83)){this.next();let r=null;return this.isContextual(128)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(e,!1):e.importKind="value",this.tsParseImportEqualsDeclaration(e,r,!0)}else if(this.eat(29)){let r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(93)){let r=e;return this.expectContextual(126),r.id=this.parseIdentifier(),this.semicolon(),this.finishNode(r,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(122)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(127)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,r=!1){let{isAmbientContext:a}=this.state,n=super.parseVarStatement(e,s,r||a);if(!a)return n;for(let{id:o,init:u}of n.declarations)u&&(s!=="const"||o.typeAnnotation?this.raise(g.InitializerNotAllowedInAmbientContext,{at:u}):$l(u,this.hasPlugin("estree"))||this.raise(g.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,{at:u}));return n}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){let r=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(r,{const:!0})}if(this.isContextual(124))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(127)){let r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(r=>ga(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(104)&&this.lookaheadCharCode()===123}parseClassMember(e,s,r){let a=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:a,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:g.InvalidModifierOnTypeParameterPositions},s);let n=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,a)&&this.raise(g.StaticBlockCannotHaveModifier,{at:this.state.curPosition()}),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,r,!!s.static)};s.declare?this.tsInAmbientContext(n):n()}parseClassMemberWithIsStatic(e,s,r,a){let n=this.tsTryParseIndexSignature(s);if(n){e.body.push(n),s.abstract&&this.raise(g.IndexSignatureHasAbstract,{at:s}),s.accessibility&&this.raise(g.IndexSignatureHasAccessibility,{at:s,modifier:s.accessibility}),s.declare&&this.raise(g.IndexSignatureHasDeclare,{at:s}),s.override&&this.raise(g.IndexSignatureHasOverride,{at:s});return}!this.state.inAbstractClass&&s.abstract&&this.raise(g.NonAbstractClassHasAbstractMethod,{at:s}),s.override&&(r.hadSuperClass||this.raise(g.OverrideNotInSubClass,{at:s})),super.parseClassMemberWithIsStatic(e,s,r,a)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(g.ClassMethodHasReadonly,{at:e}),e.declare&&this.match(10)&&this.raise(g.ClassMethodHasDeclare,{at:e})}parseExpressionStatement(e,s,r){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,r):void 0)||super.parseExpressionStatement(e,s,r)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,r){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,s,r);let a=this.tryParse(()=>super.parseConditional(e,s));return a.node?(a.error&&(this.state=a.failState),a.node):(a.error&&super.setOptionalParametersError(r,a.error),e)}parseParenItem(e,s){if(e=super.parseParenItem(e,s),this.eat(17)&&(e.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(123))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,r=this.eatContextual(123);if(r&&(this.isContextual(123)||!this.shouldParseExportDeclaration()))throw this.raise(g.ExpectedAmbientAfterExportDeclare,{at:this.state.startLoc});let n=k(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return n?((n.type==="TSInterfaceDeclaration"||n.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&(this.resetStartLocation(n,s),n.declare=!0),n):null}parseClassId(e,s,r,a){if((!s||r)&&this.isContextual(111))return;super.parseClassId(e,s,r,e.declare?1024:8331);let n=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);n&&(e.typeParameters=n)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(g.DeclareClassFieldHasInitializer,{at:this.state.startLoc}),e.abstract&&this.match(29)){let{key:s}=e;this.raise(g.AbstractPropertyHasInitializer,{at:this.state.startLoc,propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(s.start,s.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(g.PrivateElementHasAbstract,{at:e}),e.accessibility&&this.raise(g.PrivateElementHasAccessibility,{at:e,modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(g.AccessorCannotBeOptional,{at:e}),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,r,a,n,o){let u=this.tsTryParseTypeParameters(this.tsParseConstModifier);u&&n&&this.raise(g.ConstructorHasTypeParameters,{at:u});let{declare:l=!1,kind:c}=s;l&&(c==="get"||c==="set")&&this.raise(g.DeclareAccessor,{at:s,kind:c}),u&&(s.typeParameters=u),super.pushClassMethod(e,s,r,a,n,o)}pushClassPrivateMethod(e,s,r,a){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(s.typeParameters=n),super.pushClassPrivateMethod(e,s,r,a)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!e.value.body||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(111)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,r,a,n,o,u){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);return l&&(e.typeParameters=l),super.parseObjPropValue(e,s,r,a,n,o,u)}parseFunctionParams(e,s){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var r,a,n,o,u;let l,c,p;if(this.hasPlugin("jsx")&&(this.match(140)||this.match(47))){if(l=this.state.clone(),c=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!c.error)return c.node;let{context:m}=this.state,y=m[m.length-1];(y===N.j_oTag||y===N.j_expr)&&m.pop()}if(!((r=c)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!l||l===this.state)&&(l=this.state.clone());let f,d=this.tryParse(m=>{var y,v;f=this.tsParseTypeParameters(this.tsParseConstModifier);let A=super.parseMaybeAssign(e,s);return(A.type!=="ArrowFunctionExpression"||(y=A.extra)!=null&&y.parenthesized)&&m(),((v=f)==null?void 0:v.params.length)!==0&&this.resetStartLocationFromNode(A,f),A.typeParameters=f,A},l);if(!d.error&&!d.aborted)return f&&this.reportReservedArrowTypeParam(f),d.node;if(!c&&(xa(!this.hasPlugin("jsx")),p=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!p.error))return p.node;if((a=c)!=null&&a.node)return this.state=c.failState,c.node;if(d.node)return this.state=d.failState,f&&this.reportReservedArrowTypeParam(f),d.node;if((n=p)!=null&&n.node)return this.state=p.failState,p.node;throw((o=c)==null?void 0:o.error)||d.error||((u=p)==null?void 0:u.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(g.ReservedArrowTypeParam,{at:e})}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(r=>{let a=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),a});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseAssignableListItemTypes(e,s){if(!(s&2))return e;this.eat(17)&&(e.optional=!0);let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(g.UnexpectedTypeCastInParameter,{at:e}):this.raise(g.UnexpectedTypeCastInParameter,{at:e}),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,r){return Dl({TSTypeCastExpression:!0,TSParameterProperty:"parameter",TSNonNullExpression:"expression",TSAsExpression:(r!==64||!s)&&["expression",!0],TSSatisfiesExpression:(r!==64||!s)&&["expression",!0],TSTypeAssertion:(r!==64||!s)&&["expression",!0]},e)||super.isValidLVal(e,s,r)}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){let s=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e);return r.typeParameters=s,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){let r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(g.TypeAnnotationAfterAssign,{at:r.typeAnnotation}),r}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(48,1);return}if(e===60){this.finishOp(47,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}toAssignableList(e,s,r){for(let a=0;a<e.length;a++){let n=e[a];(n==null?void 0:n.type)==="TSTypeCastExpression"&&(e[a]=this.typeCastToParameter(n))}super.toAssignableList(e,s,r)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}shouldParseArrow(e){return this.match(14)?e.every(s=>this.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),a=this.getObjectOrClassMethodParams(e)[0];return a&&this.isThisParam(a)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let s=this.state.isAmbientContext;this.state.isAmbientContext=!0;try{return e()}finally{this.state.isAmbientContext=s}}parseClass(e,s,r){let a=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,r)}finally{this.state.inAbstractClass=a}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(127)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(g.NonClassMethodPropertyHasAbstractModifer,{at:e}),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,r,a,n,o,u){let l=super.parseMethod(e,s,r,a,n,o,u);if(l.abstract&&(this.hasPlugin("estree")?!!l.value.body:!!l.body)){let{key:p}=l;this.raise(g.AbstractMethodHasImplementation,{at:l,methodName:p.type==="Identifier"&&!l.computed?p.name:`[${this.input.slice(p.start,p.end)}]`})}return l}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,r,a){return!s&&a?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,r,a))}parseImportSpecifier(e,s,r,a,n){return!s&&a?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,r,a,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,r){let a=s?"imported":"local",n=s?"local":"exported",o=e[a],u,l=!1,c=!0,p=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let m=this.parseIdentifier();X(this.state.type)?(l=!0,o=d,u=s?this.parseIdentifier():this.parseModuleExportName(),c=!1):(u=m,c=!1)}else X(this.state.type)?(c=!1,u=s?this.parseIdentifier():this.parseModuleExportName()):(l=!0,o=d)}else X(this.state.type)&&(l=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());l&&r&&this.raise(s?g.TypeModifierIsUsedInTypeImports:g.TypeModifierIsUsedInTypeExports,{at:p}),e[a]=o,e[n]=u;let f=s?"importKind":"exportKind";e[f]=l?"type":"value",c&&this.eatContextual(93)&&(e[n]=s?this.parseIdentifier():this.parseModuleExportName()),e[n]||(e[n]=ne(e[a])),s&&this.checkIdentifier(e[n],l?4098:4096)}};function jl(i){if(i.type!=="MemberExpression")return!1;let{computed:t,property:e}=i;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:ja(i.object)}function $l(i,t){var e;let{type:s}=i;if((e=i.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){let{value:r}=i;if(typeof r=="string"||typeof r=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(Ua(i,t)||ql(i,t)||s==="TemplateLiteral"&&i.expressions.length===0||jl(i))}function Ua(i,t){return t?i.type==="Literal"&&(typeof i.value=="number"||"bigint"in i):i.type==="NumericLiteral"||i.type==="BigIntLiteral"}function ql(i,t){if(i.type==="UnaryExpression"){let{operator:e,argument:s}=i;if(e==="-"&&Ua(s,t))return!0}return!1}function ja(i){return i.type==="Identifier"?!0:i.type!=="MemberExpression"||i.computed?!1:ja(i.object)}var ba=ae`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Wl=i=>class extends i{parsePlaceholder(e){if(this.match(142)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(142),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let r=!!(e.expectedNode&&e.type==="Placeholder");return e.expectedNode=s,r?e:this.finishNode(e,"Placeholder")}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(142,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,r,a){e!==void 0&&super.checkReservedWord(e,s,r,a)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,r){return e==="Placeholder"||super.isValidLVal(e,s,r)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){return!!(super.chStartsBindingIdentifier(e,s)||this.lookahead().type===142)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var r;if(s.type!=="Placeholder"||(r=s.extra)!=null&&r.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let a=e;return a.label=this.finishPlaceholder(s,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}return this.semicolon(),e.name=s.name,this.finishPlaceholder(e,"Statement")}parseBlock(e,s,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,r){let a=s?"ClassDeclaration":"ClassExpression";this.next();let n=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(142)||this.match(5))e.id=o;else{if(r||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,a);throw this.raise(ba.ClassNameIsRequired,{at:this.state.startLoc})}else this.parseClassId(e,s,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,n),this.finishNode(e,a)}parseExport(e,s){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,s);if(!this.isContextual(97)&&!this.match(12))return e.specifiers=[],e.source=null,e.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(e,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=r,e.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(e,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(pe(142),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var r;return(r=e.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(97)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(s);return r.local=s,e.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(97),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.state.lastTokEndLoc.index&&this.raise(ba.UnexpectedSpace,{at:this.state.lastTokEndLoc})}},Vl=i=>class extends i{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),k(this.state.type)){let r=this.parseIdentifierName(),a=this.createIdentifier(s,r);if(a.type="V8IntrinsicIdentifier",this.match(10))return a}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}};function D(i,t){let[e,s]=typeof t=="string"?[t,{}]:t,r=Object.keys(s),a=r.length===0;return i.some(n=>{if(typeof n=="string")return a&&n===e;{let[o,u]=n;if(o!==e)return!1;for(let l of r)if(u[l]!==s[l])return!1;return!0}})}function ve(i,t,e){let s=i.find(r=>Array.isArray(r)?r[0]===t:r===t);return s&&Array.isArray(s)&&s.length>1?s[1][e]:null}var Pa=["minimal","fsharp","hack","smart"],va=["^^","@@","^","%","#"],Ta=["hash","bar"];function zl(i){if(D(i,"decorators")){if(D(i,"decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let t=ve(i,"decorators","decoratorsBeforeExport");if(t!=null&&typeof t!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let e=ve(i,"decorators","allowCallParenthesized");if(e!=null&&typeof e!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(D(i,"flow")&&D(i,"typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(D(i,"placeholders")&&D(i,"v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(D(i,"pipelineOperator")){let t=ve(i,"pipelineOperator","proposal");if(!Pa.includes(t)){let s=Pa.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${s}.`)}let e=D(i,["recordAndTuple",{syntaxType:"hash"}]);if(t==="hack"){if(D(i,"placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(D(i,"v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let s=ve(i,"pipelineOperator","topicToken");if(!va.includes(s)){let r=va.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}if(s==="#"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}else if(t==="smart"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}if(D(i,"moduleAttributes")){if(D(i,"importAssertions")||D(i,"importAttributes"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if(ve(i,"moduleAttributes","version")!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(D(i,"importAssertions")&&D(i,"importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(D(i,"recordAndTuple")&&ve(i,"recordAndTuple","syntaxType")!=null&&!Ta.includes(ve(i,"recordAndTuple","syntaxType")))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+Ta.map(t=>`'${t}'`).join(", "));if(D(i,"asyncDoExpressions")&&!D(i,"doExpressions")){let t=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw t.missingPlugins="doExpressions",t}}var $a={estree:Vu,jsx:Ol,flow:_l,typescript:Ul,v8intrinsic:Vl,placeholders:Wl},Hl=Object.keys($a),Cs={sourceType:"script",sourceFilename:void 0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};function Kl(i){if(i==null)return Object.assign({},Cs);if(i.annexB!=null&&i.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let t={};for(let s of Object.keys(Cs)){var e;t[s]=(e=i[s])!=null?e:Cs[s]}return t}var Gs=class extends Ks{checkProto(t,e,s,r){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;let a=t.key;if((a.type==="Identifier"?a.name:a.value)==="__proto__"){if(e){this.raise(h.RecordNoProto,{at:a});return}s.used&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=a.loc.start):this.raise(h.DuplicateProto,{at:a})),s.used=!0}}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&t.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();let t=this.parseExpression();return this.match(137)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.state.comments,t.errors=this.state.errors,this.options.tokens&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){let r=this.startNodeAt(e);for(r.expressions=[s];this.eat(12);)r.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t,e){var s;t.optionalParametersLoc=(s=e==null?void 0:e.loc)!=null?s:this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc;if(this.isContextual(106)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,s)),o}let r;t?r=!1:(t=new Re,r=!0);let{type:a}=this.state;(a===10||k(a))&&(this.state.potentialArrowAt=this.state.start);let n=this.parseMaybeConditional(t);if(e&&(n=e.call(this,n,s)),Xu(this.state.type)){let o=this.startNodeAt(s),u=this.state.value;if(o.operator=u,this.match(29)){this.toAssignable(n,!0),o.left=n;let l=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=l&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=l&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=l&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else o.left=n;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(n,{in:this.finishNode(o,"AssignmentExpression")}),o}else r&&this.checkExpressionErrors(t,!0);return n}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseExprOps(t);return this.shouldExitDescending(r,s)?r:this.parseConditional(r,e,t)}parseConditional(t,e,s){if(this.eat(17)){let r=this.startNodeAt(e);return r.test=t,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(136)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(r,s)?r:this.parseExprOp(r,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let a=this.getPrivateNameSV(t);(s>=jt(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(h.PrivateInExpectedIn,{at:t,identifierName:a}),this.classScope.usePrivateName(a,t.loc.start)}let r=this.state.type;if(Yu(r)&&(this.prodParam.hasIn||!this.match(58))){let a=jt(r);if(a>s){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let n=this.startNodeAt(e);n.left=t,n.operator=this.state.value;let o=r===41||r===42,u=r===40;if(u&&(a=jt(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(h.UnexpectedAwaitAfterPipelineBody,{at:this.state.startLoc});n.right=this.parseExprOpRightExpr(r,a);let l=this.finishNode(n,o||u?"LogicalExpression":"BinaryExpression"),c=this.state.type;if(u&&(c===41||c===42)||o&&c===40)throw this.raise(h.MixingCoalesceWithLogical,{at:this.state.startLoc});return this.parseExprOp(l,e,s)}}return t}parseExprOpRightExpr(t,e){let s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"smart":return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(106))throw this.raise(h.PipeBodyIsTighter,{at:this.state.startLoc});return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,sl(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return Ru.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(h.PipeUnparenthesizedBody,{at:e,type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(h.PipeTopicUnused,{at:e}),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(h.UnexpectedTokenUnaryExponentiation,{at:t.argument})}parseMaybeUnary(t,e){let s=this.state.startLoc,r=this.isContextual(96);if(r&&this.isAwaitAllowed()){this.next();let u=this.parseAwait(s);return e||this.checkExponentialAfterUnary(u),u}let a=this.match(34),n=this.startNode();if(Zu(this.state.type)){n.operator=this.state.value,n.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let u=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&u){let l=n.argument;l.type==="Identifier"?this.raise(h.StrictDelete,{at:n}):this.hasPropertyAsPrivateName(l)&&this.raise(h.DeletePrivateField,{at:n})}if(!a)return e||this.checkExponentialAfterUnary(n),this.finishNode(n,"UnaryExpression")}let o=this.parseUpdate(n,a,t);if(r){let{type:u}=this.state;if((this.hasPlugin("v8intrinsic")?Ns(u):Ns(u)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(h.AwaitNotInAsyncContext,{at:s}),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){let n=t;return this.checkLVal(n.argument,{in:this.finishNode(n,"UpdateExpression")}),t}let r=this.state.startLoc,a=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return a;for(;Qu(this.state.type)&&!this.canInsertSemicolon();){let n=this.startNodeAt(r);n.operator=this.state.value,n.prefix=!1,n.argument=a,this.next(),this.checkLVal(a,{in:a=this.finishNode(n,"UpdateExpression")})}return a}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseExprAtom(t);return this.shouldExitDescending(r,s)?r:this.parseSubscripts(r,e)}parseSubscripts(t,e,s){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,r),r.maybeAsyncArrow=!1;while(!r.stop);return t}parseSubscript(t,e,s,r){let{type:a}=this.state;if(!s&&a===15)return this.parseBind(t,e,s,r);if(zt(a))return this.parseTaggedTemplateExpression(t,e,r);let n=!1;if(a===18){if(s&&(this.raise(h.OptionalChainingNoNew,{at:this.state.startLoc}),this.lookaheadCharCode()===40))return r.stop=!0,t;r.optionalChainMember=n=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,r,n);{let o=this.eat(0);return o||n||this.eat(16)?this.parseMember(t,e,r,o,n):(r.stop=!0,t)}}parseMember(t,e,s,r,a){let n=this.startNodeAt(e);return n.object=t,n.computed=r,r?(n.property=this.parseExpression(),this.expect(3)):this.match(136)?(t.type==="Super"&&this.raise(h.SuperPrivateField,{at:e}),this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),s.optionalChainMember?(n.optional=a,this.finishNode(n,"OptionalMemberExpression")):this.finishNode(n,"MemberExpression")}parseBind(t,e,s,r){let a=this.startNodeAt(e);return a.object=t,this.next(),a.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(a,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,r){let a=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=t;let{maybeAsyncArrow:u,optionalChainMember:l}=s;u&&(this.expressionScope.enter(wl()),n=new Re),l&&(o.optional=r),r?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type==="Import",t.type!=="Super",o,n);let c=this.finishCallExpression(o,l);return u&&this.shouldParseAsyncArrow()&&!r?(s.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),c)):(u&&(this.checkExpressionErrors(n,!0),this.expressionScope.exit()),this.toReferencedArguments(c)),this.state.maybeInArrowParameters=a,c}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let r=this.startNodeAt(e);return r.tag=t,r.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(h.OptionalChainingNoTemplate,{at:e}),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&t.start===this.state.potentialArrowAt}expectImportAttributesPlugin(){this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.expectImportAttributesPlugin()),t.arguments.length===0||t.arguments.length>2)this.raise(h.ImportCallArity,{at:t,maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(h.ImportCallSpreadArgument,{at:s});return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,r,a){let n=[],o=!0,u=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(h.ImportCallArgumentTrailingComma,{at:this.state.lastTokStartLoc}),r&&this.addTrailingCommaExtraToNode(r),this.next();break}n.push(this.parseExprListItem(!1,a,s))}return this.state.inFSharpPipelineDirectBody=u,n}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&<(t,e.innerComments),e.callee.trailingComments&<(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:r}=this.state;switch(r){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):(this.match(10)||this.raise(h.UnsupportedImport,{at:this.state.lastTokStartLoc}),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 132:return this.parseNumericLiteral(this.state.value);case 133:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseDecimalLiteral(this.state.value);case 131:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let a=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(a)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,t);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let a=e.callee=this.parseNoCallExpr();if(a.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(h.UnsupportedBind,{at:a})}case 136:return this.raise(h.PrivateInExpectedIn,{at:this.state.startLoc,identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let a=this.getPluginOption("pipelineOperator","proposal");if(a)return this.parseTopicReference(a);this.unexpected();break}case 47:{let a=this.input.codePointAt(this.nextTokenStart());ie(a)||a===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(k(r)){if(this.isContextual(125)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let a=this.state.potentialArrowAt===this.state.start,n=this.state.containsEsc,o=this.parseIdentifier();if(!n&&o.name==="async"&&!this.canInsertSemicolon()){let{type:u}=this.state;if(u===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(k(u))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(u===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return a&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=z(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,s,t,r)}finishTopicReference(t,e,s,r){if(this.testTopicReferenceConfiguration(s,e,r)){let a=s==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(s==="smart"?h.PrimaryTopicNotAllowed:h.PipeTopicUnbound,{at:e}),this.registerTopicReference(),this.finishNode(t,a)}else throw this.raise(h.PipeTopicUnconfiguredToken,{at:e,token:pe(r)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:pe(s)}]);case"smart":return s===27;default:throw this.raise(h.PipeTopicRequiresHackPipes,{at:e})}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(qt(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(h.LineTerminatorBeforeArrow,{at:this.state.curPosition()}),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(Gt),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(h.SuperNotAllowed,{at:t}):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(h.UnexpectedSuper,{at:t}),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(h.UnsupportedSuper,{at:t}),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(z(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(102)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let r=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||r)&&this.raise(h.UnsupportedMetaProperty,{at:t.property,target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){let e=this.createIdentifier(this.startNodeAtNode(t),"import");return this.next(),this.isContextual(100)&&(this.inModule||this.raise(h.ImportMetaOutsideModule,{at:e}),this.sawUnambiguousESM=!0),this.parseMetaProperty(t,e,"meta")}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(s.start,this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.parseLiteral(t.value,"RegExpLiteral");return e.pattern=t.pattern,e.flags=t.flags,e}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(Tl());let r=this.state.maybeInArrowParameters,a=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n=this.state.startLoc,o=[],u=new Re,l=!0,c,p;for(;!this.match(11);){if(l)l=!1;else if(this.expect(12,u.optionalParametersLoc===null?null:u.optionalParametersLoc),this.match(11)){p=this.state.startLoc;break}if(this.match(21)){let m=this.state.startLoc;if(c=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),m)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(u,this.parseParenItem))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=a;let d=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(u),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(d,o,!1),d):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),p&&this.unexpected(p),c&&this.unexpected(c),this.checkExpressionErrors(u,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(n),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,f)):s=o[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(h.UnexpectedNewTarget,{at:s}),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){t.callee=this.parseNoCallExpr(),t.callee.type==="Import"&&this.raise(h.ImportCallNotNewExpression,{at:t.callee})}parseTemplateElement(t){let{start:e,startLoc:s,end:r,value:a}=this.state,n=e+1,o=this.startNodeAt(z(s,1));a===null&&(t||this.raise(h.InvalidEscapeSequenceTemplate,{at:z(this.state.firstInvalidTemplateEscapePos,1)}));let u=this.match(24),l=u?-1:-2,c=r+l;o.value={raw:this.input.slice(n,c).replace(/\r\n?/g,`
|
|
16
|
-
`),cooked:a===null?null:a.slice(1,l)},o.tail=u,this.next();let p=this.finishNode(o,"TemplateElement");return this.resetEndLocation(p,z(this.state.lastTokEndLoc,l)),p}parseTemplate(t){let e=this.startNode();e.expressions=[];let s=this.parseTemplateElement(t);for(e.quasis=[s];!s.tail;)e.expressions.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),e.quasis.push(s=this.parseTemplateElement(t));return this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,r){s&&this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=Object.create(null),o=!0,u=this.startNode();for(u.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(u);break}let c;e?c=this.parseBindingProperty():(c=this.parsePropertyDefinition(r),this.checkProto(c,s,n,r)),s&&!this.isObjectProperty(c)&&c.type!=="SpreadElement"&&this.raise(h.InvalidRecordProperty,{at:c}),c.shorthand&&this.addExtra(c,"shorthand",!0),u.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=a;let l="ObjectExpression";return e?l="ObjectPattern":s&&(l="RecordExpression"),this.finishNode(u,l)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStart),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(h.UnsupportedPropertyDecorator,{at:this.state.startLoc});this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),r=!1,a=!1,n;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let u=this.state.containsEsc,l=this.parsePropertyName(s,t);if(!o&&!u&&this.maybeAsyncOrAccessorProp(s)){let c=l.name;c==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(l),o=this.eat(55),this.parsePropertyName(s)),(c==="get"||c==="set")&&(a=!0,this.resetPreviousNodeTrailingComments(l),s.kind=c,this.match(55)&&(o=!0,this.raise(h.AccessorIsGenerator,{at:this.state.curPosition(),kind:c}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,n,o,r,!1,a,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),r=this.getObjectOrClassMethodParams(t);r.length!==s&&this.raise(t.kind==="get"?h.BadGetterArity:h.BadSetterArity,{at:t}),t.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(h.BadSetterRestParameter,{at:t})}parseObjectMethod(t,e,s,r,a){if(a){let n=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(s||e||this.match(10))return r&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,r){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(r),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,ne(t.key));else if(this.match(29)){let a=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=a):this.raise(h.InvalidCoverInitializedName,{at:a}),t.value=this.parseMaybeDefault(e,ne(t.key))}else t.value=ne(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,r,a,n,o){let u=this.parseObjectMethod(t,s,r,a,n)||this.parseObjectProperty(t,e,a,o);return u||this.unexpected(),u}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:r}=this.state,a;if(X(s))a=this.parseIdentifier(!0);else switch(s){case 132:a=this.parseNumericLiteral(r);break;case 131:a=this.parseStringLiteral(r);break;case 133:a=this.parseBigIntLiteral(r);break;case 134:a=this.parseDecimalLiteral(r);break;case 136:{let n=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=n):this.raise(h.UnexpectedPrivateField,{at:n}),a=this.parsePrivateName();break}default:this.unexpected()}t.key=a,s!==136&&(t.computed=!1)}return t.key}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,r,a,n,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(18|(o?64:0)|(a?32:0)),this.prodParam.enter(qt(s,t.generator)),this.parseFunctionParams(t,r);let u=this.parseFunctionBodyAndFinish(t,n,!0);return this.prodParam.exit(),this.scope.exit(),u}parseArrayLike(t,e,s,r){s&&this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=this.startNode();return this.next(),n.elements=this.parseExprList(t,!s,r,n),this.state.inFSharpPipelineDirectBody=a,this.finishNode(n,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,r){this.scope.enter(6);let a=qt(s,!1);!this.match(5)&&this.prodParam.hasIn&&(a|=Le),this.prodParam.enter(a),this.initFunction(t,s);let n=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let r=e&&!this.match(5);if(this.expressionScope.enter(Da()),r)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let a=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|Fa),t.body=this.parseBlock(!0,!1,o=>{let u=!this.isSimpleParamList(t.params);o&&u&&this.raise(h.IllegalLanguageModeDirective,{at:(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t});let l=!a&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!u,e,l),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,l)}),this.prodParam.exit(),this.state.labels=n}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e<s;e++)if(!this.isSimpleParameter(t[e]))return!1;return!0}checkParams(t,e,s,r=!0){let a=!e&&new Set,n={type:"FormalParameters"};for(let o of t.params)this.checkLVal(o,{in:n,binding:5,checkClashes:a,strictModeChanged:r})}parseExprList(t,e,s,r){let a=[],n=!0;for(;!this.eat(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}a.push(this.parseExprListItem(e,s))}return a}parseExprListItem(t,e,s){let r;if(this.match(12))t||this.raise(h.UnexpectedToken,{at:this.state.curPosition(),unexpected:","}),r=null;else if(this.match(21)){let a=this.state.startLoc;r=this.parseParenItem(this.parseSpread(e),a)}else if(this.match(17)){this.expectPlugin("partialApplication"),s||this.raise(h.UnexpectedArgumentPlaceholder,{at:this.state.startLoc});let a=this.startNode();this.next(),r=this.finishNode(a,"ArgumentPlaceholder")}else r=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return r}parseIdentifier(t){let e=this.startNode(),s=this.parseIdentifierName(t);return this.createIdentifier(e,s)}createIdentifier(t,e){return t.name=e,t.loc.identifierName=e,this.finishNode(t,"Identifier")}parseIdentifierName(t){let e,{startLoc:s,type:r}=this.state;X(r)?e=this.state.value:this.unexpected();let a=Ku(r);return t?a&&this.replaceToken(130):this.checkReservedWord(e,s,a,!1),this.next(),e}checkReservedWord(t,e,s,r){if(t.length>10||!pl(t))return;if(s&&ll(t)){this.raise(h.UnexpectedKeyword,{at:e,keyword:t});return}if((this.state.strict?r?Na:Ia:Ea)(t,this.inModule)){this.raise(h.UnexpectedReservedWord,{at:e,reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(h.YieldBindingIdentifier,{at:e});return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(h.AwaitBindingIdentifier,{at:e});return}if(this.scope.inStaticBlock){this.raise(h.AwaitBindingIdentifierInStaticBlock,{at:e});return}this.expressionScope.recordAsyncArrowParametersError({at:e})}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(h.ArgumentsInClass,{at:e});return}}isAwaitAllowed(){return!!(this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction)}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(h.AwaitExpressionFormalParameter,{at:e}),this.eat(55)&&this.raise(h.ObsoleteAwaitStar,{at:e}),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||zt(t)||t===101&&!this.state.containsEsc||t===135||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){let t=this.startNode();this.expressionScope.recordParameterInitializerError(h.YieldInParameter,{at:t}),this.next();let e=!1,s=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 137:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:s=this.parseMaybeAssign()}return t.delegate=e,t.argument=s,this.finishNode(t,"YieldExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(h.PipelineHeadSequenceExpression,{at:e})}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(h.PipelineBodyNoArrow,{at:this.state.startLoc});this.topicReferenceWasUsedInCurrentContext()||this.raise(h.PipelineTopicUnused,{at:t})}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(Le&~e){this.prodParam.enter(e|Le);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(Le&e){this.prodParam.enter(e&~Le);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}},Es={kind:"loop"},Gl={kind:"switch"},Xl=/[\uD800-\uDFFF]/u,Is=/in(?:stanceof)?/y;function Jl(i,t){for(let e=0;e<i.length;e++){let s=i[e],{type:r}=s;if(typeof r=="number"){{if(r===136){let{loc:a,start:n,value:o,end:u}=s,l=n+1,c=z(a.start,1);i.splice(e,1,new Q({type:se(27),value:"#",start:n,end:l,startLoc:a.start,endLoc:c}),new Q({type:se(130),value:o,start:l,end:u,startLoc:c,endLoc:a.end})),e++;continue}if(zt(r)){let{loc:a,start:n,value:o,end:u}=s,l=n+1,c=z(a.start,1),p;t.charCodeAt(n)===96?p=new Q({type:se(22),value:"`",start:n,end:l,startLoc:a.start,endLoc:c}):p=new Q({type:se(8),value:"}",start:n,end:l,startLoc:a.start,endLoc:c});let f,d,m,y;r===24?(d=u-1,m=z(a.end,-1),f=o===null?null:o.slice(1,-1),y=new Q({type:se(22),value:"`",start:d,end:u,startLoc:m,endLoc:a.end})):(d=u-2,m=z(a.end,-2),f=o===null?null:o.slice(1,-2),y=new Q({type:se(23),value:"${",start:d,end:u,startLoc:m,endLoc:a.end})),i.splice(e,1,p,new Q({type:se(20),value:f,start:l,end:d,startLoc:c,endLoc:m}),y),e+=2;continue}}s.type=se(r)}}return i}var Xs=class extends Gs{parseTopLevel(t,e){return t.program=this.parseProgram(e),t.comments=this.state.comments,this.options.tokens&&(t.tokens=Jl(this.tokens,this.input)),this.finishNode(t,"File")}parseProgram(t,e=137,s=this.options.sourceType){if(t.sourceType=s,t.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(t,!0,!0,e),this.inModule&&!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[a,n]of Array.from(this.scope.undefinedExports))this.raise(h.ModuleExportUndefined,{at:n,localName:a});let r;return e===137?r=this.finishNode(t,"Program"):r=this.finishNodeAt(t,"Program",z(this.state.startLoc,-1)),r}stmtToDirective(t){let e=t;e.type="Directive",e.value=e.expression,delete e.expression;let s=e.value,r=s.value,a=this.input.slice(s.start,s.end),n=s.value=a.slice(1,-1);return this.addExtra(s,"raw",a),this.addExtra(s,"rawValue",n),this.addExtra(s,"expressionValue",r),s.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(99)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(ie(t)){if(Is.lastIndex=e,Is.test(this.input)){let s=this.codePointAtPos(Is.lastIndex);if(!Be(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifier(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){let{type:t,containsEsc:e}=this.lookahead();if(t===101&&!e)return!1;if(k(t)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,r=this.startNode(),a=!!(t&2),n=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(r,!0);case 63:return this.parseBreakContinueStatement(r,!1);case 64:return this.parseDebuggerStatement(r);case 90:return this.parseDoWhileStatement(r);case 91:return this.parseForStatement(r);case 68:if(this.lookaheadCharCode()===46)break;return n||this.raise(this.state.strict?h.StrictFunction:this.options.annexB?h.SloppyFunctionAnnexB:h.SloppyFunction,{at:this.state.startLoc}),this.parseFunctionStatement(r,!1,!a&&n);case 80:return a||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,r),!0);case 69:return this.parseIfStatement(r);case 70:return this.parseReturnStatement(r);case 71:return this.parseSwitchStatement(r);case 72:return this.parseThrowStatement(r);case 73:return this.parseTryStatement(r);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.isAwaitAllowed()?a||this.raise(h.UnexpectedLexicalDeclaration,{at:r}):this.raise(h.AwaitUsingNotInAsyncContext,{at:r}),this.next(),this.parseVarStatement(r,"await using");break;case 105:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifier())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(h.UnexpectedUsingDeclaration,{at:this.state.startLoc}):a||this.raise(h.UnexpectedLexicalDeclaration,{at:this.state.startLoc}),this.parseVarStatement(r,"using");case 99:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),p=this.codePointAtPos(c);if(p!==91&&(!a&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(p,c)&&p!==123))break}case 75:a||this.raise(h.UnexpectedLexicalDeclaration,{at:this.state.startLoc});case 74:{let c=this.state.value;return this.parseVarStatement(r,c)}case 92:return this.parseWhileStatement(r);case 76:return this.parseWithStatement(r);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(r);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(h.UnexpectedImportExport,{at:this.state.startLoc}),this.next();let c;return s===83?(c=this.parseImport(r),c.type==="ImportDeclaration"&&(!c.importKind||c.importKind==="value")&&(this.sawUnambiguousESM=!0)):(c=this.parseExport(r,e),(c.type==="ExportNamedDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportAllDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction())return a||this.raise(h.AsyncFunctionInSingleStatementContext,{at:this.state.startLoc}),this.next(),this.parseFunctionStatement(r,!0,!a&&n)}let u=this.state.value,l=this.parseExpression();return k(s)&&l.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,u,l,t):this.parseExpressionStatement(r,l,e)}assertModuleNodeAllowed(t){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(h.ImportOutsideModule,{at:t})}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){return t&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(h.DecoratorsBeforeAfterExport,{at:e.decorators[0]}),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(h.DecoratorExportClass,{at:this.state.startLoc});else if(!this.canHaveLeadingDecorator())throw this.raise(h.UnexpectedLeadingDecorator,{at:this.state.startLoc});return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(10)){let r=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(r,s);let a=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(h.DecoratorArgumentsOutsideParentheses,{at:a})}else{for(s=this.parseIdentifier(!1);this.eat(16);){let r=this.startNodeAt(e);r.object=s,this.match(136)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,s=this.finishNode(r,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t){if(this.eat(10)){let e=this.startNodeAtNode(t);return e.callee=t,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;s<this.state.labels.length;++s){let r=this.state.labels[s];if((t.label==null||r.name===t.label.name)&&(r.kind!=null&&(e||r.kind==="loop")||t.label&&e))break}if(s===this.state.labels.length){let r=e?"BreakStatement":"ContinueStatement";this.raise(h.IllegalBreakContinue,{at:t,type:r})}}parseDebuggerStatement(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let t=this.parseExpression();return this.expect(11),t}parseDoWhileStatement(t){return this.next(),this.state.labels.push(Es),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(Es);let e=null;if(this.isAwaitAllowed()&&this.eatContextual(96)&&(e=this.state.lastTokStartLoc),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(99);{let u=this.isContextual(96)&&this.startsAwaitUsing(),l=u||this.isContextual(105)&&this.startsUsingForOf(),c=s&&this.hasFollowingBindingAtom()||l;if(this.match(74)||this.match(75)||c){let p=this.startNode(),f;u?(f="await using",this.isAwaitAllowed()||this.raise(h.AwaitUsingNotInAsyncContext,{at:this.state.startLoc}),this.next()):f=this.state.value,this.next(),this.parseVar(p,!0,f);let d=this.finishNode(p,"VariableDeclaration"),m=this.match(58);return m&&l&&this.raise(h.ForInUsing,{at:d}),(m||this.isContextual(101))&&d.declarations.length===1?this.parseForIn(t,d,e):(e!==null&&this.unexpected(e),this.parseFor(t,d))}}let r=this.isContextual(95),a=new Re,n=this.parseExpression(!0,a),o=this.isContextual(101);if(o&&(s&&this.raise(h.ForOfLet,{at:n}),e===null&&r&&n.type==="Identifier"&&this.raise(h.ForOfAsync,{at:n})),o||this.match(58)){this.checkDestructuringPrivate(a),this.toAssignable(n,!0);let u=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{in:{type:u}}),this.parseForIn(t,n,e)}else this.checkExpressionErrors(a,!0);return e!==null&&this.unexpected(e),this.parseFor(t,n)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(h.IllegalReturn,{at:this.state.startLoc}),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(Gl),this.scope.enter(0);let s;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let a=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),a?s.test=this.parseExpression():(r&&this.raise(h.MultipleDefaultsInSwitch,{at:this.state.lastTokStartLoc}),r=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(h.NewlineAfterThrow,{at:this.state.lastTokEndLoc}),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{in:{type:"CatchClause"},binding:9}),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(h.NoCatchOrFinally,{at:t}),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(Es),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(h.StrictWith,{at:this.state.startLoc}),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,r){for(let n of this.state.labels)n.name===e&&this.raise(h.LabelRedeclaration,{at:s,labelName:e});let a=Ju(this.state.type)?"loop":this.match(71)?"switch":null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===t.start)o.statementStart=this.state.start,o.kind=a;else break}return this.state.labels.push({name:e,kind:a,statementStart:this.state.start}),t.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let r=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,t,!1,8,s),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,r,a){let n=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(n,e?o:void 0,s,r,a)}parseBlockOrModuleBlockBody(t,e,s,r,a){let n=this.state.strict,o=!1,u=!1;for(;!this.match(r);){let l=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!u){if(this.isValidDirective(l)){let c=this.stmtToDirective(l);e.push(c),!o&&c.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}u=!0,this.state.strictErrors.clear()}t.push(l)}a==null||a.call(this,o),n||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let r=this.match(58);return this.next(),r?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(h.ForInOfLoopInitializer,{at:e,type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(h.InvalidLhs,{at:e,ancestor:{type:"ForStatement"}}),t.left=e,t.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,r?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,r=!1){let a=t.declarations=[];for(t.kind=s;;){let n=this.startNode();if(this.parseVarId(n,s),n.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,n.init===null&&!r&&(n.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(101)))?this.raise(h.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"destructuring"}):s==="const"&&!(this.match(58)||this.isContextual(101))&&this.raise(h.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"const"})),a.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();this.checkLVal(s,{in:{type:"VariableDeclarator"},binding:e==="var"?5:8201}),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,r=!!(e&1),a=r&&!(e&4),n=!!(e&8);this.initFunction(t,n),this.match(55)&&(s&&this.raise(h.GeneratorInSingleStatementContext,{at:this.state.startLoc}),this.next(),t.generator=!0),r&&(t.id=this.parseFunctionId(a));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(qt(n,t.generator)),r||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||k(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(vl()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,r),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}isNonstaticConstructor(t){return!t.computed&&!t.static&&(t.key.name==="constructor"||t.key.value==="constructor")}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},r=[],a=this.startNode();if(a.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(r.length>0)throw this.raise(h.DecoratorSemicolon,{at:this.state.lastTokEndLoc});continue}if(this.match(26)){r.push(this.parseDecorator());continue}let n=this.startNode();r.length&&(n.decorators=r,this.resetStartLocationFromNode(n,r[0]),r=[]),this.parseClassMember(a,n,s),n.kind==="constructor"&&n.decorators&&n.decorators.length>0&&this.raise(h.DecoratorConstructor,{at:n})}}),this.state.strict=e,this.next(),r.length)throw this.raise(h.TrailingDecorator,{at:this.state.startLoc});return this.classScope.exit(),this.finishNode(a,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let r=e;return r.kind="method",r.computed=!1,r.key=s,r.static=!1,this.pushClassMethod(t,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=s,r.static=!1,t.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let r=this.isContextual(104);if(r){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,r)}parseClassMemberWithIsStatic(t,e,s,r){let a=e,n=e,o=e,u=e,l=e,c=a,p=a;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){c.kind="method";let v=this.match(136);if(this.parseClassElementName(c),v){this.pushClassPrivateMethod(t,n,!0,!1);return}this.isNonstaticConstructor(a)&&this.raise(h.ConstructorIsGenerator,{at:a.key}),this.pushClassMethod(t,a,!0,!1,!1,!1);return}let f=k(this.state.type)&&!this.state.containsEsc,d=this.match(136),m=this.parseClassElementName(e),y=this.state.startLoc;if(this.parsePostMemberNameModifiers(p),this.isClassMethod()){if(c.kind="method",d){this.pushClassPrivateMethod(t,n,!1,!1);return}let v=this.isNonstaticConstructor(a),A=!1;v&&(a.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(h.DuplicateConstructor,{at:m}),v&&this.hasPlugin("typescript")&&e.override&&this.raise(h.OverrideOnConstructor,{at:m}),s.hadConstructor=!0,A=s.hadSuperClass),this.pushClassMethod(t,a,!1,!1,v,A)}else if(this.isClassProperty())d?this.pushClassPrivateProperty(t,u):this.pushClassProperty(t,o);else if(f&&m.name==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(m);let v=this.eat(55);p.optional&&this.unexpected(y),c.kind="method";let A=this.match(136);this.parseClassElementName(c),this.parsePostMemberNameModifiers(p),A?this.pushClassPrivateMethod(t,n,v,!0):(this.isNonstaticConstructor(a)&&this.raise(h.ConstructorIsAsync,{at:a.key}),this.pushClassMethod(t,a,v,!0,!1,!1))}else if(f&&(m.name==="get"||m.name==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(m),c.kind=m.name;let v=this.match(136);this.parseClassElementName(a),v?this.pushClassPrivateMethod(t,n,!1,!1):(this.isNonstaticConstructor(a)&&this.raise(h.ConstructorIsAccessor,{at:a.key}),this.pushClassMethod(t,a,!1,!1,!1,!1)),this.checkGetterSetterParams(a)}else if(f&&m.name==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(m);let v=this.match(136);this.parseClassElementName(o),this.pushClassAccessorProperty(t,l,v)}else this.isLineTerminator()?d?this.pushClassPrivateProperty(t,u):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===130||e===131)&&t.static&&s==="prototype"&&this.raise(h.StaticPrototype,{at:this.state.startLoc}),e===136){s==="constructor"&&this.raise(h.ConstructorClassPrivateField,{at:this.state.startLoc});let r=this.parsePrivateName();return t.key=r,r}return this.parsePropertyName(t)}parseClassStaticBlock(t,e){var s;this.scope.enter(208);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(Fe);let a=e.body=[];this.parseBlockOrModuleBlockBody(a,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(h.DecoratorStaticBlock,{at:e})}pushClassProperty(t,e){!e.computed&&(e.key.name==="constructor"||e.key.value==="constructor")&&this.raise(h.ConstructorClassField,{at:e.key}),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){if(!s&&!e.computed){let a=e.key;(a.name==="constructor"||a.value==="constructor")&&this.raise(h.ConstructorClassField,{at:a})}let r=this.parseClassAccessorProperty(e);t.body.push(r),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(t,e,s,r,a,n){t.body.push(this.parseMethod(e,s,r,a,n,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,r){let a=this.parseMethod(e,s,r,!1,!1,"ClassPrivateMethod",!0);t.body.push(a);let n=a.kind==="get"?a.static?6:2:a.kind==="set"?a.static?5:1:0;this.declareClassPrivateMethodInScope(a,n)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(80),this.expressionScope.enter(Da()),this.prodParam.enter(Fe),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,r=8331){if(k(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,r);else if(s||!e)t.id=null;else throw this.raise(h.MissingClassName,{at:this.state.startLoc})}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),r=this.maybeParseExportDefaultSpecifier(t,s),a=!r||this.eat(12),n=a&&this.eatExportStar(t),o=n&&this.maybeParseExportNamespaceSpecifier(t),u=a&&(!o||this.eat(12)),l=r||n;if(n&&!o){if(r&&this.unexpected(),e)throw this.raise(h.UnsupportedDecoratorExport,{at:t});return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(t);r&&a&&!n&&!c&&this.unexpected(null,5),o&&u&&this.unexpected(null,97);let p;if(l||c){if(p=!1,e)throw this.raise(h.UnsupportedDecoratorExport,{at:t});this.parseExportFrom(t,l)}else p=this.maybeParseExportDeclaration(t);if(l||c||p){var f;let d=t;if(this.checkExport(d,!0,!1,!!d.source),((f=d.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(h.UnsupportedDecoratorExport,{at:t});return this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=t,m=this.parseExportDefaultExpression();if(d.declaration=m,m.type==="ClassDeclaration")this.maybeTakeDecorators(e,m,d);else if(e)throw this.raise(h.UnsupportedDecoratorExport,{at:t});return this.checkExport(d,!0,!0),this.finishNode(d,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);let s=e||this.parseIdentifier(!0),r=this.startNodeAtNode(s);return r.exported=s,t.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){t.specifiers||(t.specifiers=[]);let e=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),e.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(e,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){t.specifiers||(t.specifiers=[]);let e=t.exportKind==="type";return t.specifiers.push(...this.parseExportSpecifiers(e)),t.source=null,t.declaration=null,this.hasPlugin("importAssertions")&&(t.assertions=[]),!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")&&(t.assertions=[]),t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(h.DecoratorBeforeExport,{at:this.state.startLoc}),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(h.UnsupportedDefaultExport,{at:this.state.startLoc});let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(k(t)){if(t===95&&!this.state.containsEsc||t===99)return!1;if((t===128||t===127)&&!this.state.containsEsc){let{type:r}=this.lookahead();if(k(r)&&r!==97||r===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||k(this.state.type)&&s)return!0;if(this.match(65)&&s){let r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(t,e){this.eatContextual(97)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(h.DecoratorBeforeExport,{at:this.state.startLoc}),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,r){if(e){var a;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var n;let o=t.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((n=o.extra)!=null&&n.parenthesized)&&this.raise(h.ExportDefaultFromAsIdentifier,{at:o})}}else if((a=t.specifiers)!=null&&a.length)for(let o of t.specifiers){let{exported:u}=o,l=u.type==="Identifier"?u.name:u.value;if(this.checkDuplicateExports(o,l),!r&&o.local){let{local:c}=o;c.type!=="Identifier"?this.raise(h.ExportBindingIsString,{at:o,localName:c.value,exportName:l}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(t.declaration){if(t.declaration.type==="FunctionDeclaration"||t.declaration.type==="ClassDeclaration"){let o=t.declaration.id;if(!o)throw new Error("Assertion failure");this.checkDuplicateExports(t,o.name)}else if(t.declaration.type==="VariableDeclaration")for(let o of t.declaration.declarations)this.checkDeclaration(o.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(h.DuplicateDefaultExport,{at:t}):this.raise(h.DuplicateExport,{at:t,exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let r=this.isContextual(128),a=this.match(131),n=this.startNode();n.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(n,a,t,r))}return e}parseExportSpecifier(t,e,s,r){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=Sl(t.local):t.exported||(t.exported=ne(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(131)){let t=this.parseStringLiteral(this.state.value),e=t.value.match(Xl);return e&&this.raise(h.ModuleExportNameHasLoneSurrogate,{at:t,surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){if(t.module){var e;(t.specifiers.length!==1||t.specifiers[0].type!=="ImportDefaultSpecifier")&&this.raise(h.ImportReflectionNotBinding,{at:t.specifiers[0].loc.start}),((e=t.assertions)==null?void 0:e.length)>0&&this.raise(h.ImportReflectionHasAssertion,{at:t.specifiers[0].loc.start})}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(r=>{let a;if(r.type==="ExportSpecifier"?a=r.local:r.type==="ImportSpecifier"&&(a=r.imported),a!==void 0)return a.type==="Identifier"?a.name!=="default":a.value!=="default"});s!==void 0&&this.raise(h.ImportJSONBindingNotDefault,{at:s.loc.start})}}}isPotentialImportPhase(t){return!t&&this.isContextual(125)}applyImportPhase(t,e,s,r){e||(s==="module"?(this.expectPlugin("importReflection",r),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.parseIdentifier(!0),{type:r}=this.state;return(X(r)?r!==97||this.lookaheadCharCode()===102:r!==12)?(this.resetPreviousIdentifierLeadingComments(s),this.applyImportPhase(t,e,s.name,s.loc.start),null):(this.applyImportPhase(t,e,null),s)}isPrecedingIdImportPhase(t){let{type:e}=this.state;return k(e)?e!==97||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(131)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let r=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),a=r&&this.maybeParseStarImportSpecifier(t);return r&&!a&&this.parseNamedImportSpecifiers(t),this.expectContextual(97),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(131)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{in:{type:e},binding:s}),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(h.ModuleAttributesWithDuplicateKeys,{at:this.state.startLoc,key:r}),e.add(r),this.match(131)?s.key=this.parseStringLiteral(r):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(131))throw this.raise(h.ModuleAttributeInvalidValue,{at:this.state.startLoc});s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(h.ModuleAttributeDifferentFromType,{at:s.key}),e.has(s.key.name)&&this.raise(h.ModuleAttributesWithDuplicateKeys,{at:s.key,key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(131))throw this.raise(h.ModuleAttributeInvalidValue,{at:this.state.startLoc});s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e,s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.expectImportAttributesPlugin(),e=this.parseImportAttributes()),s=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(h.ImportAttributesUseAssert,{at:this.state.startLoc}),this.addExtra(t,"deprecatedAssertSyntax",!0)):this.expectOnePlugin(["importAttributes","importAssertions"]),this.next(),e=this.parseImportAttributes();else if(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))e=[];else if(this.hasPlugin("moduleAttributes"))e=[];else return;!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(X(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(h.DestructureNamedImport,{at:this.state.startLoc});if(this.expect(12),this.eat(8))break}let s=this.startNode(),r=this.match(131),a=this.isContextual(128);s.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(s,r,t.importKind==="type"||t.importKind==="typeof",a,void 0);t.specifiers.push(n)}}parseImportSpecifier(t,e,s,r,a){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:n}=t;if(e)throw this.raise(h.ImportBindingIsString,{at:t,importName:n.value});this.checkReservedWord(n.name,t.loc.start,!0,!0),t.local||(t.local=ne(n))}return this.finishImportSpecifier(t,"ImportSpecifier",a)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},Kt=class extends Xs{constructor(t,e){t=Kl(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=Yl(this.options.plugins),this.filename=t.sourceFilename}getScopeHandler(){return ut}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t}};function Yl(i){let t=new Map;for(let e of i){let[s,r]=Array.isArray(e)?e:[e,{}];t.has(s)||t.set(s,r||{})}return t}function Ql(i,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let s=it(t,i),r=s.parse();if(s.sawUnambiguousESM)return r;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",it(t,i).parse()}catch{}else r.program.sourceType="script";return r}catch(s){try{return t.sourceType="script",it(t,i).parse()}catch{}throw s}}else return it(t,i).parse()}function Zl(i,t){let e=it(t,i);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function ec(i){let t={};for(let e of Object.keys(i))t[e]=se(i[e]);return t}var tc=ec(Hu);function it(i,t){let e=Kt;return i!=null&&i.plugins&&(zl(i.plugins),e=sc(i.plugins)),new e(i,t)}var wa={};function sc(i){let t=Hl.filter(r=>D(i,r)),e=t.join("/"),s=wa[e];if(!s){s=Kt;for(let r of t)s=$a[r](s);wa[e]=s}return s}ct.parse=Ql;ct.parseExpression=Zl;ct.tokTypes=tc});var Ha=S((fp,za)=>{"use strict";var{Duplex:rc}=require("stream");function Wa(i){i.emit("close")}function ic(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Va(i){this.removeListener("error",Va),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function ac(i,t){let e=!0,s=new rc({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(a,n){let o=!n&&s._readableState.objectMode?a.toString():a;s.push(o)||i.pause()}),i.once("error",function(a){s.destroyed||(e=!1,s.destroy(a))}),i.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(r,a){if(i.readyState===i.CLOSED){a(r),process.nextTick(Wa,s);return}let n=!1;i.once("error",function(u){n=!0,a(u)}),i.once("close",function(){n||a(r),process.nextTick(Wa,s)}),e&&i.terminate()},s._final=function(r){if(i.readyState===i.CONNECTING){i.once("open",function(){s._final(r)});return}i._socket!==null&&(i._socket._writableState.finished?(r(),s._readableState.endEmitted&&s.destroy()):(i._socket.once("finish",function(){r()}),i.close()))},s._read=function(){i.isPaused&&i.resume()},s._write=function(r,a,n){if(i.readyState===i.CONNECTING){i.once("open",function(){s._write(r,a,n)});return}i.send(r,n)},s.on("end",ic),s.on("error",Va),s}za.exports=ac});var fe=S((dp,Ka)=>{"use strict";Ka.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ht=S((mp,Xt)=>{"use strict";var{EMPTY_BUFFER:nc}=fe(),nr=Buffer[Symbol.species];function oc(i,t){if(i.length===0)return nc;if(i.length===1)return i[0];let e=Buffer.allocUnsafe(t),s=0;for(let r=0;r<i.length;r++){let a=i[r];e.set(a,s),s+=a.length}return s<t?new nr(e.buffer,e.byteOffset,s):e}function Ga(i,t,e,s,r){for(let a=0;a<r;a++)e[s+a]=i[a]^t[a&3]}function Xa(i,t){for(let e=0;e<i.length;e++)i[e]^=t[e&3]}function uc(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function or(i){if(or.readOnly=!0,Buffer.isBuffer(i))return i;let t;return i instanceof ArrayBuffer?t=new nr(i):ArrayBuffer.isView(i)?t=new nr(i.buffer,i.byteOffset,i.byteLength):(t=Buffer.from(i),or.readOnly=!1),t}Xt.exports={concat:oc,mask:Ga,toArrayBuffer:uc,toBuffer:or,unmask:Xa};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=require("bufferutil");Xt.exports.mask=function(t,e,s,r,a){a<48?Ga(t,e,s,r,a):i.mask(t,e,s,r,a)},Xt.exports.unmask=function(t,e){t.length<32?Xa(t,e):i.unmask(t,e)}}catch{}});var Qa=S((yp,Ya)=>{"use strict";var Ja=Symbol("kDone"),ur=Symbol("kRun"),lr=class{constructor(t){this[Ja]=()=>{this.pending--,this[ur]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[ur]()}[ur](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Ja])}}};Ya.exports=lr});var dt=S((xp,sn)=>{"use strict";var pt=require("zlib"),Za=ht(),lc=Qa(),{kStatusCode:en}=fe(),cc=Buffer[Symbol.species],hc=Buffer.from([0,0,255,255]),Qt=Symbol("permessage-deflate"),oe=Symbol("total-length"),ft=Symbol("callback"),de=Symbol("buffers"),Yt=Symbol("error"),Jt,cr=class{constructor(t,e,s){if(this._maxPayload=s|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!e,this._deflate=null,this._inflate=null,this.params=null,!Jt){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Jt=new lc(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[ft];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let e=this._options,s=t.find(r=>!(e.serverNoContextTakeover===!1&&r.server_no_context_takeover||r.server_max_window_bits&&(e.serverMaxWindowBits===!1||typeof e.serverMaxWindowBits=="number"&&e.serverMaxWindowBits>r.server_max_window_bits)||typeof e.clientMaxWindowBits=="number"&&!r.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return e.serverNoContextTakeover&&(s.server_no_context_takeover=!0),e.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof e.serverMaxWindowBits=="number"&&(s.server_max_window_bits=e.serverMaxWindowBits),typeof e.clientMaxWindowBits=="number"?s.client_max_window_bits=e.clientMaxWindowBits:(s.client_max_window_bits===!0||e.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(t){let e=t[0];if(this._options.clientNoContextTakeover===!1&&e.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!e.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(e.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&e.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return e}normalizeParams(t){return t.forEach(e=>{Object.keys(e).forEach(s=>{let r=e[s];if(r.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(r=r[0],s==="client_max_window_bits"){if(r!==!0){let a=+r;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${s}": ${r}`);r=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${r}`)}else if(s==="server_max_window_bits"){let a=+r;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${s}": ${r}`);r=a}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(r!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${r}`)}else throw new Error(`Unknown parameter "${s}"`);e[s]=r})}),t}decompress(t,e,s){Jt.add(r=>{this._decompress(t,e,(a,n)=>{r(),s(a,n)})})}compress(t,e,s){Jt.add(r=>{this._compress(t,e,(a,n)=>{r(),s(a,n)})})}_decompress(t,e,s){let r=this._isServer?"client":"server";if(!this._inflate){let a=`${r}_max_window_bits`,n=typeof this.params[a]!="number"?pt.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=pt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:n}),this._inflate[Qt]=this,this._inflate[oe]=0,this._inflate[de]=[],this._inflate.on("error",fc),this._inflate.on("data",tn)}this._inflate[ft]=s,this._inflate.write(t),e&&this._inflate.write(hc),this._inflate.flush(()=>{let a=this._inflate[Yt];if(a){this._inflate.close(),this._inflate=null,s(a);return}let n=Za.concat(this._inflate[de],this._inflate[oe]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[oe]=0,this._inflate[de]=[],e&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),s(null,n)})}_compress(t,e,s){let r=this._isServer?"server":"client";if(!this._deflate){let a=`${r}_max_window_bits`,n=typeof this.params[a]!="number"?pt.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=pt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:n}),this._deflate[oe]=0,this._deflate[de]=[],this._deflate.on("data",pc)}this._deflate[ft]=s,this._deflate.write(t),this._deflate.flush(pt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=Za.concat(this._deflate[de],this._deflate[oe]);e&&(a=new cc(a.buffer,a.byteOffset,a.length-4)),this._deflate[ft]=null,this._deflate[oe]=0,this._deflate[de]=[],e&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),s(null,a)})}};sn.exports=cr;function pc(i){this[de].push(i),this[oe]+=i.length}function tn(i){if(this[oe]+=i.length,this[Qt]._maxPayload<1||this[oe]<=this[Qt]._maxPayload){this[de].push(i);return}this[Yt]=new RangeError("Max payload size exceeded"),this[Yt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Yt][en]=1009,this.removeListener("data",tn),this.reset()}function fc(i){this[Qt]._inflate=null,i[en]=1007,this[ft](i)}});var mt=S((gp,Zt)=>{"use strict";var{isUtf8:rn}=require("buffer"),dc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function mc(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function hr(i){let t=i.length,e=0;for(;e<t;)if(!(i[e]&128))e++;else if((i[e]&224)===192){if(e+1===t||(i[e+1]&192)!==128||(i[e]&254)===192)return!1;e+=2}else if((i[e]&240)===224){if(e+2>=t||(i[e+1]&192)!==128||(i[e+2]&192)!==128||i[e]===224&&(i[e+1]&224)===128||i[e]===237&&(i[e+1]&224)===160)return!1;e+=3}else if((i[e]&248)===240){if(e+3>=t||(i[e+1]&192)!==128||(i[e+2]&192)!==128||(i[e+3]&192)!==128||i[e]===240&&(i[e+1]&240)===128||i[e]===244&&i[e+1]>143||i[e]>244)return!1;e+=4}else return!1;return!0}Zt.exports={isValidStatusCode:mc,isValidUTF8:hr,tokenChars:dc};if(rn)Zt.exports.isValidUTF8=function(i){return i.length<24?hr(i):rn(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=require("utf-8-validate");Zt.exports.isValidUTF8=function(t){return t.length<32?hr(t):i(t)}}catch{}});var yr=S((bp,pn)=>{"use strict";var{Writable:yc}=require("stream"),an=dt(),{BINARY_TYPES:xc,EMPTY_BUFFER:nn,kStatusCode:gc,kWebSocket:bc}=fe(),{concat:pr,toArrayBuffer:Pc,unmask:vc}=ht(),{isValidStatusCode:Tc,isValidUTF8:on}=mt(),es=Buffer[Symbol.species],wc=Promise.resolve(),Ac=typeof queueMicrotask=="function"?queueMicrotask:Sc,qe=0,un=1,ln=2,cn=3,fr=4,hn=5,dr=6,mr=class extends yc{constructor(t={}){super(),this._binaryType=t.binaryType||xc[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[bc]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=qe,this._loop=!1}_write(t,e,s){if(this._opcode===8&&this._state==qe)return s();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(s)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let s=this._buffers[0];return this._buffers[0]=new es(s.buffer,s.byteOffset+t,s.length-t),new es(s.buffer,s.byteOffset,t)}let e=Buffer.allocUnsafe(t);do{let s=this._buffers[0],r=e.length-t;t>=s.length?e.set(this._buffers.shift(),r):(e.set(new Uint8Array(s.buffer,s.byteOffset,t),r),this._buffers[0]=new es(s.buffer,s.byteOffset+t,s.length-t)),t-=s.length}while(t>0);return e}startLoop(t){let e;this._loop=!0;do switch(this._state){case qe:e=this.getInfo();break;case un:e=this.getPayloadLength16();break;case ln:e=this.getPayloadLength64();break;case cn:this.getMask();break;case fr:e=this.getData(t);break;case hn:this._loop=!1;return;default:this._loop=!1,Ac(()=>{this._state=qe,this.startLoop(t)});return}while(this._loop);t(e)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48)return this._loop=!1,F(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let e=(t[0]&64)===64;if(e&&!this._extensions[an.extensionName])return this._loop=!1,F(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(e)return this._loop=!1,F(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,F(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,F(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=e}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,F(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(e)return this._loop=!1,F(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1)return this._loop=!1,F(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,F(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,F(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,F(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=un;else if(this._payloadLength===127)this._state=ln;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),e=t.readUInt32BE(0);return e>Math.pow(2,53-32)-1?(this._loop=!1,F(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=e*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,F(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=cn:this._state=fr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=fr}getData(t){let e=nn;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}e=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&vc(e,this._mask)}if(this._opcode>7)return this.controlMessage(e);if(this._compressed){this._state=hn,this.decompress(e,t);return}return e.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(e)),this.dataMessage()}decompress(t,e){this._extensions[an.extensionName].decompress(t,this._fin,(r,a)=>{if(r)return e(r);if(a.length){if(this._messageLength+=a.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return e(F(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(a)}let n=this.dataMessage();if(n)return e(n);this.startLoop(e)})}dataMessage(){if(this._fin){let t=this._messageLength,e=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let s;this._binaryType==="nodebuffer"?s=pr(e,t):this._binaryType==="arraybuffer"?s=Pc(pr(e,t)):s=e,this.emit("message",s,!0)}else{let s=pr(e,t);if(!this._skipUTF8Validation&&!on(s))return this._loop=!1,F(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",s,!1)}}this._state=dr}controlMessage(t){if(this._opcode===8)if(this._loop=!1,t.length===0)this.emit("conclude",1005,nn),this.end(),this._state=qe;else{let e=t.readUInt16BE(0);if(!Tc(e))return F(RangeError,`invalid status code ${e}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let s=new es(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!on(s))return F(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",e,s),this.end(),this._state=qe}else this._opcode===9?(this.emit("ping",t),this._state=dr):(this.emit("pong",t),this._state=dr)}};pn.exports=mr;function F(i,t,e,s,r){let a=new i(e?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(a,F),a.code=r,a[gc]=s,a}function Sc(i){wc.then(i).catch(Ec)}function Cc(i){throw i}function Ec(i){process.nextTick(Cc,i)}});var gr=S((vp,mn)=>{"use strict";var{Duplex:Pp}=require("stream"),{randomFillSync:Ic}=require("crypto"),fn=dt(),{EMPTY_BUFFER:kc}=fe(),{isValidStatusCode:Nc}=mt(),{mask:dn,toBuffer:We}=ht(),J=Symbol("kByteLength"),_c=Buffer.alloc(4),xr=class i{constructor(t,e,s){this._extensions=e||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,e){let s,r=!1,a=2,n=!1;e.mask&&(s=e.maskBuffer||_c,e.generateMask?e.generateMask(s):Ic(s,0,4),n=(s[0]|s[1]|s[2]|s[3])===0,a=6);let o;typeof t=="string"?(!e.mask||n)&&e[J]!==void 0?o=e[J]:(t=Buffer.from(t),o=t.length):(o=t.length,r=e.mask&&e.readOnly&&!n);let u=o;o>=65536?(a+=8,u=127):o>125&&(a+=2,u=126);let l=Buffer.allocUnsafe(r?o+a:a);return l[0]=e.fin?e.opcode|128:e.opcode,e.rsv1&&(l[0]|=64),l[1]=u,u===126?l.writeUInt16BE(o,2):u===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),e.mask?(l[1]|=128,l[a-4]=s[0],l[a-3]=s[1],l[a-2]=s[2],l[a-1]=s[3],n?[l,t]:r?(dn(t,s,l,a,o),[l]):(dn(t,s,t,0,o),[l,t])):[l,t]}close(t,e,s,r){let a;if(t===void 0)a=kc;else{if(typeof t!="number"||!Nc(t))throw new TypeError("First argument must be a valid error code number");if(e===void 0||!e.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let o=Buffer.byteLength(e);if(o>123)throw new RangeError("The message must not be greater than 123 bytes");a=Buffer.allocUnsafe(2+o),a.writeUInt16BE(t,0),typeof e=="string"?a.write(e,2):a.set(e,2)}}let n={[J]:a.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,a,!1,n,r]):this.sendFrame(i.frame(a,n),r)}ping(t,e,s){let r,a;if(typeof t=="string"?(r=Buffer.byteLength(t),a=!1):(t=We(t),r=t.length,a=We.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let n={[J]:r,fin:!0,generateMask:this._generateMask,mask:e,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,n,s]):this.sendFrame(i.frame(t,n),s)}pong(t,e,s){let r,a;if(typeof t=="string"?(r=Buffer.byteLength(t),a=!1):(t=We(t),r=t.length,a=We.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let n={[J]:r,fin:!0,generateMask:this._generateMask,mask:e,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,n,s]):this.sendFrame(i.frame(t,n),s)}send(t,e,s){let r=this._extensions[fn.extensionName],a=e.binary?2:1,n=e.compress,o,u;if(typeof t=="string"?(o=Buffer.byteLength(t),u=!1):(t=We(t),o=t.length,u=We.readOnly),this._firstFragment?(this._firstFragment=!1,n&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(n=o>=r._threshold),this._compress=n):(n=!1,a=0),e.fin&&(this._firstFragment=!0),r){let l={[J]:o,fin:e.fin,generateMask:this._generateMask,mask:e.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:u,rsv1:n};this._deflating?this.enqueue([this.dispatch,t,this._compress,l,s]):this.dispatch(t,this._compress,l,s)}else this.sendFrame(i.frame(t,{[J]:o,fin:e.fin,generateMask:this._generateMask,mask:e.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:u,rsv1:!1}),s)}dispatch(t,e,s,r){if(!e){this.sendFrame(i.frame(t,s),r);return}let a=this._extensions[fn.extensionName];this._bufferedBytes+=s[J],this._deflating=!0,a.compress(t,s.fin,(n,o)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");typeof r=="function"&&r(u);for(let l=0;l<this._queue.length;l++){let c=this._queue[l],p=c[c.length-1];typeof p=="function"&&p(u)}return}this._bufferedBytes-=s[J],this._deflating=!1,s.readOnly=!1,this.sendFrame(i.frame(o,s),r),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][J],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][J],this._queue.push(t)}sendFrame(t,e){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],e),this._socket.uncork()):this._socket.write(t[0],e)}};mn.exports=xr});var An=S((Tp,wn)=>{"use strict";var{kForOnEventAttribute:yt,kListener:br}=fe(),yn=Symbol("kCode"),xn=Symbol("kData"),gn=Symbol("kError"),bn=Symbol("kMessage"),Pn=Symbol("kReason"),Ve=Symbol("kTarget"),vn=Symbol("kType"),Tn=Symbol("kWasClean"),ue=class{constructor(t){this[Ve]=null,this[vn]=t}get target(){return this[Ve]}get type(){return this[vn]}};Object.defineProperty(ue.prototype,"target",{enumerable:!0});Object.defineProperty(ue.prototype,"type",{enumerable:!0});var we=class extends ue{constructor(t,e={}){super(t),this[yn]=e.code===void 0?0:e.code,this[Pn]=e.reason===void 0?"":e.reason,this[Tn]=e.wasClean===void 0?!1:e.wasClean}get code(){return this[yn]}get reason(){return this[Pn]}get wasClean(){return this[Tn]}};Object.defineProperty(we.prototype,"code",{enumerable:!0});Object.defineProperty(we.prototype,"reason",{enumerable:!0});Object.defineProperty(we.prototype,"wasClean",{enumerable:!0});var ze=class extends ue{constructor(t,e={}){super(t),this[gn]=e.error===void 0?null:e.error,this[bn]=e.message===void 0?"":e.message}get error(){return this[gn]}get message(){return this[bn]}};Object.defineProperty(ze.prototype,"error",{enumerable:!0});Object.defineProperty(ze.prototype,"message",{enumerable:!0});var xt=class extends ue{constructor(t,e={}){super(t),this[xn]=e.data===void 0?null:e.data}get data(){return this[xn]}};Object.defineProperty(xt.prototype,"data",{enumerable:!0});var Mc={addEventListener(i,t,e={}){for(let r of this.listeners(i))if(!e[yt]&&r[br]===t&&!r[yt])return;let s;if(i==="message")s=function(a,n){let o=new xt("message",{data:n?a:a.toString()});o[Ve]=this,ts(t,this,o)};else if(i==="close")s=function(a,n){let o=new we("close",{code:a,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});o[Ve]=this,ts(t,this,o)};else if(i==="error")s=function(a){let n=new ze("error",{error:a,message:a.message});n[Ve]=this,ts(t,this,n)};else if(i==="open")s=function(){let a=new ue("open");a[Ve]=this,ts(t,this,a)};else return;s[yt]=!!e[yt],s[br]=t,e.once?this.once(i,s):this.on(i,s)},removeEventListener(i,t){for(let e of this.listeners(i))if(e[br]===t&&!e[yt]){this.removeListener(i,e);break}}};wn.exports={CloseEvent:we,ErrorEvent:ze,Event:ue,EventTarget:Mc,MessageEvent:xt};function ts(i,t,e){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,e):i.call(t,e)}});var Pr=S((wp,Sn)=>{"use strict";var{tokenChars:gt}=mt();function ee(i,t,e){i[t]===void 0?i[t]=[e]:i[t].push(e)}function Oc(i){let t=Object.create(null),e=Object.create(null),s=!1,r=!1,a=!1,n,o,u=-1,l=-1,c=-1,p=0;for(;p<i.length;p++)if(l=i.charCodeAt(p),n===void 0)if(c===-1&>[l]===1)u===-1&&(u=p);else if(p!==0&&(l===32||l===9))c===-1&&u!==-1&&(c=p);else if(l===59||l===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);c===-1&&(c=p);let d=i.slice(u,c);l===44?(ee(t,d,e),e=Object.create(null)):n=d,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(o===void 0)if(c===-1&>[l]===1)u===-1&&(u=p);else if(l===32||l===9)c===-1&&u!==-1&&(c=p);else if(l===59||l===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);c===-1&&(c=p),ee(e,i.slice(u,c),!0),l===44&&(ee(t,n,e),e=Object.create(null),n=void 0),u=c=-1}else if(l===61&&u!==-1&&c===-1)o=i.slice(u,p),u=c=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(r){if(gt[l]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1?u=p:s||(s=!0),r=!1}else if(a)if(gt[l]===1)u===-1&&(u=p);else if(l===34&&u!==-1)a=!1,c=p;else if(l===92)r=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(l===34&&i.charCodeAt(p-1)===61)a=!0;else if(c===-1&>[l]===1)u===-1&&(u=p);else if(u!==-1&&(l===32||l===9))c===-1&&(c=p);else if(l===59||l===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);c===-1&&(c=p);let d=i.slice(u,c);s&&(d=d.replace(/\\/g,""),s=!1),ee(e,o,d),l===44&&(ee(t,n,e),e=Object.create(null),n=void 0),o=void 0,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(u===-1||a||l===32||l===9)throw new SyntaxError("Unexpected end of input");c===-1&&(c=p);let f=i.slice(u,c);return n===void 0?ee(t,f,e):(o===void 0?ee(e,f,!0):s?ee(e,o,f.replace(/\\/g,"")):ee(e,o,f),ee(t,n,e)),t}function Lc(i){return Object.keys(i).map(t=>{let e=i[t];return Array.isArray(e)||(e=[e]),e.map(s=>[t].concat(Object.keys(s).map(r=>{let a=s[r];return Array.isArray(a)||(a=[a]),a.map(n=>n===!0?r:`${r}=${n}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Sn.exports={format:Lc,parse:Oc}});var Sr=S((Cp,Bn)=>{"use strict";var Dc=require("events"),Bc=require("https"),Fc=require("http"),In=require("net"),Rc=require("tls"),{randomBytes:Uc,createHash:jc}=require("crypto"),{Duplex:Ap,Readable:Sp}=require("stream"),{URL:vr}=require("url"),me=dt(),$c=yr(),qc=gr(),{BINARY_TYPES:Cn,EMPTY_BUFFER:ss,GUID:Wc,kForOnEventAttribute:Tr,kListener:Vc,kStatusCode:zc,kWebSocket:j,NOOP:kn}=fe(),{EventTarget:{addEventListener:Hc,removeEventListener:Kc}}=An(),{format:Gc,parse:Xc}=Pr(),{toBuffer:Jc}=ht(),Yc=30*1e3,Nn=Symbol("kAborted"),wr=[8,13],le=["CONNECTING","OPEN","CLOSING","CLOSED"],Qc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,M=class i extends Dc{constructor(t,e,s){super(),this._binaryType=Cn[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ss,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=i.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,e===void 0?e=[]:Array.isArray(e)||(typeof e=="object"&&e!==null?(s=e,e=[]):e=[e]),_n(this,t,e,s)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){Cn.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,e,s){let r=new $c({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation});this._sender=new qc(t,this._extensions,s.generateMask),this._receiver=r,this._socket=t,r[j]=this,t[j]=this,r.on("conclude",th),r.on("drain",sh),r.on("error",rh),r.on("message",ih),r.on("ping",ah),r.on("pong",nh),t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),e.length>0&&t.unshift(e),t.on("close",On),t.on("data",is),t.on("end",Ln),t.on("error",Dn),this._readyState=i.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[me.extensionName]&&this._extensions[me.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,e){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){let s="WebSocket was closed before the connection was established";H(this,this._req,s);return}if(this.readyState===i.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=i.CLOSING,this._sender.close(t,e,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),Yc)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,e,s){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=e=void 0):typeof e=="function"&&(s=e,e=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==i.OPEN){Ar(this,t,s);return}e===void 0&&(e=!this._isServer),this._sender.ping(t||ss,e,s)}pong(t,e,s){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=e=void 0):typeof e=="function"&&(s=e,e=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==i.OPEN){Ar(this,t,s);return}e===void 0&&(e=!this._isServer),this._sender.pong(t||ss,e,s)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,e,s){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"&&(s=e,e={}),typeof t=="number"&&(t=t.toString()),this.readyState!==i.OPEN){Ar(this,t,s);return}let r={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...e};this._extensions[me.extensionName]||(r.compress=!1),this._sender.send(t||ss,r,s)}terminate(){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){let t="WebSocket was closed before the connection was established";H(this,this._req,t);return}this._socket&&(this._readyState=i.CLOSING,this._socket.destroy())}}};Object.defineProperty(M,"CONNECTING",{enumerable:!0,value:le.indexOf("CONNECTING")});Object.defineProperty(M.prototype,"CONNECTING",{enumerable:!0,value:le.indexOf("CONNECTING")});Object.defineProperty(M,"OPEN",{enumerable:!0,value:le.indexOf("OPEN")});Object.defineProperty(M.prototype,"OPEN",{enumerable:!0,value:le.indexOf("OPEN")});Object.defineProperty(M,"CLOSING",{enumerable:!0,value:le.indexOf("CLOSING")});Object.defineProperty(M.prototype,"CLOSING",{enumerable:!0,value:le.indexOf("CLOSING")});Object.defineProperty(M,"CLOSED",{enumerable:!0,value:le.indexOf("CLOSED")});Object.defineProperty(M.prototype,"CLOSED",{enumerable:!0,value:le.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(M.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(M.prototype,`on${i}`,{enumerable:!0,get(){for(let t of this.listeners(i))if(t[Tr])return t[Vc];return null},set(t){for(let e of this.listeners(i))if(e[Tr]){this.removeListener(i,e);break}typeof t=="function"&&this.addEventListener(i,t,{[Tr]:!0})}})});M.prototype.addEventListener=Hc;M.prototype.removeEventListener=Kc;Bn.exports=M;function _n(i,t,e,s){let r={protocolVersion:wr[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(!wr.includes(r.protocolVersion))throw new RangeError(`Unsupported protocol version: ${r.protocolVersion} (supported versions: ${wr.join(", ")})`);let a;if(t instanceof vr)a=t;else try{a=new vr(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}a.protocol==="http:"?a.protocol="ws:":a.protocol==="https:"&&(a.protocol="wss:"),i._url=a.href;let n=a.protocol==="wss:",o=a.protocol==="ws+unix:",u;if(a.protocol!=="ws:"&&!n&&!o?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:o&&!a.pathname?u="The URL's pathname is empty":a.hash&&(u="The URL contains a fragment identifier"),u){let y=new SyntaxError(u);if(i._redirects===0)throw y;rs(i,y);return}let l=n?443:80,c=Uc(16).toString("base64"),p=n?Bc.request:Fc.request,f=new Set,d;if(r.createConnection=n?eh:Zc,r.defaultPort=r.defaultPort||l,r.port=a.port||l,r.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,r.headers={...r.headers,"Sec-WebSocket-Version":r.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket"},r.path=a.pathname+a.search,r.timeout=r.handshakeTimeout,r.perMessageDeflate&&(d=new me(r.perMessageDeflate!==!0?r.perMessageDeflate:{},!1,r.maxPayload),r.headers["Sec-WebSocket-Extensions"]=Gc({[me.extensionName]:d.offer()})),e.length){for(let y of e){if(typeof y!="string"||!Qc.test(y)||f.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(y)}r.headers["Sec-WebSocket-Protocol"]=e.join(",")}if(r.origin&&(r.protocolVersion<13?r.headers["Sec-WebSocket-Origin"]=r.origin:r.headers.Origin=r.origin),(a.username||a.password)&&(r.auth=`${a.username}:${a.password}`),o){let y=r.path.split(":");r.socketPath=y[0],r.path=y[1]}let m;if(r.followRedirects){if(i._redirects===0){i._originalIpc=o,i._originalSecure=n,i._originalHostOrSocketPath=o?r.socketPath:a.host;let y=s&&s.headers;if(s={...s,headers:{}},y)for(let[v,A]of Object.entries(y))s.headers[v.toLowerCase()]=A}else if(i.listenerCount("redirect")===0){let y=o?i._originalIpc?r.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:a.host===i._originalHostOrSocketPath;(!y||i._originalSecure&&!n)&&(delete r.headers.authorization,delete r.headers.cookie,y||delete r.headers.host,r.auth=void 0)}r.auth&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(r.auth).toString("base64")),m=i._req=p(r),i._redirects&&i.emit("redirect",i.url,m)}else m=i._req=p(r);r.timeout&&m.on("timeout",()=>{H(i,m,"Opening handshake has timed out")}),m.on("error",y=>{m===null||m[Nn]||(m=i._req=null,rs(i,y))}),m.on("response",y=>{let v=y.headers.location,A=y.statusCode;if(v&&r.followRedirects&&A>=300&&A<400){if(++i._redirects>r.maxRedirects){H(i,m,"Maximum redirects exceeded");return}m.abort();let _;try{_=new vr(v,t)}catch{let B=new SyntaxError(`Invalid URL: ${v}`);rs(i,B);return}_n(i,_,e,s)}else i.emit("unexpected-response",m,y)||H(i,m,`Unexpected server response: ${y.statusCode}`)}),m.on("upgrade",(y,v,A)=>{if(i.emit("upgrade",y),i.readyState!==M.CONNECTING)return;if(m=i._req=null,y.headers.upgrade.toLowerCase()!=="websocket"){H(i,v,"Invalid Upgrade header");return}let _=jc("sha1").update(c+Wc).digest("base64");if(y.headers["sec-websocket-accept"]!==_){H(i,v,"Invalid Sec-WebSocket-Accept header");return}let $=y.headers["sec-websocket-protocol"],B;if($!==void 0?f.size?f.has($)||(B="Server sent an invalid subprotocol"):B="Server sent a subprotocol but none was requested":f.size&&(B="Server sent no subprotocol"),B){H(i,v,B);return}$&&(i._protocol=$);let vt=y.headers["sec-websocket-extensions"];if(vt!==void 0){if(!d){H(i,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ye;try{ye=Xc(vt)}catch{H(i,v,"Invalid Sec-WebSocket-Extensions header");return}let Tt=Object.keys(ye);if(Tt.length!==1||Tt[0]!==me.extensionName){H(i,v,"Server indicated an extension that was not requested");return}try{d.accept(ye[me.extensionName])}catch{H(i,v,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[me.extensionName]=d}i.setSocket(v,A,{generateMask:r.generateMask,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation})}),r.finishRequest?r.finishRequest(m,i):m.end()}function rs(i,t){i._readyState=M.CLOSING,i.emit("error",t),i.emitClose()}function Zc(i){return i.path=i.socketPath,In.connect(i)}function eh(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=In.isIP(i.host)?"":i.host),Rc.connect(i)}function H(i,t,e){i._readyState=M.CLOSING;let s=new Error(e);Error.captureStackTrace(s,H),t.setHeader?(t[Nn]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(rs,i,s)):(t.destroy(s),t.once("error",i.emit.bind(i,"error")),t.once("close",i.emitClose.bind(i)))}function Ar(i,t,e){if(t){let s=Jc(t).length;i._socket?i._sender._bufferedBytes+=s:i._bufferedAmount+=s}if(e){let s=new Error(`WebSocket is not open: readyState ${i.readyState} (${le[i.readyState]})`);process.nextTick(e,s)}}function th(i,t){let e=this[j];e._closeFrameReceived=!0,e._closeMessage=t,e._closeCode=i,e._socket[j]!==void 0&&(e._socket.removeListener("data",is),process.nextTick(Mn,e._socket),i===1005?e.close():e.close(i,t))}function sh(){let i=this[j];i.isPaused||i._socket.resume()}function rh(i){let t=this[j];t._socket[j]!==void 0&&(t._socket.removeListener("data",is),process.nextTick(Mn,t._socket),t.close(i[zc])),t.emit("error",i)}function En(){this[j].emitClose()}function ih(i,t){this[j].emit("message",i,t)}function ah(i){let t=this[j];t.pong(i,!t._isServer,kn),t.emit("ping",i)}function nh(i){this[j].emit("pong",i)}function Mn(i){i.resume()}function On(){let i=this[j];this.removeListener("close",On),this.removeListener("data",is),this.removeListener("end",Ln),i._readyState=M.CLOSING;let t;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(t=i._socket.read())!==null&&i._receiver.write(t),i._receiver.end(),this[j]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",En),i._receiver.on("finish",En))}function is(i){this[j]._receiver.write(i)||this.pause()}function Ln(){let i=this[j];i._readyState=M.CLOSING,i._receiver.end(),this.end()}function Dn(){let i=this[j];this.removeListener("error",Dn),this.on("error",kn),i&&(i._readyState=M.CLOSING,this.destroy())}});var Rn=S((Ep,Fn)=>{"use strict";var{tokenChars:oh}=mt();function uh(i){let t=new Set,e=-1,s=-1,r=0;for(r;r<i.length;r++){let n=i.charCodeAt(r);if(s===-1&&oh[n]===1)e===-1&&(e=r);else if(r!==0&&(n===32||n===9))s===-1&&e!==-1&&(s=r);else if(n===44){if(e===-1)throw new SyntaxError(`Unexpected character at index ${r}`);s===-1&&(s=r);let o=i.slice(e,s);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);t.add(o),e=s=-1}else throw new SyntaxError(`Unexpected character at index ${r}`)}if(e===-1||s!==-1)throw new SyntaxError("Unexpected end of input");let a=i.slice(e,r);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);return t.add(a),t}Fn.exports={parse:uh}});var zn=S((kp,Vn)=>{"use strict";var lh=require("events"),as=require("http"),{Duplex:Ip}=require("stream"),{createHash:ch}=require("crypto"),Un=Pr(),Ae=dt(),hh=Rn(),ph=Sr(),{GUID:fh,kWebSocket:dh}=fe(),mh=/^[+/0-9A-Za-z]{22}==$/,jn=0,$n=1,Wn=2,Cr=class extends lh{constructor(t,e){if(super(),t={maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:ph,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=as.createServer((s,r)=>{let a=as.STATUS_CODES[426];r.writeHead(426,{"Content-Length":a.length,"Content-Type":"text/plain"}),r.end(a)}),this._server.listen(t.port,t.host,t.backlog,e)):t.server&&(this._server=t.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=yh(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(r,a,n)=>{this.handleUpgrade(r,a,n,s)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=jn}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===Wn){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(bt,this);return}if(t&&this.once("close",t),this._state!==$n)if(this._state=$n,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(bt,this):process.nextTick(bt,this);else{let e=this._server;this._removeListeners(),this._removeListeners=this._server=null,e.close(()=>{bt(this)})}}shouldHandle(t){if(this.options.path){let e=t.url.indexOf("?");if((e!==-1?t.url.slice(0,e):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,e,s,r){e.on("error",qn);let a=t.headers["sec-websocket-key"],n=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Se(this,t,e,405,"Invalid HTTP method");return}if(t.headers.upgrade.toLowerCase()!=="websocket"){Se(this,t,e,400,"Invalid Upgrade header");return}if(!a||!mh.test(a)){Se(this,t,e,400,"Missing or invalid Sec-WebSocket-Key header");return}if(n!==8&&n!==13){Se(this,t,e,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(t)){Pt(e,400);return}let o=t.headers["sec-websocket-protocol"],u=new Set;if(o!==void 0)try{u=hh.parse(o)}catch{Se(this,t,e,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],c={};if(this.options.perMessageDeflate&&l!==void 0){let p=new Ae(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let f=Un.parse(l);f[Ae.extensionName]&&(p.accept(f[Ae.extensionName]),c[Ae.extensionName]=p)}catch{Se(this,t,e,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let p={origin:t.headers[`${n===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(p,(f,d,m,y)=>{if(!f)return Pt(e,d||401,m,y);this.completeUpgrade(c,a,u,t,e,s,r)});return}if(!this.options.verifyClient(p))return Pt(e,401)}this.completeUpgrade(c,a,u,t,e,s,r)}completeUpgrade(t,e,s,r,a,n,o){if(!a.readable||!a.writable)return a.destroy();if(a[dh])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>jn)return Pt(a,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${ch("sha1").update(e+fh).digest("base64")}`],c=new this.options.WebSocket(null);if(s.size){let p=this.options.handleProtocols?this.options.handleProtocols(s,r):s.values().next().value;p&&(l.push(`Sec-WebSocket-Protocol: ${p}`),c._protocol=p)}if(t[Ae.extensionName]){let p=t[Ae.extensionName].params,f=Un.format({[Ae.extensionName]:[p]});l.push(`Sec-WebSocket-Extensions: ${f}`),c._extensions=t}this.emit("headers",l,r),a.write(l.concat(`\r
|
|
17
|
-
`).join(`\r
|
|
18
|
-
`)),a.removeListener("error",qn),c.setSocket(a,n,{maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(c),c.on("close",()=>{this.clients.delete(c),this._shouldEmitClose&&!this.clients.size&&process.nextTick(bt,this)})),o(c,r)}};Vn.exports=Cr;function yh(i,t){for(let e of Object.keys(t))i.on(e,t[e]);return function(){for(let s of Object.keys(t))i.removeListener(s,t[s])}}function bt(i){i._state=Wn,i.emit("close")}function qn(){this.destroy()}function Pt(i,t,e,s){e=e||as.STATUS_CODES[t],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(e),...s},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${t} ${as.STATUS_CODES[t]}\r
|
|
19
|
-
`+Object.keys(s).map(r=>`${r}: ${s[r]}`).join(`\r
|
|
20
|
-
`)+`\r
|
|
21
|
-
\r
|
|
22
|
-
`+e)}function Se(i,t,e,s,r){if(i.listenerCount("wsClientError")){let a=new Error(r);Error.captureStackTrace(a,Se),i.emit("wsClientError",a,e,t)}else Pt(e,s,r)}});var Xn=S((_p,Gn)=>{"use strict";function Ph(i){return i>=55296&&i<=56319}function vh(i){return i>=56320&&i<=57343}Gn.exports=function(t,e,s){if(typeof e!="string")throw new Error("Input must be string");for(var r=e.length,a=0,n,o,u=0;u<r;u+=1){if(n=e.charCodeAt(u),o=e[u],Ph(n)&&vh(e.charCodeAt(u+1))&&(u+=1,o+=e[u]),a+=t(o),a===s)return e.slice(0,u+1);if(a>s)return e.slice(0,u-o.length+1)}return e}});var Yn=S((Mp,Jn)=>{"use strict";var Th=Xn(),wh=Buffer.byteLength.bind(Buffer);Jn.exports=Th.bind(null,wh)});var eo=S((Op,Zn)=>{"use strict";var Ah=Yn(),Sh=/[\/\?<>\\:\*\|"]/g,Ch=/[\x00-\x1f\x80-\x9f]/g,Eh=/^\.+$/,Ih=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,kh=/[\. ]+$/;function Qn(i,t){if(typeof i!="string")throw new Error("Input must be string");var e=i.replace(Sh,t).replace(Ch,t).replace(Eh,t).replace(Ih,t).replace(kh,t);return Ah(e,255)}Zn.exports=function(i,t){var e=t&&t.replacement||"",s=Qn(i,e);return e===""?s:Qn(s,"")}});var Nh={};ho(Nh,{StackUtils:()=>to.default,WebSocket:()=>Kn,WebSocketServer:()=>Er.default,codeFrameColumns:()=>so.codeFrameColumns,parse:()=>ro.parse,sanitize:()=>io.default});module.exports=po(Nh);var to=te(Lr()),so=te(oa()),ro=te(qa());var xh=te(Ha(),1),gh=te(yr(),1),bh=te(gr(),1),Hn=te(Sr(),1),Er=te(zn(),1);var Kn=Hn.default;var io=te(eo());0&&(module.exports={StackUtils,WebSocket,WebSocketServer,codeFrameColumns,parse,sanitize});
|