@zeus-js/compiler 0.1.0 → 0.1.1-beta.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/dist/compiler.cjs +246 -28
- package/dist/compiler.d.ts +4 -1
- package/dist/compiler.esm-browser.js +255 -38
- package/dist/compiler.esm-browser.prod.js +6 -6
- package/dist/compiler.esm-bundler.js +246 -28
- package/dist/compiler.global.js +255 -38
- package/dist/compiler.global.prod.js +3 -3
- package/dist/compiler.prod.cjs +246 -28
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const o={assertVersion:e=>t=>{l(t,e.version)}};function s(e){return(t,n,r)=>{var i;let a;for(let e of Object.keys(o))t[e]||(a!=null||(a=c(t)),a[e]=o[e](a));return e((i=a)==null?t:i,n||{},r)}}function c(e){let t=null;return typeof e.version==`string`&&e.version.startsWith(`7.`)&&(t=Object.getPrototypeOf(e),t&&(!Object.hasOwn(t,`version`)||!Object.hasOwn(t,`transform`)||!Object.hasOwn(t,`template`)||!Object.hasOwn(t,`types`))&&(t=null)),a(a({},t),e)}function l(e,t){if(typeof e==`number`){if(!Number.isInteger(e))throw Error(`Expected string or integer value.`);e=`^${e}.0.0-0`}if(typeof e!=`string`)throw Error(`Expected string or integer value.`);let n=Error.stackTraceLimit;typeof n==`number`&&n<25&&(Error.stackTraceLimit=25);let r;throw r=t.startsWith(`7.`)?Error(`Requires Babel "^7.0.0-beta.41", but was loaded with "${t}". You'll need to update your @babel/core version.`):Error(`Requires Babel "${e}", but was loaded with "${t}". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.`),typeof n==`number`&&(Error.stackTraceLimit=n),Object.assign(r,{code:`BABEL_VERSION_UNSUPPORTED`,version:t,range:e})}const u=Object.assign;Array.isArray;const d=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],f=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],p=RegExp(`[\\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-\\u088f\\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\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\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-\\u1c8a\\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-\\ua7dc\\ua7f1-\\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]`),m=RegExp(`[\\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-\\u088f\\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\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\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-\\u1c8a\\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-\\ua7dc\\ua7f1-\\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\\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\\u0897-\\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-\\u1add\\u1ae0-\\u1aeb\\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\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\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\\uff65]`);function ee(e,t){let n=65536;for(let r=0,i=t.length;r<i;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function te(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&p.test(String.fromCharCode(e)):ee(e,d)}function ne(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&m.test(String.fromCharCode(e)):ee(e,d)||ee(e,f)}function re(e){let t=!0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if((r&64512)==55296&&n+1<e.length){let t=e.charCodeAt(++n);(t&64512)==56320&&(r=65536+((r&1023)<<10)+(t&1023))}if(t){if(t=!1,!te(r))return!1}else if(!ne(r))return!1}return!t}const ie={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`.split(`.`),strict:[`implements`,`interface`,`let`,`package`,`private`,`protected`,`public`,`static`,`yield`],strictBind:[`eval`,`arguments`]},ae=new Set(ie.keyword),oe=new Set(ie.strict);new Set(ie.strictBind);function se(e,t){return t&&e===`await`||e===`enum`}function ce(e,t){return se(e,t)||oe.has(e)}function le(e){return ae.has(e)}var ue=function(e){return e>=48&&e<=57};const de={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},fe={bin:e=>e===48||e===49,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function pe(e,t,n,r,i,a){let o=n,s=r,c=i,l=``,u=null,d=n,{length:f}=t;for(;;){if(n>=f){a.unterminated(o,s,c),l+=t.slice(d,n);break}let p=t.charCodeAt(n);if(me(e,p,t,n)){l+=t.slice(d,n);break}if(p===92){l+=t.slice(d,n);let o=he(t,n,r,i,e===`template`,a);o.ch===null&&!u?u={pos:n,lineStart:r,curLine:i}:l+=o.ch,{pos:n,lineStart:r,curLine:i}=o,d=n}else p===8232||p===8233?(++n,++i,r=n):p===10||p===13?e===`template`?(l+=t.slice(d,n)+`
|
|
2
2
|
`,++n,p===13&&t.charCodeAt(n)===10&&++n,++i,d=r=n):a.unterminated(o,s,c):++n}return{pos:n,str:l,firstInvalidLoc:u,lineStart:r,curLine:i}}function me(e,t,n,r){return e===`template`?t===96||t===36&&n.charCodeAt(r+1)===123:t===(e===`double`?34:39)}function he(e,t,n,r,i,a){let o=!i;t++;let s=e=>({pos:t,ch:e,lineStart:n,curLine:r}),c=e.charCodeAt(t++);switch(c){case 110:return s(`
|
|
3
|
-
`);case 114:return s(`\r`);case 120:{let i;return{code:i,pos:t}=ge(e,t,n,r,2,!1,o,a),s(i===null?null:String.fromCharCode(i))}case 117:{let i;return{code:i,pos:t}=ve(e,t,n,r,o,a),s(i===null?null:String.fromCodePoint(i))}case 116:return s(` `);case 98:return s(`\b`);case 118:return s(`\v`);case 102:return s(`\f`);case 13:e.charCodeAt(t)===10&&++t;case 10:n=t,++r;case 8232:case 8233:return s(``);case 56:case 57:if(i)return s(null);a.strictNumericEscape(t-1,n,r);default:if(c>=48&&c<=55){let o=t-1,c=/^[0-7]+/.exec(e.slice(o,t+2))[0],l=parseInt(c,8);l>255&&(c=c.slice(0,-1),l=parseInt(c,8)),t+=c.length-1;let u=e.charCodeAt(t);if(c!==`0`||u===56||u===57){if(i)return s(null);a.strictNumericEscape(o,n,r)}return s(String.fromCharCode(l))}return s(String.fromCharCode(c))}}function ge(e,t,n,r,i,a,o,s){let c=t,l;return{n:l,pos:t}=_e(e,t,n,r,16,i,a,!1,s,!o),l===null&&(o?s.invalidEscapeSequence(c,n,r):t=c-1),{code:l,pos:t}}function _e(e,t,n,r,i,a,o,s,c,l){let u=t,d=i===16?de.hex:de.decBinOct,f=i===16?fe.hex:i===10?fe.dec:i===8?fe.oct:fe.bin,p=!1,m=0;for(let u=0,ee=a==null?1/0:a;u<ee;++u){let a=e.charCodeAt(t),u;if(a===95&&s!==`bail`){let i=e.charCodeAt(t-1),a=e.charCodeAt(t+1);if(!s){if(l)return{n:null,pos:t};c.numericSeparatorInEscapeSequence(t,n,r)}else if(Number.isNaN(a)||!f(a)||d.has(i)||d.has(a)){if(l)return{n:null,pos:t};c.unexpectedNumericSeparator(t,n,r)}++t;continue}if(u=a>=97?a-97+10:a>=65?a-65+10:ue(a)?a-48:1/0,u>=i){if(u<=9&&l)return{n:null,pos:t};if(u<=9&&c.invalidDigit(t,n,r,i))u=0;else if(o)u=0,p=!0;else break}++t,m=m*i+u}return t===u||a!=null&&t-u!==a||p?{n:null,pos:t}:{n:m,pos:t}}function ve(e,t,n,r,i,a){let o=e.charCodeAt(t),s;if(o===123){if(++t,{code:s,pos:t}=ge(e,t,n,r,e.indexOf(`}`,t)-t,!0,i,a),++t,s!==null&&s>1114111)if(i)a.invalidCodePoint(t,n,r);else return{code:null,pos:t}}else({code:s,pos:t}=ge(e,t,n,r,4,!1,i,a));return{code:s,pos:t}}function h(e,t){let n=Object.keys(t);for(let r of n)if(e[r]!==t[r])return!1;return!0}function ye(e,t){return!e||e.type!==`AssignmentExpression`?!1:t==null||h(e,t)}function be(e,t){return!e||e.type!==`File`?!1:t==null||h(e,t)}function xe(e,t){return!e||e.type!==`FunctionDeclaration`?!1:t==null||h(e,t)}function Se(e,t){return!e||e.type!==`FunctionExpression`?!1:t==null||h(e,t)}function Ce(e,t){return!e||e.type!==`Identifier`?!1:t==null||h(e,t)}function we(e,t){return!e||e.type!==`StringLiteral`?!1:t==null||h(e,t)}function Te(e,t){return!e||e.type!==`NumericLiteral`?!1:t==null||h(e,t)}function Ee(e,t){return!e||e.type!==`NullLiteral`?!1:t==null||h(e,t)}function De(e,t){return!e||e.type!==`BooleanLiteral`?!1:t==null||h(e,t)}function Oe(e,t){return!e||e.type!==`MemberExpression`?!1:t==null||h(e,t)}function ke(e,t){return!e||e.type!==`ParenthesizedExpression`?!1:t==null||h(e,t)}function Ae(e,t){return!e||e.type!==`ThisExpression`?!1:t==null||h(e,t)}function je(e,t){return!e||e.type!==`UnaryExpression`?!1:t==null||h(e,t)}function Me(e,t){return!e||e.type!==`UpdateExpression`?!1:t==null||h(e,t)}function Ne(e,t){return!e||e.type!==`ArrowFunctionExpression`?!1:t==null||h(e,t)}function Pe(e,t){return!e||e.type!==`ClassExpression`?!1:t==null||h(e,t)}function Fe(e,t){return!e||e.type!==`ExportAllDeclaration`?!1:t==null||h(e,t)}function Ie(e,t){return!e||e.type!==`ImportDeclaration`?!1:t==null||h(e,t)}function Le(e,t){return!e||e.type!==`ImportSpecifier`?!1:t==null||h(e,t)}function Re(e,t){return!e||e.type!==`MetaProperty`?!1:t==null||h(e,t)}function ze(e,t){return!e||e.type!==`Super`?!1:t==null||h(e,t)}function Be(e,t){return!e||e.type!==`OptionalMemberExpression`?!1:t==null||h(e,t)}function Ve(e,t){return!e||e.type!==`PrivateName`?!1:t==null||h(e,t)}function He(e,t){return!e||e.type!==`TypeCastExpression`?!1:t==null||h(e,t)}function Ue(e,t){return!e||e.type!==`JSXIdentifier`?!1:t==null||h(e,t)}function We(e,t){return!e||e.type!==`JSXMemberExpression`?!1:t==null||h(e,t)}function Ge(e,t){return!e||e.type!==`JSXNamespacedName`?!1:t==null||h(e,t)}function Ke(e,t){return!e||e.type!==`JSXSpreadAttribute`?!1:t==null||h(e,t)}function qe(e,t){return!e||e.type!==`TSAsExpression`?!1:t==null||h(e,t)}function Je(e,t){return!e||e.type!==`TSSatisfiesExpression`?!1:t==null||h(e,t)}function Ye(e,t){return!e||e.type!==`TSTypeAssertion`?!1:t==null||h(e,t)}function Xe(e,t){return!e||e.type!==`TSNonNullExpression`?!1:t==null||h(e,t)}function Ze(e,t){if(!e)return!1;switch(e.type){case`FunctionDeclaration`:case`FunctionExpression`:case`ObjectMethod`:case`ArrowFunctionExpression`:case`ClassMethod`:case`ClassPrivateMethod`:break;default:return!1}return t==null||h(e,t)}function Qe(e,t){if(!e)return!1;switch(e.type){case`FunctionDeclaration`:case`VariableDeclaration`:case`ClassDeclaration`:case`ExportAllDeclaration`:case`ExportDefaultDeclaration`:case`ExportNamedDeclaration`:case`ImportDeclaration`:case`DeclareClass`:case`DeclareFunction`:case`DeclareInterface`:case`DeclareModule`:case`DeclareModuleExports`:case`DeclareTypeAlias`:case`DeclareOpaqueType`:case`DeclareVariable`:case`DeclareExportDeclaration`:case`DeclareExportAllDeclaration`:case`InterfaceDeclaration`:case`OpaqueType`:case`TypeAlias`:case`EnumDeclaration`:case`TSDeclareFunction`:case`TSInterfaceDeclaration`:case`TSTypeAliasDeclaration`:case`TSEnumDeclaration`:case`TSModuleDeclaration`:case`TSImportEqualsDeclaration`:break;case`Placeholder`:if(e.expectedNode===`Declaration`)break;default:return!1}return t==null||h(e,t)}function $e(e,t){if(!e)return!1;switch(e.type){case`ExportAllDeclaration`:case`ExportDefaultDeclaration`:case`ExportNamedDeclaration`:break;default:return!1}return t==null||h(e,t)}function et(e){return Oe(e)||Re(e)}function tt(e,t,n){var r;if(!et(e))return!1;let i=Array.isArray(t)?t:t.split(`.`),a=[],o;for(o=e;et(o);o=(r=o.object)==null?o.meta:r)a.push(o.property);if(a.push(o),a.length<i.length||!n&&a.length>i.length)return!1;for(let e=0,t=a.length-1;e<i.length;e++,t--){let n=a[t],r;if(Ce(n))r=n.name;else if(we(n))r=n.value;else if(Ae(n))r=`this`;else if(ze(n))r=`super`;else if(Ve(n))r=`#`+n.id.name;else return!1;if(i[e]!==r)return!1}return!0}function nt(e,t){let n=e.split(`.`);return e=>tt(e,n,t)}nt(`React.Component`);function rt(e,t){if(e===t)return!0;if(e==null||vt[t])return!1;let n=_[t];return!!(n!=null&&n.includes(e))}function it(e,t){if(e===t)return!0;let n=Xt[e];return!!(n!=null&&n.includes(t))}function g(e,t,n){return t?rt(t.type,e)?n===void 0?!0:h(t,n):!n&&t.type===`Placeholder`&&e in _?it(t.expectedNode,e):!1:!1}function at(e,t=!0){return typeof e!=`string`||t&&(le(e)||ce(e,!0))?!1:re(e)}const ot=[`leadingComments`,`trailingComments`,`innerComments`],st=[`||`,`&&`,`??`],ct=[`++`,`--`],lt=[`==`,`===`,`!=`,`!==`,`in`,`instanceof`,`>`,`<`,`>=`,`<=`],ut=[`-`,`/`,`%`,`*`,`**`,`&`,`|`,`>>`,`>>>`,`<<`,`^`],dt=[`+`,...ut,...lt,`|>`],ft=[`=`,`+=`,...ut.map(e=>e+`=`),...st.map(e=>e+`=`)],pt=[`delete`,`!`],mt=[`+`,`-`,`~`],ht=[`typeof`],gt=[`void`,`throw`,...pt,...mt,...ht],_t={},vt={},_={},yt={},bt={},xt={},St={},Ct={};function wt(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e}function v(e,...t){return Object.assign(e,...t)}function y(e){return{validate:e}}function b(...e){return y(E(...e))}function x(e){return{validate:e,optional:!0}}function Tt(e,t){return{validate:e,default:t,optional:!1}}function S(...e){return{validate:E(...e),optional:!0}}function Et(e){return O(D(`array`),Dt(e))}function C(...e){return Et(E(...e))}function w(...e){return y(C(...e))}function Dt(e){let t=
|
|
4
|
-
`)}`)}return n.shapeOf=e,n}function jt(){function e(e){let t=e;for(;e;){let{type:e}=t;if(e===`OptionalCallExpression`){if(t.optional)return;t=t.callee;continue}if(e===`OptionalMemberExpression`){if(t.optional)return;t=t.object;continue}break}throw TypeError(`Non-optional ${e.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${t==null?void 0:t.type}`)}return e}function O(...e){function t(...t){for(let n of e)n(...t)}if(t.chainOf=e,e.length>=2&&`type`in e[0]&&e[0].type===`array`&&!(`each`in e[1]))throw Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`);return t}const Mt=new Set([`aliases`,`builder`,`deprecatedAlias`,`fields`,`inherits`,`visitor`,`validate`,`unionShape`]),Nt=new Set([`default`,`optional`,`deprecated`,`validate`]),Pt={};function Ft(...e){return(t,n={})=>{let r=n.aliases;if(!r){var i;n.inherits&&(r=(i=Pt[n.inherits].aliases)==null?void 0:i.slice()),r!=null||(r=[]),n.aliases=r}let a=e.filter(e=>!r.includes(e));r.unshift(...a),It(t,n)}}function It(e,t={}){let n=t.inherits&&Pt[t.inherits]||{},r=t.visitor||n.visitor||[],i=t.aliases||n.aliases||[],a=t.builder||n.builder||t.visitor||[],o=t.fields;if(!o&&(o={},n.fields)){let e=Object.getOwnPropertyNames(n.fields);for(let t of e){let e=n.fields[t],r=e.default;if(Array.isArray(r)?r.length>0:r&&typeof r==`object`)throw Error(`field defaults can only be primitives or empty arrays currently`);o[t]={default:Array.isArray(r)?[]:r,optional:e.optional,deprecated:e.deprecated,validate:e.validate}}}for(let n of Object.keys(t))if(!Mt.has(n))throw Error(`Unknown type option "${n}" on ${e}`);t.deprecatedAlias&&(xt[t.deprecatedAlias]=e);for(let e of r.concat(a))o[e]=o[e]||{};for(let t of Object.keys(o)){let n=o[t];n.default===null&&(n.optional!=null||(n.optional=!0)),n.default===void 0?(n.default=null,n.optional!=null||(n.optional=!1)):!n.validate&&n.default!=null&&(n.validate=D(wt(n.default)));for(let r of Object.keys(n))if(!Nt.has(r))throw Error(`Unknown field key "${r}" on ${e}.${t}`)}_t[e]=t.visitor=r,bt[e]=t.builder=a,yt[e]=t.fields=o,vt[e]=t.aliases=i,i.forEach(t=>{_[t]=_[t]||[],_[t].push(e)}),t.validate&&(St[e]=t.validate),t.unionShape&&(Ct[e]=t.unionShape),Pt[e]=t}const Lt=Object.defineProperty({__proto__:null,ALIAS_KEYS:vt,BUILDER_KEYS:bt,DEPRECATED_KEYS:xt,FLIPPED_ALIAS_KEYS:_,NODE_FIELDS:yt,NODE_PARENT_VALIDATIONS:St,NODE_UNION_SHAPES__PRIVATE:Ct,VISITOR_KEYS:_t,allExpandedTypes:Ot,arrayOf:Et,arrayOfType:C,assertEach:Dt,assertNodeOrValueType:kt,assertNodeType:E,assertOneOf:T,assertOptionalChainStart:jt,assertShape:At,assertValueType:D,chain:O,combine:v,default:It,defineAliasedType:Ft,validate:y,validateArrayOfType:w,validateDefault:Tt,validateOptional:x,validateOptionalType:S,validateType:b},Symbol.toStringTag,{value:`Module`}),Rt=(e=!1)=>({unionShape:{discriminator:`computed`,shapes:[{name:`computed`,value:[!0],properties:{key:{validate:E(`Expression`)}}},{name:`nonComputed`,value:[!1],properties:{key:{validate:e?E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`PrivateName`):E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`)}}}]}}),zt={unionShape:{discriminator:`computed`,shapes:[{name:`computed`,value:[!0],properties:{property:{validate:E(`Expression`)}}},{name:`nonComputed`,value:[!1],properties:{property:{validate:E(`Identifier`,`PrivateName`)}}}]}},k=Ft(`Standardized`);k(`ArrayExpression`,{fields:{elements:{validate:Et(kt(`null`,`Expression`,`SpreadElement`)),default:void 0}},visitor:[`elements`],aliases:[`Expression`]}),k(`AssignmentExpression`,{fields:{operator:{validate:v(function(){let e=T(...ft),t=T(`=`);return function(n,r,i){(g(`Pattern`,n.left)?t:e)(n,r,i)}}(),{oneOf:ft})},left:{validate:E(`Identifier`,`MemberExpression`,`OptionalMemberExpression`,`ArrayPattern`,`ObjectPattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`)},right:{validate:E(`Expression`)}},builder:[`operator`,`left`,`right`],visitor:[`left`,`right`],aliases:[`Expression`]}),k(`BinaryExpression`,{builder:[`operator`,`left`,`right`],fields:{operator:{validate:T(...dt)},left:{validate:function(){let e=E(`Expression`),t=E(`Expression`,`PrivateName`);return v(function(n,r,i){(n.operator===`in`?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`PrivateName`]})}()},right:{validate:E(`Expression`)}},unionShape:{discriminator:`operator`,shapes:[{name:`in`,value:[`in`],properties:{left:{validate:E(`Expression`,`PrivateName`)}}},{name:`notIn`,value:dt.filter(e=>e!==`in`),properties:{left:{validate:E(`Expression`)}}}]},visitor:[`left`,`right`],aliases:[`Binary`,`Expression`]}),k(`InterpreterDirective`,{builder:[`value`],fields:{value:{validate:D(`string`)}}}),k(`Directive`,{visitor:[`value`],fields:{value:{validate:E(`DirectiveLiteral`)}}}),k(`DirectiveLiteral`,{builder:[`value`],fields:{value:{validate:D(`string`)}}}),k(`BlockStatement`,{builder:[`body`,`directives`],visitor:[`directives`,`body`],fields:{directives:{validate:C(`Directive`),default:[]},body:w(`Statement`)},aliases:[`Scopable`,`BlockParent`,`Block`,`Statement`]}),k(`BreakStatement`,{visitor:[`label`],fields:{label:{validate:E(`Identifier`),optional:!0}},aliases:[`Statement`,`Terminatorless`,`CompletionStatement`]}),k(`CallExpression`,{visitor:[`callee`,`typeArguments`,`arguments`],builder:[`callee`,`arguments`],aliases:[`Expression`],fields:{callee:{validate:E(`Expression`,`Super`,`Import`,`V8IntrinsicIdentifier`)},arguments:w(`Expression`,`SpreadElement`,`ArgumentPlaceholder`),typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),k(`CatchClause`,{visitor:[`param`,`body`],fields:{param:{validate:E(`Identifier`,`ArrayPattern`,`ObjectPattern`),optional:!0},body:{validate:E(`BlockStatement`)}},aliases:[`Scopable`,`BlockParent`]}),k(`ConditionalExpression`,{visitor:[`test`,`consequent`,`alternate`],fields:{test:{validate:E(`Expression`)},consequent:{validate:E(`Expression`)},alternate:{validate:E(`Expression`)}},aliases:[`Expression`,`Conditional`]}),k(`ContinueStatement`,{visitor:[`label`],fields:{label:{validate:E(`Identifier`),optional:!0}},aliases:[`Statement`,`Terminatorless`,`CompletionStatement`]}),k(`DebuggerStatement`,{aliases:[`Statement`]}),k(`DoWhileStatement`,{builder:[`test`,`body`],visitor:[`body`,`test`],fields:{test:{validate:E(`Expression`)},body:{validate:E(`Statement`)}},aliases:[`Statement`,`BlockParent`,`Loop`,`While`,`Scopable`]}),k(`EmptyStatement`,{aliases:[`Statement`]}),k(`ExpressionStatement`,{visitor:[`expression`],fields:{expression:{validate:E(`Expression`)}},aliases:[`Statement`,`ExpressionWrapper`]}),k(`File`,{builder:[`program`,`comments`,`tokens`],visitor:[`program`],fields:{program:{validate:E(`Program`)},comments:{validate:Dt(E(`CommentBlock`,`CommentLine`)),optional:!0},tokens:{validate:Dt(Object.assign(()=>{},{type:`any`})),optional:!0}}}),k(`ForInStatement`,{visitor:[`left`,`right`,`body`],aliases:[`Scopable`,`Statement`,`For`,`BlockParent`,`Loop`,`ForXStatement`],fields:{left:{validate:E(`VariableDeclaration`,`Identifier`,`MemberExpression`,`ArrayPattern`,`ObjectPattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`)},right:{validate:E(`Expression`)},body:{validate:E(`Statement`)}}}),k(`ForStatement`,{visitor:[`init`,`test`,`update`,`body`],aliases:[`Scopable`,`Statement`,`For`,`BlockParent`,`Loop`],fields:{init:{validate:E(`VariableDeclaration`,`Expression`),optional:!0},test:{validate:E(`Expression`),optional:!0},update:{validate:E(`Expression`),optional:!0},body:{validate:E(`Statement`)}}});const Bt=()=>({params:w(`FunctionParameter`),generator:{default:!1},async:{default:!1}}),Vt=()=>({returnType:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},typeParameters:{validate:E(`TypeParameterDeclaration`,`TSTypeParameterDeclaration`),optional:!0}}),Ht=()=>a(a({},Bt()),{},{declare:{validate:D(`boolean`),optional:!0},id:{validate:E(`Identifier`),optional:!0}});k(`FunctionDeclaration`,{builder:[`id`,`params`,`body`,`generator`,`async`],visitor:[`id`,`typeParameters`,`params`,`predicate`,`returnType`,`body`],fields:a(a(a({},Ht()),Vt()),{},{body:{validate:E(`BlockStatement`)},predicate:{validate:E(`FlowPredicate`),optional:!0}}),aliases:[`Scopable`,`Function`,`BlockParent`,`FunctionParent`,`Statement`,`Pureish`,`Declaration`],validate:function(){let e=E(`Identifier`);return function(t,n,r){g(`ExportDefaultDeclaration`,t)||e(r,`id`,r.id)}}()}),k(`FunctionExpression`,{inherits:`FunctionDeclaration`,aliases:[`Scopable`,`Function`,`BlockParent`,`FunctionParent`,`Expression`,`Pureish`],fields:a(a(a({},Bt()),Vt()),{},{id:{validate:E(`Identifier`),optional:!0},body:{validate:E(`BlockStatement`)},predicate:{validate:E(`FlowPredicate`),optional:!0}})});const Ut=()=>({typeAnnotation:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},optional:{validate:D(`boolean`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0}});k(`Identifier`,{builder:[`name`],visitor:[`typeAnnotation`,`decorators`],aliases:[`Expression`,`FunctionParameter`,`PatternLike`,`LVal`,`TSEntityName`],fields:a(a({},Ut()),{},{name:{validate:O(D(`string`),v(function(e,t,n){if(!at(n,!1))throw TypeError(`"${n}" is not a valid identifier name`)},{type:`string`}))}}),validate:function(e,t,n){let r=/\.(\w+)$/.exec(t.toString());if(!r)return;let[,i]=r,a={computed:!1};if(i===`property`){if(g(`MemberExpression`,e,a)||g(`OptionalMemberExpression`,e,a))return}else if(i===`key`){if(g(`Property`,e,a)||g(`Method`,e,a))return}else if(i===`exported`){if(g(`ExportSpecifier`,e))return}else if(i===`imported`){if(g(`ImportSpecifier`,e,{imported:n}))return}else if(i===`meta`&&g(`MetaProperty`,e,{meta:n}))return;if((le(n.name)||se(n.name,!1))&&n.name!==`this`)throw TypeError(`"${n.name}" is not a valid identifier`)}}),k(`IfStatement`,{visitor:[`test`,`consequent`,`alternate`],aliases:[`Statement`,`Conditional`],fields:{test:{validate:E(`Expression`)},consequent:{validate:E(`Statement`)},alternate:{optional:!0,validate:E(`Statement`)}}}),k(`LabeledStatement`,{visitor:[`label`,`body`],aliases:[`Statement`],fields:{label:{validate:E(`Identifier`)},body:{validate:E(`Statement`)}}}),k(`StringLiteral`,{builder:[`value`],fields:{value:{validate:D(`string`)}},aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`NumericLiteral`,{builder:[`value`],deprecatedAlias:`NumberLiteral`,fields:{value:{validate:O(D(`number`),v(function(e,t,n){if(1/n<0||!Number.isFinite(n)){let e=Error(`NumericLiterals must be non-negative finite numbers. You can use t.valueToNode(${n}) instead.`);if(!Error().stack.includes(`regenerator`))throw e}},{type:`number`}))}},aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`NullLiteral`,{aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`BooleanLiteral`,{builder:[`value`],fields:{value:{validate:D(`boolean`)}},aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`RegExpLiteral`,{builder:[`pattern`,`flags`],deprecatedAlias:`RegexLiteral`,aliases:[`Expression`,`Pureish`,`Literal`],fields:{pattern:{validate:D(`string`)},flags:{validate:O(D(`string`),v(function(e,t,n){let r=/[^dgimsuvy]/.exec(n);if(r)throw TypeError(`"${r[0]}" is not a valid RegExp flag`)},{type:`string`})),default:``}}}),k(`LogicalExpression`,{builder:[`operator`,`left`,`right`],visitor:[`left`,`right`],aliases:[`Binary`,`Expression`],fields:{operator:{validate:T(...st)},left:{validate:E(`Expression`)},right:{validate:E(`Expression`)}}}),k(`MemberExpression`,a(a({builder:[`object`,`property`,`computed`],visitor:[`object`,`property`],aliases:[`Expression`,`LVal`,`PatternLike`]},zt),{},{fields:{object:{validate:E(`Expression`,`Super`)},property:{validate:function(){let e=E(`Identifier`,`PrivateName`),t=E(`Expression`);return v(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`Identifier`,`PrivateName`]})}()},computed:{default:!1}}})),k(`NewExpression`,{inherits:`CallExpression`,fields:{callee:{validate:E(`Expression`)},arguments:w(`Expression`,`SpreadElement`,`ArgumentPlaceholder`),typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),k(`Program`,{visitor:[`directives`,`body`],builder:[`body`,`directives`,`sourceType`,`interpreter`],fields:{sourceType:{validate:T(`script`,`module`),default:`script`},interpreter:{validate:E(`InterpreterDirective`),default:null,optional:!0},directives:{validate:C(`Directive`),default:[]},body:w(`Statement`)},aliases:[`Scopable`,`BlockParent`,`Block`]}),k(`ObjectExpression`,{visitor:[`properties`],aliases:[`Expression`],fields:{properties:w(`ObjectMethod`,`ObjectProperty`,`SpreadElement`)}}),k(`ObjectMethod`,a(a({builder:[`kind`,`key`,`params`,`body`,`computed`,`generator`,`async`],visitor:[`decorators`,`key`,`typeParameters`,`params`,`returnType`,`body`]},Rt()),{},{fields:a(a(a({},Bt()),Vt()),{},{kind:{validate:T(`method`,`get`,`set`)},computed:{default:!1},key:{validate:function(){let e=E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`),t=E(`Expression`);return v(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`]})}()},decorators:{validate:C(`Decorator`),optional:!0},body:{validate:E(`BlockStatement`)}}),aliases:[`UserWhitespacable`,`Function`,`Scopable`,`BlockParent`,`FunctionParent`,`Method`,`ObjectMember`]})),k(`ObjectProperty`,a(a({builder:[`key`,`value`,`computed`,`shorthand`]},Rt(!0)),{},{fields:{computed:{default:!1},key:{validate:function(){let e=E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`PrivateName`),t=E(`Expression`);return v(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`PrivateName`]})}()},value:{validate:E(`Expression`,`PatternLike`)},shorthand:{validate:O(D(`boolean`),v(function(e,t,n){if(n){if(e.computed)throw TypeError(`Property shorthand of ObjectProperty cannot be true if computed is true`);if(!g(`Identifier`,e.key))throw TypeError(`Property shorthand of ObjectProperty cannot be true if key is not an Identifier`)}},{type:`boolean`})),default:!1},decorators:{validate:C(`Decorator`),optional:!0}},visitor:[`decorators`,`key`,`value`],aliases:[`UserWhitespacable`,`Property`,`ObjectMember`],validate:function(){let e=E(`Identifier`,`Pattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSNonNullExpression`,`TSTypeAssertion`),t=E(`Expression`);return function(n,r,i){(g(`ObjectPattern`,n)?e:t)(i,`value`,i.value)}}()})),k(`RestElement`,{visitor:[`argument`,`typeAnnotation`],builder:[`argument`],aliases:[`FunctionParameter`,`PatternLike`],deprecatedAlias:`RestProperty`,fields:a(a({},Ut()),{},{argument:{validate:E(`Identifier`,`ArrayPattern`,`ObjectPattern`,`MemberExpression`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`)}}),validate:function(e,t){let n=/(\w+)\[(\d+)\]/.exec(t.toString());if(!n)throw Error(`Internal Babel error: malformed key.`);let[,r,i]=n;if(e[r].length>+i+1)throw TypeError(`RestElement must be last element of ${r}`)}}),k(`ReturnStatement`,{visitor:[`argument`],aliases:[`Statement`,`Terminatorless`,`CompletionStatement`],fields:{argument:{validate:E(`Expression`),optional:!0}}}),k(`SequenceExpression`,{visitor:[`expressions`],fields:{expressions:w(`Expression`)},aliases:[`Expression`]}),k(`ParenthesizedExpression`,{visitor:[`expression`],aliases:[`Expression`,`ExpressionWrapper`],fields:{expression:{validate:E(`Expression`)}}}),k(`SwitchCase`,{visitor:[`test`,`consequent`],fields:{test:{validate:E(`Expression`),optional:!0},consequent:w(`Statement`)}}),k(`SwitchStatement`,{visitor:[`discriminant`,`cases`],aliases:[`Statement`,`BlockParent`,`Scopable`],fields:{discriminant:{validate:E(`Expression`)},cases:w(`SwitchCase`)}}),k(`ThisExpression`,{aliases:[`Expression`,`TSEntityName`]}),k(`ThrowStatement`,{visitor:[`argument`],aliases:[`Statement`,`Terminatorless`,`CompletionStatement`],fields:{argument:{validate:E(`Expression`)}}}),k(`TryStatement`,{visitor:[`block`,`handler`,`finalizer`],aliases:[`Statement`],fields:{block:{validate:O(E(`BlockStatement`),v(function(e){if(!e.handler&&!e.finalizer)throw TypeError(`TryStatement expects either a handler or finalizer, or both`)},{oneOfNodeTypes:[`BlockStatement`]}))},handler:{optional:!0,validate:E(`CatchClause`)},finalizer:{optional:!0,validate:E(`BlockStatement`)}}}),k(`UnaryExpression`,{builder:[`operator`,`argument`,`prefix`],fields:{prefix:{default:!0},argument:{validate:E(`Expression`)},operator:{validate:T(...gt)}},visitor:[`argument`],aliases:[`UnaryLike`,`Expression`]}),k(`UpdateExpression`,{builder:[`operator`,`argument`,`prefix`],fields:{prefix:{default:!1},argument:{validate:E(`Identifier`,`MemberExpression`)},operator:{validate:T(...ct)}},visitor:[`argument`],aliases:[`Expression`]}),k(`VariableDeclaration`,{builder:[`kind`,`declarations`],visitor:[`declarations`],aliases:[`Statement`,`Declaration`],fields:{declare:{validate:D(`boolean`),optional:!0},kind:{validate:T(`var`,`let`,`const`,`using`,`await using`)},declarations:w(`VariableDeclarator`)},validate:(()=>{let e=E(`Identifier`,`Placeholder`),t=E(`Identifier`,`ArrayPattern`,`ObjectPattern`,`Placeholder`),n=E(`Identifier`,`VoidPattern`,`Placeholder`);return function(r,i,a){let{kind:o,declarations:s}=a,c=g(`ForXStatement`,r,{left:a});if(c&&s.length!==1)throw TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${r.type}`);for(let r of s)o===`const`||o===`let`||o===`var`?!c&&!r.init?e(r,`id`,r.id):t(r,`id`,r.id):n(r,`id`,r.id)}})()}),k(`VariableDeclarator`,{visitor:[`id`,`init`],fields:{id:{validate:E(`Identifier`,`ArrayPattern`,`ObjectPattern`,`VoidPattern`)},definite:{optional:!0,validate:D(`boolean`)},init:{optional:!0,validate:E(`Expression`)}}}),k(`WhileStatement`,{visitor:[`test`,`body`],aliases:[`Statement`,`BlockParent`,`Loop`,`While`,`Scopable`],fields:{test:{validate:E(`Expression`)},body:{validate:E(`Statement`)}}}),k(`WithStatement`,{visitor:[`object`,`body`],aliases:[`Statement`],fields:{object:{validate:E(`Expression`)},body:{validate:E(`Statement`)}}}),k(`AssignmentPattern`,{visitor:[`left`,`right`,`decorators`],builder:[`left`,`right`],aliases:[`FunctionParameter`,`Pattern`,`PatternLike`],fields:a(a({},Ut()),{},{left:{validate:E(`Identifier`,`ObjectPattern`,`ArrayPattern`,`MemberExpression`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`)},right:{validate:E(`Expression`)},decorators:{validate:C(`Decorator`),optional:!0}})}),k(`ArrayPattern`,{visitor:[`elements`,`typeAnnotation`],builder:[`elements`],aliases:[`FunctionParameter`,`Pattern`,`PatternLike`,`LVal`],fields:a(a({},Ut()),{},{elements:{validate:O(D(`array`),Dt(kt(`null`,`PatternLike`)))}})}),k(`ArrowFunctionExpression`,{builder:[`params`,`body`,`async`],visitor:[`typeParameters`,`params`,`predicate`,`returnType`,`body`],aliases:[`Scopable`,`Function`,`BlockParent`,`FunctionParent`,`Expression`,`Pureish`],fields:a(a(a({},Bt()),{},{generator:{default:null,optional:!0,validate:v((e,t,n)=>{if(n)throw TypeError(`ArrowFunctionExpression cannot be a generator`)},{type:`boolean`})}},Vt()),{},{expression:{optional:!0,validate:D(`boolean`)},body:{validate:E(`BlockStatement`,`Expression`)},predicate:{validate:E(`FlowPredicate`),optional:!0}})}),k(`ClassBody`,{visitor:[`body`],fields:{body:w(`ClassMethod`,`ClassPrivateMethod`,`ClassProperty`,`ClassPrivateProperty`,`ClassAccessorProperty`,`TSDeclareMethod`,`TSIndexSignature`,`StaticBlock`)}}),k(`ClassExpression`,{builder:[`id`,`superClass`,`body`,`decorators`],visitor:[`decorators`,`id`,`typeParameters`,`superClass`,`superTypeArguments`,`mixins`,`implements`,`body`],aliases:[`Scopable`,`Class`,`Expression`],fields:{id:{validate:E(`Identifier`),optional:!0},typeParameters:{validate:E(`TypeParameterDeclaration`,`TSTypeParameterDeclaration`),optional:!0},body:{validate:E(`ClassBody`)},superClass:{optional:!0,validate:E(`Expression`)},superTypeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0},implements:{validate:C(`TSClassImplements`,`ClassImplements`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},mixins:{validate:E(`InterfaceExtends`),optional:!0}}}),k(`ClassDeclaration`,{inherits:`ClassExpression`,aliases:[`Scopable`,`Class`,`Statement`,`Declaration`],fields:{id:{validate:E(`Identifier`),optional:!0},typeParameters:{validate:E(`TypeParameterDeclaration`,`TSTypeParameterDeclaration`),optional:!0},body:{validate:E(`ClassBody`)},superClass:{optional:!0,validate:E(`Expression`)},superTypeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0},implements:{validate:C(`TSClassImplements`,`ClassImplements`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},mixins:{validate:E(`InterfaceExtends`),optional:!0},declare:{validate:D(`boolean`),optional:!0},abstract:{validate:D(`boolean`),optional:!0}},validate:function(){let e=E(`Identifier`);return function(t,n,r){g(`ExportDefaultDeclaration`,t)||e(r,`id`,r.id)}}()});const Wt={attributes:{optional:!0,validate:C(`ImportAttribute`)}};k(`ExportAllDeclaration`,{visitor:[`source`,`attributes`],aliases:[`Statement`,`Declaration`,`ImportOrExportDeclaration`,`ExportDeclaration`],fields:a({source:{validate:E(`StringLiteral`)},exportKind:x(T(`type`,`value`))},Wt)}),k(`ExportDefaultDeclaration`,{visitor:[`declaration`],aliases:[`Statement`,`Declaration`,`ImportOrExportDeclaration`,`ExportDeclaration`],fields:{declaration:b(`FunctionDeclaration`,`ClassDeclaration`,`Expression`,`TSDeclareFunction`,`TSInterfaceDeclaration`,`EnumDeclaration`),exportKind:x(T(`value`))}}),k(`ExportNamedDeclaration`,{builder:[`declaration`,`specifiers`,`source`,`attributes`],visitor:[`declaration`,`specifiers`,`source`,`attributes`],aliases:[`Statement`,`Declaration`,`ImportOrExportDeclaration`,`ExportDeclaration`],fields:a(a({declaration:{optional:!0,validate:O(E(`Declaration`),v(function(e,t,n){if(n&&e.specifiers.length)throw TypeError(`Only declaration or specifiers is allowed on ExportNamedDeclaration`);if(n&&e.source)throw TypeError(`Cannot export a declaration from a source`)},{oneOfNodeTypes:[`VariableDeclaration`,`FunctionDeclaration`,`ClassDeclaration`,`TSDeclareFunction`,`TSEnumDeclaration`,`TSImportEqualsDeclaration`,`TSInterfaceDeclaration`,`TSModuleDeclaration`,`TSTypeAliasDeclaration`,`EnumDeclaration`,`InterfaceDeclaration`,`OpaqueType`,`TypeAlias`]}))}},Wt),{},{specifiers:{default:[],validate:Et(function(){let e=E(`ExportSpecifier`,`ExportDefaultSpecifier`,`ExportNamespaceSpecifier`),t=E(`ExportSpecifier`);return v(function(n,r,i){(n.source?e:t)(n,r,i)},{oneOfNodeTypes:[`ExportSpecifier`,`ExportDefaultSpecifier`,`ExportNamespaceSpecifier`]})}())},source:{validate:E(`StringLiteral`),optional:!0},exportKind:x(T(`type`,`value`))})}),k(`ExportSpecifier`,{visitor:[`local`,`exported`],aliases:[`ModuleSpecifier`],fields:{local:{validate:E(`Identifier`)},exported:{validate:E(`Identifier`,`StringLiteral`)},exportKind:{validate:T(`type`,`value`),optional:!0}}}),k(`ForOfStatement`,{visitor:[`left`,`right`,`body`],builder:[`left`,`right`,`body`,`await`],aliases:[`Scopable`,`Statement`,`For`,`BlockParent`,`Loop`,`ForXStatement`],fields:{left:{validate:function(){let e=E(`VariableDeclaration`),t=E(`Identifier`,`MemberExpression`,`ArrayPattern`,`ObjectPattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`);return v(function(n,r,i){g(`VariableDeclaration`,i)?e(n,r,i):t(n,r,i)},{oneOfNodeTypes:[`VariableDeclaration`,`Identifier`,`MemberExpression`,`ArrayPattern`,`ObjectPattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`]})}()},right:{validate:E(`Expression`)},body:{validate:E(`Statement`)},await:{default:!1}}}),k(`ImportDeclaration`,{builder:[`specifiers`,`source`,`attributes`],visitor:[`specifiers`,`source`,`attributes`],aliases:[`Statement`,`Declaration`,`ImportOrExportDeclaration`],fields:a(a({},Wt),{},{module:{optional:!0,validate:D(`boolean`)},phase:{default:null,validate:T(`source`,`defer`)},specifiers:w(`ImportSpecifier`,`ImportDefaultSpecifier`,`ImportNamespaceSpecifier`),source:{validate:E(`StringLiteral`)},importKind:{validate:T(`type`,`typeof`,`value`),optional:!0}})}),k(`ImportDefaultSpecifier`,{visitor:[`local`],aliases:[`ModuleSpecifier`],fields:{local:{validate:E(`Identifier`)}}}),k(`ImportNamespaceSpecifier`,{visitor:[`local`],aliases:[`ModuleSpecifier`],fields:{local:{validate:E(`Identifier`)}}}),k(`ImportSpecifier`,{visitor:[`imported`,`local`],builder:[`local`,`imported`],aliases:[`ModuleSpecifier`],fields:{local:{validate:E(`Identifier`)},imported:{validate:E(`Identifier`,`StringLiteral`)},importKind:{validate:T(`type`,`typeof`,`value`),optional:!0}}}),k(`MetaProperty`,{visitor:[`meta`,`property`],aliases:[`Expression`],fields:{meta:{validate:O(E(`Identifier`),v(function(e,t,n){let r;switch(n.name){case`function`:r=`sent`;break;case`new`:r=`target`;break;case`import`:r=`meta`;break}if(!g(`Identifier`,e.property,{name:r}))throw TypeError(`Unrecognised MetaProperty`)},{oneOfNodeTypes:[`Identifier`]}))},property:{validate:E(`Identifier`)}}});const Gt=()=>({abstract:{validate:D(`boolean`),default:!1,optional:!0},accessibility:{validate:T(`public`,`private`,`protected`),optional:!0},static:{default:!1},override:{optional:!0,validate:D(`boolean`),default:!1},computed:{default:!1},optional:{validate:D(`boolean`),optional:!0},key:{validate:O(function(){let e=E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`),t=E(`Expression`);return function(n,r,i){(n.computed?t:e)(n,r,i)}}(),E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`Expression`))}}),Kt=(e=!0)=>a(a(a({},Bt()),Gt()),{},{params:w(`FunctionParameter`,`TSParameterProperty`),kind:{validate:T(`get`,`set`,`method`,`constructor`),default:`method`},access:{validate:O(D(`string`),T(`public`,`private`,`protected`)),optional:!0}},e?{decorators:{validate:C(`Decorator`),optional:!0}}:{});k(`ClassMethod`,a(a({aliases:[`Function`,`Scopable`,`BlockParent`,`FunctionParent`,`Method`],builder:[`kind`,`key`,`params`,`body`,`computed`,`static`,`generator`,`async`],visitor:[`decorators`,`key`,`typeParameters`,`params`,`returnType`,`body`]},Rt()),{},{fields:a(a(a({},Kt()),Vt()),{},{body:{validate:E(`BlockStatement`)}})})),k(`ObjectPattern`,{visitor:[`decorators`,`properties`,`typeAnnotation`],builder:[`properties`],aliases:[`FunctionParameter`,`Pattern`,`PatternLike`,`LVal`],fields:a(a({},Ut()),{},{properties:w(`RestElement`,`ObjectProperty`)})}),k(`SpreadElement`,{visitor:[`argument`],aliases:[`UnaryLike`],deprecatedAlias:`SpreadProperty`,fields:{argument:{validate:E(`Expression`)}}}),k(`Super`),k(`TaggedTemplateExpression`,{visitor:[`tag`,`typeArguments`,`quasi`],builder:[`tag`,`quasi`],aliases:[`Expression`],fields:{tag:{validate:E(`Expression`)},quasi:{validate:E(`TemplateLiteral`)},typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),k(`TemplateElement`,{builder:[`value`,`tail`],fields:{value:{validate:O(At({raw:{validate:D(`string`)},cooked:{validate:D(`string`),optional:!0}}),function(e){let t=e.value.raw,n=!1,r=()=>{throw Error(`Internal @babel/types error.`)},{str:i,firstInvalidLoc:a}=pe(`template`,t,0,0,0,{unterminated(){n=!0},strictNumericEscape:r,invalidEscapeSequence:r,numericSeparatorInEscapeSequence:r,unexpectedNumericSeparator:r,invalidDigit:r,invalidCodePoint:r});if(!n)throw Error(`Invalid raw`);e.value.cooked=a?null:i})},tail:{default:!1}}}),k(`TemplateLiteral`,{visitor:[`quasis`,`expressions`],aliases:[`Expression`,`Literal`],fields:{quasis:w(`TemplateElement`),expressions:{validate:O(D(`array`),Dt(E(`Expression`,`TSType`)),function(e,t,n){if(e.quasis.length!==n.length+1)throw TypeError(`Number of ${e.type} quasis should be exactly one more than the number of expressions.\nExpected ${n.length+1} quasis but got ${e.quasis.length}`)})}}}),k(`YieldExpression`,{builder:[`argument`,`delegate`],visitor:[`argument`],aliases:[`Expression`,`Terminatorless`],fields:{delegate:{validate:O(D(`boolean`),v(function(e,t,n){if(n&&!e.argument)throw TypeError(`Property delegate of YieldExpression cannot be true if there is no argument`)},{type:`boolean`})),default:!1},argument:{optional:!0,validate:E(`Expression`)}}}),k(`AwaitExpression`,{builder:[`argument`],visitor:[`argument`],aliases:[`Expression`,`Terminatorless`],fields:{argument:{validate:E(`Expression`)}}}),k(`ImportExpression`,{visitor:[`source`,`options`],aliases:[`Expression`],fields:{phase:{default:null,validate:T(`source`,`defer`)},source:{validate:E(`Expression`)},options:{validate:E(`Expression`),optional:!0}}}),k(`Import`),k(`BigIntLiteral`,{builder:[`value`],fields:{value:{validate:D(`bigint`)}},aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`ExportNamespaceSpecifier`,{visitor:[`exported`],aliases:[`ModuleSpecifier`],fields:{exported:{validate:E(`Identifier`,`StringLiteral`)}}}),k(`OptionalMemberExpression`,a(a({builder:[`object`,`property`,`computed`,`optional`],visitor:[`object`,`property`],aliases:[`Expression`]},zt),{},{fields:{object:{validate:E(`Expression`)},property:{validate:function(){let e=E(`Identifier`,`PrivateName`),t=E(`Expression`);return v(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`PrivateName`]})}()},computed:{default:!1},optional:{validate:O(D(`boolean`),jt())}}})),k(`OptionalCallExpression`,{visitor:[`callee`,`typeArguments`,`arguments`],builder:[`callee`,`arguments`,`optional`],aliases:[`Expression`],fields:{callee:{validate:E(`Expression`)},arguments:w(`Expression`,`SpreadElement`,`ArgumentPlaceholder`),optional:{validate:O(D(`boolean`),jt())},typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),k(`ClassProperty`,a(a({visitor:[`decorators`,`variance`,`key`,`typeAnnotation`,`value`],builder:[`key`,`value`,`typeAnnotation`,`decorators`,`computed`,`static`],aliases:[`Property`]},Rt()),{},{fields:a(a({},Gt()),{},{value:{validate:E(`Expression`),optional:!0},definite:{validate:D(`boolean`),optional:!0},typeAnnotation:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},readonly:{validate:D(`boolean`),optional:!0},declare:{validate:D(`boolean`),optional:!0},variance:{validate:E(`Variance`),optional:!0}})})),k(`ClassPrivateProperty`,{visitor:[`decorators`,`variance`,`key`,`typeAnnotation`,`value`],builder:[`key`,`value`,`decorators`,`static`],aliases:[`Property`,`Private`],fields:{key:{validate:E(`PrivateName`)},value:{validate:E(`Expression`),optional:!0},typeAnnotation:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},static:{validate:D(`boolean`),default:!1},readonly:{validate:D(`boolean`),optional:!0},optional:{validate:D(`boolean`),optional:!0},definite:{validate:D(`boolean`),optional:!0},variance:{validate:E(`Variance`),optional:!0}}}),k(`ClassPrivateMethod`,{builder:[`kind`,`key`,`params`,`body`,`static`],visitor:[`decorators`,`key`,`typeParameters`,`params`,`returnType`,`body`],aliases:[`Function`,`Scopable`,`BlockParent`,`FunctionParent`,`Method`,`Private`],fields:a(a(a({},Kt()),Vt()),{},{kind:{validate:T(`get`,`set`,`method`),default:`method`},key:{validate:E(`PrivateName`)},body:{validate:E(`BlockStatement`)}})}),k(`PrivateName`,{visitor:[`id`],aliases:[`Private`],fields:{id:{validate:E(`Identifier`)}}}),k(`StaticBlock`,{visitor:[`body`],fields:{body:w(`Statement`)},aliases:[`Scopable`,`BlockParent`,`FunctionParent`]}),k(`ImportAttribute`,{visitor:[`key`,`value`],fields:{key:{validate:E(`Identifier`,`StringLiteral`)},value:{validate:E(`StringLiteral`)}}});const A=Ft(`Flow`),qt=e=>{let t=e===`DeclareClass`;A(e,{builder:[`id`,`typeParameters`,`extends`,`body`],visitor:[`id`,`typeParameters`,`extends`,...t?[`mixins`,`implements`]:[],`body`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:a(a({id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),extends:x(C(`InterfaceExtends`))},t?{mixins:x(C(`InterfaceExtends`)),implements:x(C(`ClassImplements`))}:{}),{},{body:b(`ObjectTypeAnnotation`)})})};A(`AnyTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`ArrayTypeAnnotation`,{visitor:[`elementType`],aliases:[`FlowType`],fields:{elementType:b(`FlowType`)}}),A(`BooleanTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`BooleanLiteralTypeAnnotation`,{builder:[`value`],aliases:[`FlowType`],fields:{value:y(D(`boolean`))}}),A(`NullLiteralTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`ClassImplements`,{visitor:[`id`,`typeParameters`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterInstantiation`)}}),qt(`DeclareClass`),A(`DeclareFunction`,{builder:[`id`],visitor:[`id`,`predicate`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),predicate:S(`FlowPredicate`)}}),qt(`DeclareInterface`),A(`DeclareModule`,{builder:[`id`,`body`,`kind`],visitor:[`id`,`body`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`,`StringLiteral`),body:b(`BlockStatement`),kind:x(T(`CommonJS`,`ES`))}}),A(`DeclareModuleExports`,{visitor:[`typeAnnotation`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{typeAnnotation:b(`TypeAnnotation`)}}),A(`DeclareTypeAlias`,{visitor:[`id`,`typeParameters`,`right`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),right:b(`FlowType`)}}),A(`DeclareOpaqueType`,{visitor:[`id`,`typeParameters`,`supertype`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),supertype:S(`FlowType`),impltype:S(`FlowType`)}}),A(`DeclareVariable`,{visitor:[`id`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`)}}),A(`DeclareExportDeclaration`,{visitor:[`declaration`,`specifiers`,`source`,`attributes`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:a({declaration:S(`Flow`),specifiers:x(C(`ExportSpecifier`,`ExportNamespaceSpecifier`)),source:S(`StringLiteral`),default:x(D(`boolean`))},Wt)}),A(`DeclareExportAllDeclaration`,{visitor:[`source`,`attributes`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:a({source:b(`StringLiteral`),exportKind:x(T(`type`,`value`))},Wt)}),A(`DeclaredPredicate`,{visitor:[`value`],aliases:[`FlowPredicate`],fields:{value:b(`Expression`)}}),A(`ExistsTypeAnnotation`,{aliases:[`FlowType`]}),A(`FunctionTypeAnnotation`,{builder:[`typeParameters`,`params`,`rest`,`returnType`],visitor:[`typeParameters`,`this`,`params`,`rest`,`returnType`],aliases:[`FlowType`],fields:{typeParameters:S(`TypeParameterDeclaration`),params:w(`FunctionTypeParam`),rest:S(`FunctionTypeParam`),this:S(`FunctionTypeParam`),returnType:b(`FlowType`)}}),A(`FunctionTypeParam`,{visitor:[`name`,`typeAnnotation`],fields:{name:S(`Identifier`),typeAnnotation:b(`FlowType`),optional:x(D(`boolean`))}}),A(`GenericTypeAnnotation`,{visitor:[`id`,`typeParameters`],aliases:[`FlowType`],fields:{id:b(`Identifier`,`QualifiedTypeIdentifier`),typeParameters:S(`TypeParameterInstantiation`)}}),A(`InferredPredicate`,{aliases:[`FlowPredicate`]}),A(`InterfaceExtends`,{visitor:[`id`,`typeParameters`],fields:{id:b(`Identifier`,`QualifiedTypeIdentifier`),typeParameters:S(`TypeParameterInstantiation`)}}),qt(`InterfaceDeclaration`),A(`InterfaceTypeAnnotation`,{visitor:[`extends`,`body`],aliases:[`FlowType`],fields:{extends:x(C(`InterfaceExtends`)),body:b(`ObjectTypeAnnotation`)}}),A(`IntersectionTypeAnnotation`,{visitor:[`types`],aliases:[`FlowType`],fields:{types:y(C(`FlowType`))}}),A(`MixedTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`EmptyTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`NullableTypeAnnotation`,{visitor:[`typeAnnotation`],aliases:[`FlowType`],fields:{typeAnnotation:b(`FlowType`)}}),A(`NumberLiteralTypeAnnotation`,{builder:[`value`],aliases:[`FlowType`],fields:{value:y(D(`number`))}}),A(`BigIntLiteralTypeAnnotation`,{builder:[`value`],aliases:[`FlowType`],fields:{value:y(D(`bigint`))}}),A(`NumberTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`ObjectTypeAnnotation`,{visitor:[`properties`,`indexers`,`callProperties`,`internalSlots`],aliases:[`FlowType`],builder:[`properties`,`indexers`,`callProperties`,`internalSlots`,`exact`],fields:{properties:y(C(`ObjectTypeProperty`,`ObjectTypeSpreadProperty`)),indexers:{validate:C(`ObjectTypeIndexer`),optional:!1,default:[]},callProperties:{validate:C(`ObjectTypeCallProperty`),optional:!1,default:[]},internalSlots:{validate:C(`ObjectTypeInternalSlot`),optional:!1,default:[]},exact:{validate:D(`boolean`),default:!1},inexact:x(D(`boolean`))}}),A(`ObjectTypeInternalSlot`,{visitor:[`id`,`value`],builder:[`id`,`value`,`optional`,`static`,`method`],aliases:[`UserWhitespacable`],fields:{id:b(`Identifier`),value:b(`FlowType`),optional:y(D(`boolean`)),static:y(D(`boolean`)),method:y(D(`boolean`))}}),A(`ObjectTypeCallProperty`,{visitor:[`value`],aliases:[`UserWhitespacable`],fields:{value:b(`FlowType`),static:Tt(D(`boolean`),!1)}}),A(`ObjectTypeIndexer`,{visitor:[`variance`,`id`,`key`,`value`],builder:[`id`,`key`,`value`,`variance`],aliases:[`UserWhitespacable`],fields:{id:S(`Identifier`),key:b(`FlowType`),value:b(`FlowType`),static:Tt(D(`boolean`),!1),variance:S(`Variance`)}}),A(`ObjectTypeProperty`,{visitor:[`key`,`value`,`variance`],aliases:[`UserWhitespacable`],fields:{key:b(`Identifier`,`StringLiteral`,`NumericLiteral`),value:b(`FlowType`),kind:{validate:T(`init`,`get`,`set`),default:`init`,optional:!1},static:Tt(D(`boolean`),!1),proto:Tt(D(`boolean`),!1),optional:Tt(D(`boolean`),!1),variance:S(`Variance`),method:Tt(D(`boolean`),!1)}}),A(`ObjectTypeSpreadProperty`,{visitor:[`argument`],aliases:[`UserWhitespacable`],fields:{argument:b(`FlowType`)}}),A(`OpaqueType`,{visitor:[`id`,`typeParameters`,`supertype`,`impltype`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),supertype:S(`FlowType`),impltype:b(`FlowType`)}}),A(`QualifiedTypeIdentifier`,{visitor:[`qualification`,`id`],builder:[`id`,`qualification`],fields:{id:b(`Identifier`),qualification:b(`Identifier`,`QualifiedTypeIdentifier`)}}),A(`StringLiteralTypeAnnotation`,{builder:[`value`],aliases:[`FlowType`],fields:{value:y(D(`string`))}}),A(`StringTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`SymbolTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`ThisTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`TupleTypeAnnotation`,{visitor:[`types`],aliases:[`FlowType`],fields:{types:y(C(`FlowType`))}}),A(`TypeofTypeAnnotation`,{visitor:[`argument`],aliases:[`FlowType`],fields:{argument:b(`FlowType`)}}),A(`TypeAlias`,{visitor:[`id`,`typeParameters`,`right`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),right:b(`FlowType`)}}),A(`TypeAnnotation`,{visitor:[`typeAnnotation`],fields:{typeAnnotation:b(`FlowType`)}}),A(`TypeCastExpression`,{visitor:[`expression`,`typeAnnotation`],aliases:[`ExpressionWrapper`,`Expression`],fields:{expression:b(`Expression`),typeAnnotation:b(`TypeAnnotation`)}}),A(`TypeParameter`,{builder:[`name`,`bound`,`default`,`variance`],visitor:[`bound`,`default`,`variance`],fields:{name:y(D(`string`)),bound:S(`TypeAnnotation`),default:S(`FlowType`),variance:S(`Variance`)}}),A(`TypeParameterDeclaration`,{visitor:[`params`],fields:{params:y(C(`TypeParameter`))}}),A(`TypeParameterInstantiation`,{visitor:[`params`],fields:{params:y(C(`FlowType`))}}),A(`UnionTypeAnnotation`,{visitor:[`types`],aliases:[`FlowType`],fields:{types:y(C(`FlowType`))}}),A(`Variance`,{builder:[`kind`],fields:{kind:y(T(`minus`,`plus`))}}),A(`VoidTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`EnumDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`body`],fields:{id:b(`Identifier`),body:b(`EnumBooleanBody`,`EnumNumberBody`,`EnumStringBody`,`EnumSymbolBody`)}});const Jt={explicitType:Tt(D(`boolean`),!1),hasUnknownMembers:Tt(D(`boolean`),!1)};A(`EnumBooleanBody`,{aliases:[`EnumBody`],visitor:[`members`],fields:a(a({},Jt),{},{members:w(`EnumBooleanMember`)})}),A(`EnumNumberBody`,{aliases:[`EnumBody`],visitor:[`members`],fields:a(a({},Jt),{},{members:w(`EnumNumberMember`)})}),A(`EnumStringBody`,{aliases:[`EnumBody`],visitor:[`members`],fields:a(a({},Jt),{},{members:w(`EnumStringMember`,`EnumDefaultedMember`)})}),A(`EnumSymbolBody`,{aliases:[`EnumBody`],visitor:[`members`],fields:{members:w(`EnumDefaultedMember`),hasUnknownMembers:Tt(D(`boolean`),!1)}}),A(`EnumBooleanMember`,{aliases:[`EnumMember`],visitor:[`id`,`init`],fields:{id:b(`Identifier`),init:b(`BooleanLiteral`)}}),A(`EnumNumberMember`,{aliases:[`EnumMember`],visitor:[`id`,`init`],fields:{id:b(`Identifier`),init:b(`NumericLiteral`)}}),A(`EnumStringMember`,{aliases:[`EnumMember`],visitor:[`id`,`init`],fields:{id:b(`Identifier`),init:b(`StringLiteral`)}}),A(`EnumDefaultedMember`,{aliases:[`EnumMember`],visitor:[`id`],fields:{id:b(`Identifier`)}}),A(`IndexedAccessType`,{visitor:[`objectType`,`indexType`],aliases:[`FlowType`],fields:{objectType:b(`FlowType`),indexType:b(`FlowType`)}}),A(`OptionalIndexedAccessType`,{visitor:[`objectType`,`indexType`],aliases:[`FlowType`],fields:{objectType:b(`FlowType`),indexType:b(`FlowType`),optional:Tt(D(`boolean`),!1)}});const j=Ft(`JSX`);j(`JSXAttribute`,{visitor:[`name`,`value`],aliases:[`Immutable`],fields:{name:{validate:E(`JSXIdentifier`,`JSXNamespacedName`)},value:{optional:!0,validate:E(`JSXElement`,`JSXFragment`,`StringLiteral`,`JSXExpressionContainer`)}}}),j(`JSXClosingElement`,{visitor:[`name`],aliases:[`Immutable`],fields:{name:{validate:E(`JSXIdentifier`,`JSXMemberExpression`,`JSXNamespacedName`)}}}),j(`JSXElement`,{builder:[`openingElement`,`closingElement`,`children`],visitor:[`openingElement`,`children`,`closingElement`],aliases:[`Immutable`,`Expression`],fields:{openingElement:{validate:E(`JSXOpeningElement`)},closingElement:{optional:!0,validate:E(`JSXClosingElement`)},children:w(`JSXText`,`JSXExpressionContainer`,`JSXSpreadChild`,`JSXElement`,`JSXFragment`)}}),j(`JSXEmptyExpression`,{}),j(`JSXExpressionContainer`,{visitor:[`expression`],aliases:[`Immutable`],fields:{expression:{validate:E(`Expression`,`JSXEmptyExpression`)}}}),j(`JSXSpreadChild`,{visitor:[`expression`],aliases:[`Immutable`],fields:{expression:{validate:E(`Expression`)}}}),j(`JSXIdentifier`,{builder:[`name`],fields:{name:{validate:D(`string`)}}}),j(`JSXMemberExpression`,{visitor:[`object`,`property`],fields:{object:{validate:E(`JSXMemberExpression`,`JSXIdentifier`)},property:{validate:E(`JSXIdentifier`)}}}),j(`JSXNamespacedName`,{visitor:[`namespace`,`name`],fields:{namespace:{validate:E(`JSXIdentifier`)},name:{validate:E(`JSXIdentifier`)}}}),j(`JSXOpeningElement`,{builder:[`name`,`attributes`,`selfClosing`],visitor:[`name`,`typeArguments`,`attributes`],aliases:[`Immutable`],fields:{name:{validate:E(`JSXIdentifier`,`JSXMemberExpression`,`JSXNamespacedName`)},selfClosing:{default:!1},attributes:w(`JSXAttribute`,`JSXSpreadAttribute`),typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),j(`JSXSpreadAttribute`,{visitor:[`argument`],fields:{argument:{validate:E(`Expression`)}}}),j(`JSXText`,{aliases:[`Immutable`],builder:[`value`],fields:{value:{validate:D(`string`)}}}),j(`JSXFragment`,{builder:[`openingFragment`,`closingFragment`,`children`],visitor:[`openingFragment`,`children`,`closingFragment`],aliases:[`Immutable`,`Expression`],fields:{openingFragment:{validate:E(`JSXOpeningFragment`)},closingFragment:{validate:E(`JSXClosingFragment`)},children:w(`JSXText`,`JSXExpressionContainer`,`JSXSpreadChild`,`JSXElement`,`JSXFragment`)}}),j(`JSXOpeningFragment`,{aliases:[`Immutable`]}),j(`JSXClosingFragment`,{aliases:[`Immutable`]});const Yt=[`Identifier`,`StringLiteral`,`Expression`,`Statement`,`Declaration`,`BlockStatement`,`ClassBody`,`Pattern`],Xt={Declaration:[`Statement`],Pattern:[`PatternLike`,`LVal`]};for(let e of Yt){let t=vt[e];t!=null&&t.length&&(Xt[e]=t)}const Zt={};Object.keys(Xt).forEach(e=>{Xt[e].forEach(t=>{Object.hasOwn(Zt,t)||(Zt[t]=[]),Zt[t].push(e)})});const Qt=Ft(`Miscellaneous`);Qt(`Placeholder`,{visitor:[],builder:[`expectedNode`,`name`],fields:a({name:{validate:E(`Identifier`)},expectedNode:{validate:T(...Yt)}},Ut())}),Qt(`V8IntrinsicIdentifier`,{builder:[`name`],fields:{name:{validate:D(`string`)}}}),It(`ArgumentPlaceholder`,{}),It(`BindExpression`,{visitor:[`object`,`callee`],aliases:[`Expression`],fields:{object:{validate:kt(`null`,`Expression`)},callee:{validate:E(`Expression`)}}}),It(`ClassAccessorProperty`,a(a({visitor:[`decorators`,`key`,`typeAnnotation`,`value`],builder:[`key`,`value`,`typeAnnotation`,`decorators`,`computed`,`static`],aliases:[`Property`,`Accessor`]},Rt(!0)),{},{fields:a(a({},Gt()),{},{key:{validate:O(function(){let e=E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`PrivateName`),t=E(`Expression`);return function(n,r,i){(n.computed?t:e)(n,r,i)}}(),E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`Expression`,`PrivateName`))},value:{validate:E(`Expression`),optional:!0},definite:{validate:D(`boolean`),optional:!0},typeAnnotation:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},readonly:{validate:D(`boolean`),optional:!0},declare:{validate:D(`boolean`),optional:!0},variance:{validate:E(`Variance`),optional:!0}})})),It(`Decorator`,{visitor:[`expression`],fields:{expression:{validate:E(`Expression`)}}}),It(`DoExpression`,{visitor:[`body`],builder:[`body`,`async`],aliases:[`Expression`],fields:{body:{validate:E(`BlockStatement`)},async:{validate:D(`boolean`),default:!1}}}),It(`ExportDefaultSpecifier`,{visitor:[`exported`],aliases:[`ModuleSpecifier`],fields:{exported:{validate:E(`Identifier`)}}}),It(`ModuleExpression`,{visitor:[`body`],fields:{body:{validate:E(`Program`)}},aliases:[`Expression`]}),It(`TopicReference`,{aliases:[`Expression`]}),It(`VoidPattern`,{aliases:[`Pattern`,`PatternLike`,`FunctionParameter`]});const M=Ft(`TypeScript`),N=D(`boolean`),$t=()=>({returnType:{validate:E(`TSTypeAnnotation`),optional:!0},typeParameters:{validate:E(`TSTypeParameterDeclaration`),optional:!0}});M(`TSParameterProperty`,{aliases:[],visitor:[`parameter`],fields:{accessibility:{validate:T(`public`,`private`,`protected`),optional:!0},readonly:{validate:D(`boolean`),optional:!0},parameter:{validate:E(`Identifier`,`AssignmentPattern`)},override:{validate:D(`boolean`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0}}}),M(`TSDeclareFunction`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`typeParameters`,`params`,`returnType`],fields:a(a({},Ht()),$t())}),M(`TSDeclareMethod`,a(a({visitor:[`key`,`typeParameters`,`params`,`returnType`]},Rt()),{},{fields:a(a({},Kt(!1)),$t())})),M(`TSQualifiedName`,{aliases:[`TSEntityName`],visitor:[`left`,`right`],fields:{left:b(`TSEntityName`),right:b(`Identifier`)}});const en=()=>({typeParameters:S(`TSTypeParameterDeclaration`),params:w(`ArrayPattern`,`Identifier`,`ObjectPattern`,`RestElement`),returnType:S(`TSTypeAnnotation`)}),tn={aliases:[`TSTypeElement`],visitor:[`typeParameters`,`params`,`returnType`],fields:en()};M(`TSCallSignatureDeclaration`,tn),M(`TSConstructSignatureDeclaration`,tn);const nn=()=>({key:b(`Expression`),computed:{default:!1},optional:x(N)});M(`TSPropertySignature`,{aliases:[`TSTypeElement`],visitor:[`key`,`typeAnnotation`],fields:a(a({},nn()),{},{readonly:x(N),typeAnnotation:S(`TSTypeAnnotation`),kind:{optional:!0,validate:T(`get`,`set`)}})}),M(`TSMethodSignature`,{aliases:[`TSTypeElement`],visitor:[`key`,`typeParameters`,`params`,`returnType`],fields:a(a(a({},en()),nn()),{},{kind:{validate:T(`method`,`get`,`set`),default:`method`}})}),M(`TSIndexSignature`,{aliases:[`TSTypeElement`],visitor:[`parameters`,`typeAnnotation`],fields:{readonly:x(N),static:x(N),parameters:w(`Identifier`),typeAnnotation:S(`TSTypeAnnotation`)}});for(let e of[`TSAnyKeyword`,`TSBooleanKeyword`,`TSBigIntKeyword`,`TSIntrinsicKeyword`,`TSNeverKeyword`,`TSNullKeyword`,`TSNumberKeyword`,`TSObjectKeyword`,`TSStringKeyword`,`TSSymbolKeyword`,`TSUndefinedKeyword`,`TSUnknownKeyword`,`TSVoidKeyword`])M(e,{aliases:[`TSType`,`TSBaseType`],visitor:[],fields:{}});M(`TSThisType`,{aliases:[`TSType`,`TSBaseType`],visitor:[],fields:{}});const rn={aliases:[`TSType`],visitor:[`typeParameters`,`params`,`returnType`]};M(`TSFunctionType`,a(a({},rn),{},{fields:en()})),M(`TSConstructorType`,a(a({},rn),{},{fields:a(a({},en()),{},{abstract:x(N)})})),M(`TSTypeReference`,{aliases:[`TSType`],visitor:[`typeName`,`typeArguments`],fields:{typeName:b(`TSEntityName`),typeArguments:S(`TSTypeParameterInstantiation`)}}),M(`TSTypePredicate`,{aliases:[`TSType`],visitor:[`parameterName`,`typeAnnotation`],builder:[`parameterName`,`typeAnnotation`,`asserts`],fields:{parameterName:b(`Identifier`,`TSThisType`),typeAnnotation:S(`TSTypeAnnotation`),asserts:x(N)}}),M(`TSTypeQuery`,{aliases:[`TSType`],visitor:[`exprName`,`typeArguments`],fields:{exprName:b(`TSEntityName`,`TSImportType`),typeArguments:S(`TSTypeParameterInstantiation`)}}),M(`TSTypeLiteral`,{aliases:[`TSType`],visitor:[`members`],fields:{members:w(`TSTypeElement`)}}),M(`TSArrayType`,{aliases:[`TSType`],visitor:[`elementType`],fields:{elementType:b(`TSType`)}}),M(`TSTupleType`,{aliases:[`TSType`],visitor:[`elementTypes`],fields:{elementTypes:w(`TSType`,`TSNamedTupleMember`)}}),M(`TSOptionalType`,{aliases:[`TSType`],visitor:[`typeAnnotation`],fields:{typeAnnotation:b(`TSType`)}}),M(`TSRestType`,{aliases:[`TSType`],visitor:[`typeAnnotation`],fields:{typeAnnotation:b(`TSType`)}}),M(`TSNamedTupleMember`,{visitor:[`label`,`elementType`],builder:[`label`,`elementType`,`optional`],fields:{label:b(`Identifier`),optional:{validate:N,default:!1},elementType:b(`TSType`)}});const an={aliases:[`TSType`],visitor:[`types`],fields:{types:w(`TSType`)}};M(`TSUnionType`,an),M(`TSIntersectionType`,an),M(`TSConditionalType`,{aliases:[`TSType`],visitor:[`checkType`,`extendsType`,`trueType`,`falseType`],fields:{checkType:b(`TSType`),extendsType:b(`TSType`),trueType:b(`TSType`),falseType:b(`TSType`)}}),M(`TSInferType`,{aliases:[`TSType`],visitor:[`typeParameter`],fields:{typeParameter:b(`TSTypeParameter`)}}),M(`TSParenthesizedType`,{aliases:[`TSType`],visitor:[`typeAnnotation`],fields:{typeAnnotation:b(`TSType`)}}),M(`TSTypeOperator`,{aliases:[`TSType`],visitor:[`typeAnnotation`],builder:[`typeAnnotation`,`operator`],fields:{operator:{validate:T(`keyof`,`readonly`,`unique`),default:void 0},typeAnnotation:b(`TSType`)}}),M(`TSIndexedAccessType`,{aliases:[`TSType`],visitor:[`objectType`,`indexType`],fields:{objectType:b(`TSType`),indexType:b(`TSType`)}}),M(`TSMappedType`,{aliases:[`TSType`],visitor:[`key`,`constraint`,`nameType`,`typeAnnotation`],builder:[`key`,`constraint`,`nameType`,`typeAnnotation`],fields:{key:b(`Identifier`),constraint:b(`TSType`),readonly:x(T(!0,!1,`+`,`-`)),optional:x(T(!0,!1,`+`,`-`)),typeAnnotation:S(`TSType`),nameType:S(`TSType`)}}),M(`TSTemplateLiteralType`,{aliases:[`TSType`,`TSBaseType`],visitor:[`quasis`,`types`],fields:{quasis:w(`TemplateElement`),types:{validate:O(D(`array`),Dt(E(`TSType`)),function(e,t,n){if(e.quasis.length!==n.length+1)throw TypeError(`Number of ${e.type} quasis should be exactly one more than the number of types.\nExpected ${n.length+1} quasis but got ${e.quasis.length}`)})}}}),M(`TSLiteralType`,{aliases:[`TSType`,`TSBaseType`],visitor:[`literal`],fields:{literal:{validate:function(){let e=E(`NumericLiteral`,`BigIntLiteral`),t=T(`-`),n=E(`NumericLiteral`,`StringLiteral`,`BooleanLiteral`,`BigIntLiteral`,`TemplateLiteral`);return v(function(r,i,a){g(`UnaryExpression`,a)?(t(a,`operator`,a.operator),e(a,`argument`,a.argument)):n(r,i,a)},{oneOfNodeTypes:[`NumericLiteral`,`StringLiteral`,`BooleanLiteral`,`BigIntLiteral`,`TemplateLiteral`,`UnaryExpression`]})}()}}}),M(`TSClassImplements`,{aliases:[`TSType`],visitor:[`expression`,`typeArguments`],fields:{expression:b(`Expression`),typeArguments:S(`TSTypeParameterInstantiation`)}}),M(`TSInterfaceHeritage`,{aliases:[`TSType`],visitor:[`expression`,`typeArguments`],fields:{expression:b(`Expression`),typeArguments:S(`TSTypeParameterInstantiation`)}}),M(`TSInterfaceDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`typeParameters`,`extends`,`body`],fields:{declare:x(N),id:b(`Identifier`),typeParameters:S(`TSTypeParameterDeclaration`),extends:x(C(`TSInterfaceHeritage`)),body:b(`TSInterfaceBody`)}}),M(`TSInterfaceBody`,{visitor:[`body`],fields:{body:w(`TSTypeElement`)}}),M(`TSTypeAliasDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`typeParameters`,`typeAnnotation`],fields:{declare:x(N),id:b(`Identifier`),typeParameters:S(`TSTypeParameterDeclaration`),typeAnnotation:b(`TSType`)}}),M(`TSInstantiationExpression`,{aliases:[`Expression`],visitor:[`expression`,`typeArguments`],fields:{expression:b(`Expression`),typeArguments:S(`TSTypeParameterInstantiation`)}});const on={aliases:[`Expression`,`LVal`,`PatternLike`],visitor:[`expression`,`typeAnnotation`],fields:{expression:b(`Expression`),typeAnnotation:b(`TSType`)}};M(`TSAsExpression`,on),M(`TSSatisfiesExpression`,on),M(`TSTypeAssertion`,{aliases:[`Expression`,`LVal`,`PatternLike`],visitor:[`typeAnnotation`,`expression`],fields:{typeAnnotation:b(`TSType`),expression:b(`Expression`)}}),M(`TSEnumBody`,{visitor:[`members`],fields:{members:w(`TSEnumMember`)}}),M(`TSEnumDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`body`],fields:{declare:x(N),const:x(N),id:b(`Identifier`),body:b(`TSEnumBody`)}}),M(`TSEnumMember`,{visitor:[`id`,`initializer`],fields:{id:b(`Identifier`,`StringLiteral`),initializer:S(`Expression`)}}),M(`TSModuleDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`body`],fields:{kind:{validate:T(`global`,`namespace`,`module`),default:`namespace`},declare:x(N),id:{validate:O(E(`TSEntityName`,`StringLiteral`),v(function(e,t,n){if(e.kind===`namespace`&&g(`StringLiteral`,n))throw TypeError(`TSModuleDeclaration of kind 'namespace' cannot have a StringLiteral id.`)},{oneOfNodeTypes:[`TSEntityName`,`StringLiteral`]}))},body:b(`TSModuleBlock`)}}),M(`TSModuleBlock`,{aliases:[`Scopable`,`Block`,`BlockParent`,`FunctionParent`],visitor:[`body`],fields:{body:w(`Statement`)}}),M(`TSImportType`,{aliases:[`TSType`],builder:[`source`,`qualifier`,`typeArguments`],visitor:[`source`,`options`,`qualifier`,`typeArguments`],fields:{source:b(`StringLiteral`),qualifier:S(`TSEntityName`),typeArguments:S(`TSTypeParameterInstantiation`),options:{validate:E(`ObjectExpression`),optional:!0}}}),M(`TSImportEqualsDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`moduleReference`],fields:{id:b(`Identifier`),moduleReference:b(`TSEntityName`,`TSExternalModuleReference`),importKind:{validate:T(`type`,`value`),optional:!0}}}),M(`TSExternalModuleReference`,{visitor:[`expression`],fields:{expression:b(`StringLiteral`)}}),M(`TSNonNullExpression`,{aliases:[`Expression`,`LVal`,`PatternLike`],visitor:[`expression`],fields:{expression:b(`Expression`)}}),M(`TSExportAssignment`,{aliases:[`Statement`],visitor:[`expression`],fields:{expression:b(`Expression`)}}),M(`TSNamespaceExportDeclaration`,{aliases:[`Statement`],visitor:[`id`],fields:{id:b(`Identifier`)}}),M(`TSTypeAnnotation`,{visitor:[`typeAnnotation`],fields:{typeAnnotation:{validate:E(`TSType`)}}}),M(`TSTypeParameterInstantiation`,{visitor:[`params`],fields:{params:w(`TSType`)}}),M(`TSTypeParameterDeclaration`,{visitor:[`params`],fields:{params:w(`TSTypeParameter`)}}),M(`TSTypeParameter`,{builder:[`constraint`,`default`,`name`],visitor:[`name`,`constraint`,`default`],fields:{name:{validate:E(`Identifier`)},in:{validate:D(`boolean`),optional:!0},out:{validate:D(`boolean`),optional:!0},const:{validate:D(`boolean`),optional:!0},constraint:{validate:E(`TSType`),optional:!0},default:{validate:E(`TSType`),optional:!0}}});const sn={ModuleDeclaration:`ImportOrExportDeclaration`};Object.keys(sn).forEach(e=>{_[e]=_[sn[e]]});for(let{types:e,set:t}of Ot)for(let n of e){let e=_[n];e?e.forEach(t.add,t):t.add(n)}[].concat(Object.keys(_t),Object.keys(_),Object.keys(xt));function cn(e,t,n){if(!e)return;let r=yt[e.type];if(!r)return;let i=r[t];un(e,t,n,i),dn(e,t,n)}function ln(e,t,n,r,i){if(e!=null&&e.validate&&!(e.optional&&r==null)&&(e.validate(t,n,r),i)){var a;let e=r.type;if(e==null)return;(a=St[e])==null||a.call(St,t,n,r)}}function un(e,t,n,r){r!=null&&r.validate&&(r.optional&&n==null||r.validate(e,t,n))}function dn(e,t,n){var r;let i=n==null?void 0:n.type;i!=null&&((r=St[i])==null||r.call(St,e,t,n))}const{validateInternal:P}=Object.defineProperty({__proto__:null,default:cn,validateChild:dn,validateField:un,validateInternal:ln},Symbol.toStringTag,{value:`Module`}),{NODE_FIELDS:F}=Lt;function fn(e){let t={type:`ArrayExpression`,elements:e},n=F.ArrayExpression;return P(n.elements,t,`elements`,e,1),t}function pn(e,t=[]){let n={type:`BlockStatement`,body:e,directives:t},r=F.BlockStatement;return P(r.body,n,`body`,e,1),P(r.directives,n,`directives`,t,1),n}function I(e,t){let n={type:`CallExpression`,callee:e,arguments:t},r=F.CallExpression;return P(r.callee,n,`callee`,e,1),P(r.arguments,n,`arguments`,t,1),n}function L(e){let t={type:`ExpressionStatement`,expression:e},n=F.ExpressionStatement;return P(n.expression,t,`expression`,e,1),t}function R(e){let t={type:`Identifier`,name:e},n=F.Identifier;return P(n.name,t,`name`,e),t}function z(e){let t={type:`StringLiteral`,value:e},n=F.StringLiteral;return P(n.value,t,`value`,e),t}function mn(e){let t={type:`NumericLiteral`,value:e},n=F.NumericLiteral;return P(n.value,t,`value`,e),t}function hn(){return{type:`NullLiteral`}}function gn(e){let t={type:`BooleanLiteral`,value:e},n=F.BooleanLiteral;return P(n.value,t,`value`,e),t}function _n(e,t,n=!1){let r={type:`MemberExpression`,object:e,property:t,computed:n},i=F.MemberExpression;return P(i.object,r,`object`,e,1),P(i.property,r,`property`,t,1),P(i.computed,r,`computed`,n),r}function vn(e){let t={type:`ObjectExpression`,properties:e},n=F.ObjectExpression;return P(n.properties,t,`properties`,e,1),t}function yn(e,t,n,r,i=!1,a=!1,o=!1){let s={type:`ObjectMethod`,kind:e,key:t,params:n,body:r,computed:i,generator:a,async:o},c=F.ObjectMethod;return P(c.kind,s,`kind`,e),P(c.key,s,`key`,t,1),P(c.params,s,`params`,n,1),P(c.body,s,`body`,r,1),P(c.computed,s,`computed`,i),P(c.generator,s,`generator`,a),P(c.async,s,`async`,o),s}function bn(e,t,n=!1,r=!1){let i={type:`ObjectProperty`,key:e,value:t,computed:n,shorthand:r},a=F.ObjectProperty;return P(a.key,i,`key`,e,1),P(a.value,i,`value`,t,1),P(a.computed,i,`computed`,n),P(a.shorthand,i,`shorthand`,r),i}function xn(e=null){let t={type:`ReturnStatement`,argument:e},n=F.ReturnStatement;return P(n.argument,t,`argument`,e,1),t}function Sn(e,t){let n={type:`VariableDeclaration`,kind:e,declarations:t},r=F.VariableDeclaration;return P(r.kind,n,`kind`,e),P(r.declarations,n,`declarations`,t,1),n}function Cn(e,t=null){let n={type:`VariableDeclarator`,id:e,init:t},r=F.VariableDeclarator;return P(r.id,n,`id`,e,1),P(r.init,n,`init`,t,1),n}function B(e,t,n=!1){let r={type:`ArrowFunctionExpression`,params:e,body:t,async:n},i=F.ArrowFunctionExpression;return P(i.params,r,`params`,e,1),P(i.body,r,`body`,t,1),P(i.async,r,`async`,n),r}function wn(e,t,n=null){let r={type:`ImportDeclaration`,specifiers:e,source:t,attributes:n},i=F.ImportDeclaration;return P(i.specifiers,r,`specifiers`,e,1),P(i.source,r,`source`,t,1),P(i.attributes,r,`attributes`,n,1),r}function Tn(e,t){let n={type:`ImportSpecifier`,local:e,imported:t},r=F.ImportSpecifier;return P(r.local,n,`local`,e,1),P(r.imported,n,`imported`,t,1),n}function En(e,t=!1){let n={type:`TemplateElement`,value:e,tail:t},r=F.TemplateElement;return P(r.value,n,`value`,e),P(r.tail,n,`tail`,t),n}function Dn(e,t){let n={type:`TemplateLiteral`,quasis:e,expressions:t},r=F.TemplateLiteral;return P(r.quasis,n,`quasis`,e,1),P(r.expressions,n,`expressions`,t,1),n}function On(e,t,n){let r={type:`OptionalCallExpression`,callee:e,arguments:t,optional:n},i=F.OptionalCallExpression;return P(i.callee,r,`callee`,e,1),P(i.arguments,r,`arguments`,t,1),P(i.optional,r,`optional`,n),r}const{hasOwn:kn}=Object;function An(e,t,n,r){return e&&typeof e.type==`string`?Nn(e,t,n,r):e}function jn(e,t,n,r){return Array.isArray(e)?e.map(e=>An(e,t,n,r)):An(e,t,n,r)}function Mn(e,t=!0,n=!1){return e&&Nn(e,t,n,new Map)}function Nn(e,t=!0,n=!1,r){if(!e)return e;let{type:i}=e,o={type:e.type};if(Ce(e))o.name=e.name,kn(e,`optional`)&&typeof e.optional==`boolean`&&(o.optional=e.optional),kn(e,`typeAnnotation`)&&(o.typeAnnotation=t?jn(e.typeAnnotation,!0,n,r):e.typeAnnotation),kn(e,`decorators`)&&(o.decorators=t?jn(e.decorators,!0,n,r):e.decorators);else if(kn(yt,i))for(let a of Object.keys(yt[i]))kn(e,a)&&(t?o[a]=be(e)&&a===`comments`?Pn(e.comments,t,n,r):jn(e[a],!0,n,r):o[a]=e[a]);else throw Error(`Unknown node type: "${i}"`);return kn(e,`loc`)&&(n?o.loc=null:o.loc=e.loc),kn(e,`leadingComments`)&&(o.leadingComments=Pn(e.leadingComments,t,n,r)),kn(e,`innerComments`)&&(o.innerComments=Pn(e.innerComments,t,n,r)),kn(e,`trailingComments`)&&(o.trailingComments=Pn(e.trailingComments,t,n,r)),kn(e,`extra`)&&(o.extra=a({},e.extra)),o}function Pn(e,t,n,r){return!e||!t?e:e.map(e=>{let t=r.get(e);if(t)return t;let{type:i,value:a,loc:o}=e,s={type:i,value:a,loc:o};return n&&(s.loc=void 0),r.set(e,s),s})}function Fn(e,t,n){if(!n||!e)return e;let r=`${t}Comments`;return e[r]?t===`leading`?e[r]=n.concat(e[r]):e[r].push(...n):e[r]=n,e}function In(e,t,n,r){return Fn(e,t,[{type:r?`CommentLine`:`CommentBlock`,value:n}])}_.Standardized,_.Expression,_.Binary,_.Scopable,_.BlockParent,_.Block,_.Statement,_.Terminatorless,_.CompletionStatement,_.Conditional,_.Loop,_.While,_.ExpressionWrapper,_.For,_.ForXStatement,_.Function,_.FunctionParent,_.Pureish,_.Declaration,_.FunctionParameter,_.PatternLike,_.LVal,_.TSEntityName,_.Literal,_.Immutable,_.UserWhitespacable,_.Method,_.ObjectMember,_.Property,_.UnaryLike,_.Pattern,_.Class,_.ImportOrExportDeclaration,_.ExportDeclaration,_.ModuleSpecifier,_.Private,_.Flow,_.FlowType,_.FlowBaseAnnotation,_.FlowDeclaration,_.FlowPredicate,_.EnumBody,_.EnumMember,_.JSX,_.Miscellaneous,_.Accessor,_.TypeScript,_.TSTypeElement,_.TSType,_.TSBaseType;const Ln=Symbol(),Rn=Symbol();function zn(e,t,n){if(!e)return!1;let r=_t[e.type];if(!r)return!1;n=n||{};let i=t(e,n);if(i!==void 0)switch(i){case Ln:return!1;case Rn:return!0}for(let i of r){let r=e[i];if(r){if(Array.isArray(r)){for(let e of r)if(zn(e,t,n))return!0}else if(zn(r,t,n))return!0}}return!1}zn.skip=Ln,zn.stop=Rn;const Bn=[`tokens`,`start`,`end`,`loc`,`raw`,`rawValue`],Vn=[...ot,`comments`,...Bn];function Hn(e,t={}){let n=t.preserveComments?Bn:Vn;for(let t of n)e[t]!=null&&(e[t]=void 0);for(let t of Object.keys(e))t.startsWith(`_`)&&e[t]!=null&&(e[t]=void 0);let r=Object.getOwnPropertySymbols(e);for(let t of r)e[t]=null}function Un(e,t){return zn(e,Hn,t),e}function Wn(e,t=e.key){let n;return e.kind===`method`?Wn.increment()+``:(n=Ce(t)?t.name:we(t)?JSON.stringify(t.value):JSON.stringify(Un(Mn(t))),e.computed&&(n=`[${n}]`),e.static&&(n=`static:${n}`),n)}Wn.uid=0,Wn.increment=function(){return Wn.uid>=2**53-1?Wn.uid=0:Wn.uid++},Function.call.bind(Object.prototype.toString);function Gn(e,t,n,r){let i=[].concat(e),a=Object.create(null);for(;i.length;){let e=i.shift();if(!e||r&&(ye(e)||je(e)||Me(e)))continue;if(Ce(e)){t?(a[e.name]=a[e.name]||[]).push(e):a[e.name]=e;continue}if($e(e)&&!Fe(e)){Qe(e.declaration)&&i.push(e.declaration);continue}if(n){if(xe(e)){i.push(e.id);continue}if(Se(e)||Pe(e))continue}let o=Gn.keys[e.type];if(o)for(let t=0;t<o.length;t++){let n=e[o[t]];n&&(Array.isArray(n)?i.push(...n):i.push(n))}}return a}Gn.keys={DeclareClass:[`id`],DeclareFunction:[`id`],DeclareModule:[`id`],DeclareVariable:[`id`],DeclareInterface:[`id`],DeclareTypeAlias:[`id`],DeclareOpaqueType:[`id`],InterfaceDeclaration:[`id`],TypeAlias:[`id`],OpaqueType:[`id`],CatchClause:[`param`],LabeledStatement:[`label`],UnaryExpression:[`argument`],AssignmentExpression:[`left`],ImportSpecifier:[`local`],ImportNamespaceSpecifier:[`local`],ImportDefaultSpecifier:[`local`],ImportDeclaration:[`specifiers`],TSImportEqualsDeclaration:[`id`],ExportSpecifier:[`exported`],ExportNamespaceSpecifier:[`exported`],ExportDefaultSpecifier:[`exported`],FunctionDeclaration:[`id`,`params`],FunctionExpression:[`id`,`params`],ArrowFunctionExpression:[`params`],ObjectMethod:[`params`],ClassMethod:[`params`],ClassPrivateMethod:[`params`],ForInStatement:[`left`],ForOfStatement:[`left`],ClassDeclaration:[`id`],ClassExpression:[`id`],RestElement:[`argument`],UpdateExpression:[`argument`],ObjectProperty:[`value`],AssignmentPattern:[`left`],ArrayPattern:[`elements`],ObjectPattern:[`properties`],VariableDeclaration:[`declarations`],VariableDeclarator:[`id`]};const Kn=`@zeus-js/runtime-dom`;function qn(e,t){return`${e}:${t}`}function Jn(e,t=`dom`){var n;let r=e.hub;return{renderer:t,moduleName:(r==null||(n=r.file)==null||(n=n.metadata)==null||(n=n.zeus)==null||(n=n.config)==null?void 0:n.moduleName)||`@zeus-js/runtime-dom`}}function Yn(e,t,n=Jn(e,`dom`).moduleName){let r=Zn(e),i=r.importMethods||(r.importMethods=new Map),a=qn(n,t),o=i.get(a);if(o)return Mn(o.local);let s=Qn(e).scope.generateUidIdentifier(t);return i.set(a,{imported:t,local:s,moduleName:n}),Mn(s)}function Xn(e){let t=e.scope.data.importMethods;if(!(t!=null&&t.size))return;let n=new Map;for(let e of t.values()){let t=n.get(e.moduleName);t?t.push(e):n.set(e.moduleName,[e])}let r=[];for(let[e,t]of n)r.push(wn(t.map(e=>Tn(Mn(e.local),R(e.imported))),z(e)));e.unshiftContainer(`body`,r)}function Zn(e){return e.scope.getProgramParent().path.scope.data}function Qn(e){return e.scope.getProgramParent().path}function $n(e,t=`dom`){var n,r;return(n=(r=e.scope.data.templates)==null?void 0:r.filter(e=>e.renderer===t))==null?[]:n}function er(e){return e.replace(/\\/g,`\\\\`).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function tr(e){return/^<(math|annotation|annotation-xml|maction|merror|mfrac|mi|mmultiscripts|mn|mo|mover|mpadded|mphantom|mprescripts|mroot|mrow|ms|mspace|msqrt|mstyle|msub|msubsup|msup|mtable|mtd|mtext|mtr|munder|munderover|semantics|menclose|mfenced)(\s|>)/.test(e)}function nr(e){let t=$n(e,`dom`);if(!t.length)return;let n=Yn(e,`template`,Jn(e,`dom`).moduleName),r=t.map(e=>{let t=e.templateWithClosingTags||e.template,r={cooked:t,raw:er(t)},i=!!(e.isCE||e.isImportNode),a=tr(t),o=[Dn([En(r,!0)],[])];return(e.isSVG||i||a)&&o.push(gn(i),gn(!!e.isSVG),gn(a)),Cn(Mn(e.id),In(I(Mn(n),o),`leading`,`#__PURE__`))});e.node.body.unshift(Sn(`var`,r))}function rr(e,t){let n=e.scope.getProgramParent().path.scope.data;(n.events||(n.events=new Set)).add(t)}function ir(e){let t=e.scope.data.events;t!=null&&t.size&&e.node.body.push(L(I(Yn(e,`delegateEvents`,Jn(e,`dom`).moduleName),[fn(Array.from(t).map(e=>z(e)))])))}const ar={moduleName:Kn,generate:`dom`,hydratable:!1,delegateEvents:!0,delegatedEvents:[],builtIns:[],wrapConditionals:!0,omitNestedClosingTags:!1,omitLastClosingTag:!0,omitQuotes:!0,contextToCustomElements:!1,staticMarker:`@once`,effectWrapper:`effect`,memoWrapper:`memo`,validate:!0,inlineStyles:!0};function or(e){return u(ar,e)}var sr=class{constructor(e,t){this.options=e,this.programPath=t}runtimeModule(){return this.options.moduleName||`@zeus-js/runtime-dom`}uid(e){return this.programPath.scope.generateUidIdentifier(e)}importRuntime(e){let t=this.runtimeModule(),n=this.programPath.scope.data,r=n.importMethods||(n.importMethods=new Map),i=`${t}:${e}`,a=r.get(i);if(a)return Mn(a.local);let o=this.uid(e);return r.set(i,{moduleName:t,imported:e,local:o}),Mn(o)}registerTemplate(e,t=!1){let n=this.programPath.scope.data,r=n.templateMap||(n.templateMap=new Map),i=n.templates||(n.templates=[]),a=r.get(e);if(a)return{id:Mn(a.id),html:e,isSVG:!!a.isSVG};let o=this.uid(`tmpl$`);return r.set(e,{id:o,template:e,templateWithClosingTags:e,renderer:`dom`,isSVG:t,isCE:e.includes(`-`),isImportNode:/^<(img|iframe)(\s|>)/.test(e)}),i.push(r.get(e)),{id:Mn(o),html:e,isSVG:t}}};function cr(e,t){return new sr(t,e.scope.getProgramParent().path)}function lr(e,t){let n=new WeakSet,r=new Set([Kn,`@zeus-js/zeus`,t]);for(let t of e.node.body)if(!(!Ie(t)||!r.has(t.source.value)))for(let r of t.specifiers){if(!dr(r))continue;let t=e.scope.getBinding(r.local.name);if(!(!t||t.path.node!==r))for(let e of t.referencePaths)fr(e,n)}Zn(e).defineElementSetups=n}function ur(e){var t;let n=Zn(e).defineElementSetups,r=e.getFunctionParent();if(!n||!r||!Ze(r.node)||!n.has(r.node))return!1;let i=hr(e);if(r.isArrowFunctionExpression()&&r.node.body===i.node)return!0;let a=i.parentPath;return!!(a!=null&&a.isReturnStatement()&&a.node.argument===i.node&&((t=a.getFunctionParent())==null?void 0:t.node)===r.node)}function dr(e){if(!Le(e))return!1;let t=e.imported;return Ce(t)&&t.name===`defineElement`||we(t)&&t.value===`defineElement`}function fr(e,t){let n=e.parentPath;if(e.key!==`callee`||!(n!=null&&n.isCallExpression())||n.node.callee!==e.node)return;let r=n.get(`arguments`)[2];if(!r)return;let i=pr(r,new Set);i&&t.add(i)}function pr(e,t){let n=mr(e);if(n.isArrowFunctionExpression()||n.isFunctionExpression())return n.node;if(!n.isIdentifier())return;let r=n.scope.getBinding(n.node.name);if(!(r!=null&&r.constant)||t.has(r))return;if(t.add(r),r.path.isFunctionDeclaration())return r.path.node;if(!r.path.isVariableDeclarator())return;let i=r.path.get(`init`);if(!(Array.isArray(i)||!i.node))return pr(i,t)}function mr(e){let t=e;for(;_r(t.node);)t=t.get(`expression`);return t}function hr(e){let t=e;for(;t.parentPath&&gr(t.parentPath,t);)t=t.parentPath;return t}function gr(e,t){let n=e.node;return _r(n)&&n.expression===t.node}function _r(e){return ke(e)||qe(e)||Je(e)||Ye(e)||He(e)||Xe(e)}const vr=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`];function yr(e,t=!1){let n=e.replace(/&/g,`&`);return t?n.replace(/"/g,`"`).replace(/>/g,`>`):n.replace(/</g,`<`)}function br(e){return e.replace(/\r\n?/g,`
|
|
3
|
+
`);case 114:return s(`\r`);case 120:{let i;return{code:i,pos:t}=ge(e,t,n,r,2,!1,o,a),s(i===null?null:String.fromCharCode(i))}case 117:{let i;return{code:i,pos:t}=ve(e,t,n,r,o,a),s(i===null?null:String.fromCodePoint(i))}case 116:return s(` `);case 98:return s(`\b`);case 118:return s(`\v`);case 102:return s(`\f`);case 13:e.charCodeAt(t)===10&&++t;case 10:n=t,++r;case 8232:case 8233:return s(``);case 56:case 57:if(i)return s(null);a.strictNumericEscape(t-1,n,r);default:if(c>=48&&c<=55){let o=t-1,c=/^[0-7]+/.exec(e.slice(o,t+2))[0],l=parseInt(c,8);l>255&&(c=c.slice(0,-1),l=parseInt(c,8)),t+=c.length-1;let u=e.charCodeAt(t);if(c!==`0`||u===56||u===57){if(i)return s(null);a.strictNumericEscape(o,n,r)}return s(String.fromCharCode(l))}return s(String.fromCharCode(c))}}function ge(e,t,n,r,i,a,o,s){let c=t,l;return{n:l,pos:t}=_e(e,t,n,r,16,i,a,!1,s,!o),l===null&&(o?s.invalidEscapeSequence(c,n,r):t=c-1),{code:l,pos:t}}function _e(e,t,n,r,i,a,o,s,c,l){let u=t,d=i===16?de.hex:de.decBinOct,f=i===16?fe.hex:i===10?fe.dec:i===8?fe.oct:fe.bin,p=!1,m=0;for(let u=0,ee=a==null?1/0:a;u<ee;++u){let a=e.charCodeAt(t),u;if(a===95&&s!==`bail`){let i=e.charCodeAt(t-1),a=e.charCodeAt(t+1);if(!s){if(l)return{n:null,pos:t};c.numericSeparatorInEscapeSequence(t,n,r)}else if(Number.isNaN(a)||!f(a)||d.has(i)||d.has(a)){if(l)return{n:null,pos:t};c.unexpectedNumericSeparator(t,n,r)}++t;continue}if(u=a>=97?a-97+10:a>=65?a-65+10:ue(a)?a-48:1/0,u>=i){if(u<=9&&l)return{n:null,pos:t};if(u<=9&&c.invalidDigit(t,n,r,i))u=0;else if(o)u=0,p=!0;else break}++t,m=m*i+u}return t===u||a!=null&&t-u!==a||p?{n:null,pos:t}:{n:m,pos:t}}function ve(e,t,n,r,i,a){let o=e.charCodeAt(t),s;if(o===123){if(++t,{code:s,pos:t}=ge(e,t,n,r,e.indexOf(`}`,t)-t,!0,i,a),++t,s!==null&&s>1114111)if(i)a.invalidCodePoint(t,n,r);else return{code:null,pos:t}}else({code:s,pos:t}=ge(e,t,n,r,4,!1,i,a));return{code:s,pos:t}}function h(e,t){let n=Object.keys(t);for(let r of n)if(e[r]!==t[r])return!1;return!0}function ye(e,t){return!e||e.type!==`AssignmentExpression`?!1:t==null||h(e,t)}function be(e,t){return!e||e.type!==`File`?!1:t==null||h(e,t)}function xe(e,t){return!e||e.type!==`FunctionDeclaration`?!1:t==null||h(e,t)}function Se(e,t){return!e||e.type!==`FunctionExpression`?!1:t==null||h(e,t)}function Ce(e,t){return!e||e.type!==`Identifier`?!1:t==null||h(e,t)}function we(e,t){return!e||e.type!==`StringLiteral`?!1:t==null||h(e,t)}function Te(e,t){return!e||e.type!==`NumericLiteral`?!1:t==null||h(e,t)}function Ee(e,t){return!e||e.type!==`NullLiteral`?!1:t==null||h(e,t)}function De(e,t){return!e||e.type!==`BooleanLiteral`?!1:t==null||h(e,t)}function Oe(e,t){return!e||e.type!==`MemberExpression`?!1:t==null||h(e,t)}function ke(e,t){return!e||e.type!==`ParenthesizedExpression`?!1:t==null||h(e,t)}function Ae(e,t){return!e||e.type!==`ThisExpression`?!1:t==null||h(e,t)}function je(e,t){return!e||e.type!==`UnaryExpression`?!1:t==null||h(e,t)}function Me(e,t){return!e||e.type!==`UpdateExpression`?!1:t==null||h(e,t)}function Ne(e,t){return!e||e.type!==`ArrowFunctionExpression`?!1:t==null||h(e,t)}function Pe(e,t){return!e||e.type!==`ClassExpression`?!1:t==null||h(e,t)}function Fe(e,t){return!e||e.type!==`ExportAllDeclaration`?!1:t==null||h(e,t)}function Ie(e,t){return!e||e.type!==`ImportDeclaration`?!1:t==null||h(e,t)}function Le(e,t){return!e||e.type!==`ImportSpecifier`?!1:t==null||h(e,t)}function Re(e,t){return!e||e.type!==`MetaProperty`?!1:t==null||h(e,t)}function ze(e,t){return!e||e.type!==`Super`?!1:t==null||h(e,t)}function Be(e,t){return!e||e.type!==`OptionalMemberExpression`?!1:t==null||h(e,t)}function Ve(e,t){return!e||e.type!==`PrivateName`?!1:t==null||h(e,t)}function He(e,t){return!e||e.type!==`TypeCastExpression`?!1:t==null||h(e,t)}function Ue(e,t){return!e||e.type!==`JSXIdentifier`?!1:t==null||h(e,t)}function We(e,t){return!e||e.type!==`JSXMemberExpression`?!1:t==null||h(e,t)}function Ge(e,t){return!e||e.type!==`JSXNamespacedName`?!1:t==null||h(e,t)}function Ke(e,t){return!e||e.type!==`JSXSpreadAttribute`?!1:t==null||h(e,t)}function qe(e,t){return!e||e.type!==`TSAsExpression`?!1:t==null||h(e,t)}function Je(e,t){return!e||e.type!==`TSSatisfiesExpression`?!1:t==null||h(e,t)}function Ye(e,t){return!e||e.type!==`TSTypeAssertion`?!1:t==null||h(e,t)}function Xe(e,t){return!e||e.type!==`TSNonNullExpression`?!1:t==null||h(e,t)}function Ze(e,t){if(!e)return!1;switch(e.type){case`FunctionDeclaration`:case`FunctionExpression`:case`ObjectMethod`:case`ArrowFunctionExpression`:case`ClassMethod`:case`ClassPrivateMethod`:break;default:return!1}return t==null||h(e,t)}function Qe(e,t){if(!e)return!1;switch(e.type){case`FunctionDeclaration`:case`VariableDeclaration`:case`ClassDeclaration`:case`ExportAllDeclaration`:case`ExportDefaultDeclaration`:case`ExportNamedDeclaration`:case`ImportDeclaration`:case`DeclareClass`:case`DeclareFunction`:case`DeclareInterface`:case`DeclareModule`:case`DeclareModuleExports`:case`DeclareTypeAlias`:case`DeclareOpaqueType`:case`DeclareVariable`:case`DeclareExportDeclaration`:case`DeclareExportAllDeclaration`:case`InterfaceDeclaration`:case`OpaqueType`:case`TypeAlias`:case`EnumDeclaration`:case`TSDeclareFunction`:case`TSInterfaceDeclaration`:case`TSTypeAliasDeclaration`:case`TSEnumDeclaration`:case`TSModuleDeclaration`:case`TSImportEqualsDeclaration`:break;case`Placeholder`:if(e.expectedNode===`Declaration`)break;default:return!1}return t==null||h(e,t)}function $e(e,t){if(!e)return!1;switch(e.type){case`ExportAllDeclaration`:case`ExportDefaultDeclaration`:case`ExportNamedDeclaration`:break;default:return!1}return t==null||h(e,t)}function et(e){return Oe(e)||Re(e)}function tt(e,t,n){var r;if(!et(e))return!1;let i=Array.isArray(t)?t:t.split(`.`),a=[],o;for(o=e;et(o);o=(r=o.object)==null?o.meta:r)a.push(o.property);if(a.push(o),a.length<i.length||!n&&a.length>i.length)return!1;for(let e=0,t=a.length-1;e<i.length;e++,t--){let n=a[t],r;if(Ce(n))r=n.name;else if(we(n))r=n.value;else if(Ae(n))r=`this`;else if(ze(n))r=`super`;else if(Ve(n))r=`#`+n.id.name;else return!1;if(i[e]!==r)return!1}return!0}function nt(e,t){let n=e.split(`.`);return e=>tt(e,n,t)}nt(`React.Component`);function rt(e,t){if(e===t)return!0;if(e==null||vt[t])return!1;let n=_[t];return!!(n!=null&&n.includes(e))}function it(e,t){if(e===t)return!0;let n=Xt[e];return!!(n!=null&&n.includes(t))}function g(e,t,n){return t?rt(t.type,e)?n===void 0?!0:h(t,n):!n&&t.type===`Placeholder`&&e in _?it(t.expectedNode,e):!1:!1}function at(e,t=!0){return typeof e!=`string`||t&&(le(e)||ce(e,!0))?!1:re(e)}const ot=[`leadingComments`,`trailingComments`,`innerComments`],st=[`||`,`&&`,`??`],ct=[`++`,`--`],lt=[`==`,`===`,`!=`,`!==`,`in`,`instanceof`,`>`,`<`,`>=`,`<=`],ut=[`-`,`/`,`%`,`*`,`**`,`&`,`|`,`>>`,`>>>`,`<<`,`^`],dt=[`+`,...ut,...lt,`|>`],ft=[`=`,`+=`,...ut.map(e=>e+`=`),...st.map(e=>e+`=`)],pt=[`delete`,`!`],mt=[`+`,`-`,`~`],ht=[`typeof`],gt=[`void`,`throw`,...pt,...mt,...ht],_t={},vt={},_={},yt={},bt={},xt={},St={},Ct={};function wt(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e}function v(e,...t){return Object.assign(e,...t)}function y(e){return{validate:e}}function b(...e){return y(E(...e))}function x(e){return{validate:e,optional:!0}}function Tt(e,t){return{validate:e,default:t,optional:!1}}function S(...e){return{validate:E(...e),optional:!0}}function Et(e){return O(D(`array`),Dt(e))}function C(...e){return Et(E(...e))}function w(...e){return y(C(...e))}function Dt(e){let t=fn;function n(n,r,i){if(!Array.isArray(i))return;let a=0,o={toString(){return`${r}[${a}]`}};for(;a<i.length;a++){let r=i[a];e(n,o,r),t(n,o,r)}}return n.each=e,n}function T(...e){function t(t,n,r){if(!e.includes(r))throw TypeError(`Property ${n} expected value to be one of ${JSON.stringify(e)} but got ${JSON.stringify(r)}`)}return t.oneOf=e,t}const Ot=[];function E(...e){let t=new Set;Ot.push({types:e,set:t});function n(n,r,i){let a=i==null?void 0:i.type;if(a!=null){if(t.has(a)){fn(n,r,i);return}if(a===`Placeholder`){for(let t of e)if(g(t,i)){fn(n,r,i);return}}}throw TypeError(`Property ${r} of ${n.type} expected node to be of a type ${JSON.stringify(e)} but instead got ${JSON.stringify(a)}`)}return n.oneOfNodeTypes=e,n}function kt(...e){function t(t,n,r){let i=wt(r);for(let a of e)if(i===a||g(a,r)){fn(t,n,r);return}throw TypeError(`Property ${n} of ${t.type} expected node to be of a type ${JSON.stringify(e)} but instead got ${JSON.stringify(r==null?void 0:r.type)}`)}return t.oneOfNodeOrValueTypes=e,t}function D(e){function t(t,n,r){if(wt(r)!==e)throw TypeError(`Property ${n} expected type of ${e} but got ${wt(r)}`)}return t.type=e,t}function At(e){let t=Object.keys(e);function n(n,r,i){let a=[];for(let r of t)try{dn(n,r,i[r],e[r])}catch(e){if(e instanceof TypeError){a.push(e.message);continue}throw e}if(a.length)throw TypeError(`Property ${r} of ${n.type} expected to have the following:\n${a.join(`
|
|
4
|
+
`)}`)}return n.shapeOf=e,n}function jt(){function e(e){let t=e;for(;e;){let{type:e}=t;if(e===`OptionalCallExpression`){if(t.optional)return;t=t.callee;continue}if(e===`OptionalMemberExpression`){if(t.optional)return;t=t.object;continue}break}throw TypeError(`Non-optional ${e.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${t==null?void 0:t.type}`)}return e}function O(...e){function t(...t){for(let n of e)n(...t)}if(t.chainOf=e,e.length>=2&&`type`in e[0]&&e[0].type===`array`&&!(`each`in e[1]))throw Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`);return t}const Mt=new Set([`aliases`,`builder`,`deprecatedAlias`,`fields`,`inherits`,`visitor`,`validate`,`unionShape`]),Nt=new Set([`default`,`optional`,`deprecated`,`validate`]),Pt={};function Ft(...e){return(t,n={})=>{let r=n.aliases;if(!r){var i;n.inherits&&(r=(i=Pt[n.inherits].aliases)==null?void 0:i.slice()),r!=null||(r=[]),n.aliases=r}let a=e.filter(e=>!r.includes(e));r.unshift(...a),It(t,n)}}function It(e,t={}){let n=t.inherits&&Pt[t.inherits]||{},r=t.visitor||n.visitor||[],i=t.aliases||n.aliases||[],a=t.builder||n.builder||t.visitor||[],o=t.fields;if(!o&&(o={},n.fields)){let e=Object.getOwnPropertyNames(n.fields);for(let t of e){let e=n.fields[t],r=e.default;if(Array.isArray(r)?r.length>0:r&&typeof r==`object`)throw Error(`field defaults can only be primitives or empty arrays currently`);o[t]={default:Array.isArray(r)?[]:r,optional:e.optional,deprecated:e.deprecated,validate:e.validate}}}for(let n of Object.keys(t))if(!Mt.has(n))throw Error(`Unknown type option "${n}" on ${e}`);t.deprecatedAlias&&(xt[t.deprecatedAlias]=e);for(let e of r.concat(a))o[e]=o[e]||{};for(let t of Object.keys(o)){let n=o[t];n.default===null&&(n.optional!=null||(n.optional=!0)),n.default===void 0?(n.default=null,n.optional!=null||(n.optional=!1)):!n.validate&&n.default!=null&&(n.validate=D(wt(n.default)));for(let r of Object.keys(n))if(!Nt.has(r))throw Error(`Unknown field key "${r}" on ${e}.${t}`)}_t[e]=t.visitor=r,bt[e]=t.builder=a,yt[e]=t.fields=o,vt[e]=t.aliases=i,i.forEach(t=>{_[t]=_[t]||[],_[t].push(e)}),t.validate&&(St[e]=t.validate),t.unionShape&&(Ct[e]=t.unionShape),Pt[e]=t}const Lt=Object.defineProperty({__proto__:null,ALIAS_KEYS:vt,BUILDER_KEYS:bt,DEPRECATED_KEYS:xt,FLIPPED_ALIAS_KEYS:_,NODE_FIELDS:yt,NODE_PARENT_VALIDATIONS:St,NODE_UNION_SHAPES__PRIVATE:Ct,VISITOR_KEYS:_t,allExpandedTypes:Ot,arrayOf:Et,arrayOfType:C,assertEach:Dt,assertNodeOrValueType:kt,assertNodeType:E,assertOneOf:T,assertOptionalChainStart:jt,assertShape:At,assertValueType:D,chain:O,combine:v,default:It,defineAliasedType:Ft,validate:y,validateArrayOfType:w,validateDefault:Tt,validateOptional:x,validateOptionalType:S,validateType:b},Symbol.toStringTag,{value:`Module`}),Rt=(e=!1)=>({unionShape:{discriminator:`computed`,shapes:[{name:`computed`,value:[!0],properties:{key:{validate:E(`Expression`)}}},{name:`nonComputed`,value:[!1],properties:{key:{validate:e?E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`PrivateName`):E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`)}}}]}}),zt={unionShape:{discriminator:`computed`,shapes:[{name:`computed`,value:[!0],properties:{property:{validate:E(`Expression`)}}},{name:`nonComputed`,value:[!1],properties:{property:{validate:E(`Identifier`,`PrivateName`)}}}]}},k=Ft(`Standardized`);k(`ArrayExpression`,{fields:{elements:{validate:Et(kt(`null`,`Expression`,`SpreadElement`)),default:void 0}},visitor:[`elements`],aliases:[`Expression`]}),k(`AssignmentExpression`,{fields:{operator:{validate:v(function(){let e=T(...ft),t=T(`=`);return function(n,r,i){(g(`Pattern`,n.left)?t:e)(n,r,i)}}(),{oneOf:ft})},left:{validate:E(`Identifier`,`MemberExpression`,`OptionalMemberExpression`,`ArrayPattern`,`ObjectPattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`)},right:{validate:E(`Expression`)}},builder:[`operator`,`left`,`right`],visitor:[`left`,`right`],aliases:[`Expression`]}),k(`BinaryExpression`,{builder:[`operator`,`left`,`right`],fields:{operator:{validate:T(...dt)},left:{validate:function(){let e=E(`Expression`),t=E(`Expression`,`PrivateName`);return v(function(n,r,i){(n.operator===`in`?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`PrivateName`]})}()},right:{validate:E(`Expression`)}},unionShape:{discriminator:`operator`,shapes:[{name:`in`,value:[`in`],properties:{left:{validate:E(`Expression`,`PrivateName`)}}},{name:`notIn`,value:dt.filter(e=>e!==`in`),properties:{left:{validate:E(`Expression`)}}}]},visitor:[`left`,`right`],aliases:[`Binary`,`Expression`]}),k(`InterpreterDirective`,{builder:[`value`],fields:{value:{validate:D(`string`)}}}),k(`Directive`,{visitor:[`value`],fields:{value:{validate:E(`DirectiveLiteral`)}}}),k(`DirectiveLiteral`,{builder:[`value`],fields:{value:{validate:D(`string`)}}}),k(`BlockStatement`,{builder:[`body`,`directives`],visitor:[`directives`,`body`],fields:{directives:{validate:C(`Directive`),default:[]},body:w(`Statement`)},aliases:[`Scopable`,`BlockParent`,`Block`,`Statement`]}),k(`BreakStatement`,{visitor:[`label`],fields:{label:{validate:E(`Identifier`),optional:!0}},aliases:[`Statement`,`Terminatorless`,`CompletionStatement`]}),k(`CallExpression`,{visitor:[`callee`,`typeArguments`,`arguments`],builder:[`callee`,`arguments`],aliases:[`Expression`],fields:{callee:{validate:E(`Expression`,`Super`,`Import`,`V8IntrinsicIdentifier`)},arguments:w(`Expression`,`SpreadElement`,`ArgumentPlaceholder`),typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),k(`CatchClause`,{visitor:[`param`,`body`],fields:{param:{validate:E(`Identifier`,`ArrayPattern`,`ObjectPattern`),optional:!0},body:{validate:E(`BlockStatement`)}},aliases:[`Scopable`,`BlockParent`]}),k(`ConditionalExpression`,{visitor:[`test`,`consequent`,`alternate`],fields:{test:{validate:E(`Expression`)},consequent:{validate:E(`Expression`)},alternate:{validate:E(`Expression`)}},aliases:[`Expression`,`Conditional`]}),k(`ContinueStatement`,{visitor:[`label`],fields:{label:{validate:E(`Identifier`),optional:!0}},aliases:[`Statement`,`Terminatorless`,`CompletionStatement`]}),k(`DebuggerStatement`,{aliases:[`Statement`]}),k(`DoWhileStatement`,{builder:[`test`,`body`],visitor:[`body`,`test`],fields:{test:{validate:E(`Expression`)},body:{validate:E(`Statement`)}},aliases:[`Statement`,`BlockParent`,`Loop`,`While`,`Scopable`]}),k(`EmptyStatement`,{aliases:[`Statement`]}),k(`ExpressionStatement`,{visitor:[`expression`],fields:{expression:{validate:E(`Expression`)}},aliases:[`Statement`,`ExpressionWrapper`]}),k(`File`,{builder:[`program`,`comments`,`tokens`],visitor:[`program`],fields:{program:{validate:E(`Program`)},comments:{validate:Dt(E(`CommentBlock`,`CommentLine`)),optional:!0},tokens:{validate:Dt(Object.assign(()=>{},{type:`any`})),optional:!0}}}),k(`ForInStatement`,{visitor:[`left`,`right`,`body`],aliases:[`Scopable`,`Statement`,`For`,`BlockParent`,`Loop`,`ForXStatement`],fields:{left:{validate:E(`VariableDeclaration`,`Identifier`,`MemberExpression`,`ArrayPattern`,`ObjectPattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`)},right:{validate:E(`Expression`)},body:{validate:E(`Statement`)}}}),k(`ForStatement`,{visitor:[`init`,`test`,`update`,`body`],aliases:[`Scopable`,`Statement`,`For`,`BlockParent`,`Loop`],fields:{init:{validate:E(`VariableDeclaration`,`Expression`),optional:!0},test:{validate:E(`Expression`),optional:!0},update:{validate:E(`Expression`),optional:!0},body:{validate:E(`Statement`)}}});const Bt=()=>({params:w(`FunctionParameter`),generator:{default:!1},async:{default:!1}}),Vt=()=>({returnType:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},typeParameters:{validate:E(`TypeParameterDeclaration`,`TSTypeParameterDeclaration`),optional:!0}}),Ht=()=>a(a({},Bt()),{},{declare:{validate:D(`boolean`),optional:!0},id:{validate:E(`Identifier`),optional:!0}});k(`FunctionDeclaration`,{builder:[`id`,`params`,`body`,`generator`,`async`],visitor:[`id`,`typeParameters`,`params`,`predicate`,`returnType`,`body`],fields:a(a(a({},Ht()),Vt()),{},{body:{validate:E(`BlockStatement`)},predicate:{validate:E(`FlowPredicate`),optional:!0}}),aliases:[`Scopable`,`Function`,`BlockParent`,`FunctionParent`,`Statement`,`Pureish`,`Declaration`],validate:function(){let e=E(`Identifier`);return function(t,n,r){g(`ExportDefaultDeclaration`,t)||e(r,`id`,r.id)}}()}),k(`FunctionExpression`,{inherits:`FunctionDeclaration`,aliases:[`Scopable`,`Function`,`BlockParent`,`FunctionParent`,`Expression`,`Pureish`],fields:a(a(a({},Bt()),Vt()),{},{id:{validate:E(`Identifier`),optional:!0},body:{validate:E(`BlockStatement`)},predicate:{validate:E(`FlowPredicate`),optional:!0}})});const Ut=()=>({typeAnnotation:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},optional:{validate:D(`boolean`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0}});k(`Identifier`,{builder:[`name`],visitor:[`typeAnnotation`,`decorators`],aliases:[`Expression`,`FunctionParameter`,`PatternLike`,`LVal`,`TSEntityName`],fields:a(a({},Ut()),{},{name:{validate:O(D(`string`),v(function(e,t,n){if(!at(n,!1))throw TypeError(`"${n}" is not a valid identifier name`)},{type:`string`}))}}),validate:function(e,t,n){let r=/\.(\w+)$/.exec(t.toString());if(!r)return;let[,i]=r,a={computed:!1};if(i===`property`){if(g(`MemberExpression`,e,a)||g(`OptionalMemberExpression`,e,a))return}else if(i===`key`){if(g(`Property`,e,a)||g(`Method`,e,a))return}else if(i===`exported`){if(g(`ExportSpecifier`,e))return}else if(i===`imported`){if(g(`ImportSpecifier`,e,{imported:n}))return}else if(i===`meta`&&g(`MetaProperty`,e,{meta:n}))return;if((le(n.name)||se(n.name,!1))&&n.name!==`this`)throw TypeError(`"${n.name}" is not a valid identifier`)}}),k(`IfStatement`,{visitor:[`test`,`consequent`,`alternate`],aliases:[`Statement`,`Conditional`],fields:{test:{validate:E(`Expression`)},consequent:{validate:E(`Statement`)},alternate:{optional:!0,validate:E(`Statement`)}}}),k(`LabeledStatement`,{visitor:[`label`,`body`],aliases:[`Statement`],fields:{label:{validate:E(`Identifier`)},body:{validate:E(`Statement`)}}}),k(`StringLiteral`,{builder:[`value`],fields:{value:{validate:D(`string`)}},aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`NumericLiteral`,{builder:[`value`],deprecatedAlias:`NumberLiteral`,fields:{value:{validate:O(D(`number`),v(function(e,t,n){if(1/n<0||!Number.isFinite(n)){let e=Error(`NumericLiterals must be non-negative finite numbers. You can use t.valueToNode(${n}) instead.`);if(!Error().stack.includes(`regenerator`))throw e}},{type:`number`}))}},aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`NullLiteral`,{aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`BooleanLiteral`,{builder:[`value`],fields:{value:{validate:D(`boolean`)}},aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`RegExpLiteral`,{builder:[`pattern`,`flags`],deprecatedAlias:`RegexLiteral`,aliases:[`Expression`,`Pureish`,`Literal`],fields:{pattern:{validate:D(`string`)},flags:{validate:O(D(`string`),v(function(e,t,n){let r=/[^dgimsuvy]/.exec(n);if(r)throw TypeError(`"${r[0]}" is not a valid RegExp flag`)},{type:`string`})),default:``}}}),k(`LogicalExpression`,{builder:[`operator`,`left`,`right`],visitor:[`left`,`right`],aliases:[`Binary`,`Expression`],fields:{operator:{validate:T(...st)},left:{validate:E(`Expression`)},right:{validate:E(`Expression`)}}}),k(`MemberExpression`,a(a({builder:[`object`,`property`,`computed`],visitor:[`object`,`property`],aliases:[`Expression`,`LVal`,`PatternLike`]},zt),{},{fields:{object:{validate:E(`Expression`,`Super`)},property:{validate:function(){let e=E(`Identifier`,`PrivateName`),t=E(`Expression`);return v(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`Identifier`,`PrivateName`]})}()},computed:{default:!1}}})),k(`NewExpression`,{inherits:`CallExpression`,fields:{callee:{validate:E(`Expression`)},arguments:w(`Expression`,`SpreadElement`,`ArgumentPlaceholder`),typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),k(`Program`,{visitor:[`directives`,`body`],builder:[`body`,`directives`,`sourceType`,`interpreter`],fields:{sourceType:{validate:T(`script`,`module`),default:`script`},interpreter:{validate:E(`InterpreterDirective`),default:null,optional:!0},directives:{validate:C(`Directive`),default:[]},body:w(`Statement`)},aliases:[`Scopable`,`BlockParent`,`Block`]}),k(`ObjectExpression`,{visitor:[`properties`],aliases:[`Expression`],fields:{properties:w(`ObjectMethod`,`ObjectProperty`,`SpreadElement`)}}),k(`ObjectMethod`,a(a({builder:[`kind`,`key`,`params`,`body`,`computed`,`generator`,`async`],visitor:[`decorators`,`key`,`typeParameters`,`params`,`returnType`,`body`]},Rt()),{},{fields:a(a(a({},Bt()),Vt()),{},{kind:{validate:T(`method`,`get`,`set`)},computed:{default:!1},key:{validate:function(){let e=E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`),t=E(`Expression`);return v(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`]})}()},decorators:{validate:C(`Decorator`),optional:!0},body:{validate:E(`BlockStatement`)}}),aliases:[`UserWhitespacable`,`Function`,`Scopable`,`BlockParent`,`FunctionParent`,`Method`,`ObjectMember`]})),k(`ObjectProperty`,a(a({builder:[`key`,`value`,`computed`,`shorthand`]},Rt(!0)),{},{fields:{computed:{default:!1},key:{validate:function(){let e=E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`PrivateName`),t=E(`Expression`);return v(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`PrivateName`]})}()},value:{validate:E(`Expression`,`PatternLike`)},shorthand:{validate:O(D(`boolean`),v(function(e,t,n){if(n){if(e.computed)throw TypeError(`Property shorthand of ObjectProperty cannot be true if computed is true`);if(!g(`Identifier`,e.key))throw TypeError(`Property shorthand of ObjectProperty cannot be true if key is not an Identifier`)}},{type:`boolean`})),default:!1},decorators:{validate:C(`Decorator`),optional:!0}},visitor:[`decorators`,`key`,`value`],aliases:[`UserWhitespacable`,`Property`,`ObjectMember`],validate:function(){let e=E(`Identifier`,`Pattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSNonNullExpression`,`TSTypeAssertion`),t=E(`Expression`);return function(n,r,i){(g(`ObjectPattern`,n)?e:t)(i,`value`,i.value)}}()})),k(`RestElement`,{visitor:[`argument`,`typeAnnotation`],builder:[`argument`],aliases:[`FunctionParameter`,`PatternLike`],deprecatedAlias:`RestProperty`,fields:a(a({},Ut()),{},{argument:{validate:E(`Identifier`,`ArrayPattern`,`ObjectPattern`,`MemberExpression`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`)}}),validate:function(e,t){let n=/(\w+)\[(\d+)\]/.exec(t.toString());if(!n)throw Error(`Internal Babel error: malformed key.`);let[,r,i]=n;if(e[r].length>+i+1)throw TypeError(`RestElement must be last element of ${r}`)}}),k(`ReturnStatement`,{visitor:[`argument`],aliases:[`Statement`,`Terminatorless`,`CompletionStatement`],fields:{argument:{validate:E(`Expression`),optional:!0}}}),k(`SequenceExpression`,{visitor:[`expressions`],fields:{expressions:w(`Expression`)},aliases:[`Expression`]}),k(`ParenthesizedExpression`,{visitor:[`expression`],aliases:[`Expression`,`ExpressionWrapper`],fields:{expression:{validate:E(`Expression`)}}}),k(`SwitchCase`,{visitor:[`test`,`consequent`],fields:{test:{validate:E(`Expression`),optional:!0},consequent:w(`Statement`)}}),k(`SwitchStatement`,{visitor:[`discriminant`,`cases`],aliases:[`Statement`,`BlockParent`,`Scopable`],fields:{discriminant:{validate:E(`Expression`)},cases:w(`SwitchCase`)}}),k(`ThisExpression`,{aliases:[`Expression`,`TSEntityName`]}),k(`ThrowStatement`,{visitor:[`argument`],aliases:[`Statement`,`Terminatorless`,`CompletionStatement`],fields:{argument:{validate:E(`Expression`)}}}),k(`TryStatement`,{visitor:[`block`,`handler`,`finalizer`],aliases:[`Statement`],fields:{block:{validate:O(E(`BlockStatement`),v(function(e){if(!e.handler&&!e.finalizer)throw TypeError(`TryStatement expects either a handler or finalizer, or both`)},{oneOfNodeTypes:[`BlockStatement`]}))},handler:{optional:!0,validate:E(`CatchClause`)},finalizer:{optional:!0,validate:E(`BlockStatement`)}}}),k(`UnaryExpression`,{builder:[`operator`,`argument`,`prefix`],fields:{prefix:{default:!0},argument:{validate:E(`Expression`)},operator:{validate:T(...gt)}},visitor:[`argument`],aliases:[`UnaryLike`,`Expression`]}),k(`UpdateExpression`,{builder:[`operator`,`argument`,`prefix`],fields:{prefix:{default:!1},argument:{validate:E(`Identifier`,`MemberExpression`)},operator:{validate:T(...ct)}},visitor:[`argument`],aliases:[`Expression`]}),k(`VariableDeclaration`,{builder:[`kind`,`declarations`],visitor:[`declarations`],aliases:[`Statement`,`Declaration`],fields:{declare:{validate:D(`boolean`),optional:!0},kind:{validate:T(`var`,`let`,`const`,`using`,`await using`)},declarations:w(`VariableDeclarator`)},validate:(()=>{let e=E(`Identifier`,`Placeholder`),t=E(`Identifier`,`ArrayPattern`,`ObjectPattern`,`Placeholder`),n=E(`Identifier`,`VoidPattern`,`Placeholder`);return function(r,i,a){let{kind:o,declarations:s}=a,c=g(`ForXStatement`,r,{left:a});if(c&&s.length!==1)throw TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${r.type}`);for(let r of s)o===`const`||o===`let`||o===`var`?!c&&!r.init?e(r,`id`,r.id):t(r,`id`,r.id):n(r,`id`,r.id)}})()}),k(`VariableDeclarator`,{visitor:[`id`,`init`],fields:{id:{validate:E(`Identifier`,`ArrayPattern`,`ObjectPattern`,`VoidPattern`)},definite:{optional:!0,validate:D(`boolean`)},init:{optional:!0,validate:E(`Expression`)}}}),k(`WhileStatement`,{visitor:[`test`,`body`],aliases:[`Statement`,`BlockParent`,`Loop`,`While`,`Scopable`],fields:{test:{validate:E(`Expression`)},body:{validate:E(`Statement`)}}}),k(`WithStatement`,{visitor:[`object`,`body`],aliases:[`Statement`],fields:{object:{validate:E(`Expression`)},body:{validate:E(`Statement`)}}}),k(`AssignmentPattern`,{visitor:[`left`,`right`,`decorators`],builder:[`left`,`right`],aliases:[`FunctionParameter`,`Pattern`,`PatternLike`],fields:a(a({},Ut()),{},{left:{validate:E(`Identifier`,`ObjectPattern`,`ArrayPattern`,`MemberExpression`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`)},right:{validate:E(`Expression`)},decorators:{validate:C(`Decorator`),optional:!0}})}),k(`ArrayPattern`,{visitor:[`elements`,`typeAnnotation`],builder:[`elements`],aliases:[`FunctionParameter`,`Pattern`,`PatternLike`,`LVal`],fields:a(a({},Ut()),{},{elements:{validate:O(D(`array`),Dt(kt(`null`,`PatternLike`)))}})}),k(`ArrowFunctionExpression`,{builder:[`params`,`body`,`async`],visitor:[`typeParameters`,`params`,`predicate`,`returnType`,`body`],aliases:[`Scopable`,`Function`,`BlockParent`,`FunctionParent`,`Expression`,`Pureish`],fields:a(a(a({},Bt()),{},{generator:{default:null,optional:!0,validate:v((e,t,n)=>{if(n)throw TypeError(`ArrowFunctionExpression cannot be a generator`)},{type:`boolean`})}},Vt()),{},{expression:{optional:!0,validate:D(`boolean`)},body:{validate:E(`BlockStatement`,`Expression`)},predicate:{validate:E(`FlowPredicate`),optional:!0}})}),k(`ClassBody`,{visitor:[`body`],fields:{body:w(`ClassMethod`,`ClassPrivateMethod`,`ClassProperty`,`ClassPrivateProperty`,`ClassAccessorProperty`,`TSDeclareMethod`,`TSIndexSignature`,`StaticBlock`)}}),k(`ClassExpression`,{builder:[`id`,`superClass`,`body`,`decorators`],visitor:[`decorators`,`id`,`typeParameters`,`superClass`,`superTypeArguments`,`mixins`,`implements`,`body`],aliases:[`Scopable`,`Class`,`Expression`],fields:{id:{validate:E(`Identifier`),optional:!0},typeParameters:{validate:E(`TypeParameterDeclaration`,`TSTypeParameterDeclaration`),optional:!0},body:{validate:E(`ClassBody`)},superClass:{optional:!0,validate:E(`Expression`)},superTypeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0},implements:{validate:C(`TSClassImplements`,`ClassImplements`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},mixins:{validate:E(`InterfaceExtends`),optional:!0}}}),k(`ClassDeclaration`,{inherits:`ClassExpression`,aliases:[`Scopable`,`Class`,`Statement`,`Declaration`],fields:{id:{validate:E(`Identifier`),optional:!0},typeParameters:{validate:E(`TypeParameterDeclaration`,`TSTypeParameterDeclaration`),optional:!0},body:{validate:E(`ClassBody`)},superClass:{optional:!0,validate:E(`Expression`)},superTypeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0},implements:{validate:C(`TSClassImplements`,`ClassImplements`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},mixins:{validate:E(`InterfaceExtends`),optional:!0},declare:{validate:D(`boolean`),optional:!0},abstract:{validate:D(`boolean`),optional:!0}},validate:function(){let e=E(`Identifier`);return function(t,n,r){g(`ExportDefaultDeclaration`,t)||e(r,`id`,r.id)}}()});const Wt={attributes:{optional:!0,validate:C(`ImportAttribute`)}};k(`ExportAllDeclaration`,{visitor:[`source`,`attributes`],aliases:[`Statement`,`Declaration`,`ImportOrExportDeclaration`,`ExportDeclaration`],fields:a({source:{validate:E(`StringLiteral`)},exportKind:x(T(`type`,`value`))},Wt)}),k(`ExportDefaultDeclaration`,{visitor:[`declaration`],aliases:[`Statement`,`Declaration`,`ImportOrExportDeclaration`,`ExportDeclaration`],fields:{declaration:b(`FunctionDeclaration`,`ClassDeclaration`,`Expression`,`TSDeclareFunction`,`TSInterfaceDeclaration`,`EnumDeclaration`),exportKind:x(T(`value`))}}),k(`ExportNamedDeclaration`,{builder:[`declaration`,`specifiers`,`source`,`attributes`],visitor:[`declaration`,`specifiers`,`source`,`attributes`],aliases:[`Statement`,`Declaration`,`ImportOrExportDeclaration`,`ExportDeclaration`],fields:a(a({declaration:{optional:!0,validate:O(E(`Declaration`),v(function(e,t,n){if(n&&e.specifiers.length)throw TypeError(`Only declaration or specifiers is allowed on ExportNamedDeclaration`);if(n&&e.source)throw TypeError(`Cannot export a declaration from a source`)},{oneOfNodeTypes:[`VariableDeclaration`,`FunctionDeclaration`,`ClassDeclaration`,`TSDeclareFunction`,`TSEnumDeclaration`,`TSImportEqualsDeclaration`,`TSInterfaceDeclaration`,`TSModuleDeclaration`,`TSTypeAliasDeclaration`,`EnumDeclaration`,`InterfaceDeclaration`,`OpaqueType`,`TypeAlias`]}))}},Wt),{},{specifiers:{default:[],validate:Et(function(){let e=E(`ExportSpecifier`,`ExportDefaultSpecifier`,`ExportNamespaceSpecifier`),t=E(`ExportSpecifier`);return v(function(n,r,i){(n.source?e:t)(n,r,i)},{oneOfNodeTypes:[`ExportSpecifier`,`ExportDefaultSpecifier`,`ExportNamespaceSpecifier`]})}())},source:{validate:E(`StringLiteral`),optional:!0},exportKind:x(T(`type`,`value`))})}),k(`ExportSpecifier`,{visitor:[`local`,`exported`],aliases:[`ModuleSpecifier`],fields:{local:{validate:E(`Identifier`)},exported:{validate:E(`Identifier`,`StringLiteral`)},exportKind:{validate:T(`type`,`value`),optional:!0}}}),k(`ForOfStatement`,{visitor:[`left`,`right`,`body`],builder:[`left`,`right`,`body`,`await`],aliases:[`Scopable`,`Statement`,`For`,`BlockParent`,`Loop`,`ForXStatement`],fields:{left:{validate:function(){let e=E(`VariableDeclaration`),t=E(`Identifier`,`MemberExpression`,`ArrayPattern`,`ObjectPattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`);return v(function(n,r,i){g(`VariableDeclaration`,i)?e(n,r,i):t(n,r,i)},{oneOfNodeTypes:[`VariableDeclaration`,`Identifier`,`MemberExpression`,`ArrayPattern`,`ObjectPattern`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`]})}()},right:{validate:E(`Expression`)},body:{validate:E(`Statement`)},await:{default:!1}}}),k(`ImportDeclaration`,{builder:[`specifiers`,`source`,`attributes`],visitor:[`specifiers`,`source`,`attributes`],aliases:[`Statement`,`Declaration`,`ImportOrExportDeclaration`],fields:a(a({},Wt),{},{module:{optional:!0,validate:D(`boolean`)},phase:{default:null,validate:T(`source`,`defer`)},specifiers:w(`ImportSpecifier`,`ImportDefaultSpecifier`,`ImportNamespaceSpecifier`),source:{validate:E(`StringLiteral`)},importKind:{validate:T(`type`,`typeof`,`value`),optional:!0}})}),k(`ImportDefaultSpecifier`,{visitor:[`local`],aliases:[`ModuleSpecifier`],fields:{local:{validate:E(`Identifier`)}}}),k(`ImportNamespaceSpecifier`,{visitor:[`local`],aliases:[`ModuleSpecifier`],fields:{local:{validate:E(`Identifier`)}}}),k(`ImportSpecifier`,{visitor:[`imported`,`local`],builder:[`local`,`imported`],aliases:[`ModuleSpecifier`],fields:{local:{validate:E(`Identifier`)},imported:{validate:E(`Identifier`,`StringLiteral`)},importKind:{validate:T(`type`,`typeof`,`value`),optional:!0}}}),k(`MetaProperty`,{visitor:[`meta`,`property`],aliases:[`Expression`],fields:{meta:{validate:O(E(`Identifier`),v(function(e,t,n){let r;switch(n.name){case`function`:r=`sent`;break;case`new`:r=`target`;break;case`import`:r=`meta`;break}if(!g(`Identifier`,e.property,{name:r}))throw TypeError(`Unrecognised MetaProperty`)},{oneOfNodeTypes:[`Identifier`]}))},property:{validate:E(`Identifier`)}}});const Gt=()=>({abstract:{validate:D(`boolean`),default:!1,optional:!0},accessibility:{validate:T(`public`,`private`,`protected`),optional:!0},static:{default:!1},override:{optional:!0,validate:D(`boolean`),default:!1},computed:{default:!1},optional:{validate:D(`boolean`),optional:!0},key:{validate:O(function(){let e=E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`),t=E(`Expression`);return function(n,r,i){(n.computed?t:e)(n,r,i)}}(),E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`Expression`))}}),Kt=(e=!0)=>a(a(a({},Bt()),Gt()),{},{params:w(`FunctionParameter`,`TSParameterProperty`),kind:{validate:T(`get`,`set`,`method`,`constructor`),default:`method`},access:{validate:O(D(`string`),T(`public`,`private`,`protected`)),optional:!0}},e?{decorators:{validate:C(`Decorator`),optional:!0}}:{});k(`ClassMethod`,a(a({aliases:[`Function`,`Scopable`,`BlockParent`,`FunctionParent`,`Method`],builder:[`kind`,`key`,`params`,`body`,`computed`,`static`,`generator`,`async`],visitor:[`decorators`,`key`,`typeParameters`,`params`,`returnType`,`body`]},Rt()),{},{fields:a(a(a({},Kt()),Vt()),{},{body:{validate:E(`BlockStatement`)}})})),k(`ObjectPattern`,{visitor:[`decorators`,`properties`,`typeAnnotation`],builder:[`properties`],aliases:[`FunctionParameter`,`Pattern`,`PatternLike`,`LVal`],fields:a(a({},Ut()),{},{properties:w(`RestElement`,`ObjectProperty`)})}),k(`SpreadElement`,{visitor:[`argument`],aliases:[`UnaryLike`],deprecatedAlias:`SpreadProperty`,fields:{argument:{validate:E(`Expression`)}}}),k(`Super`),k(`TaggedTemplateExpression`,{visitor:[`tag`,`typeArguments`,`quasi`],builder:[`tag`,`quasi`],aliases:[`Expression`],fields:{tag:{validate:E(`Expression`)},quasi:{validate:E(`TemplateLiteral`)},typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),k(`TemplateElement`,{builder:[`value`,`tail`],fields:{value:{validate:O(At({raw:{validate:D(`string`)},cooked:{validate:D(`string`),optional:!0}}),function(e){let t=e.value.raw,n=!1,r=()=>{throw Error(`Internal @babel/types error.`)},{str:i,firstInvalidLoc:a}=pe(`template`,t,0,0,0,{unterminated(){n=!0},strictNumericEscape:r,invalidEscapeSequence:r,numericSeparatorInEscapeSequence:r,unexpectedNumericSeparator:r,invalidDigit:r,invalidCodePoint:r});if(!n)throw Error(`Invalid raw`);e.value.cooked=a?null:i})},tail:{default:!1}}}),k(`TemplateLiteral`,{visitor:[`quasis`,`expressions`],aliases:[`Expression`,`Literal`],fields:{quasis:w(`TemplateElement`),expressions:{validate:O(D(`array`),Dt(E(`Expression`,`TSType`)),function(e,t,n){if(e.quasis.length!==n.length+1)throw TypeError(`Number of ${e.type} quasis should be exactly one more than the number of expressions.\nExpected ${n.length+1} quasis but got ${e.quasis.length}`)})}}}),k(`YieldExpression`,{builder:[`argument`,`delegate`],visitor:[`argument`],aliases:[`Expression`,`Terminatorless`],fields:{delegate:{validate:O(D(`boolean`),v(function(e,t,n){if(n&&!e.argument)throw TypeError(`Property delegate of YieldExpression cannot be true if there is no argument`)},{type:`boolean`})),default:!1},argument:{optional:!0,validate:E(`Expression`)}}}),k(`AwaitExpression`,{builder:[`argument`],visitor:[`argument`],aliases:[`Expression`,`Terminatorless`],fields:{argument:{validate:E(`Expression`)}}}),k(`ImportExpression`,{visitor:[`source`,`options`],aliases:[`Expression`],fields:{phase:{default:null,validate:T(`source`,`defer`)},source:{validate:E(`Expression`)},options:{validate:E(`Expression`),optional:!0}}}),k(`Import`),k(`BigIntLiteral`,{builder:[`value`],fields:{value:{validate:D(`bigint`)}},aliases:[`Expression`,`Pureish`,`Literal`,`Immutable`]}),k(`ExportNamespaceSpecifier`,{visitor:[`exported`],aliases:[`ModuleSpecifier`],fields:{exported:{validate:E(`Identifier`,`StringLiteral`)}}}),k(`OptionalMemberExpression`,a(a({builder:[`object`,`property`,`computed`,`optional`],visitor:[`object`,`property`],aliases:[`Expression`]},zt),{},{fields:{object:{validate:E(`Expression`)},property:{validate:function(){let e=E(`Identifier`,`PrivateName`),t=E(`Expression`);return v(function(n,r,i){(n.computed?t:e)(n,r,i)},{oneOfNodeTypes:[`Expression`,`PrivateName`]})}()},computed:{default:!1},optional:{validate:O(D(`boolean`),jt())}}})),k(`OptionalCallExpression`,{visitor:[`callee`,`typeArguments`,`arguments`],builder:[`callee`,`arguments`,`optional`],aliases:[`Expression`],fields:{callee:{validate:E(`Expression`)},arguments:w(`Expression`,`SpreadElement`,`ArgumentPlaceholder`),optional:{validate:O(D(`boolean`),jt())},typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),k(`ClassProperty`,a(a({visitor:[`decorators`,`variance`,`key`,`typeAnnotation`,`value`],builder:[`key`,`value`,`typeAnnotation`,`decorators`,`computed`,`static`],aliases:[`Property`]},Rt()),{},{fields:a(a({},Gt()),{},{value:{validate:E(`Expression`),optional:!0},definite:{validate:D(`boolean`),optional:!0},typeAnnotation:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},readonly:{validate:D(`boolean`),optional:!0},declare:{validate:D(`boolean`),optional:!0},variance:{validate:E(`Variance`),optional:!0}})})),k(`ClassPrivateProperty`,{visitor:[`decorators`,`variance`,`key`,`typeAnnotation`,`value`],builder:[`key`,`value`,`decorators`,`static`],aliases:[`Property`,`Private`],fields:{key:{validate:E(`PrivateName`)},value:{validate:E(`Expression`),optional:!0},typeAnnotation:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},static:{validate:D(`boolean`),default:!1},readonly:{validate:D(`boolean`),optional:!0},optional:{validate:D(`boolean`),optional:!0},definite:{validate:D(`boolean`),optional:!0},variance:{validate:E(`Variance`),optional:!0}}}),k(`ClassPrivateMethod`,{builder:[`kind`,`key`,`params`,`body`,`static`],visitor:[`decorators`,`key`,`typeParameters`,`params`,`returnType`,`body`],aliases:[`Function`,`Scopable`,`BlockParent`,`FunctionParent`,`Method`,`Private`],fields:a(a(a({},Kt()),Vt()),{},{kind:{validate:T(`get`,`set`,`method`),default:`method`},key:{validate:E(`PrivateName`)},body:{validate:E(`BlockStatement`)}})}),k(`PrivateName`,{visitor:[`id`],aliases:[`Private`],fields:{id:{validate:E(`Identifier`)}}}),k(`StaticBlock`,{visitor:[`body`],fields:{body:w(`Statement`)},aliases:[`Scopable`,`BlockParent`,`FunctionParent`]}),k(`ImportAttribute`,{visitor:[`key`,`value`],fields:{key:{validate:E(`Identifier`,`StringLiteral`)},value:{validate:E(`StringLiteral`)}}});const A=Ft(`Flow`),qt=e=>{let t=e===`DeclareClass`;A(e,{builder:[`id`,`typeParameters`,`extends`,`body`],visitor:[`id`,`typeParameters`,`extends`,...t?[`mixins`,`implements`]:[],`body`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:a(a({id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),extends:x(C(`InterfaceExtends`))},t?{mixins:x(C(`InterfaceExtends`)),implements:x(C(`ClassImplements`))}:{}),{},{body:b(`ObjectTypeAnnotation`)})})};A(`AnyTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`ArrayTypeAnnotation`,{visitor:[`elementType`],aliases:[`FlowType`],fields:{elementType:b(`FlowType`)}}),A(`BooleanTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`BooleanLiteralTypeAnnotation`,{builder:[`value`],aliases:[`FlowType`],fields:{value:y(D(`boolean`))}}),A(`NullLiteralTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`ClassImplements`,{visitor:[`id`,`typeParameters`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterInstantiation`)}}),qt(`DeclareClass`),A(`DeclareFunction`,{builder:[`id`],visitor:[`id`,`predicate`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),predicate:S(`FlowPredicate`)}}),qt(`DeclareInterface`),A(`DeclareModule`,{builder:[`id`,`body`,`kind`],visitor:[`id`,`body`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`,`StringLiteral`),body:b(`BlockStatement`),kind:x(T(`CommonJS`,`ES`))}}),A(`DeclareModuleExports`,{visitor:[`typeAnnotation`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{typeAnnotation:b(`TypeAnnotation`)}}),A(`DeclareTypeAlias`,{visitor:[`id`,`typeParameters`,`right`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),right:b(`FlowType`)}}),A(`DeclareOpaqueType`,{visitor:[`id`,`typeParameters`,`supertype`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),supertype:S(`FlowType`),impltype:S(`FlowType`)}}),A(`DeclareVariable`,{visitor:[`id`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`)}}),A(`DeclareExportDeclaration`,{visitor:[`declaration`,`specifiers`,`source`,`attributes`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:a({declaration:S(`Flow`),specifiers:x(C(`ExportSpecifier`,`ExportNamespaceSpecifier`)),source:S(`StringLiteral`),default:x(D(`boolean`))},Wt)}),A(`DeclareExportAllDeclaration`,{visitor:[`source`,`attributes`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:a({source:b(`StringLiteral`),exportKind:x(T(`type`,`value`))},Wt)}),A(`DeclaredPredicate`,{visitor:[`value`],aliases:[`FlowPredicate`],fields:{value:b(`Expression`)}}),A(`ExistsTypeAnnotation`,{aliases:[`FlowType`]}),A(`FunctionTypeAnnotation`,{builder:[`typeParameters`,`params`,`rest`,`returnType`],visitor:[`typeParameters`,`this`,`params`,`rest`,`returnType`],aliases:[`FlowType`],fields:{typeParameters:S(`TypeParameterDeclaration`),params:w(`FunctionTypeParam`),rest:S(`FunctionTypeParam`),this:S(`FunctionTypeParam`),returnType:b(`FlowType`)}}),A(`FunctionTypeParam`,{visitor:[`name`,`typeAnnotation`],fields:{name:S(`Identifier`),typeAnnotation:b(`FlowType`),optional:x(D(`boolean`))}}),A(`GenericTypeAnnotation`,{visitor:[`id`,`typeParameters`],aliases:[`FlowType`],fields:{id:b(`Identifier`,`QualifiedTypeIdentifier`),typeParameters:S(`TypeParameterInstantiation`)}}),A(`InferredPredicate`,{aliases:[`FlowPredicate`]}),A(`InterfaceExtends`,{visitor:[`id`,`typeParameters`],fields:{id:b(`Identifier`,`QualifiedTypeIdentifier`),typeParameters:S(`TypeParameterInstantiation`)}}),qt(`InterfaceDeclaration`),A(`InterfaceTypeAnnotation`,{visitor:[`extends`,`body`],aliases:[`FlowType`],fields:{extends:x(C(`InterfaceExtends`)),body:b(`ObjectTypeAnnotation`)}}),A(`IntersectionTypeAnnotation`,{visitor:[`types`],aliases:[`FlowType`],fields:{types:y(C(`FlowType`))}}),A(`MixedTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`EmptyTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`NullableTypeAnnotation`,{visitor:[`typeAnnotation`],aliases:[`FlowType`],fields:{typeAnnotation:b(`FlowType`)}}),A(`NumberLiteralTypeAnnotation`,{builder:[`value`],aliases:[`FlowType`],fields:{value:y(D(`number`))}}),A(`BigIntLiteralTypeAnnotation`,{builder:[`value`],aliases:[`FlowType`],fields:{value:y(D(`bigint`))}}),A(`NumberTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`ObjectTypeAnnotation`,{visitor:[`properties`,`indexers`,`callProperties`,`internalSlots`],aliases:[`FlowType`],builder:[`properties`,`indexers`,`callProperties`,`internalSlots`,`exact`],fields:{properties:y(C(`ObjectTypeProperty`,`ObjectTypeSpreadProperty`)),indexers:{validate:C(`ObjectTypeIndexer`),optional:!1,default:[]},callProperties:{validate:C(`ObjectTypeCallProperty`),optional:!1,default:[]},internalSlots:{validate:C(`ObjectTypeInternalSlot`),optional:!1,default:[]},exact:{validate:D(`boolean`),default:!1},inexact:x(D(`boolean`))}}),A(`ObjectTypeInternalSlot`,{visitor:[`id`,`value`],builder:[`id`,`value`,`optional`,`static`,`method`],aliases:[`UserWhitespacable`],fields:{id:b(`Identifier`),value:b(`FlowType`),optional:y(D(`boolean`)),static:y(D(`boolean`)),method:y(D(`boolean`))}}),A(`ObjectTypeCallProperty`,{visitor:[`value`],aliases:[`UserWhitespacable`],fields:{value:b(`FlowType`),static:Tt(D(`boolean`),!1)}}),A(`ObjectTypeIndexer`,{visitor:[`variance`,`id`,`key`,`value`],builder:[`id`,`key`,`value`,`variance`],aliases:[`UserWhitespacable`],fields:{id:S(`Identifier`),key:b(`FlowType`),value:b(`FlowType`),static:Tt(D(`boolean`),!1),variance:S(`Variance`)}}),A(`ObjectTypeProperty`,{visitor:[`key`,`value`,`variance`],aliases:[`UserWhitespacable`],fields:{key:b(`Identifier`,`StringLiteral`,`NumericLiteral`),value:b(`FlowType`),kind:{validate:T(`init`,`get`,`set`),default:`init`,optional:!1},static:Tt(D(`boolean`),!1),proto:Tt(D(`boolean`),!1),optional:Tt(D(`boolean`),!1),variance:S(`Variance`),method:Tt(D(`boolean`),!1)}}),A(`ObjectTypeSpreadProperty`,{visitor:[`argument`],aliases:[`UserWhitespacable`],fields:{argument:b(`FlowType`)}}),A(`OpaqueType`,{visitor:[`id`,`typeParameters`,`supertype`,`impltype`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),supertype:S(`FlowType`),impltype:b(`FlowType`)}}),A(`QualifiedTypeIdentifier`,{visitor:[`qualification`,`id`],builder:[`id`,`qualification`],fields:{id:b(`Identifier`),qualification:b(`Identifier`,`QualifiedTypeIdentifier`)}}),A(`StringLiteralTypeAnnotation`,{builder:[`value`],aliases:[`FlowType`],fields:{value:y(D(`string`))}}),A(`StringTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`SymbolTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`ThisTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`TupleTypeAnnotation`,{visitor:[`types`],aliases:[`FlowType`],fields:{types:y(C(`FlowType`))}}),A(`TypeofTypeAnnotation`,{visitor:[`argument`],aliases:[`FlowType`],fields:{argument:b(`FlowType`)}}),A(`TypeAlias`,{visitor:[`id`,`typeParameters`,`right`],aliases:[`FlowDeclaration`,`Statement`,`Declaration`],fields:{id:b(`Identifier`),typeParameters:S(`TypeParameterDeclaration`),right:b(`FlowType`)}}),A(`TypeAnnotation`,{visitor:[`typeAnnotation`],fields:{typeAnnotation:b(`FlowType`)}}),A(`TypeCastExpression`,{visitor:[`expression`,`typeAnnotation`],aliases:[`ExpressionWrapper`,`Expression`],fields:{expression:b(`Expression`),typeAnnotation:b(`TypeAnnotation`)}}),A(`TypeParameter`,{builder:[`name`,`bound`,`default`,`variance`],visitor:[`bound`,`default`,`variance`],fields:{name:y(D(`string`)),bound:S(`TypeAnnotation`),default:S(`FlowType`),variance:S(`Variance`)}}),A(`TypeParameterDeclaration`,{visitor:[`params`],fields:{params:y(C(`TypeParameter`))}}),A(`TypeParameterInstantiation`,{visitor:[`params`],fields:{params:y(C(`FlowType`))}}),A(`UnionTypeAnnotation`,{visitor:[`types`],aliases:[`FlowType`],fields:{types:y(C(`FlowType`))}}),A(`Variance`,{builder:[`kind`],fields:{kind:y(T(`minus`,`plus`))}}),A(`VoidTypeAnnotation`,{aliases:[`FlowType`,`FlowBaseAnnotation`]}),A(`EnumDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`body`],fields:{id:b(`Identifier`),body:b(`EnumBooleanBody`,`EnumNumberBody`,`EnumStringBody`,`EnumSymbolBody`)}});const Jt={explicitType:Tt(D(`boolean`),!1),hasUnknownMembers:Tt(D(`boolean`),!1)};A(`EnumBooleanBody`,{aliases:[`EnumBody`],visitor:[`members`],fields:a(a({},Jt),{},{members:w(`EnumBooleanMember`)})}),A(`EnumNumberBody`,{aliases:[`EnumBody`],visitor:[`members`],fields:a(a({},Jt),{},{members:w(`EnumNumberMember`)})}),A(`EnumStringBody`,{aliases:[`EnumBody`],visitor:[`members`],fields:a(a({},Jt),{},{members:w(`EnumStringMember`,`EnumDefaultedMember`)})}),A(`EnumSymbolBody`,{aliases:[`EnumBody`],visitor:[`members`],fields:{members:w(`EnumDefaultedMember`),hasUnknownMembers:Tt(D(`boolean`),!1)}}),A(`EnumBooleanMember`,{aliases:[`EnumMember`],visitor:[`id`,`init`],fields:{id:b(`Identifier`),init:b(`BooleanLiteral`)}}),A(`EnumNumberMember`,{aliases:[`EnumMember`],visitor:[`id`,`init`],fields:{id:b(`Identifier`),init:b(`NumericLiteral`)}}),A(`EnumStringMember`,{aliases:[`EnumMember`],visitor:[`id`,`init`],fields:{id:b(`Identifier`),init:b(`StringLiteral`)}}),A(`EnumDefaultedMember`,{aliases:[`EnumMember`],visitor:[`id`],fields:{id:b(`Identifier`)}}),A(`IndexedAccessType`,{visitor:[`objectType`,`indexType`],aliases:[`FlowType`],fields:{objectType:b(`FlowType`),indexType:b(`FlowType`)}}),A(`OptionalIndexedAccessType`,{visitor:[`objectType`,`indexType`],aliases:[`FlowType`],fields:{objectType:b(`FlowType`),indexType:b(`FlowType`),optional:Tt(D(`boolean`),!1)}});const j=Ft(`JSX`);j(`JSXAttribute`,{visitor:[`name`,`value`],aliases:[`Immutable`],fields:{name:{validate:E(`JSXIdentifier`,`JSXNamespacedName`)},value:{optional:!0,validate:E(`JSXElement`,`JSXFragment`,`StringLiteral`,`JSXExpressionContainer`)}}}),j(`JSXClosingElement`,{visitor:[`name`],aliases:[`Immutable`],fields:{name:{validate:E(`JSXIdentifier`,`JSXMemberExpression`,`JSXNamespacedName`)}}}),j(`JSXElement`,{builder:[`openingElement`,`closingElement`,`children`],visitor:[`openingElement`,`children`,`closingElement`],aliases:[`Immutable`,`Expression`],fields:{openingElement:{validate:E(`JSXOpeningElement`)},closingElement:{optional:!0,validate:E(`JSXClosingElement`)},children:w(`JSXText`,`JSXExpressionContainer`,`JSXSpreadChild`,`JSXElement`,`JSXFragment`)}}),j(`JSXEmptyExpression`,{}),j(`JSXExpressionContainer`,{visitor:[`expression`],aliases:[`Immutable`],fields:{expression:{validate:E(`Expression`,`JSXEmptyExpression`)}}}),j(`JSXSpreadChild`,{visitor:[`expression`],aliases:[`Immutable`],fields:{expression:{validate:E(`Expression`)}}}),j(`JSXIdentifier`,{builder:[`name`],fields:{name:{validate:D(`string`)}}}),j(`JSXMemberExpression`,{visitor:[`object`,`property`],fields:{object:{validate:E(`JSXMemberExpression`,`JSXIdentifier`)},property:{validate:E(`JSXIdentifier`)}}}),j(`JSXNamespacedName`,{visitor:[`namespace`,`name`],fields:{namespace:{validate:E(`JSXIdentifier`)},name:{validate:E(`JSXIdentifier`)}}}),j(`JSXOpeningElement`,{builder:[`name`,`attributes`,`selfClosing`],visitor:[`name`,`typeArguments`,`attributes`],aliases:[`Immutable`],fields:{name:{validate:E(`JSXIdentifier`,`JSXMemberExpression`,`JSXNamespacedName`)},selfClosing:{default:!1},attributes:w(`JSXAttribute`,`JSXSpreadAttribute`),typeArguments:{validate:E(`TypeParameterInstantiation`,`TSTypeParameterInstantiation`),optional:!0}}}),j(`JSXSpreadAttribute`,{visitor:[`argument`],fields:{argument:{validate:E(`Expression`)}}}),j(`JSXText`,{aliases:[`Immutable`],builder:[`value`],fields:{value:{validate:D(`string`)}}}),j(`JSXFragment`,{builder:[`openingFragment`,`closingFragment`,`children`],visitor:[`openingFragment`,`children`,`closingFragment`],aliases:[`Immutable`,`Expression`],fields:{openingFragment:{validate:E(`JSXOpeningFragment`)},closingFragment:{validate:E(`JSXClosingFragment`)},children:w(`JSXText`,`JSXExpressionContainer`,`JSXSpreadChild`,`JSXElement`,`JSXFragment`)}}),j(`JSXOpeningFragment`,{aliases:[`Immutable`]}),j(`JSXClosingFragment`,{aliases:[`Immutable`]});const Yt=[`Identifier`,`StringLiteral`,`Expression`,`Statement`,`Declaration`,`BlockStatement`,`ClassBody`,`Pattern`],Xt={Declaration:[`Statement`],Pattern:[`PatternLike`,`LVal`]};for(let e of Yt){let t=vt[e];t!=null&&t.length&&(Xt[e]=t)}const Zt={};Object.keys(Xt).forEach(e=>{Xt[e].forEach(t=>{Object.hasOwn(Zt,t)||(Zt[t]=[]),Zt[t].push(e)})});const Qt=Ft(`Miscellaneous`);Qt(`Placeholder`,{visitor:[],builder:[`expectedNode`,`name`],fields:a({name:{validate:E(`Identifier`)},expectedNode:{validate:T(...Yt)}},Ut())}),Qt(`V8IntrinsicIdentifier`,{builder:[`name`],fields:{name:{validate:D(`string`)}}}),It(`ArgumentPlaceholder`,{}),It(`BindExpression`,{visitor:[`object`,`callee`],aliases:[`Expression`],fields:{object:{validate:kt(`null`,`Expression`)},callee:{validate:E(`Expression`)}}}),It(`ClassAccessorProperty`,a(a({visitor:[`decorators`,`key`,`typeAnnotation`,`value`],builder:[`key`,`value`,`typeAnnotation`,`decorators`,`computed`,`static`],aliases:[`Property`,`Accessor`]},Rt(!0)),{},{fields:a(a({},Gt()),{},{key:{validate:O(function(){let e=E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`PrivateName`),t=E(`Expression`);return function(n,r,i){(n.computed?t:e)(n,r,i)}}(),E(`Identifier`,`StringLiteral`,`NumericLiteral`,`BigIntLiteral`,`Expression`,`PrivateName`))},value:{validate:E(`Expression`),optional:!0},definite:{validate:D(`boolean`),optional:!0},typeAnnotation:{validate:E(`TypeAnnotation`,`TSTypeAnnotation`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0},readonly:{validate:D(`boolean`),optional:!0},declare:{validate:D(`boolean`),optional:!0},variance:{validate:E(`Variance`),optional:!0}})})),It(`Decorator`,{visitor:[`expression`],fields:{expression:{validate:E(`Expression`)}}}),It(`DoExpression`,{visitor:[`body`],builder:[`body`,`async`],aliases:[`Expression`],fields:{body:{validate:E(`BlockStatement`)},async:{validate:D(`boolean`),default:!1}}}),It(`ExportDefaultSpecifier`,{visitor:[`exported`],aliases:[`ModuleSpecifier`],fields:{exported:{validate:E(`Identifier`)}}}),It(`ModuleExpression`,{visitor:[`body`],fields:{body:{validate:E(`Program`)}},aliases:[`Expression`]}),It(`TopicReference`,{aliases:[`Expression`]}),It(`VoidPattern`,{aliases:[`Pattern`,`PatternLike`,`FunctionParameter`]});const M=Ft(`TypeScript`),$t=D(`boolean`),en=()=>({returnType:{validate:E(`TSTypeAnnotation`),optional:!0},typeParameters:{validate:E(`TSTypeParameterDeclaration`),optional:!0}});M(`TSParameterProperty`,{aliases:[],visitor:[`parameter`],fields:{accessibility:{validate:T(`public`,`private`,`protected`),optional:!0},readonly:{validate:D(`boolean`),optional:!0},parameter:{validate:E(`Identifier`,`AssignmentPattern`)},override:{validate:D(`boolean`),optional:!0},decorators:{validate:C(`Decorator`),optional:!0}}}),M(`TSDeclareFunction`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`typeParameters`,`params`,`returnType`],fields:a(a({},Ht()),en())}),M(`TSDeclareMethod`,a(a({visitor:[`key`,`typeParameters`,`params`,`returnType`]},Rt()),{},{fields:a(a({},Kt(!1)),en())})),M(`TSQualifiedName`,{aliases:[`TSEntityName`],visitor:[`left`,`right`],fields:{left:b(`TSEntityName`),right:b(`Identifier`)}});const tn=()=>({typeParameters:S(`TSTypeParameterDeclaration`),params:w(`ArrayPattern`,`Identifier`,`ObjectPattern`,`RestElement`),returnType:S(`TSTypeAnnotation`)}),nn={aliases:[`TSTypeElement`],visitor:[`typeParameters`,`params`,`returnType`],fields:tn()};M(`TSCallSignatureDeclaration`,nn),M(`TSConstructSignatureDeclaration`,nn);const rn=()=>({key:b(`Expression`),computed:{default:!1},optional:x($t)});M(`TSPropertySignature`,{aliases:[`TSTypeElement`],visitor:[`key`,`typeAnnotation`],fields:a(a({},rn()),{},{readonly:x($t),typeAnnotation:S(`TSTypeAnnotation`),kind:{optional:!0,validate:T(`get`,`set`)}})}),M(`TSMethodSignature`,{aliases:[`TSTypeElement`],visitor:[`key`,`typeParameters`,`params`,`returnType`],fields:a(a(a({},tn()),rn()),{},{kind:{validate:T(`method`,`get`,`set`),default:`method`}})}),M(`TSIndexSignature`,{aliases:[`TSTypeElement`],visitor:[`parameters`,`typeAnnotation`],fields:{readonly:x($t),static:x($t),parameters:w(`Identifier`),typeAnnotation:S(`TSTypeAnnotation`)}});for(let e of[`TSAnyKeyword`,`TSBooleanKeyword`,`TSBigIntKeyword`,`TSIntrinsicKeyword`,`TSNeverKeyword`,`TSNullKeyword`,`TSNumberKeyword`,`TSObjectKeyword`,`TSStringKeyword`,`TSSymbolKeyword`,`TSUndefinedKeyword`,`TSUnknownKeyword`,`TSVoidKeyword`])M(e,{aliases:[`TSType`,`TSBaseType`],visitor:[],fields:{}});M(`TSThisType`,{aliases:[`TSType`,`TSBaseType`],visitor:[],fields:{}});const an={aliases:[`TSType`],visitor:[`typeParameters`,`params`,`returnType`]};M(`TSFunctionType`,a(a({},an),{},{fields:tn()})),M(`TSConstructorType`,a(a({},an),{},{fields:a(a({},tn()),{},{abstract:x($t)})})),M(`TSTypeReference`,{aliases:[`TSType`],visitor:[`typeName`,`typeArguments`],fields:{typeName:b(`TSEntityName`),typeArguments:S(`TSTypeParameterInstantiation`)}}),M(`TSTypePredicate`,{aliases:[`TSType`],visitor:[`parameterName`,`typeAnnotation`],builder:[`parameterName`,`typeAnnotation`,`asserts`],fields:{parameterName:b(`Identifier`,`TSThisType`),typeAnnotation:S(`TSTypeAnnotation`),asserts:x($t)}}),M(`TSTypeQuery`,{aliases:[`TSType`],visitor:[`exprName`,`typeArguments`],fields:{exprName:b(`TSEntityName`,`TSImportType`),typeArguments:S(`TSTypeParameterInstantiation`)}}),M(`TSTypeLiteral`,{aliases:[`TSType`],visitor:[`members`],fields:{members:w(`TSTypeElement`)}}),M(`TSArrayType`,{aliases:[`TSType`],visitor:[`elementType`],fields:{elementType:b(`TSType`)}}),M(`TSTupleType`,{aliases:[`TSType`],visitor:[`elementTypes`],fields:{elementTypes:w(`TSType`,`TSNamedTupleMember`)}}),M(`TSOptionalType`,{aliases:[`TSType`],visitor:[`typeAnnotation`],fields:{typeAnnotation:b(`TSType`)}}),M(`TSRestType`,{aliases:[`TSType`],visitor:[`typeAnnotation`],fields:{typeAnnotation:b(`TSType`)}}),M(`TSNamedTupleMember`,{visitor:[`label`,`elementType`],builder:[`label`,`elementType`,`optional`],fields:{label:b(`Identifier`),optional:{validate:$t,default:!1},elementType:b(`TSType`)}});const on={aliases:[`TSType`],visitor:[`types`],fields:{types:w(`TSType`)}};M(`TSUnionType`,on),M(`TSIntersectionType`,on),M(`TSConditionalType`,{aliases:[`TSType`],visitor:[`checkType`,`extendsType`,`trueType`,`falseType`],fields:{checkType:b(`TSType`),extendsType:b(`TSType`),trueType:b(`TSType`),falseType:b(`TSType`)}}),M(`TSInferType`,{aliases:[`TSType`],visitor:[`typeParameter`],fields:{typeParameter:b(`TSTypeParameter`)}}),M(`TSParenthesizedType`,{aliases:[`TSType`],visitor:[`typeAnnotation`],fields:{typeAnnotation:b(`TSType`)}}),M(`TSTypeOperator`,{aliases:[`TSType`],visitor:[`typeAnnotation`],builder:[`typeAnnotation`,`operator`],fields:{operator:{validate:T(`keyof`,`readonly`,`unique`),default:void 0},typeAnnotation:b(`TSType`)}}),M(`TSIndexedAccessType`,{aliases:[`TSType`],visitor:[`objectType`,`indexType`],fields:{objectType:b(`TSType`),indexType:b(`TSType`)}}),M(`TSMappedType`,{aliases:[`TSType`],visitor:[`key`,`constraint`,`nameType`,`typeAnnotation`],builder:[`key`,`constraint`,`nameType`,`typeAnnotation`],fields:{key:b(`Identifier`),constraint:b(`TSType`),readonly:x(T(!0,!1,`+`,`-`)),optional:x(T(!0,!1,`+`,`-`)),typeAnnotation:S(`TSType`),nameType:S(`TSType`)}}),M(`TSTemplateLiteralType`,{aliases:[`TSType`,`TSBaseType`],visitor:[`quasis`,`types`],fields:{quasis:w(`TemplateElement`),types:{validate:O(D(`array`),Dt(E(`TSType`)),function(e,t,n){if(e.quasis.length!==n.length+1)throw TypeError(`Number of ${e.type} quasis should be exactly one more than the number of types.\nExpected ${n.length+1} quasis but got ${e.quasis.length}`)})}}}),M(`TSLiteralType`,{aliases:[`TSType`,`TSBaseType`],visitor:[`literal`],fields:{literal:{validate:function(){let e=E(`NumericLiteral`,`BigIntLiteral`),t=T(`-`),n=E(`NumericLiteral`,`StringLiteral`,`BooleanLiteral`,`BigIntLiteral`,`TemplateLiteral`);return v(function(r,i,a){g(`UnaryExpression`,a)?(t(a,`operator`,a.operator),e(a,`argument`,a.argument)):n(r,i,a)},{oneOfNodeTypes:[`NumericLiteral`,`StringLiteral`,`BooleanLiteral`,`BigIntLiteral`,`TemplateLiteral`,`UnaryExpression`]})}()}}}),M(`TSClassImplements`,{aliases:[`TSType`],visitor:[`expression`,`typeArguments`],fields:{expression:b(`Expression`),typeArguments:S(`TSTypeParameterInstantiation`)}}),M(`TSInterfaceHeritage`,{aliases:[`TSType`],visitor:[`expression`,`typeArguments`],fields:{expression:b(`Expression`),typeArguments:S(`TSTypeParameterInstantiation`)}}),M(`TSInterfaceDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`typeParameters`,`extends`,`body`],fields:{declare:x($t),id:b(`Identifier`),typeParameters:S(`TSTypeParameterDeclaration`),extends:x(C(`TSInterfaceHeritage`)),body:b(`TSInterfaceBody`)}}),M(`TSInterfaceBody`,{visitor:[`body`],fields:{body:w(`TSTypeElement`)}}),M(`TSTypeAliasDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`typeParameters`,`typeAnnotation`],fields:{declare:x($t),id:b(`Identifier`),typeParameters:S(`TSTypeParameterDeclaration`),typeAnnotation:b(`TSType`)}}),M(`TSInstantiationExpression`,{aliases:[`Expression`],visitor:[`expression`,`typeArguments`],fields:{expression:b(`Expression`),typeArguments:S(`TSTypeParameterInstantiation`)}});const sn={aliases:[`Expression`,`LVal`,`PatternLike`],visitor:[`expression`,`typeAnnotation`],fields:{expression:b(`Expression`),typeAnnotation:b(`TSType`)}};M(`TSAsExpression`,sn),M(`TSSatisfiesExpression`,sn),M(`TSTypeAssertion`,{aliases:[`Expression`,`LVal`,`PatternLike`],visitor:[`typeAnnotation`,`expression`],fields:{typeAnnotation:b(`TSType`),expression:b(`Expression`)}}),M(`TSEnumBody`,{visitor:[`members`],fields:{members:w(`TSEnumMember`)}}),M(`TSEnumDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`body`],fields:{declare:x($t),const:x($t),id:b(`Identifier`),body:b(`TSEnumBody`)}}),M(`TSEnumMember`,{visitor:[`id`,`initializer`],fields:{id:b(`Identifier`,`StringLiteral`),initializer:S(`Expression`)}}),M(`TSModuleDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`body`],fields:{kind:{validate:T(`global`,`namespace`,`module`),default:`namespace`},declare:x($t),id:{validate:O(E(`TSEntityName`,`StringLiteral`),v(function(e,t,n){if(e.kind===`namespace`&&g(`StringLiteral`,n))throw TypeError(`TSModuleDeclaration of kind 'namespace' cannot have a StringLiteral id.`)},{oneOfNodeTypes:[`TSEntityName`,`StringLiteral`]}))},body:b(`TSModuleBlock`)}}),M(`TSModuleBlock`,{aliases:[`Scopable`,`Block`,`BlockParent`,`FunctionParent`],visitor:[`body`],fields:{body:w(`Statement`)}}),M(`TSImportType`,{aliases:[`TSType`],builder:[`source`,`qualifier`,`typeArguments`],visitor:[`source`,`options`,`qualifier`,`typeArguments`],fields:{source:b(`StringLiteral`),qualifier:S(`TSEntityName`),typeArguments:S(`TSTypeParameterInstantiation`),options:{validate:E(`ObjectExpression`),optional:!0}}}),M(`TSImportEqualsDeclaration`,{aliases:[`Statement`,`Declaration`],visitor:[`id`,`moduleReference`],fields:{id:b(`Identifier`),moduleReference:b(`TSEntityName`,`TSExternalModuleReference`),importKind:{validate:T(`type`,`value`),optional:!0}}}),M(`TSExternalModuleReference`,{visitor:[`expression`],fields:{expression:b(`StringLiteral`)}}),M(`TSNonNullExpression`,{aliases:[`Expression`,`LVal`,`PatternLike`],visitor:[`expression`],fields:{expression:b(`Expression`)}}),M(`TSExportAssignment`,{aliases:[`Statement`],visitor:[`expression`],fields:{expression:b(`Expression`)}}),M(`TSNamespaceExportDeclaration`,{aliases:[`Statement`],visitor:[`id`],fields:{id:b(`Identifier`)}}),M(`TSTypeAnnotation`,{visitor:[`typeAnnotation`],fields:{typeAnnotation:{validate:E(`TSType`)}}}),M(`TSTypeParameterInstantiation`,{visitor:[`params`],fields:{params:w(`TSType`)}}),M(`TSTypeParameterDeclaration`,{visitor:[`params`],fields:{params:w(`TSTypeParameter`)}}),M(`TSTypeParameter`,{builder:[`constraint`,`default`,`name`],visitor:[`name`,`constraint`,`default`],fields:{name:{validate:E(`Identifier`)},in:{validate:D(`boolean`),optional:!0},out:{validate:D(`boolean`),optional:!0},const:{validate:D(`boolean`),optional:!0},constraint:{validate:E(`TSType`),optional:!0},default:{validate:E(`TSType`),optional:!0}}});const cn={ModuleDeclaration:`ImportOrExportDeclaration`};Object.keys(cn).forEach(e=>{_[e]=_[cn[e]]});for(let{types:e,set:t}of Ot)for(let n of e){let e=_[n];e?e.forEach(t.add,t):t.add(n)}[].concat(Object.keys(_t),Object.keys(_),Object.keys(xt));function ln(e,t,n){if(!e)return;let r=yt[e.type];if(!r)return;let i=r[t];dn(e,t,n,i),fn(e,t,n)}function un(e,t,n,r,i){if(e!=null&&e.validate&&!(e.optional&&r==null)&&(e.validate(t,n,r),i)){var a;let e=r.type;if(e==null)return;(a=St[e])==null||a.call(St,t,n,r)}}function dn(e,t,n,r){r!=null&&r.validate&&(r.optional&&n==null||r.validate(e,t,n))}function fn(e,t,n){var r;let i=n==null?void 0:n.type;i!=null&&((r=St[i])==null||r.call(St,e,t,n))}const{validateInternal:N}=Object.defineProperty({__proto__:null,default:ln,validateChild:fn,validateField:dn,validateInternal:un},Symbol.toStringTag,{value:`Module`}),{NODE_FIELDS:P}=Lt;function pn(e){let t={type:`ArrayExpression`,elements:e},n=P.ArrayExpression;return N(n.elements,t,`elements`,e,1),t}function mn(e,t=[]){let n={type:`BlockStatement`,body:e,directives:t},r=P.BlockStatement;return N(r.body,n,`body`,e,1),N(r.directives,n,`directives`,t,1),n}function F(e,t){let n={type:`CallExpression`,callee:e,arguments:t},r=P.CallExpression;return N(r.callee,n,`callee`,e,1),N(r.arguments,n,`arguments`,t,1),n}function hn(e){let t={type:`ExpressionStatement`,expression:e},n=P.ExpressionStatement;return N(n.expression,t,`expression`,e,1),t}function I(e){let t={type:`Identifier`,name:e},n=P.Identifier;return N(n.name,t,`name`,e),t}function L(e){let t={type:`StringLiteral`,value:e},n=P.StringLiteral;return N(n.value,t,`value`,e),t}function gn(e){let t={type:`NumericLiteral`,value:e},n=P.NumericLiteral;return N(n.value,t,`value`,e),t}function _n(){return{type:`NullLiteral`}}function vn(e){let t={type:`BooleanLiteral`,value:e},n=P.BooleanLiteral;return N(n.value,t,`value`,e),t}function yn(e,t,n=!1){let r={type:`MemberExpression`,object:e,property:t,computed:n},i=P.MemberExpression;return N(i.object,r,`object`,e,1),N(i.property,r,`property`,t,1),N(i.computed,r,`computed`,n),r}function bn(e){let t={type:`ObjectExpression`,properties:e},n=P.ObjectExpression;return N(n.properties,t,`properties`,e,1),t}function xn(e,t,n,r,i=!1,a=!1,o=!1){let s={type:`ObjectMethod`,kind:e,key:t,params:n,body:r,computed:i,generator:a,async:o},c=P.ObjectMethod;return N(c.kind,s,`kind`,e),N(c.key,s,`key`,t,1),N(c.params,s,`params`,n,1),N(c.body,s,`body`,r,1),N(c.computed,s,`computed`,i),N(c.generator,s,`generator`,a),N(c.async,s,`async`,o),s}function Sn(e,t,n=!1,r=!1){let i={type:`ObjectProperty`,key:e,value:t,computed:n,shorthand:r},a=P.ObjectProperty;return N(a.key,i,`key`,e,1),N(a.value,i,`value`,t,1),N(a.computed,i,`computed`,n),N(a.shorthand,i,`shorthand`,r),i}function Cn(e=null){let t={type:`ReturnStatement`,argument:e},n=P.ReturnStatement;return N(n.argument,t,`argument`,e,1),t}function wn(e,t){let n={type:`VariableDeclaration`,kind:e,declarations:t},r=P.VariableDeclaration;return N(r.kind,n,`kind`,e),N(r.declarations,n,`declarations`,t,1),n}function Tn(e,t=null){let n={type:`VariableDeclarator`,id:e,init:t},r=P.VariableDeclarator;return N(r.id,n,`id`,e,1),N(r.init,n,`init`,t,1),n}function R(e,t,n=!1){let r={type:`ArrowFunctionExpression`,params:e,body:t,async:n},i=P.ArrowFunctionExpression;return N(i.params,r,`params`,e,1),N(i.body,r,`body`,t,1),N(i.async,r,`async`,n),r}function En(e,t,n=null){let r={type:`ImportDeclaration`,specifiers:e,source:t,attributes:n},i=P.ImportDeclaration;return N(i.specifiers,r,`specifiers`,e,1),N(i.source,r,`source`,t,1),N(i.attributes,r,`attributes`,n,1),r}function Dn(e,t){let n={type:`ImportSpecifier`,local:e,imported:t},r=P.ImportSpecifier;return N(r.local,n,`local`,e,1),N(r.imported,n,`imported`,t,1),n}function On(e,t=!1){let n={type:`TemplateElement`,value:e,tail:t},r=P.TemplateElement;return N(r.value,n,`value`,e),N(r.tail,n,`tail`,t),n}function kn(e,t){let n={type:`TemplateLiteral`,quasis:e,expressions:t},r=P.TemplateLiteral;return N(r.quasis,n,`quasis`,e,1),N(r.expressions,n,`expressions`,t,1),n}function An(e,t,n){let r={type:`OptionalCallExpression`,callee:e,arguments:t,optional:n},i=P.OptionalCallExpression;return N(i.callee,r,`callee`,e,1),N(i.arguments,r,`arguments`,t,1),N(i.optional,r,`optional`,n),r}const{hasOwn:jn}=Object;function Mn(e,t,n,r){return e&&typeof e.type==`string`?Pn(e,t,n,r):e}function Nn(e,t,n,r){return Array.isArray(e)?e.map(e=>Mn(e,t,n,r)):Mn(e,t,n,r)}function z(e,t=!0,n=!1){return e&&Pn(e,t,n,new Map)}function Pn(e,t=!0,n=!1,r){if(!e)return e;let{type:i}=e,o={type:e.type};if(Ce(e))o.name=e.name,jn(e,`optional`)&&typeof e.optional==`boolean`&&(o.optional=e.optional),jn(e,`typeAnnotation`)&&(o.typeAnnotation=t?Nn(e.typeAnnotation,!0,n,r):e.typeAnnotation),jn(e,`decorators`)&&(o.decorators=t?Nn(e.decorators,!0,n,r):e.decorators);else if(jn(yt,i))for(let a of Object.keys(yt[i]))jn(e,a)&&(t?o[a]=be(e)&&a===`comments`?Fn(e.comments,t,n,r):Nn(e[a],!0,n,r):o[a]=e[a]);else throw Error(`Unknown node type: "${i}"`);return jn(e,`loc`)&&(n?o.loc=null:o.loc=e.loc),jn(e,`leadingComments`)&&(o.leadingComments=Fn(e.leadingComments,t,n,r)),jn(e,`innerComments`)&&(o.innerComments=Fn(e.innerComments,t,n,r)),jn(e,`trailingComments`)&&(o.trailingComments=Fn(e.trailingComments,t,n,r)),jn(e,`extra`)&&(o.extra=a({},e.extra)),o}function Fn(e,t,n,r){return!e||!t?e:e.map(e=>{let t=r.get(e);if(t)return t;let{type:i,value:a,loc:o}=e,s={type:i,value:a,loc:o};return n&&(s.loc=void 0),r.set(e,s),s})}function In(e,t,n){if(!n||!e)return e;let r=`${t}Comments`;return e[r]?t===`leading`?e[r]=n.concat(e[r]):e[r].push(...n):e[r]=n,e}function Ln(e,t,n,r){return In(e,t,[{type:r?`CommentLine`:`CommentBlock`,value:n}])}_.Standardized,_.Expression,_.Binary,_.Scopable,_.BlockParent,_.Block,_.Statement,_.Terminatorless,_.CompletionStatement,_.Conditional,_.Loop,_.While,_.ExpressionWrapper,_.For,_.ForXStatement,_.Function,_.FunctionParent,_.Pureish,_.Declaration,_.FunctionParameter,_.PatternLike,_.LVal,_.TSEntityName,_.Literal,_.Immutable,_.UserWhitespacable,_.Method,_.ObjectMember,_.Property,_.UnaryLike,_.Pattern,_.Class,_.ImportOrExportDeclaration,_.ExportDeclaration,_.ModuleSpecifier,_.Private,_.Flow,_.FlowType,_.FlowBaseAnnotation,_.FlowDeclaration,_.FlowPredicate,_.EnumBody,_.EnumMember,_.JSX,_.Miscellaneous,_.Accessor,_.TypeScript,_.TSTypeElement,_.TSType,_.TSBaseType;const Rn=Symbol(),zn=Symbol();function Bn(e,t,n){if(!e)return!1;let r=_t[e.type];if(!r)return!1;n=n||{};let i=t(e,n);if(i!==void 0)switch(i){case Rn:return!1;case zn:return!0}for(let i of r){let r=e[i];if(r){if(Array.isArray(r)){for(let e of r)if(Bn(e,t,n))return!0}else if(Bn(r,t,n))return!0}}return!1}Bn.skip=Rn,Bn.stop=zn;const Vn=[`tokens`,`start`,`end`,`loc`,`raw`,`rawValue`],Hn=[...ot,`comments`,...Vn];function Un(e,t={}){let n=t.preserveComments?Vn:Hn;for(let t of n)e[t]!=null&&(e[t]=void 0);for(let t of Object.keys(e))t.startsWith(`_`)&&e[t]!=null&&(e[t]=void 0);let r=Object.getOwnPropertySymbols(e);for(let t of r)e[t]=null}function Wn(e,t){return Bn(e,Un,t),e}function Gn(e,t=e.key){let n;return e.kind===`method`?Gn.increment()+``:(n=Ce(t)?t.name:we(t)?JSON.stringify(t.value):JSON.stringify(Wn(z(t))),e.computed&&(n=`[${n}]`),e.static&&(n=`static:${n}`),n)}Gn.uid=0,Gn.increment=function(){return Gn.uid>=2**53-1?Gn.uid=0:Gn.uid++},Function.call.bind(Object.prototype.toString);function Kn(e,t,n,r){let i=[].concat(e),a=Object.create(null);for(;i.length;){let e=i.shift();if(!e||r&&(ye(e)||je(e)||Me(e)))continue;if(Ce(e)){t?(a[e.name]=a[e.name]||[]).push(e):a[e.name]=e;continue}if($e(e)&&!Fe(e)){Qe(e.declaration)&&i.push(e.declaration);continue}if(n){if(xe(e)){i.push(e.id);continue}if(Se(e)||Pe(e))continue}let o=Kn.keys[e.type];if(o)for(let t=0;t<o.length;t++){let n=e[o[t]];n&&(Array.isArray(n)?i.push(...n):i.push(n))}}return a}Kn.keys={DeclareClass:[`id`],DeclareFunction:[`id`],DeclareModule:[`id`],DeclareVariable:[`id`],DeclareInterface:[`id`],DeclareTypeAlias:[`id`],DeclareOpaqueType:[`id`],InterfaceDeclaration:[`id`],TypeAlias:[`id`],OpaqueType:[`id`],CatchClause:[`param`],LabeledStatement:[`label`],UnaryExpression:[`argument`],AssignmentExpression:[`left`],ImportSpecifier:[`local`],ImportNamespaceSpecifier:[`local`],ImportDefaultSpecifier:[`local`],ImportDeclaration:[`specifiers`],TSImportEqualsDeclaration:[`id`],ExportSpecifier:[`exported`],ExportNamespaceSpecifier:[`exported`],ExportDefaultSpecifier:[`exported`],FunctionDeclaration:[`id`,`params`],FunctionExpression:[`id`,`params`],ArrowFunctionExpression:[`params`],ObjectMethod:[`params`],ClassMethod:[`params`],ClassPrivateMethod:[`params`],ForInStatement:[`left`],ForOfStatement:[`left`],ClassDeclaration:[`id`],ClassExpression:[`id`],RestElement:[`argument`],UpdateExpression:[`argument`],ObjectProperty:[`value`],AssignmentPattern:[`left`],ArrayPattern:[`elements`],ObjectPattern:[`properties`],VariableDeclaration:[`declarations`],VariableDeclarator:[`id`]};const qn=`@zeus-js/runtime-dom`;function Jn(e,t){return`${e}:${t}`}function Yn(e,t=`dom`){var n;let r=e.hub;return{renderer:t,moduleName:(r==null||(n=r.file)==null||(n=n.metadata)==null||(n=n.zeus)==null||(n=n.config)==null?void 0:n.moduleName)||`@zeus-js/runtime-dom`}}function Xn(e,t,n=Yn(e,`dom`).moduleName){let r=Qn(e),i=r.importMethods||(r.importMethods=new Map),a=Jn(n,t),o=i.get(a);if(o)return z(o.local);let s=$n(e).scope.generateUidIdentifier(t);return i.set(a,{imported:t,local:s,moduleName:n}),z(s)}function Zn(e){let t=e.scope.data.importMethods;if(!(t!=null&&t.size))return;let n=new Map;for(let e of t.values()){let t=n.get(e.moduleName);t?t.push(e):n.set(e.moduleName,[e])}let r=[];for(let[e,t]of n)r.push(En(t.map(e=>Dn(z(e.local),I(e.imported))),L(e)));e.unshiftContainer(`body`,r)}function Qn(e){return e.scope.getProgramParent().path.scope.data}function $n(e){return e.scope.getProgramParent().path}function er(e,t=`dom`){var n,r;return(n=(r=e.scope.data.templates)==null?void 0:r.filter(e=>e.renderer===t))==null?[]:n}function tr(e){return e.replace(/\\/g,`\\\\`).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function nr(e){return/^<(math|annotation|annotation-xml|maction|merror|mfrac|mi|mmultiscripts|mn|mo|mover|mpadded|mphantom|mprescripts|mroot|mrow|ms|mspace|msqrt|mstyle|msub|msubsup|msup|mtable|mtd|mtext|mtr|munder|munderover|semantics|menclose|mfenced)(\s|>)/.test(e)}function rr(e){let t=er(e,`dom`);if(!t.length)return;let n=Xn(e,`template`,Yn(e,`dom`).moduleName),r=t.map(e=>{let t=e.templateWithClosingTags||e.template,r={cooked:t,raw:tr(t)},i=!!(e.isCE||e.isImportNode),a=nr(t),o=[kn([On(r,!0)],[])];return(e.isSVG||i||a)&&o.push(vn(i),vn(!!e.isSVG),vn(a)),Tn(z(e.id),Ln(F(z(n),o),`leading`,`#__PURE__`))});e.node.body.unshift(wn(`var`,r))}function ir(e,t){let n=e.scope.getProgramParent().path.scope.data;(n.events||(n.events=new Set)).add(t)}function ar(e){let t=e.scope.data.events;t!=null&&t.size&&e.node.body.push(hn(F(Xn(e,`delegateEvents`,Yn(e,`dom`).moduleName),[pn(Array.from(t).map(e=>L(e)))])))}const or={moduleName:qn,generate:`dom`,hydratable:!1,delegateEvents:!0,delegatedEvents:[],builtIns:[],wrapConditionals:!0,omitNestedClosingTags:!1,omitLastClosingTag:!0,omitQuotes:!0,contextToCustomElements:!1,staticMarker:`@once`,effectWrapper:`effect`,memoWrapper:`memo`,validate:!0,inlineStyles:!0};function sr(e){let t=u({},or,e);return t.generate===`ssr`&&(e==null?void 0:e.moduleName)===void 0&&(t.moduleName=`@zeus-js/runtime-ssr`),t}var cr=class{constructor(e,t){this.options=e,this.programPath=t}runtimeModule(){return this.options.moduleName||`@zeus-js/runtime-dom`}uid(e){return this.programPath.scope.generateUidIdentifier(e)}importRuntime(e){let t=this.runtimeModule(),n=this.programPath.scope.data,r=n.importMethods||(n.importMethods=new Map),i=`${t}:${e}`,a=r.get(i);if(a)return z(a.local);let o=this.uid(e);return r.set(i,{moduleName:t,imported:e,local:o}),z(o)}registerTemplate(e,t=!1){let n=this.programPath.scope.data,r=n.templateMap||(n.templateMap=new Map),i=n.templates||(n.templates=[]),a=r.get(e);if(a)return{id:z(a.id),html:e,isSVG:!!a.isSVG};let o=this.uid(`tmpl$`);return r.set(e,{id:o,template:e,templateWithClosingTags:e,renderer:`dom`,isSVG:t,isCE:e.includes(`-`),isImportNode:/^<(img|iframe)(\s|>)/.test(e)}),i.push(r.get(e)),{id:z(o),html:e,isSVG:t}}};function lr(e,t){return new cr(t,e.scope.getProgramParent().path)}function ur(e,t){let n=new WeakSet,r=new Set([qn,`@zeus-js/zeus`,t]);for(let t of e.node.body)if(!(!Ie(t)||!r.has(t.source.value)))for(let r of t.specifiers){if(!fr(r))continue;let t=e.scope.getBinding(r.local.name);if(!(!t||t.path.node!==r))for(let e of t.referencePaths)pr(e,n)}Qn(e).defineElementSetups=n}function dr(e){var t;let n=Qn(e).defineElementSetups,r=e.getFunctionParent();if(!n||!r||!Ze(r.node)||!n.has(r.node))return!1;let i=gr(e);if(r.isArrowFunctionExpression()&&r.node.body===i.node)return!0;let a=i.parentPath;return!!(a!=null&&a.isReturnStatement()&&a.node.argument===i.node&&((t=a.getFunctionParent())==null?void 0:t.node)===r.node)}function fr(e){if(!Le(e))return!1;let t=e.imported;return Ce(t)&&t.name===`defineElement`||we(t)&&t.value===`defineElement`}function pr(e,t){let n=e.parentPath;if(e.key!==`callee`||!(n!=null&&n.isCallExpression())||n.node.callee!==e.node)return;let r=n.get(`arguments`)[2];if(!r)return;let i=mr(r,new Set);i&&t.add(i)}function mr(e,t){let n=hr(e);if(n.isArrowFunctionExpression()||n.isFunctionExpression())return n.node;if(!n.isIdentifier())return;let r=n.scope.getBinding(n.node.name);if(!(r!=null&&r.constant)||t.has(r))return;if(t.add(r),r.path.isFunctionDeclaration())return r.path.node;if(!r.path.isVariableDeclarator())return;let i=r.path.get(`init`);if(!(Array.isArray(i)||!i.node))return mr(i,t)}function hr(e){let t=e;for(;vr(t.node);)t=t.get(`expression`);return t}function gr(e){let t=e;for(;t.parentPath&&_r(t.parentPath,t);)t=t.parentPath;return t}function _r(e,t){let n=e.node;return vr(n)&&n.expression===t.node}function vr(e){return ke(e)||qe(e)||Je(e)||Ye(e)||He(e)||Xe(e)}const yr=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`];function br(e,t=!1){let n=e.replace(/&/g,`&`);return t?n.replace(/"/g,`"`).replace(/>/g,`>`):n.replace(/</g,`<`)}function xr(e){return e.replace(/\r\n?/g,`
|
|
5
5
|
`).split(`
|
|
6
|
-
`).map(e=>e.trim()).filter(Boolean).join(` `)}const xr=new Set([`script`,`style`,`textarea`,`title`]);function Sr(e){return xr.has(e)}function Cr(e,t){let n=e.file.metadata;return n.zeus=u({},n.zeus,{config:t}),n.zeus}function wr(e,t,n){Cr(n,e),lr(t,e.moduleName)}function Tr(e,t,n){n.get(`skip`)||(nr(t),ir(t),Xn(t))}function Er(e){return{enter(t,n){wr(e,t,n)},exit(t,n){Tr(e,t,n)}}}function Dr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Or(e,t){if(e==null)return{};var n,r,i=Dr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const kr=[`message`];var V=class{constructor(e,t,n){this.line=void 0,this.column=void 0,n!==void 0&&(this.index=void 0),this.line=e,this.column=t,n!==void 0&&(this.index=n)}},Ar=class{constructor(e,t){r(this,`start`,void 0),r(this,`end`,void 0),r(this,`filename`,void 0),r(this,`identifierName`,void 0),this.start=e,this.end=t}};function jr(e,t){let{line:n,column:r,index:i}=e;return new V(n,r+t,i+t)}const Mr=`BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED`,Nr={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Mr},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Mr}},Pr={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`},Fr=e=>e.type===`UpdateExpression`?Pr.UpdateExpression[`${e.prefix}`]:Pr[e.type],Ir={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:`'arguments' is only allowed in functions and class methods.`,AsyncFunctionInSingleStatementContext:`Async functions can only be declared at the top level or inside a block.`,AwaitBindingIdentifier:`Can not use 'await' as identifier inside an async function.`,AwaitBindingIdentifierInStaticBlock:`Can not use 'await' as identifier inside a static block.`,AwaitExpressionFormalParameter:`'await' is not allowed in async function parameters.`,AwaitUsingNotInAsyncContext:`'await using' is only allowed within async functions and at the top levels of modules.`,AwaitNotInAsyncContext:`'await' is only allowed within async functions and at the top levels of modules.`,BadGetterArity:`A 'get' accessor must not have any formal parameters.`,BadSetterArity:`A 'set' accessor must have exactly one formal parameter.`,BadSetterRestParameter:`A 'set' accessor function argument must not be a rest parameter.`,ConstructorClassField:`Classes may not have a field named 'constructor'.`,ConstructorClassPrivateField:`Classes may not have a private field named '#constructor'.`,ConstructorIsAccessor:`Class constructor may not be an accessor.`,ConstructorIsAsync:`Constructor can't be an async function.`,ConstructorIsGenerator:`Constructor can't be a generator.`,DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:`Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.`,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 { ... }'?`,DecoratorSemicolon:`Decorators must not be followed by a semicolon.`,DecoratorStaticBlock:`Decorators can't be used with a static block.`,DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:`Deleting a private field is not allowed.`,DestructureNamedImport:`ES2015 named imports do not destructure. Use another statement for destructuring after the import.`,DuplicateConstructor:`Duplicate constructor in the same class.`,DuplicateDefaultExport:`Only one default export allowed per module.`,DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:`Redefinition of __proto__ property.`,DuplicateRegExpFlags:`Duplicate regular expression flag.`,ElementAfterRest:`Rest element must be last element.`,EscapedCharNotAnIdentifier:`Invalid Unicode escape.`,ExportBindingIsString:({localName:e,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:`'from' is not allowed as an identifier after 'export default'.`,ForInOfLoopInitializer:({type:e})=>`'${e===`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:e})=>`Unsyntactic ${e===`BreakStatement`?`break`:`continue`}.`,IllegalLanguageModeDirective:`Illegal 'use strict' directive in function with non-simple parameter list.`,IllegalReturn:`'return' outside of function.`,ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:({phase:e})=>`\`import${e?`.${e}`:``}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:e})=>`Cannot use new with import${e?`.${e}`:``}().`,ImportCallSpreadArgument:({phase:e})=>`\`...\` is not allowed in \`import${e?`.${e}`:``}()\`.`,IncompatibleRegExpUVFlags:`The 'u' and 'v' regular expression flags cannot be enabled at the same time.`,InvalidBigIntLiteral:`Invalid BigIntLiteral.`,InvalidCodePoint:`Code point out of bounds.`,InvalidCoverDiscardElement:`'void' must be followed by an expression when not used in a binding position.`,InvalidCoverInitializedName:`Invalid shorthand property initializer.`,InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:`Bad character escape sequence.`,InvalidEscapeSequenceTemplate:`Invalid escape sequence in template.`,InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${Fr(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${Fr(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${Fr(e)}.`,InvalidNumber:`Invalid number.`,InvalidOrMissingExponent:`Floating-point numbers require a valid exponent after the 'e'.`,InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:`Invalid parenthesized assignment pattern.`,InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:`Binding member expression.`,InvalidRestAssignmentPattern:`Invalid rest operator's argument.`,LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:`'let' is disallowed as a lexically bound name.`,LineTerminatorBeforeArrow:`No line break is allowed before '=>'.`,MalformedRegExpFlags:`Invalid regular expression flag.`,MissingClassName:`A class name is required.`,MissingEqInAssignment:`Only '=' operator can be used for specifying default value.`,MissingSemicolon:`Missing semicolon.`,MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingUnicodeEscape:`Expecting Unicode escape sequence \\uXXXX.`,MixingCoalesceWithLogical:`Nullish coalescing operator(??) requires parens when mixing with logical operators.`,ModuleAttributeInvalidValue:`Only string literals are allowed as module attribute values.`,ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:`Multiple default clauses.`,NewlineAfterThrow:`Illegal newline after throw.`,NoCatchOrFinally:`Missing catch or finally clause.`,NumberIdentifier:`Identifier directly after number.`,NumericSeparatorInEscapeSequence:`Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.`,ObsoleteAwaitStar:`'await*' has been removed from the async functions proposal. Use Promise.all() instead.`,OptionalChainingNoNew:`Constructors in/after an Optional Chain are not allowed.`,OptionalChainingNoTemplate:`Tagged Template Literals are not allowed in optionalChain.`,OverrideOnConstructor:`'override' modifier cannot appear on a constructor declaration.`,ParamDupe:`Argument name clash.`,PatternHasAccessor:`Object pattern can't contain getter or setter.`,PatternHasMethod:`Object pattern can't contain methods.`,PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RestTrailingComma:`Unexpected trailing comma after rest element.`,SloppyFunction:`In non-strict mode code, functions can only be declared at top level or inside a block.`,SloppyFunctionAnnexB:`In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.`,SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:`Classes may not have static property named prototype.`,SuperCallNotNewExpression:`Cannot use new with super(...).`,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.`,UnexpectedArgumentPlaceholder:`Unexpected argument placeholder.`,UnexpectedDigitAfterHash:`Unexpected digit after hash token.`,UnexpectedImportExport:`'import' and 'export' may only appear at the top level.`,UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:`Leading decorators must be attached to a class declaration.`,UnexpectedLexicalDeclaration:`Lexical declaration cannot appear in a single-statement context.`,UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:`A numeric separator is only allowed between two digits.`,UnexpectedPrivateField:`Unexpected private name.`,UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:`'super' is only allowed in object methods and classes.`,UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:``}${e?`, expected "${e}"`:``}`,UnexpectedTokenUnaryExponentiation:`Illegal expression. Wrap left hand side or entire exponentiation in parentheses.`,UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:`Unexpected void binding.`,UnsupportedDecoratorExport:`A decorated export must export a class declaration.`,UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:`Decorators cannot be used to decorate parameters.`,UnsupportedPropertyDecorator:`Decorators cannot be used to decorate object literal properties.`,UnsupportedSuper:`'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).`,UnterminatedComment:`Unterminated comment.`,UnterminatedRegExp:`Unterminated regular expression.`,UnterminatedString:`Unterminated string constant.`,UnterminatedTemplate:`Unterminated template.`,UsingDeclarationExport:`Using declaration cannot be exported.`,UsingDeclarationHasBindingPattern:`Using declaration cannot have destructuring patterns.`,VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:`A void binding may not have an initializer.`,YieldBindingIdentifier:`Can not use 'yield' as identifier inside a generator.`,YieldInParameter:`Yield expression is not allowed in formal parameters.`,YieldNotInGeneratorFunction:`'yield' is only allowed within generator functions.`,ZeroDigitNumericSeparator:`Numeric separator can not be used after leading 0.`},Lr={StrictDelete:`Deleting local variable in strict mode.`,StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:`In strict mode code, functions can only be declared at top level or inside a block.`,StrictNumericEscape:`The only valid numeric escape in strict mode is '\\0'.`,StrictOctalLiteral:`Legacy octal literals are not allowed in strict mode.`,StrictWith:`'with' in strict mode.`},Rr={ParseExpressionEmptyInput:`Unexpected parseExpression() input: The input is empty or contains only comments.`,ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},zr=new Set([`ArrowFunctionExpression`,`AssignmentExpression`,`ConditionalExpression`,`YieldExpression`]),Br={PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:`Topic reference is unbound; it must be inside a pipe body.`,PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:`Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.`,PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${Fr({type:e})}; please wrap it in parentheses.`,PipelineUnparenthesized:`Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses.`},Vr={UnsupportedBind:`Binding should be performed on object property.`,UnsupportedBindRHS:`The right-hand side of binding can not be super or import.`};function Hr(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n})}function Ur({toMessage:e,code:t,reasonCode:n,syntaxPlugin:r}){let i=n===`MissingPlugin`||n===`MissingOneOfPlugins`;return function o(s,c,l){let u=SyntaxError();return u.code=t,u.reasonCode=n,u.loc=s,u.pos=c,u.syntaxPlugin=r,i&&(u.missingPlugin=l.missingPlugin),Hr(u,`clone`,function(e={}){var t;let{line:n,column:r,index:i=c}=(t=e.loc)==null?s:t;return o(new V(n,r),i,a(a({},l),e.details))}),Hr(u,`details`,l),Object.defineProperty(u,"message",{configurable:!0,get(){let t=`${e(l)} (${s.line}:${s.column})`;return this.message=t,t},set(e){Object.defineProperty(this,"message",{value:e,writable:!0})}}),u}}function Wr(e,t){if(Array.isArray(e))return t=>Wr(t,e[0]);let n={};for(let r of Object.keys(e)){let i=e[r],o=typeof i==`string`?{message:()=>i}:typeof i==`function`?{message:i}:i,{message:s}=o,c=Or(o,kr);n[r]=Ur(a(a({code:`BABEL_PARSER_SYNTAX_ERROR`,reasonCode:r,toMessage:typeof s==`string`?()=>s:s},t?{syntaxPlugin:t}:{}),c))}return n}const H=a(a(a(a(a(a({},Wr(Nr)),Wr(Ir)),Wr(Lr)),Wr(Rr)),Wr`pipelineOperator`(Br)),Wr`functionBind`(Vr));function Gr(){return{sourceType:`script`,sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,locations:!0,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Kr(e){let t=Gr();if(e==null)return t;if(e.annexB!=null&&e.annexB!==!1)throw Error("The `annexB` option can only be set to `false`.");for(let n of Object.keys(t))e[n]!=null&&(t[n]=e[n]);if(t.startLine===1)e.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:e.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if(e.startColumn==null||e.startIndex==null)throw Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(t.sourceType===`commonjs`){if(e.allowAwaitOutsideFunction!=null)throw Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(e.allowReturnOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(e.allowNewTargetOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return t}function qr(e){let{start:t,end:n}=e.loc;return e.loc.start=new V(t.line,t.column),e.loc.end=new V(n.line,n.column),e}const Jr=e=>class extends e{createPosition(e){return new V(e.line,e.column)}parse(){let e=super.parse();return this.optionFlags&512&&(e.tokens=e.tokens.map(qr)),qr(e)}parseRegExpLiteral({pattern:e,flags:t}){let n=null;try{n=new RegExp(e,t)}catch(e){}let r=this.estreeParseLiteral(n);return r.regex={pattern:e,flags:t},r}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch(e){t=null}let n=this.estreeParseLiteral(t);return n.bigint=String(n.value||e),n}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)}estreeParseChainExpression(e,t){let n=this.startNodeAtNode(e);return n.expression=e,this.finishNodeAtNode(n,`ChainExpression`,t)}directiveToStmt(e){let t=e.value;delete e.value,this.castNodeTo(t,`Literal`),t.raw=t.extra.raw,t.value=t.extra.expressionValue;let n=this.castNodeTo(e,`ExpressionStatement`);return n.expression=t,n.directive=t.extra.rawValue,delete t.extra,n}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:t,end:n,loc:r,range:i,raw:a,value:o}=e,s=Object.create(e.constructor.prototype);return s.type=`Literal`,s.start=t,s.end=n,s.loc=r,s.range=i,s.raw=a,s.value=o,s}initFunction(e,t){super.initFunction(e,t),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 t;return e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&!((t=e.expression.extra)!=null&&t.parenthesized)}parseBlockBody(e,t,n,r,i){super.parseBlockBody(e,t,n,r,i),e.body=e.directives.map(e=>this.directiveToStmt(e)).concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.convertPrivateNameToPrivateIdentifier(e)}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return delete e.id,e.name=t,this.castNodeTo(e,`PrivateIdentifier`)}isPrivateName(e){return e.type===`PrivateIdentifier`}getPrivateNameSV(e){return e.name}parseLiteral(e,t){let n=super.parseLiteral(e,t);return n.raw=n.extra.raw,delete n.extra,n}parseFunctionBody(e,t,n=!1){super.parseFunctionBody(e,t,n),e.expression=e.body.type!==`BlockStatement`}parseMethod(e,t,n,r,i,a,o=!1){let s=this.startNode();s.kind=e.kind,s=super.parseMethod(s,t,n,r,i,a,o),delete s.kind;let{typeParameters:c}=e;return c&&(delete e.typeParameters,s.typeParameters=c,this.resetStartLocationFromNode(s,c)),e.value=this.castNodeTo(s,this.hasPlugin(`typescript`)&&!s.body?`TSEmptyBodyFunctionExpression`:`FunctionExpression`),a===`ClassPrivateMethod`&&(e.computed=!1),this.hasPlugin(`typescript`)&&e.abstract?(delete e.abstract,this.finishNode(e,`TSAbstractMethodDefinition`)):a===`ObjectMethod`?(e.kind===`method`&&(e.kind=`init`),e.shorthand=!1,this.finishNode(e,`Property`)):this.finishNode(e,`MethodDefinition`)}nameIsConstructor(e){return e.type===`Literal`?e.value===`constructor`:super.nameIsConstructor(e)}parseClassProperty(...e){let t=super.parseClassProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractPropertyDefinition`)):this.castNodeTo(t,`PropertyDefinition`),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?this.castNodeTo(t,`TSAbstractPropertyDefinition`):this.castNodeTo(t,`PropertyDefinition`),t.computed=!1,t}parseClassAccessorProperty(e){let t=super.parseClassAccessorProperty(e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractAccessorProperty`)):this.castNodeTo(t,`AccessorProperty`),t}parseObjectProperty(e,t,n,r){let i=super.parseObjectProperty(e,t,n,r);return i&&(i.kind=`init`,this.castNodeTo(i,`Property`)),i}finishObjectProperty(e){return e.kind=`init`,this.finishNode(e,`Property`)}isValidLVal(e,t,n,r){return e===`Property`?`value`:super.isValidLVal(e,t,n,r)}isAssignable(e,t){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(e!=null&&this.isObjectProperty(e)){let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,n){e.type===`Property`&&(e.kind===`get`||e.kind===`set`)?this.raise(H.PatternHasAccessor,e.key):e.type===`Property`&&e.method?this.raise(H.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,t,n)}finishCallExpression(e,t){let n=super.finishCallExpression(e,t);if(n.callee.type===`Import`){var r;this.castNodeTo(n,`ImportExpression`),n.source=n.arguments[0],n.options=(r=n.arguments[1])==null?null:r,delete n.arguments,delete n.callee}else n.type===`OptionalCallExpression`?this.castNodeTo(n,`CallExpression`):n.optional=!1;return n}parseExport(e,t){let n=this.state.lastTokStartLoc,r=super.parseExport(e,t);switch(r.type){case`ExportAllDeclaration`:r.exported=null;break;case`ExportNamedDeclaration`:r.specifiers.length===1&&r.specifiers[0].type===`ExportNamespaceSpecifier`&&(this.castNodeTo(r,`ExportAllDeclaration`),r.exported=r.specifiers[0].exported,delete r.specifiers);case`ExportDefaultDeclaration`:{var i;let{declaration:e}=r;(e==null?void 0:e.type)===`ClassDeclaration`&&((i=e.decorators)==null?void 0:i.length)>0&&e.start===r.start&&this.resetStartLocation(r,n)}break}return r}stopParseSubscript(e,t){let n=super.stopParseSubscript(e,t);return t.optionalChainMember?this.estreeParseChainExpression(n,e):n}parseMember(e,t,n,r,i){let a=super.parseMember(e,t,n,r,i);return a.type===`OptionalMemberExpression`?this.castNodeTo(a,`MemberExpression`):a.optional=!1,a}isOptionalMemberExpression(e){return e.type===`ChainExpression`?e.expression.type===`MemberExpression`:super.isOptionalMemberExpression(e)}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.type===`Property`&&(e.method||e.kind===`get`||e.kind===`set`)}castNodeTo(e,t){let n=super.castNodeTo(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}cloneIdentifier(e){let t=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(t),t}cloneStringLiteral(e){return e.type===`Literal`?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,t,n){return qr(super.finishNodeAt(e,t,n))}finishNodeAtNode(e,t,n){return qr(super.finishNodeAtNode(e,t,n))}finishNode(e,t){let n=super.finishNode(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}resetStartLocation(e,t){super.resetStartLocation(e,t),qr(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),qr(e)}};var Yr=class{constructor(e,t={}){r(this,`label`,void 0),r(this,`keyword`,void 0),r(this,`beforeExpr`,void 0),r(this,`startsExpr`,void 0),r(this,`rightAssociative`,void 0),r(this,`isLoop`,void 0),r(this,`isAssign`,void 0),r(this,`prefix`,void 0),r(this,`postfix`,void 0),r(this,`binop`,void 0),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop==null?null:t.binop}};const Xr=new Map;function U(e,t={}){t.keyword=e;let n=G(e,t);return Xr.set(e,n),n}function W(e,t){return G(e,{beforeExpr:!0,binop:t})}let Zr=-1;const Qr=[],$r=[],ei=[],ti=[],ni=[],ri=[];function G(e,t={}){var n,r,i,a;return++Zr,$r.push(e),ei.push((n=t.binop)==null?-1:n),ti.push((r=t.beforeExpr)==null?!1:r),ni.push((i=t.startsExpr)==null?!1:i),ri.push((a=t.prefix)==null?!1:a),Qr.push(new Yr(e,t)),Zr}function K(e,t={}){var n,r,i,a;return++Zr,Xr.set(e,Zr),$r.push(e),ei.push((n=t.binop)==null?-1:n),ti.push((r=t.beforeExpr)==null?!1:r),ni.push((i=t.startsExpr)==null?!1:i),ri.push((a=t.prefix)==null?!1:a),Qr.push(new Yr(`name`,t)),Zr}const ii={bracketL:G(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:G(`]`),braceL:G(`{`,{beforeExpr:!0,startsExpr:!0}),braceBarL:G(`{|`,{beforeExpr:!0,startsExpr:!0}),braceR:G(`}`),braceBarR:G(`|}`),parenL:G(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:G(`)`),comma:G(`,`,{beforeExpr:!0}),semi:G(`;`,{beforeExpr:!0}),colon:G(`:`,{beforeExpr:!0}),doubleColon:G(`::`,{beforeExpr:!0}),dot:G(`.`),question:G(`?`,{beforeExpr:!0}),questionDot:G(`?.`),arrow:G(`=>`,{beforeExpr:!0}),template:G(`template`),ellipsis:G(`...`,{beforeExpr:!0}),backQuote:G("`",{startsExpr:!0}),dollarBraceL:G("${",{beforeExpr:!0,startsExpr:!0}),templateTail:G("...`",{startsExpr:!0}),templateNonTail:G("...${",{beforeExpr:!0,startsExpr:!0}),at:G(`@`),hash:G(`#`,{startsExpr:!0}),interpreterDirective:G(`#!...`),eq:G(`=`,{beforeExpr:!0,isAssign:!0}),assign:G(`_=`,{beforeExpr:!0,isAssign:!0}),slashAssign:G(`_=`,{beforeExpr:!0,isAssign:!0}),xorAssign:G(`_=`,{beforeExpr:!0,isAssign:!0}),moduloAssign:G(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:G(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),bang:G(`!`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),tilde:G(`~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),doubleCaret:G(`^^`,{startsExpr:!0}),doubleAt:G(`@@`,{startsExpr:!0}),pipeline:W(`|>`,0),nullishCoalescing:W(`??`,1),logicalOR:W(`||`,1),logicalAND:W(`&&`,2),bitwiseOR:W(`|`,3),bitwiseXOR:W(`^`,4),bitwiseAND:W(`&`,5),equality:W(`==/!=/===/!==`,6),lt:W(`</>/<=/>=`,7),gt:W(`</>/<=/>=`,7),relational:W(`</>/<=/>=`,7),bitShift:W(`<</>>/>>>`,8),bitShiftL:W(`<</>>/>>>`,8),bitShiftR:W(`<</>>/>>>`,8),plusMin:G(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:G(`%`,{binop:10,startsExpr:!0}),star:G(`*`,{binop:10}),slash:W(`/`,10),exponent:G(`**`,{beforeExpr:!0,binop:11,rightAssociative:!0}),_in:U(`in`,{beforeExpr:!0,binop:7}),_instanceof:U(`instanceof`,{beforeExpr:!0,binop:7}),_break:U(`break`),_case:U(`case`,{beforeExpr:!0}),_catch:U(`catch`),_continue:U(`continue`),_debugger:U(`debugger`),_default:U(`default`,{beforeExpr:!0}),_else:U(`else`,{beforeExpr:!0}),_finally:U(`finally`),_function:U(`function`,{startsExpr:!0}),_if:U(`if`),_return:U(`return`,{beforeExpr:!0}),_switch:U(`switch`),_throw:U(`throw`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_try:U(`try`),_var:U(`var`),_const:U(`const`),_with:U(`with`),_new:U(`new`,{beforeExpr:!0,startsExpr:!0}),_this:U(`this`,{startsExpr:!0}),_super:U(`super`,{startsExpr:!0}),_class:U(`class`,{startsExpr:!0}),_extends:U(`extends`,{beforeExpr:!0}),_export:U(`export`),_import:U(`import`,{startsExpr:!0}),_null:U(`null`,{startsExpr:!0}),_true:U(`true`,{startsExpr:!0}),_false:U(`false`,{startsExpr:!0}),_typeof:U(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:U(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:U(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_do:U(`do`,{isLoop:!0,beforeExpr:!0}),_for:U(`for`,{isLoop:!0}),_while:U(`while`,{isLoop:!0}),_as:K(`as`,{startsExpr:!0}),_assert:K(`assert`,{startsExpr:!0}),_async:K(`async`,{startsExpr:!0}),_await:K(`await`,{startsExpr:!0}),_defer:K(`defer`,{startsExpr:!0}),_from:K(`from`,{startsExpr:!0}),_get:K(`get`,{startsExpr:!0}),_let:K(`let`,{startsExpr:!0}),_meta:K(`meta`,{startsExpr:!0}),_of:K(`of`,{startsExpr:!0}),_sent:K(`sent`,{startsExpr:!0}),_set:K(`set`,{startsExpr:!0}),_source:K(`source`,{startsExpr:!0}),_static:K(`static`,{startsExpr:!0}),_using:K(`using`,{startsExpr:!0}),_yield:K(`yield`,{startsExpr:!0}),_asserts:K(`asserts`,{startsExpr:!0}),_checks:K(`checks`,{startsExpr:!0}),_exports:K(`exports`,{startsExpr:!0}),_global:K(`global`,{startsExpr:!0}),_implements:K(`implements`,{startsExpr:!0}),_intrinsic:K(`intrinsic`,{startsExpr:!0}),_infer:K(`infer`,{startsExpr:!0}),_is:K(`is`,{startsExpr:!0}),_mixins:K(`mixins`,{startsExpr:!0}),_proto:K(`proto`,{startsExpr:!0}),_require:K(`require`,{startsExpr:!0}),_satisfies:K(`satisfies`,{startsExpr:!0}),_keyof:K(`keyof`,{startsExpr:!0}),_readonly:K(`readonly`,{startsExpr:!0}),_unique:K(`unique`,{startsExpr:!0}),_abstract:K(`abstract`,{startsExpr:!0}),_declare:K(`declare`,{startsExpr:!0}),_enum:K(`enum`,{startsExpr:!0}),_module:K(`module`,{startsExpr:!0}),_namespace:K(`namespace`,{startsExpr:!0}),_interface:K(`interface`,{startsExpr:!0}),_type:K(`type`,{startsExpr:!0}),_opaque:K(`opaque`,{startsExpr:!0}),name:G(`name`,{startsExpr:!0}),placeholder:G(`%%`,{startsExpr:!0}),string:G(`string`,{startsExpr:!0}),num:G(`num`,{startsExpr:!0}),bigint:G(`bigint`,{startsExpr:!0}),regexp:G(`regexp`,{startsExpr:!0}),privateName:G(`#name`,{startsExpr:!0}),eof:G(`eof`),jsxName:G(`jsxName`),jsxText:G(`jsxText`,{beforeExpr:!0}),jsxTagStart:G(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:G(`jsxTagEnd`)};function q(e){return e>=89&&e<=129}function ai(e){return e<=88}function oi(e){return e>=54&&e<=129}function si(e){return e>=54&&e<=132}function ci(e){return ti[e]}function li(e){return ni[e]}function ui(e){return e>=25&&e<=29}function di(e){return e>=125&&e<=127}function fi(e){return e>=86&&e<=88}function pi(e){return e>=54&&e<=88}function mi(e){return e>=35&&e<=55}function hi(e){return e===30}function gi(e){return ri[e]}function _i(e){return e>=117&&e<=119}function vi(e){return e>=120&&e<=126}function yi(e){return $r[e]}function bi(e){return ei[e]}function xi(e){return e===53}function Si(e){return e>=20&&e<=21}function Ci(e){return Qr[e]}var wi=class{constructor(e,t){r(this,`token`,void 0),r(this,`preserveSpace`,void 0),this.token=e,this.preserveSpace=!!t}};const J={brace:new wi(`{`),j_oTag:new wi(`<tag`),j_cTag:new wi(`</tag`),j_expr:new wi(`<tag>...</tag>`,!0)},Ti=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Ei=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Di=RegExp(`[\\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-\\u088f\\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\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\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-\\u1c8a\\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-\\ua7dc\\ua7f1-\\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]`),Oi=RegExp(`[\\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-\\u088f\\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\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\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-\\u1c8a\\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-\\ua7dc\\ua7f1-\\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\\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\\u0897-\\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-\\u1add\\u1ae0-\\u1aeb\\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\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\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\\uff65]`);function ki(e,t){let n=65536;for(let r=0,i=t.length;r<i;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function Ai(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&Di.test(String.fromCharCode(e)):ki(e,Ti)}function ji(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&Oi.test(String.fromCharCode(e)):ki(e,Ti)||ki(e,Ei)}const Mi={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`.split(`.`),strict:[`implements`,`interface`,`let`,`package`,`private`,`protected`,`public`,`static`,`yield`],strictBind:[`eval`,`arguments`]},Ni=new Set(Mi.keyword),Pi=new Set(Mi.strict),Fi=new Set(Mi.strictBind);function Ii(e,t){return t&&e===`await`||e===`enum`}function Li(e,t){return Ii(e,t)||Pi.has(e)}function Ri(e){return Fi.has(e)}function zi(e,t){return Li(e,t)||Ri(e)}function Bi(e){return Ni.has(e)}function Vi(e,t,n){return e===64&&t===64&&Ai(n)}const Hi=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`.split(`.`));function Ui(e){return Hi.has(e)}var Wi=class{constructor(e){r(this,`flags`,0),r(this,`names`,new Map),r(this,`firstLexicalName`,``),this.flags=e}},Gi=class{constructor(e,t){r(this,`parser`,void 0),r(this,`scopeStack`,[]),r(this,`inModule`,void 0),r(this,`undefinedExports`,new Map),this.parser=e,this.inModule=t}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 allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&(e&2)==0}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&128)return!0;if(t&3779)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new Wi(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,t,n){let r=this.currentScope();if(t&8||t&16){this.checkRedeclarationInScope(r,e,t,n);let i=r.names.get(e)||0;t&16?i|=4:(r.firstLexicalName||(r.firstLexicalName=e),i|=2),r.names.set(e,i),t&8&&this.maybeExportDefined(r,e)}else if(t&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,e,t,n),r.names.set(e,(r.names.get(e)||0)|1),this.maybeExportDefined(r,e),!(r.flags&3715));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,n,r){this.isRedeclaredInScope(e,t,n)&&this.parser.raise(H.VarRedeclaration,r,{identifierName:t})}isRedeclaredInScope(e,t,n){if(!(n&1))return!1;if(n&8)return e.names.has(t);let r=e.names.get(t)||0;return n&16?(r&2)>0||!this.treatFunctionsAsVarInScope(e)&&(r&1)>0:(r&2)>0&&!(e.flags&8&&e.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(e)&&(r&4)>0}checkLocalExport(e){let{name:t}=e;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,e.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3715)return t}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3779&&!(t&4))return t}}},Ki=class extends Wi{constructor(...e){super(...e),r(this,`declareFunctions`,new Set)}},qi=class extends Gi{createScope(e){return new Ki(e)}declareName(e,t,n){let r=this.currentScope();if(t&2048){this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e),r.declareFunctions.add(e);return}super.declareName(e,t,n)}isRedeclaredInScope(e,t,n){if(super.isRedeclaredInScope(e,t,n))return!0;if(n&2048&&!e.declareFunctions.has(t)){let n=e.names.get(t);return(n&4)>0||(n&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}};const Ji=new Set([`_`,`any`,`bool`,`boolean`,`empty`,`extends`,`false`,`interface`,`mixed`,`null`,`number`,`static`,`string`,`true`,`typeof`,`void`]),Y=Wr`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:e})=>`Cannot overwrite reserved type ${e}.`,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:e,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:t})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:t})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:t,explicitType:n})=>`Enum \`${e}\` has type \`${n}\`, so the initializer of \`${t}\` needs to be a ${n} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:t,suggestion:n})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${n}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",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:{message:`A binding pattern parameter cannot be optional in an implementation signature.`},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:e})=>`Unexpected reserved type ${e}.`,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:e,suggestion:t})=>`\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:`Only declares and type imports are allowed inside declare module.`,UnterminatedFlowComment:`Unterminated flow-comment.`});function Yi(e){return e.type===`DeclareExportAllDeclaration`||e.type===`DeclareExportDeclaration`&&(!e.declaration||e.declaration.type!==`TypeAlias`&&e.declaration.type!==`InterfaceDeclaration`)}function Xi(e){return e.importKind===`type`||e.importKind===`typeof`}const Zi={const:`declare export var`,let:`declare export var`,type:`export type`,interface:`export interface`};function Qi(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)(t(e[i],i,e)?n:r).push(e[i]);return[n,r]}const $i=/\*?\s*@((?:no)?flow)\b/,ea=e=>class extends e{constructor(...e){super(...e),r(this,`flowPragma`,void 0)}getScopeHandler(){return qi}shouldParseTypes(){return this.getPluginOption(`flow`,`all`)||this.flowPragma===`flow`}finishToken(e,t){e!==130&&e!==9&&e!==24&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=$i.exec(e.value);if(t)if(t[1]===`flow`)this.flowPragma=`flow`;else if(t[1]===`noflow`)this.flowPragma=`noflow`;else throw Error(`Unexpected flow pragma`)}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||10);let n=this.flowParseType();return this.state.inType=t,n}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(106),this.state.lastTokStartLoc.index>t.index+1&&this.raise(Y.UnexpectedSpaceBetweenModuloChecks,t),this.eat(6)?(e.value=super.parseExpression(),this.expect(7),this.finishNode(e,`DeclaredPredicate`)):this.finishNode(e,`InferredPredicate`)}flowParseTypeAndPredicateInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(10);let n=null,r=null;return e&&this.match(50)?(this.state.inType=t,r=this.flowParsePredicate()):(n=this.flowParseType(),this.state.inType=t,this.match(50)&&(r=this.flowParsePredicate())),[n,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,`DeclareClass`)}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),n=this.startNode(),r=this.startNode();this.match(43)?n.typeParameters=this.flowParseTypeParameterDeclaration():n.typeParameters=null,this.expect(6);let i=this.flowParseFunctionTypeParams();return n.params=i.params,n.rest=i.rest,n.this=i._this,this.expect(7),[n.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!1),r.typeAnnotation=this.finishNode(n,`FunctionTypeAnnotation`),t.typeAnnotation=this.finishNode(r,`TypeAnnotation`),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.start),this.finishNode(e,`DeclareFunction`)}flowParseDeclare(e,t){if(this.match(76))return this.flowParseDeclareClass(e);if(this.match(64))return this.flowParseDeclareFunction(e);if(this.match(70))return this.flowParseDeclareVariable(e);if(this.eatContextual(123))return this.match(12)?this.flowParseDeclareModuleExports(e):(t&&this.raise(Y.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(126))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(127))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(125))return this.flowParseDeclareInterface(e);if(this.match(78))return this.flowParseDeclareExportDeclaration(e,t);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(e.id.name,5,e.id.start),this.semicolon(),this.finishNode(e,`DeclareVariable`)}flowParseDeclareModule(e){this.scope.enter(0),this.match(130)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let t=this.startNode(),n=t.body=[];for(this.expect(2);!this.match(4);){let e=this.startNode();this.match(79)?(this.next(),!this.isContextual(126)&&!this.match(83)&&this.raise(Y.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),n.push(super.parseImport(e))):(this.expectContextual(121,Y.UnsupportedStatementInDeclareModule),n.push(this.flowParseDeclare(e,!0)))}this.scope.exit(),this.expect(4),e.body=this.finishNode(t,`BlockStatement`);let r=null,i=!1;return n.forEach(e=>{Yi(e)?(r===`CommonJS`&&this.raise(Y.AmbiguousDeclareModuleKind,e),r=`ES`):e.type===`DeclareModuleExports`&&(i&&this.raise(Y.DuplicateDeclareModuleExports,e),r===`ES`&&this.raise(Y.AmbiguousDeclareModuleKind,e),r=`CommonJS`,i=!0)}),e.kind=r||`CommonJS`,this.finishNode(e,`DeclareModule`)}flowParseDeclareExportDeclaration(e,t){if(this.expect(78),this.eat(61))return this.match(64)||this.match(76)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(71)||this.isLet()||(this.isContextual(126)||this.isContextual(125))&&!t){let e=this.state.value;throw this.raise(Y.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:e,suggestion:Zi[e]})}if(this.match(70)||this.match(64)||this.match(76)||this.isContextual(127))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(51)||this.match(2)||this.isContextual(125)||this.isContextual(126)||this.isContextual(127)){let t=this.parseExport(e,null);return t.type===`ExportNamedDeclaration`?(t.default=!1,delete t.exportKind,this.castNodeTo(t,`DeclareExportDeclaration`)):this.castNodeTo(t,`DeclareExportAllDeclaration`)}throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(107),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,`DeclareModuleExports`)}flowParseDeclareTypeAlias(e){this.next();let t=this.flowParseTypeAlias(e);return this.castNodeTo(t,`DeclareTypeAlias`),t}flowParseDeclareOpaqueType(e){return this.next(),this.flowParseOpaqueType(e,!0)}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,`DeclareInterface`)}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?17:8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(!t&&this.eat(8));if(t){let t=[],n=[];if(this.eatContextual(113))do n.push(this.flowParseInterfaceExtends());while(this.eat(8));if(this.eatContextual(109))do t.push(this.flowParseClassImplements());while(this.eat(8));e.implements=t,e.mixins=n}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(43)?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(Y.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,n){Ji.has(e)&&this.raise(n?Y.AssignReservedType:Y.UnexpectedReservedType,t,{reservedType:e})}flowParseRestrictedIdentifierName(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),this.parseIdentifierName(e)}flowParseRestrictedIdentifier(e,t){let n=this.startNode(),r=this.flowParseRestrictedIdentifierName(e,t);return this.createIdentifier(n,r)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(25),this.semicolon(),this.finishNode(e,`TypeAlias`)}flowParseOpaqueType(e,t){return this.expectContextual(126),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(10)&&(e.supertype=this.flowParseTypeInitialiser(10)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(25)),this.semicolon(),this.finishNode(e,t?`DeclareOpaqueType`:`OpaqueType`)}flowParseTypeParameterBound(){if(this.match(10)||this.isContextual(77)){let e=this.startNode();return this.next(),e.typeAnnotation=this.flowParseType(),this.finishNode(e,`TypeAnnotation`)}}flowParseTypeParameter(e=!1){let t=this.state.startLoc,n=this.startNode(),r=this.flowParseVariance();return n.name=this.flowParseRestrictedIdentifierName(),n.variance=r,n.bound=this.flowParseTypeParameterBound(),this.match(25)?(this.eat(25),n.default=this.flowParseType()):e&&this.raise(Y.MissingTypeParamDefault,t),this.finishNode(n,`TypeParameter`)}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(43)||this.match(138)?this.next():this.unexpected();let n=!1;do{let e=this.flowParseTypeParameter(n);t.params.push(e),e.default&&(n=!0),this.match(44)||this.expect(8)}while(!this.match(44));return this.expect(44),this.state.inType=e,this.finishNode(t,`TypeParameterDeclaration`)}flowInTopLevelContext(e){if(this.curContext()!==J.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===43)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(43);let t=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(44);)e.params.push(this.flowParseType()),this.match(44)||this.expect(8);this.state.noAnonFunctionType=t}),this.state.inType=t,!this.state.inType&&this.curContext()===J.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TypeParameterInstantiation`)}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==43)return null;let e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(43);!this.match(44);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(44)||this.expect(8);return this.expect(44),this.state.inType=t,this.finishNode(e,`TypeParameterInstantiation`)}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(125),e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(8));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,`InterfaceTypeAnnotation`)}flowParseObjectPropertyKey(){return this.match(131)||this.match(130)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,n){return e.static=t,this.lookahead().type===10?(e.id=this.parseIdentifier(!0),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(1),e.value=this.flowParseTypeInitialiser(),e.variance=n,this.finishNode(e,`ObjectTypeIndexer`)}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.parseIdentifier(!0),this.expect(1),this.expect(1),this.match(43)||this.match(6)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e))):(e.method=!1,this.eat(13)&&(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(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(6),this.match(74)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(7),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,`FunctionTypeAnnotation`)}flowParseObjectTypeCallProperty(e,t){let n=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(n),this.finishNode(e,`ObjectTypeCallProperty`)}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:n,allowProto:r,allowInexact:i}){let a=this.state.inType;this.state.inType=!0;let o=this.startNode();o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let s,c,l=!1;for(t&&this.match(3)?(this.expect(3),s=5,c=!0):(this.expect(2),s=4,c=!1),o.exact=c;!this.match(s);){let t=!1,a=null,s=null,u=this.startNode();if(r&&this.isContextual(114)){let t=this.lookahead();t.type!==10&&t.type!==13&&(this.next(),a=this.state.startLoc,e=!1)}if(e&&this.isContextual(102)){let e=this.lookahead();e.type!==10&&e.type!==13&&(this.next(),t=!0)}let d=this.flowParseVariance();if(this.eat(0))a!=null&&this.unexpected(a),this.eat(0)?(d&&this.unexpected(d.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(u,t))):o.indexers.push(this.flowParseObjectTypeIndexer(u,t,d));else if(this.match(6)||this.match(43))a!=null&&this.unexpected(a),d&&this.unexpected(d.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(u,t));else{let e=`init`;(this.isContextual(95)||this.isContextual(100))&&si(this.lookahead().type)&&(e=this.state.value,this.next());let r=this.flowParseObjectTypeProperty(u,t,a,d,e,n,i==null?!c:i);r===null?(l=!0,s=this.state.lastTokStartLoc):o.properties.push(r)}this.flowObjectTypeSemicolon(),s&&!this.match(4)&&!this.match(5)&&this.raise(Y.UnexpectedExplicitInexactInObject,s)}this.expect(s),n&&(o.inexact=l);let u=this.finishNode(o,`ObjectTypeAnnotation`);return this.state.inType=a,u}flowParseObjectTypeProperty(e,t,n,r,i,a,o){if(this.eat(17))return this.match(8)||this.match(9)||this.match(4)||this.match(5)?(a?o||this.raise(Y.InexactInsideExact,this.state.lastTokStartLoc):this.raise(Y.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(Y.InexactVariance,r),null):(a||this.raise(Y.UnexpectedSpreadType,this.state.lastTokStartLoc),n!=null&&this.unexpected(n),r&&this.raise(Y.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,`ObjectTypeSpreadProperty`));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=n!=null,e.kind=i;let o=!1;return this.match(43)||this.match(6)?(e.method=!0,n!=null&&this.unexpected(n),r&&this.unexpected(r.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)),i===`get`||i===`set`?this.flowCheckGetterSetterParams(e):!t&&!a&&e.key.name===`constructor`&&e.value.this&&this.raise(Y.ThisParamBannedInConstructor,e.value.this)):(i!==`init`&&this.unexpected(),e.method=!1,this.eat(13)&&(o=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=o,this.finishNode(e,`ObjectTypeProperty`)}}flowCheckGetterSetterParams(e){let t=e.kind===`get`?0:1,n=e.value,r=n.params.length+ +!!n.rest;n.this&&this.raise(e.kind===`get`?Y.GetterMayNotHaveThisParam:Y.SetterMayNotHaveThisParam,n.this),r!==t&&this.raise(e.kind===`get`?H.BadGetterArity:H.BadSetterArity,e),e.kind===`set`&&n.rest&&this.raise(H.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(9)&&!this.eat(8)&&!this.match(4)&&!this.match(5)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){e!=null||(e=this.state.startLoc);let n=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(12);){let t=this.startNodeAt(e);t.qualification=n,t.id=this.flowParseRestrictedIdentifier(!0),n=this.finishNode(t,`QualifiedTypeIdentifier`)}return n}flowParseGenericType(e,t){let n=this.startNodeAt(e);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(43)&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,`GenericTypeAnnotation`)}flowParseTypeofType(){let e=this.startNode();return this.expect(83),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(1)&&(e.types.push(this.flowParseType()),!this.match(1));)this.expect(8);return this.expect(1),this.finishNode(e,`TupleTypeAnnotation`)}flowParseFunctionTypeParam(e){let t=null,n=!1,r,i=this.startNode(),a=this.lookahead(),o=this.state.type===74;return a.type===10||a.type===13?(o&&!e&&this.raise(Y.ThisParamMustBeFirst,i),t=this.parseIdentifier(o),this.eat(13)&&(n=!0,o&&this.raise(Y.ThisParamMayNotBeOptional,i)),r=this.flowParseTypeInitialiser()):r=this.flowParseType(),i.name=t,i.optional=n,i.typeAnnotation=r,this.finishNode(i,`FunctionTypeParam`)}reinterpretTypeAsFunctionTypeParam(e){let t=this.startNodeAtNode(e);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,`FunctionTypeParam`)}flowParseFunctionTypeParams(e=[]){let t=null,n=null;for(this.match(74)&&(n=this.flowParseFunctionTypeParam(!0),n.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(t=this.flowParseFunctionTypeParam(!1)),{params:e,rest:t,_this:n}}flowIdentToTypeAnnotation(e,t,n){switch(n.name){case`any`:return this.finishNode(t,`AnyTypeAnnotation`);case`bool`:case`boolean`:return this.finishNode(t,`BooleanTypeAnnotation`);case`mixed`:return this.finishNode(t,`MixedTypeAnnotation`);case`empty`:return this.finishNode(t,`EmptyTypeAnnotation`);case`number`:return this.finishNode(t,`NumberTypeAnnotation`);case`string`:return this.finishNode(t,`StringTypeAnnotation`);case`symbol`:return this.finishNode(t,`SymbolTypeAnnotation`);default:return this.checkNotUnderscore(n.name),this.flowParseGenericType(e,n)}}flowParsePrimaryType(){let e=this.state.startLoc,t=this.startNode(),n,r,i=!1,a=this.state.noAnonFunctionType;switch(this.state.type){case 2:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 3:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,r=this.flowParseTupleType(),this.state.noAnonFunctionType=a,r;case 43:{let e=this.startNode();return e.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(6),n=this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),this.finishNode(e,`FunctionTypeAnnotation`)}case 6:{let e=this.startNode();if(this.next(),!this.match(7)&&!this.match(17))if(q(this.state.type)||this.match(74)){let e=this.lookahead().type;i=e!==13&&e!==10}else i=!0;if(i){if(this.state.noAnonFunctionType=!1,r=this.flowParseType(),this.state.noAnonFunctionType=a,this.state.noAnonFunctionType||!(this.match(8)||this.match(7)&&this.lookahead().type===15))return this.expect(7),r;this.eat(8)}return n=r?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(r)]):this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),e.typeParameters=null,this.finishNode(e,`FunctionTypeAnnotation`)}case 130:return this.parseLiteral(this.state.value,`StringLiteralTypeAnnotation`);case 81:case 82:return t.value=this.match(81),this.next(),this.finishNode(t,`BooleanLiteralTypeAnnotation`);case 49:if(this.state.value===`-`){if(this.next(),this.match(131))return this.parseLiteralAtNode(-this.state.value,`NumberLiteralTypeAnnotation`,t);if(this.match(132))return this.parseLiteralAtNode(-this.state.value,`BigIntLiteralTypeAnnotation`,t);throw this.raise(Y.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 131:return this.parseLiteral(this.state.value,`NumberLiteralTypeAnnotation`);case 132:return this.parseLiteral(this.state.value,`BigIntLiteralTypeAnnotation`);case 84:return this.next(),this.finishNode(t,`VoidTypeAnnotation`);case 80:return this.next(),this.finishNode(t,`NullLiteralTypeAnnotation`);case 74:return this.next(),this.finishNode(t,`ThisTypeAnnotation`);case 51:return this.next(),this.finishNode(t,`ExistsTypeAnnotation`);case 83:return this.flowParseTypeofType();default:if(pi(this.state.type)){let e=yi(this.state.type);return this.next(),super.createIdentifier(t,e)}else if(q(this.state.type))return this.isContextual(125)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,t,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,t=this.flowParsePrimaryType(),n=!1;for(;(this.match(0)||this.match(14))&&!this.canInsertSemicolon();){let r=this.startNodeAt(e),i=this.eat(14);n=n||i,this.expect(0),!i&&this.match(1)?(r.elementType=t,this.next(),t=this.finishNode(r,`ArrayTypeAnnotation`)):(r.objectType=t,r.indexType=this.flowParseType(),this.expect(1),n?(r.optional=i,t=this.finishNode(r,`OptionalIndexedAccessType`)):t=this.finishNode(r,`IndexedAccessType`))}return t}flowParsePrefixType(){let e=this.startNode();return this.eat(13)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,`NullableTypeAnnotation`)):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(15)){let t=this.startNodeAtNode(e);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.this=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,`FunctionTypeAnnotation`)}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(41);let t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(41);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?t:this.finishNode(e,`IntersectionTypeAnnotation`)}flowParseUnionType(){let e=this.startNode();this.eat(39);let t=this.flowParseIntersectionType();for(e.types=[t];this.eat(39);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?t:this.finishNode(e,`UnionTypeAnnotation`)}flowParseType(){let e=this.state.inType;this.state.inType=!0;let t=this.flowParseUnionType();return this.state.inType=e,t}flowParseTypeOrImplicitInstantiation(){if(this.state.type===128&&this.state.value===`_`){let e=this.state.startLoc,t=this.parseIdentifier();return this.flowParseGenericType(e,t)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,`TypeAnnotation`)}flowParseTypeAnnotatableIdentifier(){let e=this.startNode(),t=this.parseIdentifierName();return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(e,t)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}flowParseVariance(){let e=null;return this.match(49)?(e=this.startNode(),this.state.value===`+`?e.kind=`plus`:e.kind=`minus`,this.next(),this.finishNode(e,`Variance`)):e}parseFunctionBody(e,t,n=!1){if(t){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,n));return}super.parseFunctionBody(e,!1,n)}parseFunctionBodyAndFinish(e,t,n=!1){if(this.match(10)){let n=this.startNode();t===`FunctionDeclaration`||t===`FunctionExpression`||t===`ArrowFunctionExpression`?[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0):n.typeAnnotation=this.flowParseTypeInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,`TypeAnnotation`):null}return super.parseFunctionBodyAndFinish(e,t,n)}parseStatementLike(e){if(this.state.strict&&this.isContextual(125)){if(oi(this.lookahead().type)){let e=this.startNode();return this.next(),this.flowParseInterface(e)}}else if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}let t=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t,n){if(t.type===`Identifier`){if(t.name===`declare`){if(this.match(76)||q(this.state.type)||this.match(64)||this.match(70)||this.match(78))return this.flowParseDeclare(e)}else if(q(this.state.type)){if(t.name===`interface`)return this.flowParseInterface(e);if(t.name===`type`)return this.flowParseTypeAlias(e);if(t.name===`opaque`)return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,t,n)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===122||di(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===122||di(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.expect(13);let r=this.state.clone(),i=this.state.noArrowAt,a=this.startNodeAt(t),{consequent:o,failed:s}=this.tryParseConditionalConsequent(),c=this.getArrowLikeExpressions(o),l=c[0],u=c[1];if(s||u.length>0){let e=[...i];if(u.length>0){this.state=r,this.state.noArrowAt=e;for(let t=0;t<u.length;t++)e.push(u[t].start);({consequent:o,failed:s}=this.tryParseConditionalConsequent()),[l]=this.getArrowLikeExpressions(o)}s&&l.length>1&&this.raise(Y.AmbiguousConditionalArrow,r.startLoc),s&&l.length===1&&(this.state=r,e.push(l[0].start),this.state.noArrowAt=e,{consequent:o}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(o,!0),this.state.noArrowAt=i,this.expect(10),a.test=e,a.consequent=o,a.alternate=this.forwardNoArrowParamsConversionAt(a,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(a,`ConditionalExpression`)}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),t=!this.match(10);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let n=[e],r=[];for(;n.length!==0;){let e=n.pop();e.type===`ArrowFunctionExpression`&&e.body.type!==`BlockStatement`?(e.typeParameters||!e.returnType?this.finishArrowValidation(e):r.push(e),n.push(e.body)):e.type===`ConditionalExpression`&&(n.push(e.consequent),n.push(e.alternate))}return t?(r.forEach(e=>this.finishArrowValidation(e)),[r,[]]):Qi(r,e=>e.params.every(e=>this.isAssignable(e,!0)))}finishArrowValidation(e){var t;this.toAssignableList(e.params,(t=e.extra)==null?void 0:t.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let n;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),n=t(),this.state.noArrowParamsConversionAt.pop()):n=t(),n}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let e=this.startNodeAt(t);return e.expression=n,e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,`TypeCastExpression`)}return n}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(126)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.match(2)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}else if(this.isContextual(127)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}else if(this.isContextual(125)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseInterface(t)}else if(this.isContextual(122)){e.exportKind=`value`;let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(126)&&this.lookahead().type===51?(e.exportKind=`type`,this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:t}=this.state,n=super.maybeParseExportNamespaceSpecifier(e);return n&&e.exportKind===`type`&&this.unexpected(t),n}parseClassId(e,t,n){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n),this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,n){let{startLoc:r}=this.state;if(this.isContextual(121)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,n),t.declare&&(t.type!==`ClassProperty`&&t.type!==`ClassPrivateProperty`&&t.type!==`PropertyDefinition`?this.raise(Y.DeclareClassElement,r):t.value&&this.raise(Y.DeclareClassFieldInitializer,t.value))}isIterator(e){return e===`iterator`||e===`asyncIterator`}readIterator(){let e=super.readWord1(),t=`@@`+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(H.InvalidIdentifier,this.state.curPosition(),{identifierName:t}),this.finishToken(128,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);e===123&&t===124?this.finishOp(3,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?44:43,1):this.state.inType&&e===63?t===46?this.finishOp(14,2):this.finishOp(13,1):Vi(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,t){return e.type===`TypeCastExpression`?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&e.type===`AssignmentExpression`&&e.left.type===`TypeCastExpression`&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableListItem(e,t,n){let r=e[t];r.type===`TypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}toReferencedList(e,t){for(let r=0;r<e.length;r++){var n;let i=e[r];(i==null?void 0:i.type)===`TypeCastExpression`&&!((n=i.extra)!=null&&n.parenthesized)&&(e.length>1||!t)&&this.raise(Y.TypeCastInPattern,i.typeAnnotation)}return e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.toReferencedList(n.elements),n}isValidLVal(e,t,n,r){return e===`TypeCastExpression`||super.isValidLVal(e,t,n,r)}parseClassProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(10)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(10)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,n,r,i,a){if(t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,n,r,i,a),t.params&&i){let e=t.params;e.length>0&&this.isThisParam(e[0])&&this.raise(Y.ThisParamBannedInConstructor,t)}else if(t.type===`MethodDefinition`&&i&&t.value.params){let e=t.value.params;e.length>0&&this.isThisParam(e[0])&&this.raise(Y.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,n,r){t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,n,r)}flowParseClassImplements(){let e=this.startNode();return e.id=this.flowParseRestrictedIdentifier(!0),this.match(43)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,`ClassImplements`)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(43)||this.match(47))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.eatContextual(109)){let t=e.implements=[];do t.push(this.flowParseClassImplements());while(this.eat(8))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let n=t[0];this.isThisParam(n)&&e.kind===`get`?this.raise(Y.GetterMayNotHaveThisParam,n):this.isThisParam(n)&&this.raise(Y.SetterMayNotHaveThisParam,n)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,n,r,i,a,o){e.variance&&this.unexpected(e.variance.start),delete e.variance;let s;this.match(43)&&!a&&(s=this.flowParseTypeParameterDeclaration(),this.match(6)||this.unexpected());let c=super.parseObjPropValue(e,t,n,r,i,a,o);return s&&((c.value||c).typeParameters=s),c}parseFunctionParamType(e){return this.eat(13)&&(e.type!==`Identifier`&&this.raise(Y.PatternIsOptional,e),this.isThisParam(e)&&this.raise(Y.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(10)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(Y.ThisParamAnnotationRequired,e),this.match(25)&&this.isThisParam(e)&&this.raise(Y.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(Y.TypeBeforeInitializer,n.typeAnnotation),n}parseImportSpecifierLocal(e,t,n){t.local=Xi(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){if(!e)return!0;let t=this.lookaheadCharCode();return t===123||t===42}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){if(super.applyImportPhase(e,t,n,r),t){if(!n&&this.match(61))return;e.exportKind=n===`type`?n:`value`}else n===`type`&&this.match(51)&&this.unexpected(),e.importKind=n===`type`||n===`typeof`?n:`value`}parseImportSpecifier(e,t,n,r,i){let a=e.imported,o=null;a.type===`Identifier`&&(a.name===`type`?o=`type`:a.name===`typeof`&&(o=`typeof`));let s=!1;if(this.isContextual(89)&&!this.isLookaheadContextual(`as`)){let t=this.parseIdentifier(!0);o!==null&&!oi(this.state.type)?(e.imported=t,e.importKind=o,e.local=this.cloneIdentifier(t)):(e.imported=a,e.importKind=null,e.local=this.parseIdentifier())}else{if(o!==null&&oi(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=o;else{if(t)throw this.raise(H.ImportBindingIsString,e,{importName:a.value});e.imported=a,e.importKind=null}this.eatContextual(89)?e.local=this.parseIdentifier():(s=!0,e.local=this.cloneIdentifier(e.imported))}let c=Xi(e);return n&&c&&this.raise(Y.ImportTypeShorthandOnlyInPureImport,e),(n||c)&&this.checkReservedType(e.local.name,e.local.start,!0),s&&!n&&!c&&this.checkReservedWord(e.local.name,e.start,!0,!0),this.finishImportSpecifier(e,`ImportSpecifier`)}parseBindingAtom(){switch(this.state.type){case 74:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,t){let n=e.kind;n!==`get`&&n!==`set`&&this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),this.match(10)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){if(this.match(10)){let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=t}return super.parseAsyncArrowFromCallExpression(e,t)}shouldParseAsyncArrow(){return this.match(10)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,t){let n=null,r;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===J.j_oTag||a===J.j_expr)&&i.pop()}if(r!=null&&r.error||this.match(43)){n=n||this.state.clone();let i,a=this.tryParse(n=>{var r;i=this.flowParseTypeParameterDeclaration();let a=this.forwardNoArrowParamsConversionAt(i,()=>{let n=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(n,i),n});(r=a.extra)!=null&&r.parenthesized&&n();let o=this.maybeUnwrapTypeCastExpression(a);return o.type!==`ArrowFunctionExpression`&&n(),o.typeParameters=i,this.resetStartLocationFromNode(o,i),a},n),o=null;if(a.node&&this.maybeUnwrapTypeCastExpression(a.node).type===`ArrowFunctionExpression`){if(!a.error&&!a.aborted)return a.node.async&&this.raise(Y.UnexpectedTypeParameterBeforeAsyncArrowFunction,i),a.node;o=a.node}if(r!=null&&r.node)return this.state=r.failState,r.node;if(o)return this.state=a.failState,o;throw r!=null&&r.thrown?r.error:a.thrown?a.error:this.raise(Y.UnexpectedTokenAfterTypeParameter,i)}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(()=>{let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0),this.state.noAnonFunctionType=t,this.canInsertSemicolon()&&this.unexpected(),this.match(15)||this.unexpected(),n});if(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,`TypeAnnotation`):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(10)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,n,r=!0){if(!(n&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let t=0;t<e.params.length;t++)this.isThisParam(e.params[t])&&t>0&&this.raise(Y.ThisParamMustBeFirst,e.params[t]);super.checkParams(e,t,n,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,t,n){if(e.type===`Identifier`&&e.name===`async`&&this.state.noArrowAt.includes(t.index)){this.next();let n=this.startNodeAt(t);n.callee=e,n.arguments=super.parseCallExpressionArguments(),e=this.finishNode(n,`CallExpression`)}else if(e.type===`Identifier`&&e.name===`async`&&this.match(43)){let r=this.state.clone(),i=this.tryParse(e=>this.parseAsyncArrowWithTypeParameters(t)||e(),r);if(!i.error&&!i.aborted)return i.node;let a=this.tryParse(()=>super.parseSubscripts(e,t,n),r);if(a.node&&!a.error)return a.node;if(i.node)return this.state=i.failState,i.node;if(a.node)return this.state=a.failState,a.node;throw i.error||a.error}return super.parseSubscripts(e,t,n)}parseSubscript(e,t,n,r){if(this.match(14)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,n)return r.stop=!0,e;this.next();let i=this.startNodeAt(t);return i.callee=e,i.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(6),i.arguments=this.parseCallExpressionArguments(),i.optional=!0,this.finishCallExpression(i,!0)}else if(!n&&this.shouldParseTypes()&&(this.match(43)||this.match(47))){let n=this.startNodeAt(t);n.callee=e;let i=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(6),n.arguments=super.parseCallExpressionArguments(),r.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,r.optionalChainMember)));if(i.node)return i.error&&(this.state=i.failState),i.node}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(43)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===42&&t===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 t=this.input.charCodeAt(this.state.pos+1);if(e===124&&t===125){this.finishOp(5,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,t){let n=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(Y.UnterminatedFlowComment,this.state.curPosition()),n}skipBlockComment(){if(this.hasPlugin(`flowComments`)&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(Y.NestedFlowComment,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,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let n=this.input.charCodeAt(t+e),r=this.input.charCodeAt(t+e+1);return n===58&&r===58?t+2:this.input.slice(t+e,t+e+12)===`flow-include`?t+12:n===58&&r!==58?t:!1}hasFlowCommentCompletion(){if(this.input.indexOf(`*/`,this.state.pos)===-1)throw this.raise(H.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,t){this.raise(Y.EnumBooleanMemberNotInitialized,e,t)}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType===`symbol`?Y.EnumInvalidMemberInitializerSymbolType:Y.EnumInvalidMemberInitializerPrimaryType:Y.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(Y.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(Y.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(8)||this.match(4);switch(this.state.type){case 131:{let e=this.parseNumericLiteral(this.state.value);if(t())return{type:`number`,loc:e.start,value:e};break}case 130:{let e=this.parseStringLiteral(this.state.value);if(t())return{type:`string`,loc:e.start,value:e};break}case 81:case 82:{let e=this.parseBooleanLiteral(this.match(81));if(t())return{type:`boolean`,loc:e.start,value:e}}}return{type:`invalid`,loc:e}}flowEnumMemberRaw(){let e=this.state.startLoc;return{id:this.parseIdentifier(!0),init:this.eat(25)?this.flowEnumMemberInit():{type:`none`,loc:e}}}flowEnumCheckExplicitTypeMismatch(e,t,n){let{explicitType:r}=t;r!==null&&r!==n&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let n=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},i=!1;for(;!this.match(4);){if(this.eat(17)){i=!0;break}let a=this.startNode(),{id:o,init:s}=this.flowEnumMemberRaw(),c=o.name;if(c===``)continue;/^[a-z]/.test(c)&&this.raise(Y.EnumInvalidMemberName,o,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),n.has(c)&&this.raise(Y.EnumDuplicateMemberName,o,{memberName:c,enumName:e}),n.add(c);let l={enumName:e,explicitType:t,memberName:c};switch(a.id=o,s.type){case`boolean`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`boolean`),a.init=s.value,r.booleanMembers.push(this.finishNode(a,`EnumBooleanMember`));break;case`number`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`number`),a.init=s.value,r.numberMembers.push(this.finishNode(a,`EnumNumberMember`));break;case`string`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`string`),a.init=s.value,r.stringMembers.push(this.finishNode(a,`EnumStringMember`));break;case`invalid`:throw this.flowEnumErrorInvalidMemberInitializer(s.loc,l);case`none`:switch(t){case`boolean`:this.flowEnumErrorBooleanMemberNotInitialized(s.loc,l);break;case`number`:this.flowEnumErrorNumberMemberNotInitialized(s.loc,l);break;default:r.defaultedMembers.push(this.finishNode(a,`EnumDefaultedMember`))}}this.match(4)||this.expect(8)}return{members:r,hasUnknownMembers:i}}flowEnumStringMembers(e,t,{enumName:n}){if(e.length===0)return t;if(t.length===0)return e;if(t.length>e.length){for(let t of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(t,{enumName:n});return t}else{for(let e of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:n});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(98))return null;if(!q(this.state.type))throw this.raise(Y.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!==`boolean`&&t!==`number`&&t!==`string`&&t!==`symbol`&&this.raise(Y.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let n=t.name,r=t.start,i=this.flowEnumParseExplicitType({enumName:n});this.expect(2);let{members:a,hasUnknownMembers:o}=this.flowEnumMembers({enumName:n,explicitType:i});switch(e.hasUnknownMembers=o,i){case`boolean`:return e.explicitType=!0,e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`);case`number`:return e.explicitType=!0,e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`);case`string`:return e.explicitType=!0,e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);case`symbol`:return e.members=a.defaultedMembers,this.expect(4),this.finishNode(e,`EnumSymbolBody`);default:{let t=()=>(e.members=[],this.expect(4),this.finishNode(e,`EnumStringBody`));e.explicitType=!1;let i=a.booleanMembers.length,o=a.numberMembers.length,s=a.stringMembers.length,c=a.defaultedMembers.length;if(!i&&!o&&!s&&!c)return t();if(!i&&!o)return e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);if(!o&&!s&&i>=c){for(let e of a.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`)}else if(!i&&!s&&o>=c){for(let e of a.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`)}else return this.raise(Y.EnumInconsistentMemberValues,r,{enumName:n}),t()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,`EnumDeclaration`)}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(43)||this.match(47))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let t=this.input.charCodeAt(e+1);return t!==60&&t!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}maybeUnwrapTypeCastExpression(e){return e.type===`TypeCastExpression`?e.expression:e}},ta={__proto__:null,quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`},na=RegExp(`\\r\\n|[\\r\\n\\u2028\\u2029]`,`g`);function ra(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function ia(e,t,n){for(let r=t;r<n;r++)if(ra(e.charCodeAt(r)))return!0;return!1}const aa=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,oa=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function sa(e){switch(e){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}}const ca=Wr`jsx`({AttributeIsEmpty:`JSX attributes must only be assigned a non-empty expression.`,MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,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:e,HTMLEntity:t})=>`Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,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 la(e){return e?e.type===`JSXOpeningFragment`||e.type===`JSXClosingFragment`:!1}function ua(e){if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return ua(e.object)+`.`+ua(e.property);throw Error(`Node had unexpected type: `+e.type)}const da=e=>class extends e{jsxReadToken(){let e=``,t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(ca.UnterminatedJsxContent,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:if(this.state.pos===this.state.start){n===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(138)):super.getTokenFromCode(n);return}e+=this.input.slice(t,this.state.pos),this.finishToken(137,e);return;case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:this.raise(ca.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:n===125?`}`:`>`});default:ra(n)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t=this.input.charCodeAt(this.state.pos),n;return++this.state.pos,t===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,n=e?`
|
|
6
|
+
`).map(e=>e.trim()).filter(Boolean).join(` `)}const Sr=new Set([`script`,`style`,`textarea`,`title`]);function Cr(e){return Sr.has(e)}function wr(e,t){let n=e.file.metadata;return n.zeus=u({},n.zeus,{config:t}),n.zeus}function Tr(e,t,n){wr(n,e),ur(t,e.moduleName)}function Er(e,t,n){n.get(`skip`)||(e.generate===`dom`&&(rr(t),e.delegateEvents&&ar(t)),Zn(t))}function Dr(e){return{enter(t,n){Tr(e,t,n)},exit(t,n){Er(e,t,n)}}}function Or(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function kr(e,t){if(e==null)return{};var n,r,i=Or(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const Ar=[`message`];var B=class{constructor(e,t,n){this.line=void 0,this.column=void 0,n!==void 0&&(this.index=void 0),this.line=e,this.column=t,n!==void 0&&(this.index=n)}},jr=class{constructor(e,t){r(this,`start`,void 0),r(this,`end`,void 0),r(this,`filename`,void 0),r(this,`identifierName`,void 0),this.start=e,this.end=t}};function V(e,t){let{line:n,column:r,index:i}=e;return new B(n,r+t,i+t)}const Mr=`BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED`,Nr={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Mr},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Mr}},Pr={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`},Fr=e=>e.type===`UpdateExpression`?Pr.UpdateExpression[`${e.prefix}`]:Pr[e.type],Ir={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:`'arguments' is only allowed in functions and class methods.`,AsyncFunctionInSingleStatementContext:`Async functions can only be declared at the top level or inside a block.`,AwaitBindingIdentifier:`Can not use 'await' as identifier inside an async function.`,AwaitBindingIdentifierInStaticBlock:`Can not use 'await' as identifier inside a static block.`,AwaitExpressionFormalParameter:`'await' is not allowed in async function parameters.`,AwaitUsingNotInAsyncContext:`'await using' is only allowed within async functions and at the top levels of modules.`,AwaitNotInAsyncContext:`'await' is only allowed within async functions and at the top levels of modules.`,BadGetterArity:`A 'get' accessor must not have any formal parameters.`,BadSetterArity:`A 'set' accessor must have exactly one formal parameter.`,BadSetterRestParameter:`A 'set' accessor function argument must not be a rest parameter.`,ConstructorClassField:`Classes may not have a field named 'constructor'.`,ConstructorClassPrivateField:`Classes may not have a private field named '#constructor'.`,ConstructorIsAccessor:`Class constructor may not be an accessor.`,ConstructorIsAsync:`Constructor can't be an async function.`,ConstructorIsGenerator:`Constructor can't be a generator.`,DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:`Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.`,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 { ... }'?`,DecoratorSemicolon:`Decorators must not be followed by a semicolon.`,DecoratorStaticBlock:`Decorators can't be used with a static block.`,DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:`Deleting a private field is not allowed.`,DestructureNamedImport:`ES2015 named imports do not destructure. Use another statement for destructuring after the import.`,DuplicateConstructor:`Duplicate constructor in the same class.`,DuplicateDefaultExport:`Only one default export allowed per module.`,DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:`Redefinition of __proto__ property.`,DuplicateRegExpFlags:`Duplicate regular expression flag.`,ElementAfterRest:`Rest element must be last element.`,EscapedCharNotAnIdentifier:`Invalid Unicode escape.`,ExportBindingIsString:({localName:e,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:`'from' is not allowed as an identifier after 'export default'.`,ForInOfLoopInitializer:({type:e})=>`'${e===`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:e})=>`Unsyntactic ${e===`BreakStatement`?`break`:`continue`}.`,IllegalLanguageModeDirective:`Illegal 'use strict' directive in function with non-simple parameter list.`,IllegalReturn:`'return' outside of function.`,ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:({phase:e})=>`\`import${e?`.${e}`:``}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:e})=>`Cannot use new with import${e?`.${e}`:``}().`,ImportCallSpreadArgument:({phase:e})=>`\`...\` is not allowed in \`import${e?`.${e}`:``}()\`.`,IncompatibleRegExpUVFlags:`The 'u' and 'v' regular expression flags cannot be enabled at the same time.`,InvalidBigIntLiteral:`Invalid BigIntLiteral.`,InvalidCodePoint:`Code point out of bounds.`,InvalidCoverDiscardElement:`'void' must be followed by an expression when not used in a binding position.`,InvalidCoverInitializedName:`Invalid shorthand property initializer.`,InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:`Bad character escape sequence.`,InvalidEscapeSequenceTemplate:`Invalid escape sequence in template.`,InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${Fr(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${Fr(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${Fr(e)}.`,InvalidNumber:`Invalid number.`,InvalidOrMissingExponent:`Floating-point numbers require a valid exponent after the 'e'.`,InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:`Invalid parenthesized assignment pattern.`,InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:`Binding member expression.`,InvalidRestAssignmentPattern:`Invalid rest operator's argument.`,LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:`'let' is disallowed as a lexically bound name.`,LineTerminatorBeforeArrow:`No line break is allowed before '=>'.`,MalformedRegExpFlags:`Invalid regular expression flag.`,MissingClassName:`A class name is required.`,MissingEqInAssignment:`Only '=' operator can be used for specifying default value.`,MissingSemicolon:`Missing semicolon.`,MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingUnicodeEscape:`Expecting Unicode escape sequence \\uXXXX.`,MixingCoalesceWithLogical:`Nullish coalescing operator(??) requires parens when mixing with logical operators.`,ModuleAttributeInvalidValue:`Only string literals are allowed as module attribute values.`,ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:`Multiple default clauses.`,NewlineAfterThrow:`Illegal newline after throw.`,NoCatchOrFinally:`Missing catch or finally clause.`,NumberIdentifier:`Identifier directly after number.`,NumericSeparatorInEscapeSequence:`Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.`,ObsoleteAwaitStar:`'await*' has been removed from the async functions proposal. Use Promise.all() instead.`,OptionalChainingNoNew:`Constructors in/after an Optional Chain are not allowed.`,OptionalChainingNoTemplate:`Tagged Template Literals are not allowed in optionalChain.`,OverrideOnConstructor:`'override' modifier cannot appear on a constructor declaration.`,ParamDupe:`Argument name clash.`,PatternHasAccessor:`Object pattern can't contain getter or setter.`,PatternHasMethod:`Object pattern can't contain methods.`,PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RestTrailingComma:`Unexpected trailing comma after rest element.`,SloppyFunction:`In non-strict mode code, functions can only be declared at top level or inside a block.`,SloppyFunctionAnnexB:`In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.`,SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:`Classes may not have static property named prototype.`,SuperCallNotNewExpression:`Cannot use new with super(...).`,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.`,UnexpectedArgumentPlaceholder:`Unexpected argument placeholder.`,UnexpectedDigitAfterHash:`Unexpected digit after hash token.`,UnexpectedImportExport:`'import' and 'export' may only appear at the top level.`,UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:`Leading decorators must be attached to a class declaration.`,UnexpectedLexicalDeclaration:`Lexical declaration cannot appear in a single-statement context.`,UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:`A numeric separator is only allowed between two digits.`,UnexpectedPrivateField:`Unexpected private name.`,UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:`'super' is only allowed in object methods and classes.`,UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:``}${e?`, expected "${e}"`:``}`,UnexpectedTokenUnaryExponentiation:`Illegal expression. Wrap left hand side or entire exponentiation in parentheses.`,UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:`Unexpected void binding.`,UnsupportedDecoratorExport:`A decorated export must export a class declaration.`,UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:`Decorators cannot be used to decorate parameters.`,UnsupportedPropertyDecorator:`Decorators cannot be used to decorate object literal properties.`,UnsupportedSuper:`'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).`,UnterminatedComment:`Unterminated comment.`,UnterminatedRegExp:`Unterminated regular expression.`,UnterminatedString:`Unterminated string constant.`,UnterminatedTemplate:`Unterminated template.`,UsingDeclarationExport:`Using declaration cannot be exported.`,UsingDeclarationHasBindingPattern:`Using declaration cannot have destructuring patterns.`,VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:`A void binding may not have an initializer.`,YieldBindingIdentifier:`Can not use 'yield' as identifier inside a generator.`,YieldInParameter:`Yield expression is not allowed in formal parameters.`,YieldNotInGeneratorFunction:`'yield' is only allowed within generator functions.`,ZeroDigitNumericSeparator:`Numeric separator can not be used after leading 0.`},Lr={StrictDelete:`Deleting local variable in strict mode.`,StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:`In strict mode code, functions can only be declared at top level or inside a block.`,StrictNumericEscape:`The only valid numeric escape in strict mode is '\\0'.`,StrictOctalLiteral:`Legacy octal literals are not allowed in strict mode.`,StrictWith:`'with' in strict mode.`},Rr={ParseExpressionEmptyInput:`Unexpected parseExpression() input: The input is empty or contains only comments.`,ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},zr=new Set([`ArrowFunctionExpression`,`AssignmentExpression`,`ConditionalExpression`,`YieldExpression`]),Br={PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:`Topic reference is unbound; it must be inside a pipe body.`,PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:`Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.`,PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${Fr({type:e})}; please wrap it in parentheses.`,PipelineUnparenthesized:`Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses.`},Vr={UnsupportedBind:`Binding should be performed on object property.`,UnsupportedBindRHS:`The right-hand side of binding can not be super or import.`};function Hr(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n})}function Ur({toMessage:e,code:t,reasonCode:n,syntaxPlugin:r}){let i=n===`MissingPlugin`||n===`MissingOneOfPlugins`;return function o(s,c,l){let u=SyntaxError();return u.code=t,u.reasonCode=n,u.loc=s,u.pos=c,u.syntaxPlugin=r,i&&(u.missingPlugin=l.missingPlugin),Hr(u,`clone`,function(e={}){var t;let{line:n,column:r,index:i=c}=(t=e.loc)==null?s:t;return o(new B(n,r),i,a(a({},l),e.details))}),Hr(u,`details`,l),Object.defineProperty(u,"message",{configurable:!0,get(){let t=`${e(l)} (${s.line}:${s.column})`;return this.message=t,t},set(e){Object.defineProperty(this,"message",{value:e,writable:!0})}}),u}}function Wr(e,t){if(Array.isArray(e))return t=>Wr(t,e[0]);let n={};for(let r of Object.keys(e)){let i=e[r],o=typeof i==`string`?{message:()=>i}:typeof i==`function`?{message:i}:i,{message:s}=o,c=kr(o,Ar);n[r]=Ur(a(a({code:`BABEL_PARSER_SYNTAX_ERROR`,reasonCode:r,toMessage:typeof s==`string`?()=>s:s},t?{syntaxPlugin:t}:{}),c))}return n}const H=a(a(a(a(a(a({},Wr(Nr)),Wr(Ir)),Wr(Lr)),Wr(Rr)),Wr`pipelineOperator`(Br)),Wr`functionBind`(Vr));function Gr(){return{sourceType:`script`,sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,locations:!0,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Kr(e){let t=Gr();if(e==null)return t;if(e.annexB!=null&&e.annexB!==!1)throw Error("The `annexB` option can only be set to `false`.");for(let n of Object.keys(t))e[n]!=null&&(t[n]=e[n]);if(t.startLine===1)e.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:e.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if(e.startColumn==null||e.startIndex==null)throw Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(t.sourceType===`commonjs`){if(e.allowAwaitOutsideFunction!=null)throw Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(e.allowReturnOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(e.allowNewTargetOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return t}function qr(e){let{start:t,end:n}=e.loc;return e.loc.start=new B(t.line,t.column),e.loc.end=new B(n.line,n.column),e}const Jr=e=>class extends e{createPosition(e){return new B(e.line,e.column)}parse(){let e=super.parse();return this.optionFlags&512&&(e.tokens=e.tokens.map(qr)),qr(e)}parseRegExpLiteral({pattern:e,flags:t}){let n=null;try{n=new RegExp(e,t)}catch(e){}let r=this.estreeParseLiteral(n);return r.regex={pattern:e,flags:t},r}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch(e){t=null}let n=this.estreeParseLiteral(t);return n.bigint=String(n.value||e),n}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)}estreeParseChainExpression(e,t){let n=this.startNodeAtNode(e);return n.expression=e,this.finishNodeAtNode(n,`ChainExpression`,t)}directiveToStmt(e){let t=e.value;delete e.value,this.castNodeTo(t,`Literal`),t.raw=t.extra.raw,t.value=t.extra.expressionValue;let n=this.castNodeTo(e,`ExpressionStatement`);return n.expression=t,n.directive=t.extra.rawValue,delete t.extra,n}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:t,end:n,loc:r,range:i,raw:a,value:o}=e,s=Object.create(e.constructor.prototype);return s.type=`Literal`,s.start=t,s.end=n,s.loc=r,s.range=i,s.raw=a,s.value=o,s}initFunction(e,t){super.initFunction(e,t),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 t;return e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&!((t=e.expression.extra)!=null&&t.parenthesized)}parseBlockBody(e,t,n,r,i){super.parseBlockBody(e,t,n,r,i),e.body=e.directives.map(e=>this.directiveToStmt(e)).concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.convertPrivateNameToPrivateIdentifier(e)}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return delete e.id,e.name=t,this.castNodeTo(e,`PrivateIdentifier`)}isPrivateName(e){return e.type===`PrivateIdentifier`}getPrivateNameSV(e){return e.name}parseLiteral(e,t){let n=super.parseLiteral(e,t);return n.raw=n.extra.raw,delete n.extra,n}parseFunctionBody(e,t,n=!1){super.parseFunctionBody(e,t,n),e.expression=e.body.type!==`BlockStatement`}parseMethod(e,t,n,r,i,a,o=!1){let s=this.startNode();s.kind=e.kind,s=super.parseMethod(s,t,n,r,i,a,o),delete s.kind;let{typeParameters:c}=e;return c&&(delete e.typeParameters,s.typeParameters=c,this.resetStartLocationFromNode(s,c)),e.value=this.castNodeTo(s,this.hasPlugin(`typescript`)&&!s.body?`TSEmptyBodyFunctionExpression`:`FunctionExpression`),a===`ClassPrivateMethod`&&(e.computed=!1),this.hasPlugin(`typescript`)&&e.abstract?(delete e.abstract,this.finishNode(e,`TSAbstractMethodDefinition`)):a===`ObjectMethod`?(e.kind===`method`&&(e.kind=`init`),e.shorthand=!1,this.finishNode(e,`Property`)):this.finishNode(e,`MethodDefinition`)}nameIsConstructor(e){return e.type===`Literal`?e.value===`constructor`:super.nameIsConstructor(e)}parseClassProperty(...e){let t=super.parseClassProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractPropertyDefinition`)):this.castNodeTo(t,`PropertyDefinition`),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?this.castNodeTo(t,`TSAbstractPropertyDefinition`):this.castNodeTo(t,`PropertyDefinition`),t.computed=!1,t}parseClassAccessorProperty(e){let t=super.parseClassAccessorProperty(e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractAccessorProperty`)):this.castNodeTo(t,`AccessorProperty`),t}parseObjectProperty(e,t,n,r){let i=super.parseObjectProperty(e,t,n,r);return i&&(i.kind=`init`,this.castNodeTo(i,`Property`)),i}finishObjectProperty(e){return e.kind=`init`,this.finishNode(e,`Property`)}isValidLVal(e,t,n,r){return e===`Property`?`value`:super.isValidLVal(e,t,n,r)}isAssignable(e,t){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(e!=null&&this.isObjectProperty(e)){let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,n){e.type===`Property`&&(e.kind===`get`||e.kind===`set`)?this.raise(H.PatternHasAccessor,e.key):e.type===`Property`&&e.method?this.raise(H.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,t,n)}finishCallExpression(e,t){let n=super.finishCallExpression(e,t);if(n.callee.type===`Import`){var r;this.castNodeTo(n,`ImportExpression`),n.source=n.arguments[0],n.options=(r=n.arguments[1])==null?null:r,delete n.arguments,delete n.callee}else n.type===`OptionalCallExpression`?this.castNodeTo(n,`CallExpression`):n.optional=!1;return n}parseExport(e,t){let n=this.state.lastTokStartLoc,r=super.parseExport(e,t);switch(r.type){case`ExportAllDeclaration`:r.exported=null;break;case`ExportNamedDeclaration`:r.specifiers.length===1&&r.specifiers[0].type===`ExportNamespaceSpecifier`&&(this.castNodeTo(r,`ExportAllDeclaration`),r.exported=r.specifiers[0].exported,delete r.specifiers);case`ExportDefaultDeclaration`:{var i;let{declaration:e}=r;(e==null?void 0:e.type)===`ClassDeclaration`&&((i=e.decorators)==null?void 0:i.length)>0&&e.start===r.start&&this.resetStartLocation(r,n)}break}return r}stopParseSubscript(e,t){let n=super.stopParseSubscript(e,t);return t.optionalChainMember?this.estreeParseChainExpression(n,e):n}parseMember(e,t,n,r,i){let a=super.parseMember(e,t,n,r,i);return a.type===`OptionalMemberExpression`?this.castNodeTo(a,`MemberExpression`):a.optional=!1,a}isOptionalMemberExpression(e){return e.type===`ChainExpression`?e.expression.type===`MemberExpression`:super.isOptionalMemberExpression(e)}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.type===`Property`&&(e.method||e.kind===`get`||e.kind===`set`)}castNodeTo(e,t){let n=super.castNodeTo(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}cloneIdentifier(e){let t=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(t),t}cloneStringLiteral(e){return e.type===`Literal`?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,t,n){return qr(super.finishNodeAt(e,t,n))}finishNodeAtNode(e,t,n){return qr(super.finishNodeAtNode(e,t,n))}finishNode(e,t){let n=super.finishNode(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}resetStartLocation(e,t){super.resetStartLocation(e,t),qr(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),qr(e)}};var Yr=class{constructor(e,t={}){r(this,`label`,void 0),r(this,`keyword`,void 0),r(this,`beforeExpr`,void 0),r(this,`startsExpr`,void 0),r(this,`rightAssociative`,void 0),r(this,`isLoop`,void 0),r(this,`isAssign`,void 0),r(this,`prefix`,void 0),r(this,`postfix`,void 0),r(this,`binop`,void 0),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop==null?null:t.binop}};const Xr=new Map;function U(e,t={}){t.keyword=e;let n=G(e,t);return Xr.set(e,n),n}function W(e,t){return G(e,{beforeExpr:!0,binop:t})}let Zr=-1;const Qr=[],$r=[],ei=[],ti=[],ni=[],ri=[];function G(e,t={}){var n,r,i,a;return++Zr,$r.push(e),ei.push((n=t.binop)==null?-1:n),ti.push((r=t.beforeExpr)==null?!1:r),ni.push((i=t.startsExpr)==null?!1:i),ri.push((a=t.prefix)==null?!1:a),Qr.push(new Yr(e,t)),Zr}function K(e,t={}){var n,r,i,a;return++Zr,Xr.set(e,Zr),$r.push(e),ei.push((n=t.binop)==null?-1:n),ti.push((r=t.beforeExpr)==null?!1:r),ni.push((i=t.startsExpr)==null?!1:i),ri.push((a=t.prefix)==null?!1:a),Qr.push(new Yr(`name`,t)),Zr}const ii={bracketL:G(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:G(`]`),braceL:G(`{`,{beforeExpr:!0,startsExpr:!0}),braceBarL:G(`{|`,{beforeExpr:!0,startsExpr:!0}),braceR:G(`}`),braceBarR:G(`|}`),parenL:G(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:G(`)`),comma:G(`,`,{beforeExpr:!0}),semi:G(`;`,{beforeExpr:!0}),colon:G(`:`,{beforeExpr:!0}),doubleColon:G(`::`,{beforeExpr:!0}),dot:G(`.`),question:G(`?`,{beforeExpr:!0}),questionDot:G(`?.`),arrow:G(`=>`,{beforeExpr:!0}),template:G(`template`),ellipsis:G(`...`,{beforeExpr:!0}),backQuote:G("`",{startsExpr:!0}),dollarBraceL:G("${",{beforeExpr:!0,startsExpr:!0}),templateTail:G("...`",{startsExpr:!0}),templateNonTail:G("...${",{beforeExpr:!0,startsExpr:!0}),at:G(`@`),hash:G(`#`,{startsExpr:!0}),interpreterDirective:G(`#!...`),eq:G(`=`,{beforeExpr:!0,isAssign:!0}),assign:G(`_=`,{beforeExpr:!0,isAssign:!0}),slashAssign:G(`_=`,{beforeExpr:!0,isAssign:!0}),xorAssign:G(`_=`,{beforeExpr:!0,isAssign:!0}),moduloAssign:G(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:G(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),bang:G(`!`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),tilde:G(`~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),doubleCaret:G(`^^`,{startsExpr:!0}),doubleAt:G(`@@`,{startsExpr:!0}),pipeline:W(`|>`,0),nullishCoalescing:W(`??`,1),logicalOR:W(`||`,1),logicalAND:W(`&&`,2),bitwiseOR:W(`|`,3),bitwiseXOR:W(`^`,4),bitwiseAND:W(`&`,5),equality:W(`==/!=/===/!==`,6),lt:W(`</>/<=/>=`,7),gt:W(`</>/<=/>=`,7),relational:W(`</>/<=/>=`,7),bitShift:W(`<</>>/>>>`,8),bitShiftL:W(`<</>>/>>>`,8),bitShiftR:W(`<</>>/>>>`,8),plusMin:G(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:G(`%`,{binop:10,startsExpr:!0}),star:G(`*`,{binop:10}),slash:W(`/`,10),exponent:G(`**`,{beforeExpr:!0,binop:11,rightAssociative:!0}),_in:U(`in`,{beforeExpr:!0,binop:7}),_instanceof:U(`instanceof`,{beforeExpr:!0,binop:7}),_break:U(`break`),_case:U(`case`,{beforeExpr:!0}),_catch:U(`catch`),_continue:U(`continue`),_debugger:U(`debugger`),_default:U(`default`,{beforeExpr:!0}),_else:U(`else`,{beforeExpr:!0}),_finally:U(`finally`),_function:U(`function`,{startsExpr:!0}),_if:U(`if`),_return:U(`return`,{beforeExpr:!0}),_switch:U(`switch`),_throw:U(`throw`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_try:U(`try`),_var:U(`var`),_const:U(`const`),_with:U(`with`),_new:U(`new`,{beforeExpr:!0,startsExpr:!0}),_this:U(`this`,{startsExpr:!0}),_super:U(`super`,{startsExpr:!0}),_class:U(`class`,{startsExpr:!0}),_extends:U(`extends`,{beforeExpr:!0}),_export:U(`export`),_import:U(`import`,{startsExpr:!0}),_null:U(`null`,{startsExpr:!0}),_true:U(`true`,{startsExpr:!0}),_false:U(`false`,{startsExpr:!0}),_typeof:U(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:U(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:U(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_do:U(`do`,{isLoop:!0,beforeExpr:!0}),_for:U(`for`,{isLoop:!0}),_while:U(`while`,{isLoop:!0}),_as:K(`as`,{startsExpr:!0}),_assert:K(`assert`,{startsExpr:!0}),_async:K(`async`,{startsExpr:!0}),_await:K(`await`,{startsExpr:!0}),_defer:K(`defer`,{startsExpr:!0}),_from:K(`from`,{startsExpr:!0}),_get:K(`get`,{startsExpr:!0}),_let:K(`let`,{startsExpr:!0}),_meta:K(`meta`,{startsExpr:!0}),_of:K(`of`,{startsExpr:!0}),_sent:K(`sent`,{startsExpr:!0}),_set:K(`set`,{startsExpr:!0}),_source:K(`source`,{startsExpr:!0}),_static:K(`static`,{startsExpr:!0}),_using:K(`using`,{startsExpr:!0}),_yield:K(`yield`,{startsExpr:!0}),_asserts:K(`asserts`,{startsExpr:!0}),_checks:K(`checks`,{startsExpr:!0}),_exports:K(`exports`,{startsExpr:!0}),_global:K(`global`,{startsExpr:!0}),_implements:K(`implements`,{startsExpr:!0}),_intrinsic:K(`intrinsic`,{startsExpr:!0}),_infer:K(`infer`,{startsExpr:!0}),_is:K(`is`,{startsExpr:!0}),_mixins:K(`mixins`,{startsExpr:!0}),_proto:K(`proto`,{startsExpr:!0}),_require:K(`require`,{startsExpr:!0}),_satisfies:K(`satisfies`,{startsExpr:!0}),_keyof:K(`keyof`,{startsExpr:!0}),_readonly:K(`readonly`,{startsExpr:!0}),_unique:K(`unique`,{startsExpr:!0}),_abstract:K(`abstract`,{startsExpr:!0}),_declare:K(`declare`,{startsExpr:!0}),_enum:K(`enum`,{startsExpr:!0}),_module:K(`module`,{startsExpr:!0}),_namespace:K(`namespace`,{startsExpr:!0}),_interface:K(`interface`,{startsExpr:!0}),_type:K(`type`,{startsExpr:!0}),_opaque:K(`opaque`,{startsExpr:!0}),name:G(`name`,{startsExpr:!0}),placeholder:G(`%%`,{startsExpr:!0}),string:G(`string`,{startsExpr:!0}),num:G(`num`,{startsExpr:!0}),bigint:G(`bigint`,{startsExpr:!0}),regexp:G(`regexp`,{startsExpr:!0}),privateName:G(`#name`,{startsExpr:!0}),eof:G(`eof`),jsxName:G(`jsxName`),jsxText:G(`jsxText`,{beforeExpr:!0}),jsxTagStart:G(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:G(`jsxTagEnd`)};function q(e){return e>=89&&e<=129}function ai(e){return e<=88}function oi(e){return e>=54&&e<=129}function si(e){return e>=54&&e<=132}function ci(e){return ti[e]}function li(e){return ni[e]}function ui(e){return e>=25&&e<=29}function di(e){return e>=125&&e<=127}function fi(e){return e>=86&&e<=88}function pi(e){return e>=54&&e<=88}function mi(e){return e>=35&&e<=55}function hi(e){return e===30}function gi(e){return ri[e]}function _i(e){return e>=117&&e<=119}function vi(e){return e>=120&&e<=126}function yi(e){return $r[e]}function bi(e){return ei[e]}function xi(e){return e===53}function Si(e){return e>=20&&e<=21}function Ci(e){return Qr[e]}var wi=class{constructor(e,t){r(this,`token`,void 0),r(this,`preserveSpace`,void 0),this.token=e,this.preserveSpace=!!t}};const J={brace:new wi(`{`),j_oTag:new wi(`<tag`),j_cTag:new wi(`</tag`),j_expr:new wi(`<tag>...</tag>`,!0)},Ti=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Ei=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Di=RegExp(`[\\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-\\u088f\\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\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\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-\\u1c8a\\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-\\ua7dc\\ua7f1-\\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]`),Oi=RegExp(`[\\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-\\u088f\\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\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\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-\\u1c8a\\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-\\ua7dc\\ua7f1-\\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\\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\\u0897-\\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-\\u1add\\u1ae0-\\u1aeb\\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\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\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\\uff65]`);function ki(e,t){let n=65536;for(let r=0,i=t.length;r<i;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function Ai(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&Di.test(String.fromCharCode(e)):ki(e,Ti)}function ji(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&Oi.test(String.fromCharCode(e)):ki(e,Ti)||ki(e,Ei)}const Mi={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`.split(`.`),strict:[`implements`,`interface`,`let`,`package`,`private`,`protected`,`public`,`static`,`yield`],strictBind:[`eval`,`arguments`]},Ni=new Set(Mi.keyword),Pi=new Set(Mi.strict),Fi=new Set(Mi.strictBind);function Ii(e,t){return t&&e===`await`||e===`enum`}function Li(e,t){return Ii(e,t)||Pi.has(e)}function Ri(e){return Fi.has(e)}function zi(e,t){return Li(e,t)||Ri(e)}function Bi(e){return Ni.has(e)}function Vi(e,t,n){return e===64&&t===64&&Ai(n)}const Hi=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`.split(`.`));function Ui(e){return Hi.has(e)}var Wi=class{constructor(e){r(this,`flags`,0),r(this,`names`,new Map),r(this,`firstLexicalName`,``),this.flags=e}},Gi=class{constructor(e,t){r(this,`parser`,void 0),r(this,`scopeStack`,[]),r(this,`inModule`,void 0),r(this,`undefinedExports`,new Map),this.parser=e,this.inModule=t}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 allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&(e&2)==0}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&128)return!0;if(t&3779)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new Wi(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,t,n){let r=this.currentScope();if(t&8||t&16){this.checkRedeclarationInScope(r,e,t,n);let i=r.names.get(e)||0;t&16?i|=4:(r.firstLexicalName||(r.firstLexicalName=e),i|=2),r.names.set(e,i),t&8&&this.maybeExportDefined(r,e)}else if(t&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,e,t,n),r.names.set(e,(r.names.get(e)||0)|1),this.maybeExportDefined(r,e),!(r.flags&3715));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,n,r){this.isRedeclaredInScope(e,t,n)&&this.parser.raise(H.VarRedeclaration,r,{identifierName:t})}isRedeclaredInScope(e,t,n){if(!(n&1))return!1;if(n&8)return e.names.has(t);let r=e.names.get(t)||0;return n&16?(r&2)>0||!this.treatFunctionsAsVarInScope(e)&&(r&1)>0:(r&2)>0&&!(e.flags&8&&e.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(e)&&(r&4)>0}checkLocalExport(e){let{name:t}=e;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,e.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3715)return t}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3779&&!(t&4))return t}}},Ki=class extends Wi{constructor(...e){super(...e),r(this,`declareFunctions`,new Set)}},qi=class extends Gi{createScope(e){return new Ki(e)}declareName(e,t,n){let r=this.currentScope();if(t&2048){this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e),r.declareFunctions.add(e);return}super.declareName(e,t,n)}isRedeclaredInScope(e,t,n){if(super.isRedeclaredInScope(e,t,n))return!0;if(n&2048&&!e.declareFunctions.has(t)){let n=e.names.get(t);return(n&4)>0||(n&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}};const Ji=new Set([`_`,`any`,`bool`,`boolean`,`empty`,`extends`,`false`,`interface`,`mixed`,`null`,`number`,`static`,`string`,`true`,`typeof`,`void`]),Y=Wr`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:e})=>`Cannot overwrite reserved type ${e}.`,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:e,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:t})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:t})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:t,explicitType:n})=>`Enum \`${e}\` has type \`${n}\`, so the initializer of \`${t}\` needs to be a ${n} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:t,suggestion:n})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${n}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",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:{message:`A binding pattern parameter cannot be optional in an implementation signature.`},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:e})=>`Unexpected reserved type ${e}.`,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:e,suggestion:t})=>`\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:`Only declares and type imports are allowed inside declare module.`,UnterminatedFlowComment:`Unterminated flow-comment.`});function Yi(e){return e.type===`DeclareExportAllDeclaration`||e.type===`DeclareExportDeclaration`&&(!e.declaration||e.declaration.type!==`TypeAlias`&&e.declaration.type!==`InterfaceDeclaration`)}function Xi(e){return e.importKind===`type`||e.importKind===`typeof`}const Zi={const:`declare export var`,let:`declare export var`,type:`export type`,interface:`export interface`};function Qi(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)(t(e[i],i,e)?n:r).push(e[i]);return[n,r]}const $i=/\*?\s*@((?:no)?flow)\b/,ea=e=>class extends e{constructor(...e){super(...e),r(this,`flowPragma`,void 0)}getScopeHandler(){return qi}shouldParseTypes(){return this.getPluginOption(`flow`,`all`)||this.flowPragma===`flow`}finishToken(e,t){e!==130&&e!==9&&e!==24&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=$i.exec(e.value);if(t)if(t[1]===`flow`)this.flowPragma=`flow`;else if(t[1]===`noflow`)this.flowPragma=`noflow`;else throw Error(`Unexpected flow pragma`)}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||10);let n=this.flowParseType();return this.state.inType=t,n}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(106),this.state.lastTokStartLoc.index>t.index+1&&this.raise(Y.UnexpectedSpaceBetweenModuloChecks,t),this.eat(6)?(e.value=super.parseExpression(),this.expect(7),this.finishNode(e,`DeclaredPredicate`)):this.finishNode(e,`InferredPredicate`)}flowParseTypeAndPredicateInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(10);let n=null,r=null;return e&&this.match(50)?(this.state.inType=t,r=this.flowParsePredicate()):(n=this.flowParseType(),this.state.inType=t,this.match(50)&&(r=this.flowParsePredicate())),[n,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,`DeclareClass`)}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),n=this.startNode(),r=this.startNode();this.match(43)?n.typeParameters=this.flowParseTypeParameterDeclaration():n.typeParameters=null,this.expect(6);let i=this.flowParseFunctionTypeParams();return n.params=i.params,n.rest=i.rest,n.this=i._this,this.expect(7),[n.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!1),r.typeAnnotation=this.finishNode(n,`FunctionTypeAnnotation`),t.typeAnnotation=this.finishNode(r,`TypeAnnotation`),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.start),this.finishNode(e,`DeclareFunction`)}flowParseDeclare(e,t){if(this.match(76))return this.flowParseDeclareClass(e);if(this.match(64))return this.flowParseDeclareFunction(e);if(this.match(70))return this.flowParseDeclareVariable(e);if(this.eatContextual(123))return this.match(12)?this.flowParseDeclareModuleExports(e):(t&&this.raise(Y.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(126))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(127))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(125))return this.flowParseDeclareInterface(e);if(this.match(78))return this.flowParseDeclareExportDeclaration(e,t);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(e.id.name,5,e.id.start),this.semicolon(),this.finishNode(e,`DeclareVariable`)}flowParseDeclareModule(e){this.scope.enter(0),this.match(130)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let t=this.startNode(),n=t.body=[];for(this.expect(2);!this.match(4);){let e=this.startNode();this.match(79)?(this.next(),!this.isContextual(126)&&!this.match(83)&&this.raise(Y.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),n.push(super.parseImport(e))):(this.expectContextual(121,Y.UnsupportedStatementInDeclareModule),n.push(this.flowParseDeclare(e,!0)))}this.scope.exit(),this.expect(4),e.body=this.finishNode(t,`BlockStatement`);let r=null,i=!1;return n.forEach(e=>{Yi(e)?(r===`CommonJS`&&this.raise(Y.AmbiguousDeclareModuleKind,e),r=`ES`):e.type===`DeclareModuleExports`&&(i&&this.raise(Y.DuplicateDeclareModuleExports,e),r===`ES`&&this.raise(Y.AmbiguousDeclareModuleKind,e),r=`CommonJS`,i=!0)}),e.kind=r||`CommonJS`,this.finishNode(e,`DeclareModule`)}flowParseDeclareExportDeclaration(e,t){if(this.expect(78),this.eat(61))return this.match(64)||this.match(76)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(71)||this.isLet()||(this.isContextual(126)||this.isContextual(125))&&!t){let e=this.state.value;throw this.raise(Y.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:e,suggestion:Zi[e]})}if(this.match(70)||this.match(64)||this.match(76)||this.isContextual(127))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(51)||this.match(2)||this.isContextual(125)||this.isContextual(126)||this.isContextual(127)){let t=this.parseExport(e,null);return t.type===`ExportNamedDeclaration`?(t.default=!1,delete t.exportKind,this.castNodeTo(t,`DeclareExportDeclaration`)):this.castNodeTo(t,`DeclareExportAllDeclaration`)}throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(107),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,`DeclareModuleExports`)}flowParseDeclareTypeAlias(e){this.next();let t=this.flowParseTypeAlias(e);return this.castNodeTo(t,`DeclareTypeAlias`),t}flowParseDeclareOpaqueType(e){return this.next(),this.flowParseOpaqueType(e,!0)}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,`DeclareInterface`)}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?17:8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(!t&&this.eat(8));if(t){let t=[],n=[];if(this.eatContextual(113))do n.push(this.flowParseInterfaceExtends());while(this.eat(8));if(this.eatContextual(109))do t.push(this.flowParseClassImplements());while(this.eat(8));e.implements=t,e.mixins=n}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(43)?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(Y.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,n){Ji.has(e)&&this.raise(n?Y.AssignReservedType:Y.UnexpectedReservedType,t,{reservedType:e})}flowParseRestrictedIdentifierName(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),this.parseIdentifierName(e)}flowParseRestrictedIdentifier(e,t){let n=this.startNode(),r=this.flowParseRestrictedIdentifierName(e,t);return this.createIdentifier(n,r)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(25),this.semicolon(),this.finishNode(e,`TypeAlias`)}flowParseOpaqueType(e,t){return this.expectContextual(126),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(10)&&(e.supertype=this.flowParseTypeInitialiser(10)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(25)),this.semicolon(),this.finishNode(e,t?`DeclareOpaqueType`:`OpaqueType`)}flowParseTypeParameterBound(){if(this.match(10)||this.isContextual(77)){let e=this.startNode();return this.next(),e.typeAnnotation=this.flowParseType(),this.finishNode(e,`TypeAnnotation`)}}flowParseTypeParameter(e=!1){let t=this.state.startLoc,n=this.startNode(),r=this.flowParseVariance();return n.name=this.flowParseRestrictedIdentifierName(),n.variance=r,n.bound=this.flowParseTypeParameterBound(),this.match(25)?(this.eat(25),n.default=this.flowParseType()):e&&this.raise(Y.MissingTypeParamDefault,t),this.finishNode(n,`TypeParameter`)}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(43)||this.match(138)?this.next():this.unexpected();let n=!1;do{let e=this.flowParseTypeParameter(n);t.params.push(e),e.default&&(n=!0),this.match(44)||this.expect(8)}while(!this.match(44));return this.expect(44),this.state.inType=e,this.finishNode(t,`TypeParameterDeclaration`)}flowInTopLevelContext(e){if(this.curContext()!==J.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===43)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(43);let t=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(44);)e.params.push(this.flowParseType()),this.match(44)||this.expect(8);this.state.noAnonFunctionType=t}),this.state.inType=t,!this.state.inType&&this.curContext()===J.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TypeParameterInstantiation`)}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==43)return null;let e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(43);!this.match(44);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(44)||this.expect(8);return this.expect(44),this.state.inType=t,this.finishNode(e,`TypeParameterInstantiation`)}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(125),e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(8));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,`InterfaceTypeAnnotation`)}flowParseObjectPropertyKey(){return this.match(131)||this.match(130)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,n){return e.static=t,this.lookahead().type===10?(e.id=this.parseIdentifier(!0),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(1),e.value=this.flowParseTypeInitialiser(),e.variance=n,this.finishNode(e,`ObjectTypeIndexer`)}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.parseIdentifier(!0),this.expect(1),this.expect(1),this.match(43)||this.match(6)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e))):(e.method=!1,this.eat(13)&&(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(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(6),this.match(74)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(7),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,`FunctionTypeAnnotation`)}flowParseObjectTypeCallProperty(e,t){let n=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(n),this.finishNode(e,`ObjectTypeCallProperty`)}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:n,allowProto:r,allowInexact:i}){let a=this.state.inType;this.state.inType=!0;let o=this.startNode();o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let s,c,l=!1;for(t&&this.match(3)?(this.expect(3),s=5,c=!0):(this.expect(2),s=4,c=!1),o.exact=c;!this.match(s);){let t=!1,a=null,s=null,u=this.startNode();if(r&&this.isContextual(114)){let t=this.lookahead();t.type!==10&&t.type!==13&&(this.next(),a=this.state.startLoc,e=!1)}if(e&&this.isContextual(102)){let e=this.lookahead();e.type!==10&&e.type!==13&&(this.next(),t=!0)}let d=this.flowParseVariance();if(this.eat(0))a!=null&&this.unexpected(a),this.eat(0)?(d&&this.unexpected(d.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(u,t))):o.indexers.push(this.flowParseObjectTypeIndexer(u,t,d));else if(this.match(6)||this.match(43))a!=null&&this.unexpected(a),d&&this.unexpected(d.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(u,t));else{let e=`init`;(this.isContextual(95)||this.isContextual(100))&&si(this.lookahead().type)&&(e=this.state.value,this.next());let r=this.flowParseObjectTypeProperty(u,t,a,d,e,n,i==null?!c:i);r===null?(l=!0,s=this.state.lastTokStartLoc):o.properties.push(r)}this.flowObjectTypeSemicolon(),s&&!this.match(4)&&!this.match(5)&&this.raise(Y.UnexpectedExplicitInexactInObject,s)}this.expect(s),n&&(o.inexact=l);let u=this.finishNode(o,`ObjectTypeAnnotation`);return this.state.inType=a,u}flowParseObjectTypeProperty(e,t,n,r,i,a,o){if(this.eat(17))return this.match(8)||this.match(9)||this.match(4)||this.match(5)?(a?o||this.raise(Y.InexactInsideExact,this.state.lastTokStartLoc):this.raise(Y.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(Y.InexactVariance,r),null):(a||this.raise(Y.UnexpectedSpreadType,this.state.lastTokStartLoc),n!=null&&this.unexpected(n),r&&this.raise(Y.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,`ObjectTypeSpreadProperty`));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=n!=null,e.kind=i;let o=!1;return this.match(43)||this.match(6)?(e.method=!0,n!=null&&this.unexpected(n),r&&this.unexpected(r.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)),i===`get`||i===`set`?this.flowCheckGetterSetterParams(e):!t&&!a&&e.key.name===`constructor`&&e.value.this&&this.raise(Y.ThisParamBannedInConstructor,e.value.this)):(i!==`init`&&this.unexpected(),e.method=!1,this.eat(13)&&(o=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=o,this.finishNode(e,`ObjectTypeProperty`)}}flowCheckGetterSetterParams(e){let t=e.kind===`get`?0:1,n=e.value,r=n.params.length+ +!!n.rest;n.this&&this.raise(e.kind===`get`?Y.GetterMayNotHaveThisParam:Y.SetterMayNotHaveThisParam,n.this),r!==t&&this.raise(e.kind===`get`?H.BadGetterArity:H.BadSetterArity,e),e.kind===`set`&&n.rest&&this.raise(H.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(9)&&!this.eat(8)&&!this.match(4)&&!this.match(5)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){e!=null||(e=this.state.startLoc);let n=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(12);){let t=this.startNodeAt(e);t.qualification=n,t.id=this.flowParseRestrictedIdentifier(!0),n=this.finishNode(t,`QualifiedTypeIdentifier`)}return n}flowParseGenericType(e,t){let n=this.startNodeAt(e);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(43)&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,`GenericTypeAnnotation`)}flowParseTypeofType(){let e=this.startNode();return this.expect(83),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(1)&&(e.types.push(this.flowParseType()),!this.match(1));)this.expect(8);return this.expect(1),this.finishNode(e,`TupleTypeAnnotation`)}flowParseFunctionTypeParam(e){let t=null,n=!1,r,i=this.startNode(),a=this.lookahead(),o=this.state.type===74;return a.type===10||a.type===13?(o&&!e&&this.raise(Y.ThisParamMustBeFirst,i),t=this.parseIdentifier(o),this.eat(13)&&(n=!0,o&&this.raise(Y.ThisParamMayNotBeOptional,i)),r=this.flowParseTypeInitialiser()):r=this.flowParseType(),i.name=t,i.optional=n,i.typeAnnotation=r,this.finishNode(i,`FunctionTypeParam`)}reinterpretTypeAsFunctionTypeParam(e){let t=this.startNodeAtNode(e);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,`FunctionTypeParam`)}flowParseFunctionTypeParams(e=[]){let t=null,n=null;for(this.match(74)&&(n=this.flowParseFunctionTypeParam(!0),n.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(t=this.flowParseFunctionTypeParam(!1)),{params:e,rest:t,_this:n}}flowIdentToTypeAnnotation(e,t,n){switch(n.name){case`any`:return this.finishNode(t,`AnyTypeAnnotation`);case`bool`:case`boolean`:return this.finishNode(t,`BooleanTypeAnnotation`);case`mixed`:return this.finishNode(t,`MixedTypeAnnotation`);case`empty`:return this.finishNode(t,`EmptyTypeAnnotation`);case`number`:return this.finishNode(t,`NumberTypeAnnotation`);case`string`:return this.finishNode(t,`StringTypeAnnotation`);case`symbol`:return this.finishNode(t,`SymbolTypeAnnotation`);default:return this.checkNotUnderscore(n.name),this.flowParseGenericType(e,n)}}flowParsePrimaryType(){let e=this.state.startLoc,t=this.startNode(),n,r,i=!1,a=this.state.noAnonFunctionType;switch(this.state.type){case 2:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 3:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,r=this.flowParseTupleType(),this.state.noAnonFunctionType=a,r;case 43:{let e=this.startNode();return e.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(6),n=this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),this.finishNode(e,`FunctionTypeAnnotation`)}case 6:{let e=this.startNode();if(this.next(),!this.match(7)&&!this.match(17))if(q(this.state.type)||this.match(74)){let e=this.lookahead().type;i=e!==13&&e!==10}else i=!0;if(i){if(this.state.noAnonFunctionType=!1,r=this.flowParseType(),this.state.noAnonFunctionType=a,this.state.noAnonFunctionType||!(this.match(8)||this.match(7)&&this.lookahead().type===15))return this.expect(7),r;this.eat(8)}return n=r?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(r)]):this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),e.typeParameters=null,this.finishNode(e,`FunctionTypeAnnotation`)}case 130:return this.parseLiteral(this.state.value,`StringLiteralTypeAnnotation`);case 81:case 82:return t.value=this.match(81),this.next(),this.finishNode(t,`BooleanLiteralTypeAnnotation`);case 49:if(this.state.value===`-`){if(this.next(),this.match(131))return this.parseLiteralAtNode(-this.state.value,`NumberLiteralTypeAnnotation`,t);if(this.match(132))return this.parseLiteralAtNode(-this.state.value,`BigIntLiteralTypeAnnotation`,t);throw this.raise(Y.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 131:return this.parseLiteral(this.state.value,`NumberLiteralTypeAnnotation`);case 132:return this.parseLiteral(this.state.value,`BigIntLiteralTypeAnnotation`);case 84:return this.next(),this.finishNode(t,`VoidTypeAnnotation`);case 80:return this.next(),this.finishNode(t,`NullLiteralTypeAnnotation`);case 74:return this.next(),this.finishNode(t,`ThisTypeAnnotation`);case 51:return this.next(),this.finishNode(t,`ExistsTypeAnnotation`);case 83:return this.flowParseTypeofType();default:if(pi(this.state.type)){let e=yi(this.state.type);return this.next(),super.createIdentifier(t,e)}else if(q(this.state.type))return this.isContextual(125)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,t,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,t=this.flowParsePrimaryType(),n=!1;for(;(this.match(0)||this.match(14))&&!this.canInsertSemicolon();){let r=this.startNodeAt(e),i=this.eat(14);n=n||i,this.expect(0),!i&&this.match(1)?(r.elementType=t,this.next(),t=this.finishNode(r,`ArrayTypeAnnotation`)):(r.objectType=t,r.indexType=this.flowParseType(),this.expect(1),n?(r.optional=i,t=this.finishNode(r,`OptionalIndexedAccessType`)):t=this.finishNode(r,`IndexedAccessType`))}return t}flowParsePrefixType(){let e=this.startNode();return this.eat(13)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,`NullableTypeAnnotation`)):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(15)){let t=this.startNodeAtNode(e);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.this=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,`FunctionTypeAnnotation`)}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(41);let t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(41);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?t:this.finishNode(e,`IntersectionTypeAnnotation`)}flowParseUnionType(){let e=this.startNode();this.eat(39);let t=this.flowParseIntersectionType();for(e.types=[t];this.eat(39);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?t:this.finishNode(e,`UnionTypeAnnotation`)}flowParseType(){let e=this.state.inType;this.state.inType=!0;let t=this.flowParseUnionType();return this.state.inType=e,t}flowParseTypeOrImplicitInstantiation(){if(this.state.type===128&&this.state.value===`_`){let e=this.state.startLoc,t=this.parseIdentifier();return this.flowParseGenericType(e,t)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,`TypeAnnotation`)}flowParseTypeAnnotatableIdentifier(){let e=this.startNode(),t=this.parseIdentifierName();return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(e,t)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}flowParseVariance(){let e=null;return this.match(49)?(e=this.startNode(),this.state.value===`+`?e.kind=`plus`:e.kind=`minus`,this.next(),this.finishNode(e,`Variance`)):e}parseFunctionBody(e,t,n=!1){if(t){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,n));return}super.parseFunctionBody(e,!1,n)}parseFunctionBodyAndFinish(e,t,n=!1){if(this.match(10)){let n=this.startNode();t===`FunctionDeclaration`||t===`FunctionExpression`||t===`ArrowFunctionExpression`?[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0):n.typeAnnotation=this.flowParseTypeInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,`TypeAnnotation`):null}return super.parseFunctionBodyAndFinish(e,t,n)}parseStatementLike(e){if(this.state.strict&&this.isContextual(125)){if(oi(this.lookahead().type)){let e=this.startNode();return this.next(),this.flowParseInterface(e)}}else if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}let t=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t,n){if(t.type===`Identifier`){if(t.name===`declare`){if(this.match(76)||q(this.state.type)||this.match(64)||this.match(70)||this.match(78))return this.flowParseDeclare(e)}else if(q(this.state.type)){if(t.name===`interface`)return this.flowParseInterface(e);if(t.name===`type`)return this.flowParseTypeAlias(e);if(t.name===`opaque`)return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,t,n)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===122||di(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===122||di(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.expect(13);let r=this.state.clone(),i=this.state.noArrowAt,a=this.startNodeAt(t),{consequent:o,failed:s}=this.tryParseConditionalConsequent(),c=this.getArrowLikeExpressions(o),l=c[0],u=c[1];if(s||u.length>0){let e=[...i];if(u.length>0){this.state=r,this.state.noArrowAt=e;for(let t=0;t<u.length;t++)e.push(u[t].start);({consequent:o,failed:s}=this.tryParseConditionalConsequent()),[l]=this.getArrowLikeExpressions(o)}s&&l.length>1&&this.raise(Y.AmbiguousConditionalArrow,r.startLoc),s&&l.length===1&&(this.state=r,e.push(l[0].start),this.state.noArrowAt=e,{consequent:o}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(o,!0),this.state.noArrowAt=i,this.expect(10),a.test=e,a.consequent=o,a.alternate=this.forwardNoArrowParamsConversionAt(a,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(a,`ConditionalExpression`)}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),t=!this.match(10);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let n=[e],r=[];for(;n.length!==0;){let e=n.pop();e.type===`ArrowFunctionExpression`&&e.body.type!==`BlockStatement`?(e.typeParameters||!e.returnType?this.finishArrowValidation(e):r.push(e),n.push(e.body)):e.type===`ConditionalExpression`&&(n.push(e.consequent),n.push(e.alternate))}return t?(r.forEach(e=>this.finishArrowValidation(e)),[r,[]]):Qi(r,e=>e.params.every(e=>this.isAssignable(e,!0)))}finishArrowValidation(e){var t;this.toAssignableList(e.params,(t=e.extra)==null?void 0:t.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let n;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),n=t(),this.state.noArrowParamsConversionAt.pop()):n=t(),n}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let e=this.startNodeAt(t);return e.expression=n,e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,`TypeCastExpression`)}return n}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(126)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.match(2)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}else if(this.isContextual(127)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}else if(this.isContextual(125)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseInterface(t)}else if(this.isContextual(122)){e.exportKind=`value`;let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(126)&&this.lookahead().type===51?(e.exportKind=`type`,this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:t}=this.state,n=super.maybeParseExportNamespaceSpecifier(e);return n&&e.exportKind===`type`&&this.unexpected(t),n}parseClassId(e,t,n){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n),this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,n){let{startLoc:r}=this.state;if(this.isContextual(121)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,n),t.declare&&(t.type!==`ClassProperty`&&t.type!==`ClassPrivateProperty`&&t.type!==`PropertyDefinition`?this.raise(Y.DeclareClassElement,r):t.value&&this.raise(Y.DeclareClassFieldInitializer,t.value))}isIterator(e){return e===`iterator`||e===`asyncIterator`}readIterator(){let e=super.readWord1(),t=`@@`+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(H.InvalidIdentifier,this.state.curPosition(),{identifierName:t}),this.finishToken(128,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);e===123&&t===124?this.finishOp(3,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?44:43,1):this.state.inType&&e===63?t===46?this.finishOp(14,2):this.finishOp(13,1):Vi(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,t){return e.type===`TypeCastExpression`?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&e.type===`AssignmentExpression`&&e.left.type===`TypeCastExpression`&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableListItem(e,t,n){let r=e[t];r.type===`TypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}toReferencedList(e,t){for(let r=0;r<e.length;r++){var n;let i=e[r];(i==null?void 0:i.type)===`TypeCastExpression`&&!((n=i.extra)!=null&&n.parenthesized)&&(e.length>1||!t)&&this.raise(Y.TypeCastInPattern,i.typeAnnotation)}return e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.toReferencedList(n.elements),n}isValidLVal(e,t,n,r){return e===`TypeCastExpression`||super.isValidLVal(e,t,n,r)}parseClassProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(10)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(10)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,n,r,i,a){if(t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,n,r,i,a),t.params&&i){let e=t.params;e.length>0&&this.isThisParam(e[0])&&this.raise(Y.ThisParamBannedInConstructor,t)}else if(t.type===`MethodDefinition`&&i&&t.value.params){let e=t.value.params;e.length>0&&this.isThisParam(e[0])&&this.raise(Y.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,n,r){t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,n,r)}flowParseClassImplements(){let e=this.startNode();return e.id=this.flowParseRestrictedIdentifier(!0),this.match(43)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,`ClassImplements`)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(43)||this.match(47))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.eatContextual(109)){let t=e.implements=[];do t.push(this.flowParseClassImplements());while(this.eat(8))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let n=t[0];this.isThisParam(n)&&e.kind===`get`?this.raise(Y.GetterMayNotHaveThisParam,n):this.isThisParam(n)&&this.raise(Y.SetterMayNotHaveThisParam,n)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,n,r,i,a,o){e.variance&&this.unexpected(e.variance.start),delete e.variance;let s;this.match(43)&&!a&&(s=this.flowParseTypeParameterDeclaration(),this.match(6)||this.unexpected());let c=super.parseObjPropValue(e,t,n,r,i,a,o);return s&&((c.value||c).typeParameters=s),c}parseFunctionParamType(e){return this.eat(13)&&(e.type!==`Identifier`&&this.raise(Y.PatternIsOptional,e),this.isThisParam(e)&&this.raise(Y.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(10)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(Y.ThisParamAnnotationRequired,e),this.match(25)&&this.isThisParam(e)&&this.raise(Y.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(Y.TypeBeforeInitializer,n.typeAnnotation),n}parseImportSpecifierLocal(e,t,n){t.local=Xi(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){if(!e)return!0;let t=this.lookaheadCharCode();return t===123||t===42}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){if(super.applyImportPhase(e,t,n,r),t){if(!n&&this.match(61))return;e.exportKind=n===`type`?n:`value`}else n===`type`&&this.match(51)&&this.unexpected(),e.importKind=n===`type`||n===`typeof`?n:`value`}parseImportSpecifier(e,t,n,r,i){let a=e.imported,o=null;a.type===`Identifier`&&(a.name===`type`?o=`type`:a.name===`typeof`&&(o=`typeof`));let s=!1;if(this.isContextual(89)&&!this.isLookaheadContextual(`as`)){let t=this.parseIdentifier(!0);o!==null&&!oi(this.state.type)?(e.imported=t,e.importKind=o,e.local=this.cloneIdentifier(t)):(e.imported=a,e.importKind=null,e.local=this.parseIdentifier())}else{if(o!==null&&oi(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=o;else{if(t)throw this.raise(H.ImportBindingIsString,e,{importName:a.value});e.imported=a,e.importKind=null}this.eatContextual(89)?e.local=this.parseIdentifier():(s=!0,e.local=this.cloneIdentifier(e.imported))}let c=Xi(e);return n&&c&&this.raise(Y.ImportTypeShorthandOnlyInPureImport,e),(n||c)&&this.checkReservedType(e.local.name,e.local.start,!0),s&&!n&&!c&&this.checkReservedWord(e.local.name,e.start,!0,!0),this.finishImportSpecifier(e,`ImportSpecifier`)}parseBindingAtom(){switch(this.state.type){case 74:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,t){let n=e.kind;n!==`get`&&n!==`set`&&this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),this.match(10)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){if(this.match(10)){let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=t}return super.parseAsyncArrowFromCallExpression(e,t)}shouldParseAsyncArrow(){return this.match(10)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,t){let n=null,r;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===J.j_oTag||a===J.j_expr)&&i.pop()}if(r!=null&&r.error||this.match(43)){n=n||this.state.clone();let i,a=this.tryParse(n=>{var r;i=this.flowParseTypeParameterDeclaration();let a=this.forwardNoArrowParamsConversionAt(i,()=>{let n=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(n,i),n});(r=a.extra)!=null&&r.parenthesized&&n();let o=this.maybeUnwrapTypeCastExpression(a);return o.type!==`ArrowFunctionExpression`&&n(),o.typeParameters=i,this.resetStartLocationFromNode(o,i),a},n),o=null;if(a.node&&this.maybeUnwrapTypeCastExpression(a.node).type===`ArrowFunctionExpression`){if(!a.error&&!a.aborted)return a.node.async&&this.raise(Y.UnexpectedTypeParameterBeforeAsyncArrowFunction,i),a.node;o=a.node}if(r!=null&&r.node)return this.state=r.failState,r.node;if(o)return this.state=a.failState,o;throw r!=null&&r.thrown?r.error:a.thrown?a.error:this.raise(Y.UnexpectedTokenAfterTypeParameter,i)}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(()=>{let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0),this.state.noAnonFunctionType=t,this.canInsertSemicolon()&&this.unexpected(),this.match(15)||this.unexpected(),n});if(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,`TypeAnnotation`):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(10)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,n,r=!0){if(!(n&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let t=0;t<e.params.length;t++)this.isThisParam(e.params[t])&&t>0&&this.raise(Y.ThisParamMustBeFirst,e.params[t]);super.checkParams(e,t,n,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,t,n){if(e.type===`Identifier`&&e.name===`async`&&this.state.noArrowAt.includes(t.index)){this.next();let n=this.startNodeAt(t);n.callee=e,n.arguments=super.parseCallExpressionArguments(),e=this.finishNode(n,`CallExpression`)}else if(e.type===`Identifier`&&e.name===`async`&&this.match(43)){let r=this.state.clone(),i=this.tryParse(e=>this.parseAsyncArrowWithTypeParameters(t)||e(),r);if(!i.error&&!i.aborted)return i.node;let a=this.tryParse(()=>super.parseSubscripts(e,t,n),r);if(a.node&&!a.error)return a.node;if(i.node)return this.state=i.failState,i.node;if(a.node)return this.state=a.failState,a.node;throw i.error||a.error}return super.parseSubscripts(e,t,n)}parseSubscript(e,t,n,r){if(this.match(14)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,n)return r.stop=!0,e;this.next();let i=this.startNodeAt(t);return i.callee=e,i.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(6),i.arguments=this.parseCallExpressionArguments(),i.optional=!0,this.finishCallExpression(i,!0)}else if(!n&&this.shouldParseTypes()&&(this.match(43)||this.match(47))){let n=this.startNodeAt(t);n.callee=e;let i=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(6),n.arguments=super.parseCallExpressionArguments(),r.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,r.optionalChainMember)));if(i.node)return i.error&&(this.state=i.failState),i.node}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(43)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===42&&t===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 t=this.input.charCodeAt(this.state.pos+1);if(e===124&&t===125){this.finishOp(5,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,t){let n=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(Y.UnterminatedFlowComment,this.state.curPosition()),n}skipBlockComment(){if(this.hasPlugin(`flowComments`)&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(Y.NestedFlowComment,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,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let n=this.input.charCodeAt(t+e),r=this.input.charCodeAt(t+e+1);return n===58&&r===58?t+2:this.input.slice(t+e,t+e+12)===`flow-include`?t+12:n===58&&r!==58?t:!1}hasFlowCommentCompletion(){if(this.input.indexOf(`*/`,this.state.pos)===-1)throw this.raise(H.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,t){this.raise(Y.EnumBooleanMemberNotInitialized,e,t)}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType===`symbol`?Y.EnumInvalidMemberInitializerSymbolType:Y.EnumInvalidMemberInitializerPrimaryType:Y.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(Y.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(Y.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(8)||this.match(4);switch(this.state.type){case 131:{let e=this.parseNumericLiteral(this.state.value);if(t())return{type:`number`,loc:e.start,value:e};break}case 130:{let e=this.parseStringLiteral(this.state.value);if(t())return{type:`string`,loc:e.start,value:e};break}case 81:case 82:{let e=this.parseBooleanLiteral(this.match(81));if(t())return{type:`boolean`,loc:e.start,value:e}}}return{type:`invalid`,loc:e}}flowEnumMemberRaw(){let e=this.state.startLoc;return{id:this.parseIdentifier(!0),init:this.eat(25)?this.flowEnumMemberInit():{type:`none`,loc:e}}}flowEnumCheckExplicitTypeMismatch(e,t,n){let{explicitType:r}=t;r!==null&&r!==n&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let n=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},i=!1;for(;!this.match(4);){if(this.eat(17)){i=!0;break}let a=this.startNode(),{id:o,init:s}=this.flowEnumMemberRaw(),c=o.name;if(c===``)continue;/^[a-z]/.test(c)&&this.raise(Y.EnumInvalidMemberName,o,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),n.has(c)&&this.raise(Y.EnumDuplicateMemberName,o,{memberName:c,enumName:e}),n.add(c);let l={enumName:e,explicitType:t,memberName:c};switch(a.id=o,s.type){case`boolean`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`boolean`),a.init=s.value,r.booleanMembers.push(this.finishNode(a,`EnumBooleanMember`));break;case`number`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`number`),a.init=s.value,r.numberMembers.push(this.finishNode(a,`EnumNumberMember`));break;case`string`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`string`),a.init=s.value,r.stringMembers.push(this.finishNode(a,`EnumStringMember`));break;case`invalid`:throw this.flowEnumErrorInvalidMemberInitializer(s.loc,l);case`none`:switch(t){case`boolean`:this.flowEnumErrorBooleanMemberNotInitialized(s.loc,l);break;case`number`:this.flowEnumErrorNumberMemberNotInitialized(s.loc,l);break;default:r.defaultedMembers.push(this.finishNode(a,`EnumDefaultedMember`))}}this.match(4)||this.expect(8)}return{members:r,hasUnknownMembers:i}}flowEnumStringMembers(e,t,{enumName:n}){if(e.length===0)return t;if(t.length===0)return e;if(t.length>e.length){for(let t of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(t,{enumName:n});return t}else{for(let e of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:n});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(98))return null;if(!q(this.state.type))throw this.raise(Y.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!==`boolean`&&t!==`number`&&t!==`string`&&t!==`symbol`&&this.raise(Y.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let n=t.name,r=t.start,i=this.flowEnumParseExplicitType({enumName:n});this.expect(2);let{members:a,hasUnknownMembers:o}=this.flowEnumMembers({enumName:n,explicitType:i});switch(e.hasUnknownMembers=o,i){case`boolean`:return e.explicitType=!0,e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`);case`number`:return e.explicitType=!0,e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`);case`string`:return e.explicitType=!0,e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);case`symbol`:return e.members=a.defaultedMembers,this.expect(4),this.finishNode(e,`EnumSymbolBody`);default:{let t=()=>(e.members=[],this.expect(4),this.finishNode(e,`EnumStringBody`));e.explicitType=!1;let i=a.booleanMembers.length,o=a.numberMembers.length,s=a.stringMembers.length,c=a.defaultedMembers.length;if(!i&&!o&&!s&&!c)return t();if(!i&&!o)return e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);if(!o&&!s&&i>=c){for(let e of a.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`)}else if(!i&&!s&&o>=c){for(let e of a.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`)}else return this.raise(Y.EnumInconsistentMemberValues,r,{enumName:n}),t()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,`EnumDeclaration`)}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(43)||this.match(47))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let t=this.input.charCodeAt(e+1);return t!==60&&t!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}maybeUnwrapTypeCastExpression(e){return e.type===`TypeCastExpression`?e.expression:e}},ta={__proto__:null,quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`},na=RegExp(`\\r\\n|[\\r\\n\\u2028\\u2029]`,`g`);function ra(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function ia(e,t,n){for(let r=t;r<n;r++)if(ra(e.charCodeAt(r)))return!0;return!1}const aa=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,oa=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function sa(e){switch(e){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}}const ca=Wr`jsx`({AttributeIsEmpty:`JSX attributes must only be assigned a non-empty expression.`,MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,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:e,HTMLEntity:t})=>`Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,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 la(e){return e?e.type===`JSXOpeningFragment`||e.type===`JSXClosingFragment`:!1}function ua(e){if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return ua(e.object)+`.`+ua(e.property);throw Error(`Node had unexpected type: `+e.type)}const da=e=>class extends e{jsxReadToken(){let e=``,t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(ca.UnterminatedJsxContent,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:if(this.state.pos===this.state.start){n===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(138)):super.getTokenFromCode(n);return}e+=this.input.slice(t,this.state.pos),this.finishToken(137,e);return;case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:this.raise(ca.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:n===125?`}`:`>`});default:ra(n)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t=this.input.charCodeAt(this.state.pos),n;return++this.state.pos,t===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,n=e?`
|
|
7
7
|
`:`\r
|
|
8
|
-
`):n=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,n}jsxReadString(e){let t=``,n=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(H.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadEntity(),n=this.state.pos):ra(r)?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}t+=this.input.slice(n,this.state.pos++),this.finishToken(130,t)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let e=10;this.codePointAtPos(this.state.pos)===120&&(e=16,++this.state.pos);let t=this.readInt(e,void 0,!1,`bail`);if(t!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(t)}else{let t=0,n=!1;for(;t++<10&&this.state.pos<this.length&&!(n=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(n){let t=ta[this.input.slice(e,this.state.pos)];if(++this.state.pos,t)return t}}return this.state.pos=e,`&`}jsxReadWord(){let e,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(ji(e)||e===45);this.finishToken(136,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(136)?e.name=this.state.value:pi(this.state.type)?e.name=yi(this.state.type):this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsxParseNamespacedName(){let e=this.state.startLoc,t=this.jsxParseIdentifier();if(!this.eat(10))return t;let n=this.startNodeAt(e);return n.namespace=t,n.name=this.jsxParseIdentifier(),this.finishNode(n,`JSXNamespacedName`)}jsxParseElementName(){let e=this.state.startLoc,t=this.jsxParseNamespacedName();if(t.type===`JSXNamespacedName`)return t;for(;this.eat(12);){let n=this.startNodeAt(e);n.object=t,n.property=this.jsxParseIdentifier(),t=this.finishNode(n,`JSXMemberExpression`)}return t}jsxParseAttributeValue(){let e;switch(this.state.type){case 2:return e=this.startNode(),this.setContext(J.brace),this.next(),e=this.jsxParseExpressionContainer(e,J.j_oTag),e.expression.type===`JSXEmptyExpression`&&this.raise(ca.AttributeIsEmpty,e),e;case 138:case 130:return this.parseExprAtom();default:throw this.raise(ca.UnsupportedJsxValue,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(J.j_expr),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadChild`)}jsxParseExpressionContainer(e,t){if(this.match(4))e.expression=this.jsxParseEmptyExpression();else{var n;let t=this.parseExpression();t.type===`SequenceExpression`&&!((n=t.extra)!=null&&n.parenthesized)&&this.raise(ca.UnexpectedSequenceExpression,t.expressions[1]),e.expression=t}return this.setContext(t),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXExpressionContainer`)}jsxParseAttribute(){if(this.match(2)){let e=this.startNode();return this.setContext(J.brace),this.next(),this.expect(17),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(J.j_oTag),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadAttribute`)}let e=this.startNode();return e.name=this.jsxParseNamespacedName(),e.value=this.eat(25)?this.jsxParseAttributeValue():null,this.finishNode(e,`JSXAttribute`)}jsxParseOpeningElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXOpeningFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t)}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(52)&&!this.match(139);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(52),this.expect(139),this.finishNode(e,`JSXOpeningElement`)}jsxParseClosingElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXClosingFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.expect(139),this.finishNode(t,`JSXClosingElement`)}jsxParseElementAt(e){let t=this.startNodeAt(e),n=[],r=this.jsxParseOpeningElementAt(e),i=null;if(!r.selfClosing){contents:for(;;)switch(this.state.type){case 138:if(e=this.state.startLoc,this.next(),this.eat(52)){this.setLoc(e),i=this.jsxParseClosingElementAt(e);break contents}n.push(this.jsxParseElementAt(e));break;case 137:n.push(this.parseLiteral(this.state.value,`JSXText`));break;case 2:{let e=this.startNode();this.setContext(J.brace),this.next(),this.match(17)?n.push(this.jsxParseSpreadChild(e)):n.push(this.jsxParseExpressionContainer(e,J.j_expr));break}default:this.unexpected()}la(r)&&!la(i)&&i!==null?this.raise(ca.MissingClosingTagFragment,i):(!la(r)&&la(i)||!la(r)&&!la(i)&&ua(i.name)!==ua(r.name))&&this.raise(ca.MissingClosingTagElement,i,{openingTagName:ua(r.name)})}if(la(r)?(t.openingFragment=r,t.closingFragment=i):(t.openingElement=r,t.closingElement=i),t.children=n,this.match(43))throw this.raise(ca.UnwrappedAdjacentJSXElements,this.state.startLoc);return la(r)?this.finishNode(t,`JSXFragment`):this.finishNode(t,`JSXElement`)}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:t}=this.state;t[t.length-1]=e}parseExprAtom(e){return this.match(138)?this.jsxParseElement():this.match(43)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(138),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===J.j_expr){this.jsxReadToken();return}if(t===J.j_oTag||t===J.j_cTag){if(Ai(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(139);return}if((e===34||e===39)&&t===J.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(138);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:n}=this.state;if(n===52&&e===138)t.splice(-2,2,J.j_cTag),this.state.canStartJSXElement=!1;else if(n===138)t.push(J.j_oTag);else if(n===139){let n=t[t.length-1];n===J.j_oTag&&e===52||n===J.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===J.j_expr):(this.setContext(J.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=ci(n)}};var fa=class extends Wi{constructor(...e){super(...e),r(this,`tsNames`,new Map)}},pa=class extends Gi{constructor(...e){super(...e),r(this,`importsStack`,[])}get inTSNamespace(){let e=this.scopeStack;return e.length>=2&&e[e.length-1].flags===0&&(e[e.length-2].flags&2048)>0}createScope(e){return this.importsStack.push(new Set),new fa(e)}enter(e){e&3072&&this.importsStack.push(new Set),super.enter(e)}exit(){let e=super.exit();return e&3072&&this.importsStack.pop(),e}hasImport(e,t){let n=this.importsStack.length;if(this.importsStack[n-1].has(e))return!0;if(!t&&n>1){for(let t=0;t<n-1;t++)if(this.importsStack[t].has(e))return!0}return!1}declareName(e,t,n){if(t&4096){this.hasImport(e,!0)&&this.parser.raise(H.VarRedeclaration,n,{identifierName:e}),this.importsStack[this.importsStack.length-1].add(e);return}let r=this.currentScope(),i=r.tsNames.get(e)||0;if(t&1024){this.maybeExportDefined(r,e),r.tsNames.set(e,i|16);return}super.declareName(e,t,n),t&2&&(t&1||(this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e)),i|=1),t&256&&(i|=2),t&512&&(i|=4),t&128&&(i|=8),i&&r.tsNames.set(e,i)}isRedeclaredInScope(e,t,n){let r=e.tsNames.get(t);return(r&2)>0?n&256?(n&512)>0!=(r&4)>0:!0:n&128&&(r&8)>0?e.names.get(t)&2?!!(n&1):!1:n&2&&(r&1)>0?!0:super.isRedeclaredInScope(e,t,n)}checkLocalExport(e){let{name:t}=e;if(this.hasImport(t))return;let n=this.scopeStack.length;for(let e=n-1;e>=0;e--){let n=this.scopeStack[e].tsNames.get(t);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(e)}},ma=class{constructor(){r(this,`sawUnambiguousESM`,!1),r(this,`ambiguousScriptDifferentAst`,!1)}sourceToOffsetPos(e){return e+this.startIndex}offsetToSourcePos(e){return e-this.startIndex}hasPlugin(e){if(typeof e==`string`)return this.plugins.has(e);{let[t,n]=e;if(!this.hasPlugin(t))return!1;let r=this.plugins.get(t);for(let e of Object.keys(n))if((r==null?void 0:r[e])!==n[e])return!1;return!0}}getPluginOption(e,t){var n;return(n=this.plugins.get(e))==null?void 0:n[t]}};function ha(e,t){e.trailingComments===void 0?e.trailingComments=t:e.trailingComments.unshift(...t)}function ga(e,t){e.leadingComments===void 0?e.leadingComments=t:e.leadingComments.unshift(...t)}function _a(e,t){e.innerComments===void 0?e.innerComments=t:e.innerComments.unshift(...t)}function va(e,t,n){let r=null,i=t.length;for(;r===null&&i>0;)r=t[--i];r===null||r.start>n.start?_a(e,n.comments):ha(r,n.comments)}var ya=class extends ma{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:t}=this.state,n=t.length;if(n===0)return;let r=n-1,i=t[r];i.start===e.end&&(i.leadingNode=e,r--);let a=e.start;for(;r>=0;r--){let n=t[r],i=n.end;if(i>a)n.containingNode=e,this.finalizeComment(n),t.splice(r,1);else{i===a&&(n.trailingNode=e);break}}}finalizeComment(e){let{comments:t}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&ha(e.leadingNode,t),e.trailingNode!==null&&ga(e.trailingNode,t);else{let r=e.containingNode,i=e.start;if(this.input.charCodeAt(this.offsetToSourcePos(i)-1)===44)switch(r.type){case`ObjectExpression`:case`ObjectPattern`:va(r,r.properties,e);break;case`CallExpression`:case`NewExpression`:case`OptionalCallExpression`:va(r,r.arguments,e);break;case`ImportExpression`:var n;va(r,[r.source,(n=r.options)==null?null:n],e);break;case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`ObjectMethod`:case`ClassMethod`:case`ClassPrivateMethod`:case`TSTypeParameterDeclaration`:va(r,r.params,e);break;case`ArrayExpression`:case`ArrayPattern`:va(r,r.elements,e);break;case`ExportNamedDeclaration`:case`ImportDeclaration`:va(r,r.specifiers,e);break;case`TSEnumBody`:va(r,r.members,e);break;case`TSInterfaceBody`:va(r,r.body,e);break;default:_a(r,t)}else _a(r,t)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let t=e.length-1;t>=0;t--)this.finalizeComment(e[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:t}=this.state,{length:n}=t;if(n===0)return;let r=t[n-1];r.leadingNode===e&&(r.leadingNode=null)}takeSurroundingComments(e,t,n){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let i=r[a],o=i.end;if(i.start===n)i.leadingNode=e;else if(o===t)i.trailingNode=e;else if(o<t)break}}},ba=class e{constructor(){r(this,`flags`,2048),r(this,`startIndex`,void 0),r(this,`curLine`,void 0),r(this,`lineStart`,void 0),r(this,`startLoc`,void 0),r(this,`endLoc`,void 0),r(this,`errors`,[]),r(this,`noArrowAt`,[]),r(this,`noArrowParamsConversionAt`,[]),r(this,`labels`,[]),r(this,`commentsLen`,0),r(this,`commentStack`,[]),r(this,`pos`,0),r(this,`type`,135),r(this,`value`,null),r(this,`start`,0),r(this,`end`,0),r(this,`lastTokEndLoc`,null),r(this,`lastTokStartLoc`,null),r(this,`context`,[J.brace]),r(this,`firstInvalidTemplateEscapePos`,null),r(this,`strictErrors`,new Map),r(this,`tokensLength`,0)}get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:t,startIndex:n,startLine:r,startColumn:i}){this.strict=e===!1?!1:e===!0?!0:t===`module`,this.startIndex=n,this.curLine=r,this.lineStart=-i,this.startLoc=this.endLoc=new V(r,i,n)}get canStartArrow(){return(this.flags&2)>0}set canStartArrow(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get inConditionalConsequent(){return(this.flags&256)>0}set inConditionalConsequent(e){e?this.flags|=256:this.flags&=-257}get inHackPipelineBody(){return(this.flags&512)>0}set inHackPipelineBody(e){e?this.flags|=512:this.flags&=-513}get seenTopicReference(){return(this.flags&1024)>0}set seenTopicReference(e){e?this.flags|=1024:this.flags&=-1025}get canStartJSXElement(){return(this.flags&2048)>0}set canStartJSXElement(e){e?this.flags|=2048:this.flags&=-2049}get containsEsc(){return(this.flags&4096)>0}set containsEsc(e){e?this.flags|=4096:this.flags&=-4097}get hasTopLevelAwait(){return(this.flags&8192)>0}set hasTopLevelAwait(e){e?this.flags|=8192:this.flags&=-8193}curPosition(){return new V(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new e;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},xa=function(e){return e>=48&&e<=57};const Sa={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Ca={bin:e=>e===48||e===49,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function wa(e,t,n,r,i,a){let o=n,s=r,c=i,l=``,u=null,d=n,{length:f}=t;for(;;){if(n>=f){a.unterminated(o,s,c),l+=t.slice(d,n);break}let p=t.charCodeAt(n);if(Ta(e,p,t,n)){l+=t.slice(d,n);break}if(p===92){l+=t.slice(d,n);let o=Ea(t,n,r,i,e===`template`,a);o.ch===null&&!u?u={pos:n,lineStart:r,curLine:i}:l+=o.ch,{pos:n,lineStart:r,curLine:i}=o,d=n}else p===8232||p===8233?(++n,++i,r=n):p===10||p===13?e===`template`?(l+=t.slice(d,n)+`
|
|
8
|
+
`):n=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,n}jsxReadString(e){let t=``,n=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(H.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadEntity(),n=this.state.pos):ra(r)?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}t+=this.input.slice(n,this.state.pos++),this.finishToken(130,t)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let e=10;this.codePointAtPos(this.state.pos)===120&&(e=16,++this.state.pos);let t=this.readInt(e,void 0,!1,`bail`);if(t!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(t)}else{let t=0,n=!1;for(;t++<10&&this.state.pos<this.length&&!(n=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(n){let t=ta[this.input.slice(e,this.state.pos)];if(++this.state.pos,t)return t}}return this.state.pos=e,`&`}jsxReadWord(){let e,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(ji(e)||e===45);this.finishToken(136,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(136)?e.name=this.state.value:pi(this.state.type)?e.name=yi(this.state.type):this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsxParseNamespacedName(){let e=this.state.startLoc,t=this.jsxParseIdentifier();if(!this.eat(10))return t;let n=this.startNodeAt(e);return n.namespace=t,n.name=this.jsxParseIdentifier(),this.finishNode(n,`JSXNamespacedName`)}jsxParseElementName(){let e=this.state.startLoc,t=this.jsxParseNamespacedName();if(t.type===`JSXNamespacedName`)return t;for(;this.eat(12);){let n=this.startNodeAt(e);n.object=t,n.property=this.jsxParseIdentifier(),t=this.finishNode(n,`JSXMemberExpression`)}return t}jsxParseAttributeValue(){let e;switch(this.state.type){case 2:return e=this.startNode(),this.setContext(J.brace),this.next(),e=this.jsxParseExpressionContainer(e,J.j_oTag),e.expression.type===`JSXEmptyExpression`&&this.raise(ca.AttributeIsEmpty,e),e;case 138:case 130:return this.parseExprAtom();default:throw this.raise(ca.UnsupportedJsxValue,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(J.j_expr),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadChild`)}jsxParseExpressionContainer(e,t){if(this.match(4))e.expression=this.jsxParseEmptyExpression();else{var n;let t=this.parseExpression();t.type===`SequenceExpression`&&!((n=t.extra)!=null&&n.parenthesized)&&this.raise(ca.UnexpectedSequenceExpression,t.expressions[1]),e.expression=t}return this.setContext(t),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXExpressionContainer`)}jsxParseAttribute(){if(this.match(2)){let e=this.startNode();return this.setContext(J.brace),this.next(),this.expect(17),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(J.j_oTag),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadAttribute`)}let e=this.startNode();return e.name=this.jsxParseNamespacedName(),e.value=this.eat(25)?this.jsxParseAttributeValue():null,this.finishNode(e,`JSXAttribute`)}jsxParseOpeningElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXOpeningFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t)}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(52)&&!this.match(139);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(52),this.expect(139),this.finishNode(e,`JSXOpeningElement`)}jsxParseClosingElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXClosingFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.expect(139),this.finishNode(t,`JSXClosingElement`)}jsxParseElementAt(e){let t=this.startNodeAt(e),n=[],r=this.jsxParseOpeningElementAt(e),i=null;if(!r.selfClosing){contents:for(;;)switch(this.state.type){case 138:if(e=this.state.startLoc,this.next(),this.eat(52)){this.setLoc(e),i=this.jsxParseClosingElementAt(e);break contents}n.push(this.jsxParseElementAt(e));break;case 137:n.push(this.parseLiteral(this.state.value,`JSXText`));break;case 2:{let e=this.startNode();this.setContext(J.brace),this.next(),this.match(17)?n.push(this.jsxParseSpreadChild(e)):n.push(this.jsxParseExpressionContainer(e,J.j_expr));break}default:this.unexpected()}la(r)&&!la(i)&&i!==null?this.raise(ca.MissingClosingTagFragment,i):(!la(r)&&la(i)||!la(r)&&!la(i)&&ua(i.name)!==ua(r.name))&&this.raise(ca.MissingClosingTagElement,i,{openingTagName:ua(r.name)})}if(la(r)?(t.openingFragment=r,t.closingFragment=i):(t.openingElement=r,t.closingElement=i),t.children=n,this.match(43))throw this.raise(ca.UnwrappedAdjacentJSXElements,this.state.startLoc);return la(r)?this.finishNode(t,`JSXFragment`):this.finishNode(t,`JSXElement`)}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:t}=this.state;t[t.length-1]=e}parseExprAtom(e){return this.match(138)?this.jsxParseElement():this.match(43)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(138),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===J.j_expr){this.jsxReadToken();return}if(t===J.j_oTag||t===J.j_cTag){if(Ai(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(139);return}if((e===34||e===39)&&t===J.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(138);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:n}=this.state;if(n===52&&e===138)t.splice(-2,2,J.j_cTag),this.state.canStartJSXElement=!1;else if(n===138)t.push(J.j_oTag);else if(n===139){let n=t[t.length-1];n===J.j_oTag&&e===52||n===J.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===J.j_expr):(this.setContext(J.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=ci(n)}};var fa=class extends Wi{constructor(...e){super(...e),r(this,`tsNames`,new Map)}},pa=class extends Gi{constructor(...e){super(...e),r(this,`importsStack`,[])}get inTSNamespace(){let e=this.scopeStack;return e.length>=2&&e[e.length-1].flags===0&&(e[e.length-2].flags&2048)>0}createScope(e){return this.importsStack.push(new Set),new fa(e)}enter(e){e&3072&&this.importsStack.push(new Set),super.enter(e)}exit(){let e=super.exit();return e&3072&&this.importsStack.pop(),e}hasImport(e,t){let n=this.importsStack.length;if(this.importsStack[n-1].has(e))return!0;if(!t&&n>1){for(let t=0;t<n-1;t++)if(this.importsStack[t].has(e))return!0}return!1}declareName(e,t,n){if(t&4096){this.hasImport(e,!0)&&this.parser.raise(H.VarRedeclaration,n,{identifierName:e}),this.importsStack[this.importsStack.length-1].add(e);return}let r=this.currentScope(),i=r.tsNames.get(e)||0;if(t&1024){this.maybeExportDefined(r,e),r.tsNames.set(e,i|16);return}super.declareName(e,t,n),t&2&&(t&1||(this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e)),i|=1),t&256&&(i|=2),t&512&&(i|=4),t&128&&(i|=8),i&&r.tsNames.set(e,i)}isRedeclaredInScope(e,t,n){let r=e.tsNames.get(t);return(r&2)>0?n&256?(n&512)>0!=(r&4)>0:!0:n&128&&(r&8)>0?e.names.get(t)&2?!!(n&1):!1:n&2&&(r&1)>0?!0:super.isRedeclaredInScope(e,t,n)}checkLocalExport(e){let{name:t}=e;if(this.hasImport(t))return;let n=this.scopeStack.length;for(let e=n-1;e>=0;e--){let n=this.scopeStack[e].tsNames.get(t);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(e)}},ma=class{constructor(){r(this,`sawUnambiguousESM`,!1),r(this,`ambiguousScriptDifferentAst`,!1)}sourceToOffsetPos(e){return e+this.startIndex}offsetToSourcePos(e){return e-this.startIndex}hasPlugin(e){if(typeof e==`string`)return this.plugins.has(e);{let[t,n]=e;if(!this.hasPlugin(t))return!1;let r=this.plugins.get(t);for(let e of Object.keys(n))if((r==null?void 0:r[e])!==n[e])return!1;return!0}}getPluginOption(e,t){var n;return(n=this.plugins.get(e))==null?void 0:n[t]}};function ha(e,t){e.trailingComments===void 0?e.trailingComments=t:e.trailingComments.unshift(...t)}function ga(e,t){e.leadingComments===void 0?e.leadingComments=t:e.leadingComments.unshift(...t)}function _a(e,t){e.innerComments===void 0?e.innerComments=t:e.innerComments.unshift(...t)}function va(e,t,n){let r=null,i=t.length;for(;r===null&&i>0;)r=t[--i];r===null||r.start>n.start?_a(e,n.comments):ha(r,n.comments)}var ya=class extends ma{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:t}=this.state,n=t.length;if(n===0)return;let r=n-1,i=t[r];i.start===e.end&&(i.leadingNode=e,r--);let a=e.start;for(;r>=0;r--){let n=t[r],i=n.end;if(i>a)n.containingNode=e,this.finalizeComment(n),t.splice(r,1);else{i===a&&(n.trailingNode=e);break}}}finalizeComment(e){let{comments:t}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&ha(e.leadingNode,t),e.trailingNode!==null&&ga(e.trailingNode,t);else{let r=e.containingNode,i=e.start;if(this.input.charCodeAt(this.offsetToSourcePos(i)-1)===44)switch(r.type){case`ObjectExpression`:case`ObjectPattern`:va(r,r.properties,e);break;case`CallExpression`:case`NewExpression`:case`OptionalCallExpression`:va(r,r.arguments,e);break;case`ImportExpression`:var n;va(r,[r.source,(n=r.options)==null?null:n],e);break;case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`ObjectMethod`:case`ClassMethod`:case`ClassPrivateMethod`:case`TSTypeParameterDeclaration`:va(r,r.params,e);break;case`ArrayExpression`:case`ArrayPattern`:va(r,r.elements,e);break;case`ExportNamedDeclaration`:case`ImportDeclaration`:va(r,r.specifiers,e);break;case`TSEnumBody`:va(r,r.members,e);break;case`TSInterfaceBody`:va(r,r.body,e);break;default:_a(r,t)}else _a(r,t)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let t=e.length-1;t>=0;t--)this.finalizeComment(e[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:t}=this.state,{length:n}=t;if(n===0)return;let r=t[n-1];r.leadingNode===e&&(r.leadingNode=null)}takeSurroundingComments(e,t,n){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let i=r[a],o=i.end;if(i.start===n)i.leadingNode=e;else if(o===t)i.trailingNode=e;else if(o<t)break}}},ba=class e{constructor(){r(this,`flags`,2048),r(this,`startIndex`,void 0),r(this,`curLine`,void 0),r(this,`lineStart`,void 0),r(this,`startLoc`,void 0),r(this,`endLoc`,void 0),r(this,`errors`,[]),r(this,`noArrowAt`,[]),r(this,`noArrowParamsConversionAt`,[]),r(this,`labels`,[]),r(this,`commentsLen`,0),r(this,`commentStack`,[]),r(this,`pos`,0),r(this,`type`,135),r(this,`value`,null),r(this,`start`,0),r(this,`end`,0),r(this,`lastTokEndLoc`,null),r(this,`lastTokStartLoc`,null),r(this,`context`,[J.brace]),r(this,`firstInvalidTemplateEscapePos`,null),r(this,`strictErrors`,new Map),r(this,`tokensLength`,0)}get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:t,startIndex:n,startLine:r,startColumn:i}){this.strict=e===!1?!1:e===!0?!0:t===`module`,this.startIndex=n,this.curLine=r,this.lineStart=-i,this.startLoc=this.endLoc=new B(r,i,n)}get canStartArrow(){return(this.flags&2)>0}set canStartArrow(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get inConditionalConsequent(){return(this.flags&256)>0}set inConditionalConsequent(e){e?this.flags|=256:this.flags&=-257}get inHackPipelineBody(){return(this.flags&512)>0}set inHackPipelineBody(e){e?this.flags|=512:this.flags&=-513}get seenTopicReference(){return(this.flags&1024)>0}set seenTopicReference(e){e?this.flags|=1024:this.flags&=-1025}get canStartJSXElement(){return(this.flags&2048)>0}set canStartJSXElement(e){e?this.flags|=2048:this.flags&=-2049}get containsEsc(){return(this.flags&4096)>0}set containsEsc(e){e?this.flags|=4096:this.flags&=-4097}get hasTopLevelAwait(){return(this.flags&8192)>0}set hasTopLevelAwait(e){e?this.flags|=8192:this.flags&=-8193}curPosition(){return new B(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new e;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},xa=function(e){return e>=48&&e<=57};const Sa={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Ca={bin:e=>e===48||e===49,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function wa(e,t,n,r,i,a){let o=n,s=r,c=i,l=``,u=null,d=n,{length:f}=t;for(;;){if(n>=f){a.unterminated(o,s,c),l+=t.slice(d,n);break}let p=t.charCodeAt(n);if(Ta(e,p,t,n)){l+=t.slice(d,n);break}if(p===92){l+=t.slice(d,n);let o=Ea(t,n,r,i,e===`template`,a);o.ch===null&&!u?u={pos:n,lineStart:r,curLine:i}:l+=o.ch,{pos:n,lineStart:r,curLine:i}=o,d=n}else p===8232||p===8233?(++n,++i,r=n):p===10||p===13?e===`template`?(l+=t.slice(d,n)+`
|
|
9
9
|
`,++n,p===13&&t.charCodeAt(n)===10&&++n,++i,d=r=n):a.unterminated(o,s,c):++n}return{pos:n,str:l,firstInvalidLoc:u,lineStart:r,curLine:i}}function Ta(e,t,n,r){return e===`template`?t===96||t===36&&n.charCodeAt(r+1)===123:t===(e===`double`?34:39)}function Ea(e,t,n,r,i,a){let o=!i;t++;let s=e=>({pos:t,ch:e,lineStart:n,curLine:r}),c=e.charCodeAt(t++);switch(c){case 110:return s(`
|
|
10
|
-
`);case 114:return s(`\r`);case 120:{let i;return{code:i,pos:t}=Da(e,t,n,r,2,!1,o,a),s(i===null?null:String.fromCharCode(i))}case 117:{let i;return{code:i,pos:t}=ka(e,t,n,r,o,a),s(i===null?null:String.fromCodePoint(i))}case 116:return s(` `);case 98:return s(`\b`);case 118:return s(`\v`);case 102:return s(`\f`);case 13:e.charCodeAt(t)===10&&++t;case 10:n=t,++r;case 8232:case 8233:return s(``);case 56:case 57:if(i)return s(null);a.strictNumericEscape(t-1,n,r);default:if(c>=48&&c<=55){let o=t-1,c=/^[0-7]+/.exec(e.slice(o,t+2))[0],l=parseInt(c,8);l>255&&(c=c.slice(0,-1),l=parseInt(c,8)),t+=c.length-1;let u=e.charCodeAt(t);if(c!==`0`||u===56||u===57){if(i)return s(null);a.strictNumericEscape(o,n,r)}return s(String.fromCharCode(l))}return s(String.fromCharCode(c))}}function Da(e,t,n,r,i,a,o,s){let c=t,l;return{n:l,pos:t}=Oa(e,t,n,r,16,i,a,!1,s,!o),l===null&&(o?s.invalidEscapeSequence(c,n,r):t=c-1),{code:l,pos:t}}function Oa(e,t,n,r,i,a,o,s,c,l){let u=t,d=i===16?Sa.hex:Sa.decBinOct,f=i===16?Ca.hex:i===10?Ca.dec:i===8?Ca.oct:Ca.bin,p=!1,m=0;for(let u=0,ee=a==null?1/0:a;u<ee;++u){let a=e.charCodeAt(t),u;if(a===95&&s!==`bail`){let i=e.charCodeAt(t-1),a=e.charCodeAt(t+1);if(!s){if(l)return{n:null,pos:t};c.numericSeparatorInEscapeSequence(t,n,r)}else if(Number.isNaN(a)||!f(a)||d.has(i)||d.has(a)){if(l)return{n:null,pos:t};c.unexpectedNumericSeparator(t,n,r)}++t;continue}if(u=a>=97?a-97+10:a>=65?a-65+10:xa(a)?a-48:1/0,u>=i){if(u<=9&&l)return{n:null,pos:t};if(u<=9&&c.invalidDigit(t,n,r,i))u=0;else if(o)u=0,p=!0;else break}++t,m=m*i+u}return t===u||a!=null&&t-u!==a||p?{n:null,pos:t}:{n:m,pos:t}}function ka(e,t,n,r,i,a){let o=e.charCodeAt(t),s;if(o===123){if(++t,{code:s,pos:t}=Da(e,t,n,r,e.indexOf(`}`,t)-t,!0,i,a),++t,s!==null&&s>1114111)if(i)a.invalidCodePoint(t,n,r);else return{code:null,pos:t}}else({code:s,pos:t}=Da(e,t,n,r,4,!1,i,a));return{code:s,pos:t}}function Aa(e,t,n){return new V(n,e-t,e)}const ja=new Set([103,109,115,105,121,117,100,118]);var Ma=class{constructor(e){let t=e.startIndex||0;this.type=e.type,this.value=e.value,this.start=t+e.start,this.end=t+e.end,this.loc=new Ar(e.startLoc,e.endLoc)}};let Na;var Pa=class extends ya{constructor(e,t){super(),r(this,`isLookahead`,void 0),r(this,`tokens`,[]),r(this,`errorHandlers_readInt`,{invalidDigit:(e,t,n,r)=>this.optionFlags&4096?(this.raise(H.InvalidDigit,Aa(e,t,n),{radix:r}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(H.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(H.UnexpectedNumericSeparator)}),r(this,`errorHandlers_readCodePoint`,a(a({},this.errorHandlers_readInt),{},{invalidEscapeSequence:this.errorBuilder(H.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(H.InvalidCodePoint)})),r(this,`errorHandlers_readStringContents_string`,a(a({},this.errorHandlers_readCodePoint),{},{strictNumericEscape:(e,t,n)=>{this.recordStrictModeErrors(H.StrictNumericEscape,Aa(e,t,n))},unterminated:(e,t,n)=>{throw this.raise(H.UnterminatedString,Aa(e-1,t,n))}})),r(this,`errorHandlers_readStringContents_template`,a(a({},this.errorHandlers_readCodePoint),{},{strictNumericEscape:this.errorBuilder(H.StrictNumericEscape),unterminated:(e,t,n)=>{throw this.raise(H.UnterminatedTemplate,Aa(e,t,n))}})),this.state=new ba,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1,(!Na||Na.length<(this.length+1)*2)&&(Na=new Uint32Array((this.length+1)*2)),this.locData=Na}setLoc(e){let t=this.offsetToSourcePos(e.index);this.locData[t*2]=e.line,this.locData[t*2+1]=e.column}getLoc(e){let t=this.offsetToSourcePos(e);return new V(this.locData[t*2],this.locData[t*2+1],e)}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&512&&this.pushToken(new Ma(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return this.match(e)?(this.next(),!0):!1}match(e){return this.state.type===e}createLookaheadState(e){return{pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){let e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let t=this.state;return this.state=e,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return aa.lastIndex=e,aa.test(this.input)?aa.lastIndex:e}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(e){return this.input.charCodeAt(this.nextTokenStartSince(e))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return oa.lastIndex=e,oa.test(this.input)?oa.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let t=this.input.charCodeAt(e);if((t&64512)==55296&&++e<this.input.length){let n=this.input.charCodeAt(e);(n&64512)==56320&&(t=65536+((t&1023)<<10)+(n&1023))}return t}setStrict(e){this.state.strict=e,e&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,t)),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(135);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(e){let t;this.isLookahead||(t=this.state.curPosition());let n=this.state.pos,r=this.input.indexOf(e,n+2);if(r===-1)throw this.raise(H.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+e.length,na.lastIndex=n+2;na.test(this.input)&&na.lastIndex<=r;)++this.state.curLine,this.state.lineStart=na.lastIndex;if(this.isLookahead)return;let i={type:`CommentBlock`,value:this.input.slice(n+2,r),start:this.sourceToOffsetPos(n),end:this.sourceToOffsetPos(r+e.length),loc:new Ar(t,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(i),i}skipLineComment(e){let t=this.state.pos,n;this.isLookahead||(n=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=e);if(this.state.pos<this.length)for(;!ra(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let i=this.state.pos,a={type:`CommentLine`,value:this.input.slice(t+e,i),start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(i),loc:new Ar(n,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(a),a}skipSpace(){let e=this.state.pos,t=this.optionFlags&8192?[]:null;loop:for(;this.state.pos<this.length;){let n=this.input.charCodeAt(this.state.pos);switch(n){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 e=this.skipBlockComment(`*/`);e!==void 0&&(this.addComment(e),t==null||t.push(e));break}case 47:{let e=this.skipLineComment(2);e!==void 0&&(this.addComment(e),t==null||t.push(e));break}default:break loop}break;default:if(sa(n))++this.state.pos;else if(n===45&&!this.inModule&&this.optionFlags&16384){let n=this.state.pos;if(this.input.charCodeAt(n+1)===45&&this.input.charCodeAt(n+2)===62&&(e===0||this.state.lineStart>e)){let e=this.skipLineComment(3);e!==void 0&&(this.addComment(e),t==null||t.push(e))}else break loop}else if(n===60&&!this.inModule&&this.optionFlags&16384){let e=this.state.pos;if(this.input.charCodeAt(e+1)===33&&this.input.charCodeAt(e+2)===45&&this.input.charCodeAt(e+3)===45){let e=this.skipLineComment(4);e!==void 0&&(this.addComment(e),t==null||t.push(e))}else break loop}else break loop}}if((t==null?void 0:t.length)>0){let n=this.state.pos,r={start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(n),comments:t,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let n=this.state.type;this.state.type=e,this.state.value=t,this.isLookahead||this.updateContext(n)}replaceToken(e){this.state.type=e,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let e=this.state.pos+1,t=this.codePointAtPos(e);if(t>=48&&t<=57)throw this.raise(H.UnexpectedDigitAfterHash,this.state.curPosition());Ai(t)?(++this.state.pos,this.finishToken(134,this.readWord1(t))):t===92?(++this.state.pos,this.finishToken(134,this.readWord1())):this.finishOp(23,1)}readToken_dot(){let e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57){this.readNumber(!0);return}e===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(17)):(++this.state.pos,this.finishToken(12))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(27,2):this.finishOp(52,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let e=this.input.charCodeAt(this.state.pos+1);if(e!==33)return!1;let t=this.state.pos;for(this.state.pos+=1;!ra(e)&&++this.state.pos<this.length;)e=this.input.charCodeAt(this.state.pos);let n=this.input.slice(t+2,this.state.pos);return this.finishToken(24,n),!0}readToken_mult_modulo(e){let t=e===42?51:50,n=1,r=this.input.charCodeAt(this.state.pos+1);e===42&&r===42&&(n++,r=this.input.charCodeAt(this.state.pos+2),t=53),r===61&&!this.state.inType&&(n++,t=e===37?29:26),this.finishOp(t,n)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(26,3):this.finishOp(e===124?37:38,2);return}if(e===124&&t===62){this.finishOp(35,2);return}if(t===61){this.finishOp(26,2);return}this.finishOp(e===124?39:41,1)}readToken_caret(){let e=this.input.charCodeAt(this.state.pos+1);e===61&&!this.state.inType?this.finishOp(28,2):e===94&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`^^`}])?(this.finishOp(33,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(40,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`@@`}])?this.finishOp(34,2):this.finishOp(22,1)}readToken_plus_min(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.finishOp(30,2);return}t===61?this.finishOp(26,2):this.finishOp(49,1)}readToken_lt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===60){if(this.input.charCodeAt(e+2)===61){this.finishOp(26,3);return}this.finishOp(47,2);return}if(t===61){this.finishOp(45,2);return}this.finishOp(43,1)}readToken_gt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===62){let t=this.input.charCodeAt(e+2)===62?3:2;if(this.input.charCodeAt(e+t)===61){this.finishOp(26,t+1);return}this.finishOp(48,t);return}if(t===61){this.finishOp(45,2);return}this.finishOp(44,1)}readToken_eq_excl(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===61){this.finishOp(42,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(e===61&&t===62){this.state.pos+=2,this.finishToken(15);return}this.finishOp(e===61?25:31,1)}readToken_question(){let e=this.input.charCodeAt(this.state.pos+1),t=this.input.charCodeAt(this.state.pos+2);e===63?t===61?this.finishOp(26,3):this.finishOp(36,2):e===46&&!(t>=48&&t<=57)?(this.state.pos+=2,this.finishToken(14)):(++this.state.pos,this.finishToken(13))}getTokenFromCode(e){switch(e){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(6);return;case 41:++this.state.pos,this.finishToken(7);return;case 59:++this.state.pos,this.finishToken(9);return;case 44:++this.state.pos,this.finishToken(8);return;case 91:++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(1);return;case 123:++this.state.pos,this.finishToken(2);return;case 125:++this.state.pos,this.finishToken(4);return;case 58:this.hasPlugin(`functionBind`)&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(11,2):(++this.state.pos,this.finishToken(10));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(e);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(e);return;case 124:case 38:this.readToken_pipe_amp(e);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(e);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(e);return;case 126:this.finishOp(32,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(Ai(e)){this.readWord(e);return}}throw this.raise(H.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(e)})}finishOp(e,t){let n=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,n)}readRegexp(){let e=this.state.startLoc,t=this.state.start+1,n,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(H.UnterminatedRegExp,jr(e,1));let t=this.input.charCodeAt(i);if(ra(t))throw this.raise(H.UnterminatedRegExp,jr(e,1));if(n)n=!1;else{if(t===91)r=!0;else if(t===93&&r)r=!1;else if(t===47&&!r)break;n=t===92}}let a=this.input.slice(t,i);++i;let o=``,s=()=>jr(e,i+2-t);for(;i<this.length;){let e=this.codePointAtPos(i),t=String.fromCharCode(e);if(ja.has(e))e===118?o.includes(`u`)&&this.raise(H.IncompatibleRegExpUVFlags,s()):e===117&&o.includes(`v`)&&this.raise(H.IncompatibleRegExpUVFlags,s()),o.includes(t)&&this.raise(H.DuplicateRegExpFlags,s());else if(ji(e)||e===92)this.raise(H.MalformedRegExpFlags,s());else break;++i,o+=t}this.state.pos=i,this.finishToken(133,{pattern:a,flags:o})}readInt(e,t,n=!1,r=!0){let{n:i,pos:a}=Oa(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,t,n,r,this.errorHandlers_readInt,!1);return this.state.pos=a,i}readRadixNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1;this.state.pos+=2;let i=this.readInt(e);if(i==null&&this.raise(H.InvalidDigit,jr(n,2),{radix:e}),this.input.charCodeAt(this.state.pos)===110&&(++this.state.pos,r=!0),Ai(this.codePointAtPos(this.state.pos)))throw this.raise(H.NumberIdentifier,this.state.curPosition());if(r){let e=this.input.slice(t,this.state.pos).replace(/[_n]/g,``);this.finishToken(132,e);return}this.finishToken(131,i)}readNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1,i=!1,a=!1;!e&&this.readInt(10)===null&&this.raise(H.InvalidNumber,this.state.curPosition());let o=this.state.pos-t>=2&&this.input.charCodeAt(t)===48;if(o){let e=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(H.StrictOctalLiteral,n),!this.state.strict){let t=e.indexOf(`_`);t>0&&this.raise(H.ZeroDigitNumericSeparator,jr(n,t))}a=o&&!/[89]/.test(e)}let s=this.input.charCodeAt(this.state.pos);s===46&&!a&&(++this.state.pos,this.readInt(10),r=!0,s=this.input.charCodeAt(this.state.pos)),(s===69||s===101)&&!a&&(s=this.input.charCodeAt(++this.state.pos),(s===43||s===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(H.InvalidOrMissingExponent,n),r=!0,s=this.input.charCodeAt(this.state.pos));let c=this.input.slice(t,this.state.pos).replaceAll(`_`,``);if(s===110&&((r||o)&&this.raise(H.InvalidBigIntLiteral,n),++this.state.pos,i=!0),Ai(this.codePointAtPos(this.state.pos)))throw this.raise(H.NumberIdentifier,this.state.curPosition());if(i){this.finishToken(132,c);return}let l=a?parseInt(c,8):parseFloat(c);this.finishToken(131,l)}readCodePoint(e){let{code:t,pos:n}=ka(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=n,t}readString(e){let{str:t,pos:n,curLine:r,lineStart:i}=wa(e===34?`double`:`single`,this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=n+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(130,t)}readTemplateContinuation(){this.match(4)||this.unexpected(null,4),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let e=this.input[this.state.pos],{str:t,firstInvalidLoc:n,pos:r,curLine:i,lineStart:a}=wa(`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=a,this.state.curLine=i,n&&(this.state.firstInvalidTemplateEscapePos=new V(n.curLine,n.pos-n.lineStart,this.sourceToOffsetPos(n.pos))),this.input.codePointAt(r)===96?this.finishToken(20,n?null:e+t+"`"):(this.state.pos++,this.finishToken(21,n?null:e+t+"${"))}recordStrictModeErrors(e,t){let n=t.index;this.state.strict&&!this.state.strictErrors.has(n)?this.raise(e,t):this.state.strictErrors.set(n,[e,t])}readWord1(e){this.state.containsEsc=!1;let t=``,n=this.state.pos,r=this.state.pos;for(e!==void 0&&(this.state.pos+=e<=65535?1:2);this.state.pos<this.length;){let e=this.codePointAtPos(this.state.pos);if(ji(e))this.state.pos+=e<=65535?1:2;else if(e===92){this.state.containsEsc=!0,t+=this.input.slice(r,this.state.pos);let e=this.state.curPosition(),i=this.state.pos===n?Ai:ji;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(H.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let a=this.readCodePoint(!0);a!==null&&(i(a)||this.raise(H.EscapedCharNotAnIdentifier,e),t+=String.fromCodePoint(a)),r=this.state.pos}else break}return t+this.input.slice(r,this.state.pos)}readWord(e){let t=this.readWord1(e),n=Xr.get(t);n===void 0?this.finishToken(128,t):this.finishToken(n,yi(n))}checkKeywordEscapes(){let{type:e}=this.state;pi(e)&&this.state.containsEsc&&this.raise(H.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:yi(e)})}raise(e,t,n={}){let r=t instanceof V?t:typeof t==`number`?this.getLoc(t):this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=e(r,t instanceof V?r.index:typeof t==`number`?t:t.start,n);if(!(this.optionFlags&4096))throw i;return this.isLookahead||this.state.errors.push(i),i}raiseOverwrite(e,t,n={}){let r=t instanceof V?t:this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=t instanceof V?r.index:t.start,a=this.state.errors;for(let t=a.length-1;t>=0;t--){let o=a[t];if(o.pos===i)return a[t]=e(r,i,n);if(o.pos<i)break}return this.raise(e,r,n)}updateContext(e){}unexpected(e,t){throw this.raise(H.UnexpectedToken,e==null?this.state.startLoc:e,{expected:t?yi(t):null})}expectPlugin(e,t){if(this.hasPlugin(e))return!0;throw this.raise(H.MissingPlugin,t==null?this.state.startLoc:t,{missingPlugin:[e]})}expectOnePlugin(e){if(!e.some(e=>this.hasPlugin(e)))throw this.raise(H.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:e})}errorBuilder(e){return(t,n,r)=>{this.raise(e,Aa(t,n,r))}}},Fa=class{constructor(){r(this,`privateNames`,new Set),r(this,`loneAccessors`,new Map),r(this,`undefinedPrivateNames`,new Map)}},Ia=class{constructor(e){r(this,`parser`,void 0),r(this,`stack`,[]),this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Fa)}exit(){let e=this.stack.pop(),t=this.current();for(let[n,r]of Array.from(e.undefinedPrivateNames))t?t.undefinedPrivateNames.has(n)||t.undefinedPrivateNames.set(n,r):this.parser.raise(H.InvalidPrivateFieldResolution,r,{identifierName:n})}declarePrivateName(e,t,n){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),o=r.has(e);if(t&3){let n=o&&i.get(e);if(n){let r=n&4,a=t&4;o=(n&3)==(t&3)||r!==a,o||i.delete(e)}else o||i.set(e,t)}o&&this.parser.raise(H.PrivateNameRedeclaration,n,{identifierName:e}),r.add(e),a.delete(e)}usePrivateName(e,t){let n;for(n of this.stack)if(n.privateNames.has(e))return;n?n.undefinedPrivateNames.set(e,t):this.parser.raise(H.InvalidPrivateFieldResolution,t,{identifierName:e})}},La=class{constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Ra=class extends La{constructor(e){super(e),r(this,`declarationErrors`,new Map)}recordDeclarationError(e,t){this.declarationErrors.set(t,e)}clearDeclarationError(e){this.declarationErrors.delete(e)}iterateErrors(e){this.declarationErrors.forEach(e)}},za=class{constructor(e){r(this,`parser`,void 0),r(this,`stack`,[new La]),this.parser=e}enter(e){this.stack.push(e)}exit(){this.stack.pop()}recordParameterInitializerError(e,t){let{stack:n}=this,r=n.length-1,i=n[r];for(;!i.isCertainlyParameterDeclaration();){if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(e,t);else return;i=n[--r]}this.parser.raise(e,t)}recordArrowParameterBindingError(e,t){let{stack:n}=this,r=n[n.length-1],i=t.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(e,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(e,i);else return}recordAsyncArrowParametersError(e){let{stack:t}=this,n=t.length-1,r=t[n];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(H.AwaitBindingIdentifier,e),r=t[--n]}validateAsPattern(){let{stack:e}=this,t=e[e.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors((t,n)=>{this.parser.raise(t,n);let r=e.length-2,i=e[r];for(;i.canBeArrowParameterDeclaration();)i.clearDeclarationError(n),i=e[--r]})}};function Ba(){return new La(3)}function Va(){return new Ra(1)}function Ha(){return new Ra(2)}function Ua(){return new La}var Wa=class{constructor(){r(this,`stacks`,[])}enter(e){this.stacks.push(e)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}get inFSharpPipelineDirectBody(){return(this.currentFlags()&16)==0}};function Ga(e,t){return(e?2:0)|!!t}var Ka=class extends Pa{addExtra(e,t,n,r=!0){if(!e)return;let{extra:i}=e;i==null&&(i={},e.extra=i),r?i[t]=n:Object.defineProperty(i,t,{enumerable:r,value:n})}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,t){if(this.input.startsWith(t,e)){let n=this.input.charCodeAt(e+t.length);return!(ji(n)||(n&64512)==55296)}return!1}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}eatContextual(e){return this.isContextual(e)?(this.next(),!0):!1}expectContextual(e,t){if(!this.eatContextual(e)){if(t!=null)throw this.raise(t,this.state.startLoc);this.unexpected(null,e)}}canInsertSemicolon(){return this.match(135)||this.match(4)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return ia(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return ia(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(9)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(9))||this.raise(H.MissingSemicolon,this.state.lastTokEndLoc)}expect(e,t){this.eat(e)||this.unexpected(t,e)}tryParse(e,t=this.state.clone()){let n={node:null};try{let r=e((e=null)=>{throw n.node=e,n});if(this.state.errors.length>t.errors.length){let e=this.state;return this.state=t,this.state.tokensLength=e.tokensLength,{node:r,error:e.errors[t.errors.length],thrown:!1,aborted:!1,failState:e}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(e){let r=this.state;if(this.state=t,e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:r};if(e===n)return{node:n.node,error:null,thrown:!1,aborted:!0,failState:r};throw e}}checkExpressionErrors(e,t){if(!e)return!1;let{shorthandAssignLoc:n,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a,voidPatternLoc:o}=e,s=!!n||!!r||!!a||!!i||!!o;if(!t)return s;n!=null&&this.raise(H.InvalidCoverInitializedName,n),r!=null&&this.raise(H.DuplicateProto,r),i!=null&&this.raise(H.UnexpectedPrivateField,i),a!=null&&this.unexpected(a),o!=null&&this.raise(H.InvalidCoverDiscardElement,o)}isLiteralPropertyName(){return si(this.state.type)}isPrivateName(e){return e.type===`PrivateName`}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)&&this.isPrivateName(e.property)}isObjectProperty(e){return e.type===`ObjectProperty`}isObjectMethod(e){return e.type===`ObjectMethod`}initializeScopes(e=this.options.sourceType===`module`){let t=this.state.labels;this.state.labels=[];let n=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=e;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,e);let o=this.prodParam;this.prodParam=new Wa;let s=this.classScope;this.classScope=new Ia(this);let c=this.expressionScope;return this.expressionScope=new za(this),()=>{this.state.labels=t,this.exportedIdentifiers=n,this.inModule=r,this.scope=i,this.prodParam=o,this.classScope=s,this.expressionScope=c}}enterInitialScopes(){let e=0;(this.inModule||this.optionFlags&1)&&(e|=2),this.optionFlags&32&&(e|=1);let t=!this.inModule&&this.options.sourceType===`commonjs`;(t||this.optionFlags&2)&&(e|=4),this.prodParam.enter(e);let n=t?514:1;this.optionFlags&4&&(n|=512),this.optionFlags&16&&(n|=48),this.scope.enter(n)}checkDestructuringPrivate(e){let{privateKeyLoc:t}=e;t!==null&&this.expectPlugin(`destructuringPrivate`,t)}},qa=class{constructor(){r(this,`shorthandAssignLoc`,null),r(this,`doubleProtoLoc`,null),r(this,`privateKeyLoc`,null),r(this,`optionalParametersLoc`,null),r(this,`voidPatternLoc`,null)}},Ja=class{constructor(e,t,n,i){r(this,`type`,``),this.start=n,this.end=0,i!==void 0&&(this.loc=new Ar(i)),e&128&&(this.range=[n,0]),i!==void 0&&t&&(this.loc.filename=t)}};const Ya=Ja.prototype;var Xa=class extends Ka{createPosition(e){return e}startNode(){let{startLoc:e}=this.state;return this.setLoc(e),this.startNodeAt(e)}startNodeAt(e){let{optionFlags:t,filename:n}=this;return t&256?new Ja(t,n,e.index,this.createPosition(e)):new Ja(t,n,e.index)}startNodeAtNode(e){let{optionFlags:t,filename:n}=this;return t&256?new Ja(t,n,e.start,e.loc.start):new Ja(t,n,e.start)}finishNode(e,t){return this.finishNodeAt(e,t,this.state.lastTokEndLoc)}finishNodeAt(e,t,n){e.type=t,e.end=n.index;let{optionFlags:r}=this;return r&256&&(e.loc.end=this.createPosition(n)),r&128&&(e.range[1]=n.index),r&8192&&this.processComment(e),e}finishNodeAtNode(e,t,n){e.type=t,e.end=n.end;let{optionFlags:r}=this;return r&256&&(e.loc.end=n.loc.end),r&128&&(e.range[1]=e.end),r&8192&&this.processComment(e),e}resetStartLocation(e,t){e.start=t.index;let{optionFlags:n}=this;n&256&&(e.loc.start=this.createPosition(t)),n&128&&(e.range[0]=t.index)}resetEndLocation(e,t=this.state.lastTokEndLoc){e.end=t.index;let{optionFlags:n}=this;n&256&&(e.loc.end=this.createPosition(t)),n&128&&(e.range[1]=t.index)}resetStartLocationFromNode(e,t){e.start=t.start;let{optionFlags:n}=this;n&256&&(e.loc.start=t.loc.start),n&128&&(e.range[0]=t.start)}resetEndLocationFromNode(e,t){e.end=t.end;let{optionFlags:n}=this;n&256&&(e.loc.end=t.loc.end),n&128&&(e.range[1]=t.end)}castNodeTo(e,t){return e.type=t,e}cloneIdentifier(e){let{type:t,start:n,end:r,loc:i,range:a,name:o}=e,s=Object.create(Ya);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.name=o,e.extra&&(s.extra=e.extra),s}cloneStringLiteral(e){let{type:t,start:n,end:r,loc:i,range:a,extra:o}=e,s=Object.create(Ya);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.extra=o,s.value=e.value,s}};const Za=e=>e.type===`ParenthesizedExpression`?Za(e.expression):e;var Qa=class extends Xa{toAssignable(e,t=!1){var n;let r;switch((e.type===`ParenthesizedExpression`||(n=e.extra)!=null&&n.parenthesized)&&(r=Za(e),t?r.type===`Identifier`?this.expressionScope.recordArrowParameterBindingError(H.InvalidParenthesizedAssignment,e):r.type!==`CallExpression`&&r.type!==`MemberExpression`&&!this.isOptionalMemberExpression(r)&&this.raise(H.InvalidParenthesizedAssignment,e):this.raise(H.InvalidParenthesizedAssignment,e)),e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:break;case`ObjectExpression`:this.castNodeTo(e,`ObjectPattern`);for(let n=0,r=e.properties.length,a=r-1;n<r;n++){var i;let r=e.properties[n],o=n===a;this.toAssignableObjectExpressionProp(r,o,t),o&&r.type===`RestElement`&&(i=e.extra)!=null&&i.trailingCommaLoc&&this.raise(H.RestTrailingComma,e.extra.trailingCommaLoc)}break;case`ObjectProperty`:{let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t);break}case`SpreadElement`:throw Error(`Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.`);case`ArrayExpression`:var a;this.castNodeTo(e,`ArrayPattern`),this.toAssignableList(e.elements,(a=e.extra)==null?void 0:a.trailingCommaLoc,t);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(H.MissingEqInAssignment,this.optionFlags&256?e.left.loc.end:e.left),this.castNodeTo(e,`AssignmentPattern`),delete e.operator,e.left.type===`VoidPattern`&&this.raise(H.VoidPatternInitializer,e.left),this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(r,t);break}}toAssignableObjectExpressionProp(e,t,n){if(e.type===`ObjectMethod`)this.raise(e.kind===`get`||e.kind===`set`?H.PatternHasAccessor:H.PatternHasMethod,e.key);else if(e.type===`SpreadElement`){this.castNodeTo(e,`RestElement`);let r=e.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,n),t||this.raise(H.RestTrailingComma,e)}else this.toAssignable(e,n)}toAssignableList(e,t,n){let r=e.length-1;for(let i=0;i<=r;i++){let a=e[i];a&&(this.toAssignableListItem(e,i,n),a.type===`RestElement`&&(i<r?this.raise(H.RestTrailingComma,a):t&&this.raise(H.RestTrailingComma,t)))}}toAssignableListItem(e,t,n){let r=e[t];if(r.type===`SpreadElement`){this.castNodeTo(r,`RestElement`);let e=r.argument;this.checkToRestConversion(e,!0),this.toAssignable(e,n)}else this.toAssignable(r,n)}isAssignable(e,t){switch(e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:return!0;case`ObjectExpression`:{let t=e.properties.length-1;return e.properties.every((e,n)=>e.type!==`ObjectMethod`&&(n===t||e.type!==`SpreadElement`)&&this.isAssignable(e))}case`ObjectProperty`:return this.isAssignable(e.value);case`SpreadElement`:return this.isAssignable(e.argument);case`ArrayExpression`:return e.elements.every(e=>e===null||this.isAssignable(e));case`AssignmentExpression`:return e.operator===`=`;case`ParenthesizedExpression`:return this.isAssignable(e.expression);case`MemberExpression`:case`OptionalMemberExpression`:return!t;default:return!1}}toReferencedList(e,t){return e}parseSpread(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssignAllowIn(e,void 0),this.finishNode(t,`SpreadElement`)}parseRestBinding(){let e=this.startNode();this.next();let t=this.parseBindingAtom();return t.type===`VoidPattern`&&this.raise(H.UnexpectedVoidPattern,t),e.argument=t,this.finishNode(e,`RestElement`)}parseBindingAtom(){switch(this.state.type){case 0:{let e=this.startNode();return this.next(),e.elements=this.parseBindingList(1,93,1),this.finishNode(e,`ArrayPattern`)}case 2:return this.parseObjectLike(4,!0);case 84:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(e,t,n){let r=n&1,i=[],a=!0;for(;!this.eat(e);)if(a?a=!1:this.expect(8),r&&this.match(8))i.push(null);else if(this.eat(e))break;else if(this.match(17)){let r=this.parseRestBinding();if(n&2&&(r=this.parseFunctionParamType(r)),i.push(r),!this.checkCommaAfterRest(t)){this.expect(e);break}}else{let e=[];if(n&2)for(this.match(22)&&this.hasPlugin(`decorators`)&&this.raise(H.UnsupportedParameterDecorator,this.state.startLoc);this.match(22);)e.push(this.parseDecorator());i.push(this.parseBindingElement(n,e))}return i}parseBindingRestProperty(e){return this.next(),this.hasPlugin(`discardBinding`)&&this.match(84)?(e.argument=this.parseVoidPattern(null),this.raise(H.UnexpectedVoidPattern,e.argument)):e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,`RestElement`)}parseBindingProperty(){let{type:e,startLoc:t}=this.state;if(e===17)return this.parseBindingRestProperty(this.startNode());let n=this.startNode();return e===134?(this.expectPlugin(`destructuringPrivate`,t),this.classScope.usePrivateName(this.state.value,t),n.key=this.parsePrivateName()):this.parsePropertyName(n),n.method=!1,this.parseObjPropValue(n,t,!1,!1,!0,!1)}parseBindingElement(e,t){let{startLoc:n}=this.state,r=this.parseMaybeDefault();return e&2&&this.parseFunctionParamType(r),t.length&&(r.decorators=t,this.resetStartLocationFromNode(r,t[0])),this.parseMaybeDefault(n,r)}parseFunctionParamType(e){return e}parseMaybeDefault(e,t){var n;if(e!=null||(e=this.state.startLoc),t=(n=t)==null?this.parseBindingAtom():n,!this.eat(25))return t;let r=this.startNodeAt(e);return t.type===`VoidPattern`&&this.raise(H.VoidPatternInitializer,t),r.left=t,r.right=this.parseMaybeAssignAllowIn(),this.finishNode(r,`AssignmentPattern`)}isValidLVal(e,t,n,r){switch(e){case`AssignmentPattern`:return`left`;case`RestElement`:return`argument`;case`ObjectProperty`:return`value`;case`ParenthesizedExpression`:return`expression`;case`ArrayPattern`:return`elements`;case`ObjectPattern`:return`properties`;case`VoidPattern`:return!0;case`CallExpression`:if(!t&&!this.state.strict&&this.optionFlags&16384)return!0}return!1}isOptionalMemberExpression(e){return e.type===`OptionalMemberExpression`}checkLVal(e,t,n=64,r=!1,i=!1,a=!1,o=!1){var s;let c=e.type;if(this.isObjectMethod(e))return;let l=this.isOptionalMemberExpression(e);if(l||c===`MemberExpression`){l&&(this.expectPlugin(`optionalChainingAssign`,e.start),t.type!==`AssignmentExpression`&&this.raise(H.InvalidLhsOptionalChaining,e,{ancestor:t})),n!==64&&this.raise(H.InvalidPropertyBindingPattern,e);return}if(c===`Identifier`){this.checkIdentifier(e,n,i);let{name:t}=e;r&&(r.has(t)?this.raise(H.ParamDupe,e):r.add(t));return}else c===`VoidPattern`&&t.type===`CatchClause`&&this.raise(H.VoidPatternCatchClauseParam,e);let u=Za(e);o||(o=u.type===`CallExpression`&&(u.callee.type===`Import`||u.callee.type===`Super`));let d=this.isValidLVal(c,o,!(a||(s=e.extra)!=null&&s.parenthesized)&&t.type===`AssignmentExpression`,n);if(d===!0)return;if(d===!1){let r=n===64?H.InvalidLhs:H.InvalidLhsBinding;this.raise(r,e,{ancestor:t});return}let f,p;typeof d==`string`?(f=d,p=c===`ParenthesizedExpression`):[f,p]=d;let m=c===`ArrayPattern`||c===`ObjectPattern`?{type:c}:t,ee=e[f];if(Array.isArray(ee))for(let e of ee)e&&this.checkLVal(e,m,n,r,i,p,!0);else ee&&this.checkLVal(ee,m,n,r,i,p,o)}checkIdentifier(e,t,n=!1){this.state.strict&&(n?zi(e.name,this.inModule):Ri(e.name))&&(t===64?this.raise(H.StrictEvalArguments,e,{referenceName:e.name}):this.raise(H.StrictEvalArgumentsBinding,e,{bindingName:e.name})),t&8192&&e.name===`let`&&this.raise(H.LetInLexicalBinding,e),t&64||this.declareNameFromIdentifier(e,t)}declareNameFromIdentifier(e,t){this.scope.declareName(e.name,t,e.start)}checkToRestConversion(e,t){switch(e.type){case`ParenthesizedExpression`:this.checkToRestConversion(e.expression,t);break;case`Identifier`:case`MemberExpression`:break;case`ArrayExpression`:case`ObjectExpression`:if(t)break;default:this.raise(H.InvalidRestAssignmentPattern,e)}}checkCommaAfterRest(e){return this.match(8)?(this.raise(this.lookaheadCharCode()===e?H.RestTrailingComma:H.ElementAfterRest,this.state.startLoc),!0):!1}},$a=class extends Qa{checkProto(e,t,n){if(e.type===`SpreadElement`||this.isObjectMethod(e)||e.computed||e.shorthand)return t;let r=e.key;return(r.type===`Identifier`?r.name:r.value)===`__proto__`?(t&&(n?n.doubleProtoLoc===null&&(n.doubleProtoLoc=this.getLoc(r.start)):this.raise(H.DuplicateProto,r)),!0):t}shouldExitDescending(e){var t;return e.type===`ArrowFunctionExpression`&&!((t=e.extra)!=null&&t.parenthesized)}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(135))throw this.raise(H.ParseExpressionEmptyInput,this.state.startLoc);let e=this.parseExpression();if(!this.match(135))throw this.raise(H.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),e.comments=this.comments,e.errors=this.state.errors,this.optionFlags&512&&(e.tokens=io(this.tokens)),e}parseExpression(e,t){return e?this.disallowInAnd(()=>this.parseExpressionBase(t)):this.allowInAnd(()=>this.parseExpressionBase(t))}parseExpressionBase(e){let t=this.state.startLoc,n=this.parseMaybeAssign(e);if(this.match(8)){let r=this.startNodeAt(t);for(r.expressions=[n];this.eat(8);)r.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(r.expressions),this.finishNode(r,`SequenceExpression`)}return n}parseMaybeAssignDisallowIn(e,t){return this.disallowInAnd(()=>this.parseMaybeAssign(e,t))}parseMaybeAssignAllowIn(e,t){return this.allowInAnd(()=>this.parseMaybeAssign(e,t))}setOptionalParametersError(e){e.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(e,t){let n=this.state.startLoc,r=this.isContextual(104);if(r&&this.prodParam.hasYield){this.next();let e=this.parseYield(n);return t&&(e=t.call(this,e,n)),e}let i;e?i=!1:(e=new qa,i=!0),this.state.canStartArrow=!0;let a=this.parseMaybeConditional(e);if(t&&(a=t.call(this,a,n)),ui(this.state.type)){let t=this.startNodeAt(n),r=this.state.value;if(t.operator=r,this.match(25)){this.toAssignable(a,!0),t.left=a;let r=n.index;e.doubleProtoLoc!=null&&e.doubleProtoLoc.index>=r&&(e.doubleProtoLoc=null),e.shorthandAssignLoc!=null&&e.shorthandAssignLoc.index>=r&&(e.shorthandAssignLoc=null),e.privateKeyLoc!=null&&e.privateKeyLoc.index>=r&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null),e.voidPatternLoc!=null&&e.voidPatternLoc.index>=r&&(e.voidPatternLoc=null)}else t.left=a;return this.next(),t.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(t,`AssignmentExpression`),void 0,void 0,void 0,void 0,r===`||=`||r===`&&=`||r===`??=`),t}else i&&this.checkExpressionErrors(e,!0);if(r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?li(e):li(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(H.YieldNotInGeneratorFunction,n),this.parseYield(n)}return a}parseMaybeConditional(e){let t=this.state.startLoc,n=this.parseExprOps(e);return this.shouldExitDescending(n)?n:this.parseConditional(n,t,e)}parseConditional(e,t,n){if(this.eat(13)){let n=this.startNodeAt(t);return n.test=e,n.consequent=this.parseMaybeAssignAllowIn(),this.expect(10),n.alternate=this.parseMaybeAssign(),this.finishNode(n,`ConditionalExpression`)}return e}parseMaybeUnaryOrPrivate(e){return this.match(134)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){let t=this.state.startLoc,n=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(n)?n:(this.state.canStartArrow=!1,this.parseExprOp(n,t,-1))}parseExprOp(e,t,n){if(this.isPrivateName(e)){let r=this.getPrivateNameSV(e);(n>=bi(54)||!this.prodParam.hasIn||!this.match(54))&&this.raise(H.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t)}let r=this.state.type;if(mi(r)&&(this.prodParam.hasIn||!this.match(54))){let i=bi(r);if(i>n){if(r===35&&(this.expectPlugin(`pipelineOperator`),this.prodParam.inFSharpPipelineDirectBody))return e;let a=this.startNodeAt(t);a.left=e,a.operator=this.state.value;let o=r===37||r===38,s=r===36;s&&(i=bi(38)),this.next(),a.right=this.parseExprOpRightExpr(r,i);let c=this.finishNode(a,o||s?`LogicalExpression`:`BinaryExpression`),l=this.state.type;if(s&&(l===37||l===38)||o&&l===36)throw this.raise(H.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(c,t,n)}}return e}parseExprOpRightExpr(e,t){switch(e){case 35:switch(this.getPluginOption(`pipelineOperator`,`proposal`)){case`hack`:return this.withTopicBindingContext(()=>this.parseHackPipeBody());case`fsharp`:return this.parseFSharpPipelineBody(t)}default:return this.parseExprOpBaseRightExpr(e,t)}}parseExprOpBaseRightExpr(e,t){let n=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),n,xi(e)?t-1:t)}parseHackPipeBody(){var e;let{startLoc:t}=this.state,n=this.parseMaybeAssign();return zr.has(n.type)&&!((e=n.extra)!=null&&e.parenthesized)&&this.raise(H.PipeUnparenthesizedBody,t,{type:n.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(H.PipeTopicUnused,t),n}checkExponentialAfterUnary(e){this.match(53)&&this.raise(H.UnexpectedTokenUnaryExponentiation,e.argument)}parseMaybeUnary(e,t){let n=this.state.startLoc,r=this.isContextual(92);if(r&&this.recordAwaitIfAllowed()){this.next();let e=this.parseAwait(n);return t||this.checkExponentialAfterUnary(e),e}let i=this.match(30),a=this.startNode();if(gi(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.state.canStartArrow=!1,this.match(68)&&this.expectPlugin(`throwExpressions`);let n=this.match(85);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&n){let e=a.argument;e.type===`Identifier`?this.raise(H.StrictDelete,a):this.hasPropertyAsPrivateName(e)&&this.raise(H.DeletePrivateField,a)}if(!i)return t||this.checkExponentialAfterUnary(a),this.finishNode(a,`UnaryExpression`)}let o=this.parseUpdate(a,i,e);if(r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?li(e):li(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(H.AwaitNotInAsyncContext,n),this.parseAwait(n)}return o}parseUpdate(e,t,n){if(t){let t=this.finishNode(e,`UpdateExpression`);return this.checkLVal(t.argument,t),t}let r=this.state.startLoc,i=this.parseExprSubscripts(n);if(this.checkExpressionErrors(n,!1))return i;for(;hi(this.state.type)&&!this.canInsertSemicolon();){let e=this.startNodeAt(r);e.operator=this.state.value,e.prefix=!1,e.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(e,`UpdateExpression`))}return i}parseExprSubscripts(e){let t=this.state.startLoc;this.setLoc(t);let n=this.parseExprAtom(e);return this.shouldExitDescending(n)?n:this.parseSubscripts(n,t)}parseSubscripts(e,t,n){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do e=this.parseSubscript(e,t,n,r),r.maybeAsyncArrow=!1;while(!r.stop);return e}parseSubscript(e,t,n,r){let{type:i}=this.state;if(!n&&i===11)return this.parseBind(e,t,r);if(Si(i))return this.parseTaggedTemplateExpression(e,t,r);let a=!1;if(i===14){if(n&&(this.raise(H.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(e,r);r.optionalChainMember=a=!0,this.next()}if(!n&&this.match(6))return this.parseCoverCallAndAsyncArrowHead(e,t,r,a);{let n=this.eat(0);return n||a||this.eat(12)?this.parseMember(e,t,r,n,a):this.stopParseSubscript(e,r)}}stopParseSubscript(e,t){return t.stop=!0,e}parseMember(e,t,n,r,i){let a=this.startNodeAt(t);return a.object=e,a.computed=r,r?(a.property=this.parseExpression(),this.expect(1)):this.match(134)?(e.type===`Super`&&this.raise(H.SuperPrivateField,t),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),n.optionalChainMember?(a.optional=i,this.finishNode(a,`OptionalMemberExpression`)):this.finishNode(a,`MemberExpression`)}parseBind(e,t,n){let r=this.startNodeAt(t);r.object=e,this.next();let i=this.match(79),a=this.parseNoCallExpr();if(a.type===`Super`||i&&a.type===`ImportExpression`||a.type===`Import`)throw this.raise(H.UnsupportedBindRHS,a);return r.callee=a,n.stop=!0,this.parseSubscripts(this.finishNode(r,`BindExpression`),t,!1)}parseCoverCallAndAsyncArrowHead(e,t,n,r){let i=null;this.next();let a=this.startNodeAt(t);a.callee=e;let{maybeAsyncArrow:o,optionalChainMember:s}=n;o&&(this.expressionScope.enter(Ha()),i=new qa),s&&(a.optional=r),r?a.arguments=this.parseCallExpressionArguments():a.arguments=this.parseCallExpressionArguments(e.type!==`Super`,a,i);let c=this.finishCallExpression(a,s);return o&&this.shouldParseAsyncArrow()&&!r?(n.stop=!0,this.checkDestructuringPrivate(i),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t),c)):(o&&(this.checkExpressionErrors(i,!0),this.expressionScope.exit()),this.toReferencedList(a.arguments)),c}parseTaggedTemplateExpression(e,t,n){let r=this.startNodeAt(t);return r.tag=e,r.quasi=this.parseTemplate(!0),n.optionalChainMember&&this.raise(H.OptionalChainingNoTemplate,t),this.finishNode(r,`TaggedTemplateExpression`)}atPossibleAsyncArrow(e){return e.type===`Identifier`&&e.name===`async`&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.state.canStartArrow}finishCallExpression(e,t){if(e.callee.type===`Import`)if(e.arguments.length===0||e.arguments.length>2)this.raise(H.ImportCallArity,e);else for(let t of e.arguments)t.type===`SpreadElement`&&this.raise(H.ImportCallSpreadArgument,t);return this.finishNode(e,t?`OptionalCallExpression`:`CallExpression`)}parseCallExpressionArguments(e,t,n){let r=[],i=!0;for(;!this.eat(7);){if(i)i=!1;else if(this.expect(8),this.match(7)){t&&this.addTrailingCommaExtraToNode(t),this.next();break}r.push(this.parseExprListItem(7,!1,n,e))}return r}shouldParseAsyncArrow(){return this.match(15)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){var n;return this.resetPreviousNodeTrailingComments(t),this.expect(15),this.parseArrowExpression(e,t.arguments,!0,(n=t.extra)==null?void 0:n.trailingCommaLoc),t.innerComments&&_a(e,t.innerComments),t.callee.trailingComments&&_a(e,t.callee.trailingComments),e}parseNoCallExpr(){let e=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,!0)}parseExprAtom(e){let t,n=null,{type:r}=this.state;switch(r){case 75:return this.parseSuper();case 79:return t=this.startNode(),this.next(),this.match(12)?this.parseImportMetaPropertyOrPhaseCall(t):this.match(6)?this.optionFlags&1024?this.parseImportCall(t):this.finishNode(t,`Import`):(this.raise(H.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(t,`Import`));case 74:return t=this.startNode(),this.next(),this.finishNode(t,`ThisExpression`);case 86:return this.parseDo(this.startNode(),!1);case 52:case 27:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 131:return this.parseNumericLiteral(this.state.value);case 132:return this.parseBigIntLiteral(this.state.value);case 130:return this.parseStringLiteral(this.state.value);case 80:return this.parseNullLiteral();case 81:return this.parseBooleanLiteral(!0);case 82:return this.parseBooleanLiteral(!1);case 6:return this.parseParenAndDistinguishExpression(this.state.canStartArrow);case 0:return this.parseArrayLike(1,e);case 2:return this.parseObjectLike(4,!1,e);case 64:return this.parseFunctionOrFunctionSent();case 22:n=this.parseDecorators();case 76:return this.parseClass(this.maybeTakeDecorators(n,this.startNode()),!1);case 73:return this.parseNewOrNewTarget();case 21:case 20:return this.parseTemplate(!1);case 11:{t=this.startNode(),this.next(),t.object=null;let e=t.callee=this.parseNoCallExpr();if(e.type===`MemberExpression`)return this.finishNode(t,`BindExpression`);throw this.raise(H.UnsupportedBind,e)}case 134:return this.raise(H.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 29:return this.parseTopicReferenceThenEqualsSign(50,`%`);case 28:return this.parseTopicReferenceThenEqualsSign(40,`^`);case 33:case 34:return this.parseTopicReference(`hack`);case 40:case 50:case 23:{let e=this.getPluginOption(`pipelineOperator`,`proposal`);if(e)return this.parseTopicReference(e);throw this.unexpected()}case 43:{let e=this.input.codePointAt(this.nextTokenStart());throw Ai(e)||e===62?this.expectOnePlugin([`jsx`,`flow`,`typescript`]):this.unexpected()}default:if(q(r)){if(this.isContextual(123)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let{canStartArrow:e,containsEsc:t}=this.state,n=this.parseIdentifier();if(!t&&n.name===`async`&&!this.canInsertSemicolon()){let{type:t}=this.state;if(t===64)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(q(t))return e&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(t===86)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return e&&this.match(15)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(e,t){let n=this.getPluginOption(`pipelineOperator`,`proposal`);if(n)return this.state.type=e,this.state.value=t,this.state.pos--,this.state.end--,this.state.endLoc=jr(this.state.endLoc,-1),this.parseTopicReference(n);throw this.unexpected()}parseTopicReference(e){let t=this.startNode(),n=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(t,n,e,r)}finishTopicReference(e,t,n,r){if(this.testTopicReferenceConfiguration(n,t,r))return this.topicReferenceIsAllowedInCurrentContext()||this.raise(H.PipeTopicUnbound,t),this.registerTopicReference(),this.finishNode(e,`TopicReference`);throw this.raise(H.PipeTopicUnconfiguredToken,t,{token:yi(r)})}testTopicReferenceConfiguration(e,t,n){switch(e){case`hack`:return this.hasPlugin([`pipelineOperator`,{topicToken:yi(n)}]);default:throw this.raise(H.PipeTopicRequiresHackPipes,t)}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(Ga(!0,this.prodParam.hasYield));let t=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(H.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(15),this.parseArrowExpression(e,t,!0)}parseDo(e,t){this.expectPlugin(`doExpressions`),t&&this.expectPlugin(`asyncDoExpressions`),e.async=t,this.next();let n=this.state.labels;return this.state.labels=[],t?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=n,this.finishNode(e,`DoExpression`)}parseSuper(){let e=this.startNode();return this.next(),this.match(6)&&!this.scope.allowDirectSuper?this.raise(H.SuperNotAllowed,e):this.scope.allowSuper||this.raise(H.UnexpectedSuper,e),!this.match(6)&&!this.match(0)&&!this.match(12)&&this.raise(H.UnsupportedSuper,e),this.finishNode(e,`Super`)}parsePrivateName(){let e=this.startNode(),t=this.startNodeAt(jr(this.state.startLoc,1)),n=this.state.value;return this.next(),e.id=this.createIdentifier(t,n),this.finishNode(e,`PrivateName`)}parseFunctionOrFunctionSent(){let e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`function`);return this.next(),this.match(99)?this.expectPlugin(`functionSent`):this.hasPlugin(`functionSent`)||this.unexpected(),this.parseMetaProperty(e,t,`sent`)}return this.parseFunction(e)}parseMetaProperty(e,t,n){e.meta=t;let r=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==n||r)&&this.raise(H.UnsupportedMetaProperty,e.property,{target:t.name,onlyValidPropertyName:n}),this.finishNode(e,`MetaProperty`)}parseImportMetaPropertyOrPhaseCall(e){if(this.next(),this.isContextual(101)||this.isContextual(93)){let t=this.isContextual(101);return this.expectPlugin(t?`sourcePhaseImports`:`deferredImportEvaluation`),this.next(),e.phase=t?`source`:`defer`,this.parseImportCall(e)}else{let t=this.createIdentifierAt(this.startNodeAtNode(e),`import`,this.state.lastTokStartLoc);return this.isContextual(97)&&(this.inModule||this.raise(H.ImportMetaOutsideModule,t),this.sawUnambiguousESM=!0),this.parseMetaProperty(e,t,`meta`)}}parseLiteralAtNode(e,t,n){return this.addExtra(n,`rawValue`,e),this.addExtra(n,`raw`,this.input.slice(this.offsetToSourcePos(n.start),this.state.end)),n.value=e,this.next(),this.finishNode(n,t)}parseLiteral(e,t){let n=this.startNode();return this.parseLiteralAtNode(e,t,n)}parseStringLiteral(e){return this.parseLiteral(e,`StringLiteral`)}parseNumericLiteral(e){return this.parseLiteral(e,`NumericLiteral`)}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch(e){t=null}return this.parseLiteral(t,`BigIntLiteral`)}parseRegExpLiteral(e){let t=this.startNode();return this.addExtra(t,`raw`,this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.pattern=e.pattern,t.flags=e.flags,this.next(),this.finishNode(t,`RegExpLiteral`)}parseBooleanLiteral(e){let t=this.startNode();return t.value=e,this.next(),this.finishNode(t,`BooleanLiteral`)}parseNullLiteral(){let e=this.startNode();return this.next(),this.finishNode(e,`NullLiteral`)}parseParenAndDistinguishExpression(e){let t=this.state.startLoc,n;this.next(),this.expressionScope.enter(Va());let r=this.state.startLoc,i=[],a=new qa,o=!0,s,c;for(;!this.match(7);){if(o)o=!1;else if(this.expect(8,a.optionalParametersLoc===null?null:a.optionalParametersLoc),this.match(7)){c=this.state.startLoc;break}if(this.match(17)){let e=this.state.startLoc;if(s=this.state.startLoc,i.push(this.parseParenItem(this.parseRestBinding(),e)),!this.checkCommaAfterRest(41))break}else i.push(this.parseMaybeAssignAllowInOrVoidPattern(7,a,this.parseParenItem))}let l=this.state.lastTokEndLoc;this.expect(7);let u=this.startNodeAt(t);return e&&this.shouldParseArrow(i)&&(u=this.parseArrow(u))?(this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(u,i,!1),u):(this.expressionScope.exit(),i.length||this.unexpected(this.state.lastTokStartLoc),c&&this.unexpected(c),s&&this.unexpected(s),this.checkExpressionErrors(a,!0),this.toReferencedList(i,!0),i.length>1?(n=this.startNodeAt(r),n.expressions=i,this.finishNode(n,`SequenceExpression`),this.resetEndLocation(n,l)):n=i[0],this.wrapParenthesis(t,n))}wrapParenthesis(e,t){if(!(this.optionFlags&2048))return this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),this.takeSurroundingComments(t,e.index,this.state.lastTokEndLoc.index),t;let n=this.startNodeAt(e);return n.expression=t,this.finishNode(n,`ParenthesizedExpression`)}shouldParseArrow(e){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(15))return e}parseParenItem(e,t){return e}parseNewOrNewTarget(){let e=this.startNode();if(this.next(),this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`new`);this.next();let n=this.parseMetaProperty(e,t,`target`);return this.scope.allowNewTarget||this.raise(H.UnexpectedNewTarget,n),n}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(6)){let t=this.parseExprList(7);this.toReferencedList(t),e.arguments=t}else e.arguments=[];return this.finishNode(e,`NewExpression`)}parseNewCallee(e){let t=this.match(79),n=this.parseNoCallExpr();e.callee=n,t&&n.type===`ImportExpression`&&this.raise(H.ImportCallNotNewExpression,n,n),n.type===`Import`&&this.raise(H.ImportCallNotNewExpression,n),n.type===`Super`&&this.raise(H.SuperCallNotNewExpression,n)}parseTemplateElement(e){let{start:t,startLoc:n,end:r,value:i}=this.state,a=t+1,o=this.startNodeAt(jr(n,1));i===null&&(e||this.raise(H.InvalidEscapeSequenceTemplate,jr(this.state.firstInvalidTemplateEscapePos,1)));let s=this.match(20),c=s?-1:-2,l=r+c;o.value={raw:this.input.slice(a,l).replace(/\r\n?/g,`
|
|
11
|
-
`),cooked:i===null?null:i.slice(1,c)},o.tail=s,this.next();let u=this.finishNode(o,`TemplateElement`);return this.resetEndLocation(u,jr(this.state.lastTokEndLoc,c)),u}parseTemplate(e){let t=this.startNode(),n=this.parseTemplateElement(e),r=[n],i=[];for(;!n.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(n=this.parseTemplateElement(e));return t.expressions=i,t.quasis=r,this.finishNode(t,`TemplateLiteral`)}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,n){let r=!1,i=!0,a=this.startNode();for(a.properties=[],this.next();!this.match(e);){if(i)i=!1;else if(this.expect(8),this.match(e)){this.addTrailingCommaExtraToNode(a);break}let o;t?o=this.parseBindingProperty():(o=this.parsePropertyDefinition(n),r=this.checkProto(o,r,n)),a.properties.push(o)}this.next();let o=t?`ObjectPattern`:`ObjectExpression`;return this.finishNode(a,o)}addTrailingCommaExtraToNode(e){this.addExtra(e,`trailingComma`,this.state.lastTokStartLoc.index),this.addExtra(e,`trailingCommaLoc`,this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&e.key.type===`Identifier`&&(this.isLiteralPropertyName()||this.match(0)||this.match(51))}parsePropertyDefinition(e){let t=[];if(this.match(22))for(this.hasPlugin(`decorators`)&&this.raise(H.UnsupportedPropertyDecorator,this.state.startLoc);this.match(22);)t.push(this.parseDecorator());let n=this.startNode(),r=!1,i=!1,a;if(this.match(17))return t.length&&this.unexpected(),this.parseSpread();t.length&&(n.decorators=t),n.method=!1,e&&(a=this.state.startLoc);let o=this.eat(51);this.parsePropertyNamePrefixOperator(n);let s=this.state.containsEsc;if(this.parsePropertyName(n,e),!o&&!s&&this.maybeAsyncOrAccessorProp(n)){let{key:e}=n,t=e.name;t===`async`&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(e),o=this.eat(51),this.parsePropertyName(n)),(t===`get`||t===`set`)&&(i=!0,this.resetPreviousNodeTrailingComments(e),n.kind=t,this.match(51)&&(o=!0,this.raise(H.AccessorIsGenerator,this.state.curPosition(),{kind:t}),this.next()),this.parsePropertyName(n))}return this.parseObjPropValue(n,a,o,r,!1,i,e)}getGetterSetterExpectedParamCount(e){return e.kind===`get`?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){var t;let n=this.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e);r.length!==n&&this.raise(e.kind===`get`?H.BadGetterArity:H.BadSetterArity,e),e.kind===`set`&&((t=r[r.length-1])==null?void 0:t.type)===`RestElement`&&this.raise(H.BadSetterRestParameter,e)}parseObjectMethod(e,t,n,r,i){if(i){let n=this.parseMethod(e,t,!1,!1,!1,`ObjectMethod`);return this.checkGetterSetterParams(n),n}if(n||t||this.match(6))return r&&this.unexpected(),e.kind=`method`,e.method=!0,this.parseMethod(e,t,n,!1,!1,`ObjectMethod`)}parseObjectProperty(e,t,n,r){if(e.shorthand=!1,this.eat(10))return e.value=n?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(4,r),this.finishObjectProperty(e);if(!e.computed&&e.key.type===`Identifier`){if(this.checkReservedWord(e.key.name,e.key.start,!0,!1),n)e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key));else if(this.match(25)){let n=this.state.startLoc;r==null?this.raise(H.InvalidCoverInitializedName,n):r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=n),e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key))}else e.value=this.cloneIdentifier(e.key);return e.shorthand=!0,this.finishObjectProperty(e)}}finishObjectProperty(e){return this.finishNode(e,`ObjectProperty`)}parseObjPropValue(e,t,n,r,i,a,o){let s=this.parseObjectMethod(e,n,r,i,a)||this.parseObjectProperty(e,t,i,o);return s||this.unexpected(),s}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(1);else{let{type:n,value:r}=this.state,i;if(oi(n))i=this.parseIdentifier(!0);else switch(n){case 131:i=this.parseNumericLiteral(r);break;case 130:i=this.parseStringLiteral(r);break;case 132:i=this.parseBigIntLiteral(r);break;case 134:{let e=this.state.startLoc;t==null?this.raise(H.UnexpectedPrivateField,e):t.privateKeyLoc===null&&(t.privateKeyLoc=e),i=this.parsePrivateName();break}default:this.unexpected()}e.key=i,n!==134&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,n,r,i,a,o=!1){this.initFunction(e,n),e.generator=t,this.scope.enter(530|(o?576:0)|(i?32:0)),this.prodParam.enter(Ga(n,e.generator)),this.parseFunctionParams(e,r);let s=this.parseFunctionBodyAndFinish(e,a,!0);return this.prodParam.exit(),this.scope.exit(),s}parseArrayLike(e,t){let n=this.startNode();return this.next(),n.elements=this.parseExprList(e,!0,t,n),this.finishNode(n,`ArrayExpression`)}parseArrowExpression(e,t,n,r){this.scope.enter(518);let i=Ga(n,!1);return this.match(2)||(i|=this.prodParam.currentFlags()&24),this.prodParam.enter(i),this.initFunction(e,n),t&&this.setArrowFunctionParameters(e,t,r),this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`ArrowFunctionExpression`)}setArrowFunctionParameters(e,t,n){this.toAssignableList(t,n,!1),e.params=t}parseFunctionBodyAndFinish(e,t,n=!1){return this.parseFunctionBody(e,!1,n),this.finishNode(e,t)}parseFunctionBody(e,t,n=!1){let r=t&&!this.match(2);if(this.expressionScope.enter(Ua()),r)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{let r=this.state.strict,i=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),e.body=this.parseBlock(!0,!1,i=>{let a=!this.isSimpleParamList(e.params);i&&a&&this.raise(H.IllegalLanguageModeDirective,(e.kind===`method`||e.kind===`constructor`)&&e.key?this.optionFlags&256?e.key.loc.end:e.key:e);let o=!r&&this.state.strict;this.checkParams(e,!this.state.strict&&!t&&!n&&!a,t,o),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,o)}),this.prodParam.exit(),this.state.labels=i}this.expressionScope.exit()}isSimpleParameter(e){return e.type===`Identifier`}isSimpleParamList(e){for(let t=0,n=e.length;t<n;t++)if(!this.isSimpleParameter(e[t]))return!1;return!0}checkParams(e,t,n,r=!0){let i=!t&&new Set,a={type:`FormalParameters`};for(let t of e.params)this.checkLVal(t,a,5,i,r)}parseExprList(e,t,n,r){let i=[],a=!0;for(;!this.eat(e);){if(a)a=!1;else if(this.expect(8),this.match(e)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(e,t,n))}return i}parseExprListItem(e,t,n,r){let i;if(this.match(8))t||this.raise(H.UnexpectedToken,this.state.curPosition(),{unexpected:`,`}),i=null;else if(this.match(17)){let e=this.state.startLoc;i=this.parseParenItem(this.parseSpread(n),e)}else if(this.match(13)){this.expectPlugin(`partialApplication`),r||this.raise(H.UnexpectedArgumentPlaceholder,this.state.startLoc);let e=this.startNode();this.next(),i=this.finishNode(e,`ArgumentPlaceholder`)}else i=this.parseMaybeAssignAllowInOrVoidPattern(e,n,this.parseParenItem);return i}parseIdentifier(e){let t=this.startNode(),n=this.parseIdentifierName(e);return this.createIdentifier(t,n)}createIdentifier(e,t){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNode(e,`Identifier`)}createIdentifierAt(e,t,n){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNodeAt(e,`Identifier`,n)}parseIdentifierName(e){let t,{start:n,type:r}=this.state;oi(r)?t=this.state.value:this.unexpected();let i=ai(r);return e?i&&this.replaceToken(128):this.checkReservedWord(t,this.sourceToOffsetPos(n),i,!1),this.next(),t}checkReservedWord(e,t,n,r){if(!(e.length>10)&&Ui(e)){if(n&&Bi(e)){this.raise(H.UnexpectedKeyword,t,{keyword:e});return}if((this.state.strict?r?zi:Li:Ii)(e,this.inModule)){this.raise(H.UnexpectedReservedWord,t,{reservedWord:e});return}else if(e===`yield`){if(this.prodParam.hasYield){this.raise(H.YieldBindingIdentifier,t);return}}else if(e===`await`){if(this.prodParam.hasAwait){this.raise(H.AwaitBindingIdentifier,t);return}if(this.scope.inStaticBlock){this.raise(H.AwaitBindingIdentifierInStaticBlock,t);return}this.expressionScope.recordAsyncArrowParametersError(t)}else if(e===`arguments`&&this.scope.inClassAndNotInNonArrowFunction){this.raise(H.ArgumentsInClass,t);return}}}recordAwaitIfAllowed(){let e=this.prodParam.hasAwait;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e,t){let n=e.index;this.setLoc(e);let r=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(H.AwaitExpressionFormalParameter,n),this.eat(51)&&this.raise(H.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),t||(r.argument=this.parseMaybeUnary(null,!0)),this.finishNode(r,`AwaitExpression`)}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:e}=this.state;return e===49||e===6||e===0||Si(e)||e===98&&!this.state.containsEsc||e===133||e===52||this.hasPlugin(`v8intrinsic`)&&e===50}parseYield(e){this.setLoc(e);let t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(H.YieldInParameter,e.index);let n=!1,r=null;if(!this.hasPrecedingLineBreak())switch(n=this.eat(51),this.state.type){case 9:case 135:case 4:case 7:case 1:case 5:case 10:case 8:if(!n)break;default:r=this.parseMaybeAssign()}return t.delegate=n,t.argument=r,this.finishNode(t,`YieldExpression`)}parseImportCall(e){var t;this.next();let n=this.parseCallExpressionArguments();if(n.length===0||n.length>2)this.raise(H.ImportCallArity,e,e);else for(let t of n)t.type===`SpreadElement`&&this.raise(H.ImportCallSpreadArgument,t,e);return e.source=n[0],e.options=(t=n[1])==null?null:t,this.finishNode(e,`ImportExpression`)}withTopicBindingContext(e){let t=this.state.inHackPipelineBody;this.state.inHackPipelineBody=!0;let n=this.state.seenTopicReference;this.state.seenTopicReference=!1;try{return e()}finally{this.state.inHackPipelineBody=t,this.state.seenTopicReference=n}}allowInAnd(e){let t=this.prodParam.currentFlags();if(24&~t){this.prodParam.enter(t|24);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){let t=this.prodParam.currentFlags(),n=8&t,r=16&~t;if(n||r){this.prodParam.enter(t&-9|16);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.seenTopicReference=!0}topicReferenceIsAllowedInCurrentContext(){return this.state.inHackPipelineBody}topicReferenceWasUsedInCurrentContext(){return this.state.seenTopicReference}parseFSharpPipelineBody(e){let t=this.state.startLoc;this.prodParam.enter(this.prodParam.currentFlags()&-17);let n;if(this.isContextual(92)&&this.recordAwaitIfAllowed()){this.next(),n=this.parseAwait(t,!0);let e=this.state.type;mi(e)&&e!==35&&(this.prodParam.hasIn||e!==54)&&this.raise(H.PipelineUnparenthesized,t)}else this.state.canStartArrow=!0,n=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.prodParam.exit(),n}parseModuleExpression(){this.expectPlugin(`moduleBlocks`);let e=this.startNode();this.next(),this.match(2)||this.unexpected(null,2);let t=this.startNodeAt(this.state.endLoc);this.next();let n=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,4,`module`)}finally{n()}return this.finishNode(e,`ModuleExpression`)}parseVoidPattern(e){this.expectPlugin(`discardBinding`);let t=this.startNode();return e!=null&&(e.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(t,`VoidPattern`)}parseMaybeAssignAllowInOrVoidPattern(e,t,n){if(t!=null&&this.match(84)){let n=this.lookaheadCharCode();if(n===44||n===(e===1?93:e===4?125:41)||n===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(t))}return this.parseMaybeAssignAllowIn(t,n)}parsePropertyNamePrefixOperator(e){}};const eo={kind:1},to={kind:2},no=/[\uD800-\uDFFF]/u,ro=/in(?:stanceof)?/y;function io(e){for(let t=0;t<e.length;t++){let n=e[t],{type:r}=n;typeof r==`number`&&(n.type=Ci(r))}return e}var ao=class extends $a{parseTopLevel(e,t){return e.program=this.parseProgram(t,135,this.options.sourceType===`module`?`module`:`script`),e.comments=this.comments,this.optionFlags&512&&(e.tokens=io(this.tokens)),this.finishNode(e,`File`)}parseProgram(e,t,n){if(e.sourceType=n,e.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(e,!0,!0,t),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[e,t]of Array.from(this.scope.undefinedExports))this.raise(H.ModuleExportUndefined,t,{localName:e});this.addExtra(e,`topLevelAwait`,this.state.hasTopLevelAwait)}let r;return r=t===135?this.finishNode(e,`Program`):this.finishNodeAt(e,`Program`,jr(this.state.startLoc,-1)),r}stmtToDirective(e){let t=this.castNodeTo(e,`Directive`),n=this.castNodeTo(e.expression,`DirectiveLiteral`),r=n.value,i=this.input.slice(this.offsetToSourcePos(n.start),this.offsetToSourcePos(n.end)),a=n.value=i.slice(1,-1);return this.addExtra(n,`raw`,i),this.addExtra(n,`rawValue`,a),this.addExtra(n,`expressionValue`,r),t.value=n,delete e.expression,t}parseInterpreterDirective(){if(!this.match(24))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,`InterpreterDirective`)}isLet(){return this.isContextual(96)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(103)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(103))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);if(this.isUnparsedContextual(e,`of`)){let t=this.lookaheadCharCodeSince(e+2);if(t!==61&&t!==58&&t!==59)return!1}return!!(this.chStartsBindingIdentifier(t,e)||this.isUnparsedContextual(e,`void`))}nextTokenIsIdentifierOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifier(t,e)}isAwaitUsing(){if(!this.isContextual(92))return!1;let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,`using`)){e=this.nextTokenInLineStartSince(e+5);let t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))return!0}return!1}chStartsBindingIdentifier(e,t){if(Ai(e)){if(ro.lastIndex=t,ro.test(this.input)){let e=this.codePointAtPos(ro.lastIndex);if(!ji(e)&&e!==92)return!1}return!0}else if(e===92)return!0;else return!1}chStartsBindingPattern(e){return e===91||e===123}hasFollowingBindingAtom(){let e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===123||this.chStartsBindingIdentifier(t,e)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(22)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){let n=this.state.type,r=this.startNode(),i=!!(e&2),a=!!(e&4),o=e&1;switch(n){case 56:return this.parseBreakContinueStatement(r,!0);case 59:return this.parseBreakContinueStatement(r,!1);case 60:return this.parseDebuggerStatement(r);case 86:return this.parseDoWhileStatement(r);case 87:return this.parseForStatement(r);case 64:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?H.StrictFunction:this.options.annexB?H.SloppyFunctionAnnexB:H.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 76:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,r),!0);case 65:return this.parseIfStatement(r);case 66:return this.parseReturnStatement(r);case 67:return this.parseSwitchStatement(r);case 68:return this.parseThrowStatement(r);case 69:return this.parseTryStatement(r);case 92:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(H.AwaitUsingNotInAsyncContext,r):this.raise(H.UnexpectedLexicalDeclaration,r):this.raise(H.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,`await using`);break;case 103:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?i||this.raise(H.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(H.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,`using`);case 96:{if(this.state.containsEsc)break;let e=this.nextTokenStart(),t=this.codePointAtPos(e);if(t!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(t,e)&&t!==123))break}case 71:i||this.raise(H.UnexpectedLexicalDeclaration,this.state.startLoc);case 70:{let e=this.state.value;return this.parseVarStatement(r,e)}case 88:return this.parseWhileStatement(r);case 72:return this.parseWithStatement(r);case 2:return this.parseBlock();case 9:return this.parseEmptyStatement(r);case 79:{let e=this.lookaheadCharCode();if(e===40||e===46)break}case 78:{!(this.optionFlags&8)&&!o&&this.raise(H.UnexpectedImportExport,this.state.startLoc),this.next();let e;return e=n===79?this.parseImport(r):this.parseExport(r,t),this.assertModuleNodeAllowed(e),e}default:if(this.isAsyncFunction())return i||this.raise(H.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let s=this.state.value,c=this.parseExpression();return q(n)&&c.type===`Identifier`&&this.eat(10)?this.parseLabeledStatement(r,s,c,e):this.parseExpressionStatement(r,c,t)}assertModuleNodeAllowed(e){!(this.optionFlags&8)&&!this.inModule&&this.raise(H.ImportOutsideModule,e)}maybeTakeDecorators(e,t,n){if(e){var r;(r=t.decorators)!=null&&r.length?(this.raise(H.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),n&&this.resetStartLocationFromNode(n,t)}return t}canHaveLeadingDecorator(){return this.match(76)}parseDecorators(e){let t=[];do t.push(this.parseDecorator());while(this.match(22));if(this.match(78))e||this.unexpected();else if(!this.canHaveLeadingDecorator())throw this.raise(H.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin([`decorators`,`decorators-legacy`]);let e=this.startNode();if(this.next(),this.hasPlugin(`decorators`)){let t=this.state.startLoc,n;if(this.match(6)){let t=this.state.startLoc;this.next(),n=this.parseExpression(),this.expect(7),n=this.wrapParenthesis(t,n);let r=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(n,t),e.expression!==n&&this.raise(H.DecoratorArgumentsOutsideParentheses,r)}else{for(n=this.parseIdentifier(!1);this.eat(12);){let e=this.startNodeAt(t);e.object=n,this.match(134)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),e.property=this.parsePrivateName()):e.property=this.parseIdentifier(!0),e.computed=!1,n=this.finishNode(e,`MemberExpression`)}e.expression=this.parseMaybeDecoratorArguments(n,t)}}else this.state.canStartArrow=!1,e.expression=this.parseExprSubscripts();return this.finishNode(e,`Decorator`)}parseMaybeDecoratorArguments(e,t){if(this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.toReferencedList(n.arguments),this.finishNode(n,`CallExpression`)}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?`BreakStatement`:`ContinueStatement`)}verifyBreakContinue(e,t){let n;for(n=0;n<this.state.labels.length;++n){let r=this.state.labels[n];if((e.label==null||r.name===e.label.name)&&(r.kind!=null&&(t||r.kind===1)||e.label&&t))break}if(n===this.state.labels.length){let n=t?`BreakStatement`:`ContinueStatement`;this.raise(H.IllegalBreakContinue,e,{type:n})}}parseDebuggerStatement(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)}parseHeaderExpression(){this.expect(6);let e=this.parseExpression();return this.expect(7),e}parseDoWhileStatement(e){return this.next(),this.state.labels.push(eo),e.body=this.parseStatement(),this.state.labels.pop(),this.expect(88),e.test=this.parseHeaderExpression(),this.eat(9),this.finishNode(e,`DoWhileStatement`)}parseForStatement(e){this.next(),this.state.labels.push(eo);let t=null;if(this.isContextual(92)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(6),this.match(9))return t!==null&&this.unexpected(t),this.parseFor(e,null);let n=this.isContextual(96);{let r=this.isAwaitUsing(),i=r||this.isForUsing(),a=n&&this.hasFollowingBindingAtom()||i;if(this.match(70)||this.match(71)||a){let n=this.startNode(),a;r?(a=`await using`,this.recordAwaitIfAllowed()||this.raise(H.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):a=this.state.value,this.next(),this.parseVar(n,!0,a);let o=this.finishNode(n,`VariableDeclaration`),s=this.match(54);return s&&i&&this.raise(H.ForInUsing,o),(s||this.isContextual(98))&&o.declarations.length===1?this.parseForIn(e,o,t):(t!==null&&this.unexpected(t),this.parseFor(e,o))}}let r=this.isContextual(91),i=new qa,a=this.parseExpression(!0,i),o=this.isContextual(98);if(o&&(n&&this.raise(H.ForOfLet,a),t===null&&r&&a.type===`Identifier`&&this.raise(H.ForOfAsync,a)),o||this.match(54)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let n=o?`ForOfStatement`:`ForInStatement`;return this.checkLVal(a,{type:n}),this.parseForIn(e,a,t)}else this.checkExpressionErrors(i,!0);return t!==null&&this.unexpected(t),this.parseFor(e,a)}parseFunctionStatement(e,t,n){return this.next(),this.parseFunction(e,1|(n?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(62)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,`IfStatement`)}parseReturnStatement(e){return this.prodParam.hasReturn||this.raise(H.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let t=e.cases=[];this.expect(2),this.state.labels.push(to),this.scope.enter(256);let n;for(let e;!this.match(4);)if(this.match(57)||this.match(61)){let r=this.match(57);n&&this.finishNode(n,`SwitchCase`),t.push(n=this.startNode()),n.consequent=[],this.next(),r?n.test=this.parseExpression():(e&&this.raise(H.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),e=!0,n.test=null),this.expect(10)}else n?n.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),n&&this.finishNode(n,`SwitchCase`),this.next(),this.state.labels.pop(),this.finishNode(e,`SwitchStatement`)}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(H.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&e.type===`Identifier`?8:0),this.checkLVal(e,{type:`CatchClause`},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(58)){let t=this.startNode();this.next(),this.match(6)?(this.expect(6),t.param=this.parseCatchClauseParam(),this.expect(7)):(t.param=null,this.scope.enter(0)),t.body=this.parseBlock(!1,!1),this.scope.exit(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(63)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(H.NoCatchOrFinally,e),this.finishNode(e,`TryStatement`)}parseVarStatement(e,t,n=!1){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(eo),e.body=this.parseStatement(),this.state.labels.pop(),this.finishNode(e,`WhileStatement`)}parseWithStatement(e){return this.state.strict&&this.raise(H.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.parseStatement(),this.finishNode(e,`WithStatement`)}parseEmptyStatement(e){return this.next(),this.finishNode(e,`EmptyStatement`)}parseLabeledStatement(e,t,n,r){for(let e of this.state.labels)e.name===t&&this.raise(H.LabelRedeclaration,n,{labelName:t});let i=fi(this.state.type)?1:this.match(67)?2:null;for(let t=this.state.labels.length-1;t>=0;t--){let n=this.state.labels[t];if(n.statementStart===e.start)n.statementStart=this.sourceToOffsetPos(this.state.start),n.kind=i;else break}return this.state.labels.push({name:t,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)}parseExpressionStatement(e,t,n){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)}parseBlock(e=!1,t=!0,n){let r=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(2),t&&this.scope.enter(0),this.parseBlockBody(r,e,!1,4,n),t&&this.scope.exit(),this.finishNode(r,`BlockStatement`)}isValidDirective(e){return e.type===`ExpressionStatement`&&e.expression.type===`StringLiteral`&&!e.expression.extra.parenthesized}parseBlockBody(e,t,n,r,i){let a=e.body=[],o=e.directives=[];this.parseBlockOrModuleBlockBody(a,t?o:void 0,n,r,i)}parseBlockOrModuleBlockBody(e,t,n,r,i){let a=this.state.strict,o=!1,s=!1;for(;!this.match(r);){let r=n?this.parseModuleItem():this.parseStatementListItem();if(t&&!s){if(this.isValidDirective(r)){let e=this.stmtToDirective(r);t.push(e),!o&&e.value.value===`use strict`&&(o=!0,this.setStrict(!0));continue}s=!0,this.state.strictErrors.clear()}e.push(r)}i==null||i.call(this,o),a||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(9)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(7)?null:this.parseExpression(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,`ForStatement`)}parseForIn(e,t,n){let r=this.match(54);return this.next(),r?n!==null&&this.unexpected(n):e.await=n!==null,t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(H.ForInOfLoopInitializer,t,{type:r?`ForInStatement`:`ForOfStatement`}),t.type===`AssignmentPattern`&&this.raise(H.InvalidLhs,t,{ancestor:{type:`ForStatement`}}),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,r?`ForInStatement`:`ForOfStatement`)}parseVar(e,t,n,r=!1){let i=e.declarations=[];for(e.kind=n;;){let e=this.startNode();if(this.parseVarId(e,n),e.init=this.eat(25)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,e.init===null&&!r&&(e.id.type!==`Identifier`&&!(t&&(this.match(54)||this.isContextual(98)))?this.raise(H.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:`destructuring`}):(n===`const`||n===`using`||n===`await using`)&&!(this.match(54)||this.isContextual(98))&&this.raise(H.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:n})),i.push(this.finishNode(e,`VariableDeclarator`)),!this.eat(8))break}return e}parseVarId(e,t){let n=this.parseBindingAtom();t===`using`||t===`await using`?(n.type===`ArrayPattern`||n.type===`ObjectPattern`)&&this.raise(H.UsingDeclarationHasBindingPattern,n):n.type===`VoidPattern`&&this.raise(H.UnexpectedVoidPattern,n),this.checkLVal(n,{type:`VariableDeclarator`},t===`var`?5:8201),e.id=n}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){let n=t&2,r=!!(t&1),i=r&&!(t&4),a=!!(t&8);return this.initFunction(e,a),this.match(51)&&(n&&this.raise(H.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),r&&(e.id=this.parseFunctionId(i)),this.scope.enter(514),this.prodParam.enter(Ga(a,e.generator)),r||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.parseFunctionBodyAndFinish(e,r?`FunctionDeclaration`:`FunctionExpression`),this.prodParam.exit(),this.scope.exit(),r&&!n&&this.registerFunctionStatementId(e),e}parseFunctionId(e){return e||q(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(6),this.expressionScope.enter(Ba()),e.params=this.parseBindingList(7,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.start)}parseClass(e,t,n){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,n),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,r),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)}isClassProperty(){return this.match(25)||this.match(9)||this.match(4)}isClassMethod(){return this.match(6)}nameIsConstructor(e){return e.type===`Identifier`&&e.name===`constructor`||e.type===`StringLiteral`&&e.value===`constructor`}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();let n={hadConstructor:!1,hadSuperClass:e},r=[],i=this.startNode();for(i.body=[],this.expect(2);!this.match(4);){if(this.eat(9)){if(r.length>0)throw this.raise(H.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(22)){r.push(this.parseDecorator());continue}let e=this.startNode();r.length&&(e.decorators=r,this.resetStartLocationFromNode(e,r[0]),r=[]),this.parseClassMember(i,e,n)}if(this.state.strict=t,this.next(),r.length)throw this.raise(H.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,`ClassBody`)}parseClassMemberFromModifier(e,t){let n=this.parseIdentifier(!0);if(this.isClassMethod()){let r=t;return r.kind=`method`,r.computed=!1,r.key=n,r.static=!1,this.pushClassMethod(e,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=t;return r.computed=!1,r.key=n,r.static=!1,e.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(n),!1}parseClassMember(e,t,n){let r=this.isContextual(102);if(r){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(2)){this.parseClassStaticBlock(e,t);return}}this.parseClassMemberWithIsStatic(e,t,n,r)}parseClassMemberWithIsStatic(e,t,n,r){let i=t,a=t,o=t,s=t,c=t,l=i,u=i;if(t.static=r,this.parsePropertyNamePrefixOperator(t),this.eat(51)){l.kind=`method`;let t=this.match(134);if(this.parseClassElementName(l),this.parsePostMemberNameModifiers(l),t){this.pushClassPrivateMethod(e,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(H.ConstructorIsGenerator,i.key),this.pushClassMethod(e,i,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&q(this.state.type),f=this.parseClassElementName(t),p=d?f.name:null,m=this.isPrivateName(f),ee=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(l.kind=`method`,m){this.pushClassPrivateMethod(e,a,!1,!1);return}let r=this.isNonstaticConstructor(i),o=!1;r&&(i.kind=`constructor`,i.decorators&&i.decorators.length>0&&this.raise(H.DecoratorConstructor,t),n.hadConstructor&&!this.hasPlugin(`typescript`)&&this.raise(H.DuplicateConstructor,f),r&&this.hasPlugin(`typescript`)&&t.override&&this.raise(H.OverrideOnConstructor,f),n.hadConstructor=!0,o=n.hadSuperClass),this.pushClassMethod(e,i,!1,!1,r,o)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o);else if(p===`async`&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(f);let t=this.eat(51);u.optional&&this.unexpected(ee),l.kind=`method`;let n=this.match(134);this.parseClassElementName(l),this.parsePostMemberNameModifiers(u),n?this.pushClassPrivateMethod(e,a,t,!0):(this.isNonstaticConstructor(i)&&this.raise(H.ConstructorIsAsync,i.key),this.pushClassMethod(e,i,t,!0,!1,!1))}else if((p===`get`||p===`set`)&&!(this.match(51)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(f),l.kind=p;let t=this.match(134);this.parseClassElementName(i),t?this.pushClassPrivateMethod(e,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(H.ConstructorIsAccessor,i.key),this.pushClassMethod(e,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(p===`accessor`&&!this.isLineTerminator()){this.expectPlugin(`decoratorAutoAccessors`),this.resetPreviousNodeTrailingComments(f);let t=this.match(134);this.parseClassElementName(o),this.pushClassAccessorProperty(e,c,t)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o):this.unexpected()}parseClassElementName(e){let{type:t,value:n}=this.state;if((t===128||t===130)&&e.static&&n===`prototype`&&this.raise(H.StaticPrototype,this.state.startLoc),t===134){n===`constructor`&&this.raise(H.ConstructorClassPrivateField,this.state.startLoc);let t=this.parsePrivateName();return e.key=t,t}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){var n;this.scope.enter(720);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let i=t.body=[];this.parseBlockOrModuleBlockBody(i,void 0,!1,4),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,e.body.push(this.finishNode(t,`StaticBlock`)),(n=t.decorators)!=null&&n.length&&this.raise(H.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(H.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){let n=this.parseClassPrivateProperty(t);e.body.push(n),this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),0,n.key.start)}pushClassAccessorProperty(e,t,n){!n&&!t.computed&&this.nameIsConstructor(t.key)&&this.raise(H.ConstructorClassField,t.key);let r=this.parseClassAccessorProperty(t);e.body.push(r),n&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.start)}pushClassMethod(e,t,n,r,i,a){e.body.push(this.parseMethod(t,n,r,i,a,`ClassMethod`,!0))}pushClassPrivateMethod(e,t,n,r){let i=this.parseMethod(t,n,r,!1,!1,`ClassPrivateMethod`,!0);e.body.push(i);let a=i.kind===`get`?i.static?6:2:i.kind===`set`?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassPrivateProperty`)}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassProperty`)}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassAccessorProperty`)}parseInitializer(e){this.scope.enter(592),this.expressionScope.enter(Ua()),this.prodParam.enter(0),e.value=this.eat(25)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,n,r=8331){if(q(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,r);else if(n||!t)e.id=null;else throw this.raise(H.MissingClassName,this.state.startLoc)}parseClassSuper(e){this.eat(77)?(this.state.canStartArrow=!1,e.superClass=this.parseExprSubscripts()):e.superClass=null}parseExport(e,t){let n=this.parseMaybeImportPhase(e,!0),r=this.maybeParseExportDefaultSpecifier(e,n),i=!r||this.eat(8),a=i&&this.eatExportStar(e),o=a&&this.maybeParseExportNamespaceSpecifier(e),s=i&&(!o||this.eat(8)),c=r||a;if(a&&!o){if(r&&this.unexpected(),t)throw this.raise(H.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,`ExportAllDeclaration`)}let l=this.maybeParseExportNamedSpecifiers(e);r&&i&&!a&&!l&&this.unexpected(null,2),o&&s&&this.unexpected(null,94);let u;if(c||l){if(u=!1,t)throw this.raise(H.UnsupportedDecoratorExport,e);this.parseExportFrom(e,c)}else u=this.maybeParseExportDeclaration(e);if(c||l||u){var d;let n=e;if(this.checkExport(n,!0,!1,!!n.source),((d=n.declaration)==null?void 0:d.type)===`ClassDeclaration`)this.maybeTakeDecorators(t,n.declaration,n);else if(t)throw this.raise(H.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(n,`ExportNamedDeclaration`)}if(this.eat(61)){let n=e,r=this.parseExportDefaultExpression();if(n.declaration=r,r.type===`ClassDeclaration`)this.maybeTakeDecorators(t,r,n);else if(t)throw this.raise(H.UnsupportedDecoratorExport,e);return this.checkExport(n,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(n,`ExportDefaultDeclaration`)}throw this.unexpected(null,2)}eatExportStar(e){return this.eat(51)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin(`exportDefaultFrom`,t==null?void 0:t.start);let n=t||this.parseIdentifier(!0),r=this.startNodeAtNode(n);return r.exported=n,e.specifiers=[this.finishNode(r,`ExportDefaultSpecifier`)],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(89)){e.specifiers!=null||(e.specifiers=[]);let t=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),t.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(t,`ExportNamespaceSpecifier`)),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(2)){let t=e;t.specifiers||(t.specifiers=[]);let n=t.exportKind===`type`;return t.specifiers.push(...this.parseExportSpecifiers(n)),t.source=null,t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0):!1}isAsyncFunction(){if(!this.isContextual(91))return!1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,`function`)}parseExportDefaultExpression(){let e=this.startNode();if(this.match(64))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(76))return this.parseClass(e,!0,!0);if(this.match(22))return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(71)||this.match(70)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(H.UnsupportedDefaultExport,this.state.startLoc);let t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){return this.match(76)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(q(e)){if(e===91&&!this.state.containsEsc||e===96)return!1;if((e===126||e===125)&&!this.state.containsEsc){let e=this.nextTokenStart(),t=this.input.charCodeAt(e);if(t===123||this.chStartsBindingIdentifier(t,e)&&!this.input.startsWith(`from`,e))return this.expectOnePlugin([`flow`,`typescript`]),!1}}else if(!this.match(61))return!1;let t=this.nextTokenStart(),n=this.isUnparsedContextual(t,`from`);if(this.input.charCodeAt(t)===44||q(this.state.type)&&n)return!0;if(this.match(61)&&n){let e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return e===34||e===39}return!1}parseExportFrom(e,t){this.eatContextual(94)?(e.source=this.parseImportSource(),this.checkExport(e),this.maybeParseImportAttributes(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:e}=this.state;return e===22&&(this.expectOnePlugin([`decorators`,`decorators-legacy`]),this.hasPlugin(`decorators`))?!0:this.isUsing()||this.isAwaitUsing()?(this.raise(H.UsingDeclarationExport,this.state.startLoc),!0):e===70||e===71||e===64||e===76||this.isLet()||this.isAsyncFunction()}checkExport(e,t,n,r){if(t){var i;if(n){if(this.checkDuplicateExports(e,`default`),this.hasPlugin(`exportDefaultFrom`)){var a;let t=e.declaration;t.type===`Identifier`&&t.name===`from`&&t.end-t.start===4&&!((a=t.extra)!=null&&a.parenthesized)&&this.raise(H.ExportDefaultFromAsIdentifier,t)}}else if((i=e.specifiers)!=null&&i.length)for(let t of e.specifiers){let{exported:e}=t,n=e.type===`Identifier`?e.name:e.value;if(this.checkDuplicateExports(t,n),!r&&t.local){let{local:e}=t;e.type===`Identifier`?(this.checkReservedWord(e.name,e.start,!0,!1),this.scope.checkLocalExport(e)):this.raise(H.ExportBindingIsString,t,{localName:e.value,exportName:n})}}else if(e.declaration){let t=e.declaration;if(t.type===`FunctionDeclaration`||t.type===`ClassDeclaration`){let{id:n}=t;if(!n)throw Error(`Assertion failure`);this.checkDuplicateExports(e,n.name)}else if(t.type===`VariableDeclaration`)for(let e of t.declarations)this.checkDeclaration(e.id)}}}checkDeclaration(e){if(e.type===`Identifier`)this.checkDuplicateExports(e,e.name);else if(e.type===`ObjectPattern`)for(let t of e.properties)this.checkDeclaration(t);else if(e.type===`ArrayPattern`)for(let t of e.elements)t&&this.checkDeclaration(t);else e.type===`ObjectProperty`?this.checkDeclaration(e.value):e.type===`RestElement`?this.checkDeclaration(e.argument):e.type===`AssignmentPattern`&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&(t==="default"?this.raise(H.DuplicateDefaultExport,e):this.raise(H.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){let t=[],n=!0;for(this.expect(2);!this.eat(4);){if(n)n=!1;else if(this.expect(8),this.eat(4))break;let r=this.isContextual(126),i=this.match(130),a=this.startNode();a.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(a,i,e,r))}return t}parseExportSpecifier(e,t,n,r){return this.eatContextual(89)?e.exported=this.parseModuleExportName():t?e.exported=this.cloneStringLiteral(e.local):e.exported||(e.exported=this.cloneIdentifier(e.local)),this.finishNode(e,`ExportSpecifier`)}parseModuleExportName(){if(this.match(130)){let e=this.parseStringLiteral(this.state.value),t=no.exec(e.value);return t&&this.raise(H.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}checkImportPhase(e){let{specifiers:t}=e,n=t.length===1?t[0].type:null;e.phase===`source`?n!==`ImportDefaultSpecifier`&&this.raise(H.SourcePhaseImportRequiresDefault,t[0]):e.phase===`defer`&&n!==`ImportNamespaceSpecifier`&&this.raise(H.DeferImportRequiresNamespace,t[0])}isPotentialImportPhase(e){return e?!1:this.isContextual(101)||this.isContextual(93)}applyImportPhase(e,t,n,r){t||(n===`source`?(this.expectPlugin(`sourcePhaseImports`,r),e.phase=`source`):n===`defer`?(this.expectPlugin(`deferredImportEvaluation`,r),e.phase=`defer`):this.hasPlugin(`sourcePhaseImports`)&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;let n=this.startNode(),r=this.parseIdentifierName(!0),{type:i}=this.state;return(oi(i)?i!==94||this.lookaheadCharCode()===102:i!==8)?(this.applyImportPhase(e,t,r,n.start),null):(this.applyImportPhase(e,t,null),this.createIdentifier(n,r))}isPrecedingIdImportPhase(e){let{type:t}=this.state;return q(t)?t!==94||this.lookaheadCharCode()===102:t!==8}parseImport(e){return this.match(130)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];let n=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(8),r=n&&this.maybeParseStarImportSpecifier(e);return n&&!r&&this.parseNamedImportSpecifiers(e),this.expectContextual(94),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){return e.specifiers!=null||(e.specifiers=[]),e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportPhase(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.match(130)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,n){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}finishImportSpecifier(e,t,n=8201){return this.checkLVal(e.local,{type:t},n),this.finishNode(e,t)}parseImportAttributes(){this.expect(2);let e=[],t=new Set;do{if(this.match(4))break;let n=this.startNode(),r=this.state.value;if(t.has(r)&&this.raise(H.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),t.add(r),this.match(130)?n.key=this.parseStringLiteral(r):n.key=this.parseIdentifier(!0),this.expect(10),!this.match(130))throw this.raise(H.ModuleAttributeInvalidValue,this.state.startLoc);n.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(n,`ImportAttribute`))}while(this.eat(8));return this.expect(4),e}maybeParseImportAttributes(e){let t;if(this.match(72)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),t=this.parseImportAttributes()}else t=[];e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishImportSpecifier(n,`ImportDefaultSpecifier`)),!0}else if(oi(this.state.type))return this.parseImportSpecifierLocal(e,this.startNode(),`ImportDefaultSpecifier`),!0;return!1}maybeParseStarImportSpecifier(e){if(this.match(51)){let t=this.startNode();return this.next(),this.expectContextual(89),this.parseImportSpecifierLocal(e,t,`ImportNamespaceSpecifier`),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(2);!this.eat(4);){if(t)t=!1;else{if(this.eat(10))throw this.raise(H.DestructureNamedImport,this.state.startLoc);if(this.expect(8),this.eat(4))break}let n=this.startNode(),r=this.match(130),i=this.isContextual(126);n.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(n,r,e.importKind===`type`||e.importKind===`typeof`,i,void 0);e.specifiers.push(a)}}parseImportSpecifier(e,t,n,r,i){if(this.eatContextual(89))e.local=this.parseIdentifier();else{let{imported:n}=e;if(t)throw this.raise(H.ImportBindingIsString,e,{importName:n.value});this.checkReservedWord(n.name,e.start,!0,!0),e.local||(e.local=this.cloneIdentifier(n))}return this.finishImportSpecifier(e,`ImportSpecifier`,i)}isThisParam(e){return e.type===`Identifier`&&e.name===`this`}};const oo=/in(?:stanceof)?|as|satisfies/y;function so(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function co(e){if(!e)throw Error(`Assert fail`)}const X=Wr`typescript`({AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:`An 'accessor' property cannot be declared optional.`,AccessorCannotDeclareThisParameter:`'get' and 'set' accessors cannot declare 'this' parameters.`,AccessorCannotHaveTypeParameters:`An accessor cannot have type parameters.`,ClassMethodHasDeclare:`Class methods cannot have the 'declare' modifier.`,ClassMethodHasReadonly:`Class methods cannot have the 'readonly' modifier.`,ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:`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:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:`Initializers are not allowed in ambient contexts.`,DeclareFunctionHasImplementation:`An implementation cannot be declared in ambient contexts.`,DecoratorAbstractMethod:({kind:e})=>`Decorators can't be used with ${e.startsWith(`a`)?`an`:`a`} ${e}.`,DuplicateAccessibilityModifier:({modifier:e})=>`Accessibility modifier already seen: '${e}'.`,DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' 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.`,ExportAssignmentInTSNamespace:`An export assignment cannot be used in a namespace.`,ExportInTSNamespace:`Export declarations are not permitted in a namespace.`,ImportAliasHasImportType:`An import alias can not use 'import type'.`,ImportInTSNamespace:`Import declarations in a namespace cannot reference a module.`,IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:`Index signatures cannot have the 'abstract' modifier.`,IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,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.`,InlineModuleDeclarationMustUseString:"`module ... {}` declarations must have a string name. Use `namespace ... {}` instead.",InvalidHeritageClauseType:({token:e})=>`'${e}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:e=>`'${e}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:e=>`'${e}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[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.`,NamespaceExportInTSNamespace:`Global module exports may only appear at top level.`,NonAbstractClassHasAbstractMethod:`Abstract methods can only appear within an abstract class.`,NonClassMethodPropertyHasAbstractModifier:`'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:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,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.",SetAccessorCannotHaveOptionalParameter:`A 'set' accessor cannot have an optional parameter.`,SetAccessorCannotHaveRestParameter:`A 'set' accessor cannot have rest parameter.`,SetAccessorCannotHaveReturnType:`A 'set' accessor cannot have a return type annotation.`,SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,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.`,UnexpectedParameterInitializer:`A parameter initializer is only allowed in a function or constructor implementation.`,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.`,UnexpectedTypeDeclaration:e=>`'${e}' declarations can only be declared inside a block.`,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:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,UsingDeclarationInAmbientContext:e=>`'${e}' declarations are not allowed in ambient contexts.`});function lo(e){switch(e){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 uo(e){return e===`private`||e===`public`||e===`protected`}function fo(e){return e===`in`||e===`out`}function po(e){var t;if((t=e.extra)!=null&&t.parenthesized)return!1;switch(e.type){case`Identifier`:return!0;case`MemberExpression`:return!e.computed&&po(e.object);case`TSInstantiationExpression`:return po(e.expression);default:return!1}}const mo=e=>class extends e{constructor(...e){super(...e),r(this,`tsParseInOutModifiers`,this.tsParseModifiers.bind(this,{allowedModifiers:[`in`,`out`],disallowedModifiers:[`const`,`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`],errorTemplate:X.InvalidModifierOnTypeParameter})),r(this,`tsParseConstModifier`,this.tsParseModifiers.bind(this,{allowedModifiers:[`const`],disallowedModifiers:[`in`,`out`],errorTemplate:X.InvalidModifierOnTypeParameterPositions})),r(this,`tsParseInOutConstModifiers`,this.tsParseModifiers.bind(this,{allowedModifiers:[`in`,`out`,`const`],disallowedModifiers:[`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`],errorTemplate:X.InvalidModifierOnTypeParameter}))}getScopeHandler(){return pa}tsIsIdentifier(){return q(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(2)||this.match(51)||this.match(17)||this.match(134)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(102)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,t,n){if(!q(this.state.type)&&this.state.type!==54&&this.state.type!==71)return;let r=this.state.value;if(e.includes(r)){if(n&&this.match(102)||t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:n,errorTemplate:r=X.InvalidModifierOnTypeMember},i){let a=(e,t,n,r)=>{t===n&&i[r]&&this.raise(X.InvalidModifiersOrder,e,{orderedModifiers:[n,r]})},o=(e,t,n,r)=>{(i[n]&&t===r||i[r]&&t===n)&&this.raise(X.IncompatibleModifiers,e,{modifiers:[n,r]})};for(;;){let{startLoc:s}=this.state,c=this.tsParseModifier(e.concat(t==null?[]:t),n,i.static);if(!c)break;uo(c)?i.accessibility?this.raise(X.DuplicateAccessibilityModifier,s,{modifier:c}):(a(s,c,c,`override`),a(s,c,c,`static`),a(s,c,c,`readonly`),i.accessibility=c):fo(c)?(i[c]&&this.raise(X.DuplicateModifier,s,{modifier:c}),i[c]=!0,a(s,c,`in`,`out`)):(Object.hasOwn(i,c)?this.raise(X.DuplicateModifier,s,{modifier:c}):(a(s,c,`static`,`readonly`),a(s,c,`static`,`override`),a(s,c,`override`,`readonly`),a(s,c,`abstract`,`override`),o(s,c,`declare`,`override`),o(s,c,`static`,`abstract`)),i[c]=!0),t!=null&&t.includes(c)&&this.raise(r,s,{modifier:c})}}tsIsListTerminator(e){switch(e){case`EnumMembers`:case`TypeMembers`:return this.match(4);case`HeritageClauseElement`:return this.match(2);case`TupleElementTypes`:return this.match(1);case`TypeParametersOrArguments`:return this.match(44)}}tsParseList(e,t){let n=[];for(;!this.tsIsListTerminator(e);)n.push(t());return n}tsParseDelimitedList(e,t,n){return so(this.tsParseDelimitedListWorker(e,t,!0,n))}tsParseDelimitedListWorker(e,t,n,r){let i=[],a=-1;for(;!this.tsIsListTerminator(e);){a=-1;let r=t();if(r==null)return;if(i.push(r),this.eat(8)){a=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(8);return}return r&&(r.value=a),i}tsParseBracketedList(e,t,n,r,i){r||(n?this.expect(0):this.expect(43));let a=this.tsParseDelimitedList(e,t,i);return n?this.expect(1):this.expect(44),a}tsParseImportType(){let e=this.startNode();return this.expect(79),this.expect(6),this.match(130)?e.source=this.parseStringLiteral(this.state.value):(this.raise(X.UnsupportedImportTypeArgument,this.state.startLoc),e.source=this.tsParseNonConditionalType()),this.eat(8)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(7),this.eat(12)&&(e.qualifier=this.tsParseEntityName(3)),this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSImportType`)}tsParseImportTypeOptions(){let e=this.startNode();this.expect(2);let t=this.startNode();return this.isContextual(72)?(t.method=!1,t.key=this.parseIdentifier(!0),t.computed=!1,t.shorthand=!1):this.unexpected(null,72),this.expect(10),t.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(t)],this.eat(8),this.expect(4),this.finishNode(e,`ObjectExpression`)}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),t=[];for(this.expect(2);!this.match(4);){let e=this.state.type;q(e)||e===130?t.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(8)}return e.properties=t,this.next(),this.finishNode(e,`ObjectExpression`)}tsParseEntityName(e){let t;if(e&1&&this.match(74))if(e&2)t=this.parseIdentifier(!0);else{let e=this.startNode();this.next(),t=this.finishNode(e,`ThisExpression`)}else t=this.parseIdentifier(!!(e&1));for(;this.eat(12);){let n=this.startNodeAtNode(t);n.left=t,n.right=this.parseIdentifier(!!(e&1)),t=this.finishNode(n,`TSQualifiedName`)}return t}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeReference`)}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,`TSTypePredicate`)}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,`TSThisType`)}tsParseTypeQuery(){let e=this.startNode();return this.expect(83),this.match(79)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeQuery`)}tsParseTypeParameter(e){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(77),t.default=this.tsEatThenParseType(25),this.finishNode(t,`TSTypeParameter`)}tsTryParseTypeParameters(e){if(this.match(43))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(43)||this.match(138)?this.next():this.unexpected();let n={value:-1};return t.params=this.tsParseBracketedList(`TypeParametersOrArguments`,this.tsParseTypeParameter.bind(this,e),!1,!0,n),t.params.length===0&&this.raise(X.EmptyTypeParameters,t),n.value!==-1&&this.addExtra(t,`trailingComma`,n.value),this.finishNode(t,`TSTypeParameterDeclaration`)}tsFillSignature(e,t){let n=e===15;t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(6),t.params=this.tsParseBindingListForSignature(),(n||this.match(e))&&(t.returnType=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(7,41,2);for(let t of e){let{type:e}=t;(e===`AssignmentPattern`||e===`TSParameterProperty`)&&this.raise(X.UnsupportedSignatureParameterKind,t,{type:e})}return e}tsParseTypeMemberSemicolon(){!this.eat(8)&&!this.isLineTerminator()&&this.expect(9)}tsParseSignatureMember(e,t){return this.tsFillSignature(10,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),q(this.state.type)?(this.next(),this.match(10)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(1),e.parameters=[t];let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,`TSIndexSignature`)}tsParsePropertyOrMethodSignature(e,t){if(this.eat(13)&&(e.optional=!0),this.match(6)||this.match(43)){t&&this.raise(X.ReadonlyForMethodSignature,e);let n=e;if(n.kind&&this.match(43)&&this.raise(X.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(10,n),this.tsParseTypeMemberSemicolon(),n.kind===`get`)n.params.length>0&&(this.raise(H.BadGetterArity,this.state.curPosition()),this.isThisParam(n.params[0])&&this.raise(X.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(n.kind===`set`){if(n.params.length!==1)this.raise(H.BadSetterArity,this.state.curPosition());else{let e=n.params[0];this.isThisParam(e)&&this.raise(X.AccessorCannotDeclareThisParameter,this.state.curPosition()),e.type===`Identifier`&&e.optional&&this.raise(X.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),e.type===`RestElement`&&this.raise(X.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n.returnType&&this.raise(X.SetAccessorCannotHaveReturnType,n.returnType)}else n.kind=`method`;return this.finishNode(n,`TSMethodSignature`)}else{let n=e;t&&(n.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(n.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(n,`TSPropertySignature`)}}tsParseTypeMember(){let e=this.startNode();if(this.match(6)||this.match(43))return this.tsParseSignatureMember(`TSCallSignatureDeclaration`,e);if(this.match(73)){let t=this.startNode();return this.next(),this.match(6)||this.match(43)?this.tsParseSignatureMember(`TSConstructSignatureDeclaration`,e):(e.key=this.createIdentifier(t,`new`),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({allowedModifiers:[`readonly`],disallowedModifiers:[`declare`,`abstract`,`private`,`protected`,`public`,`static`,`override`]},e),this.tsTryParseIndexSignature(e)||(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.match(6)&&!this.match(43)&&this.unexpected(null,6)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,`TSTypeLiteral`)}tsParseObjectTypeMembers(){this.expect(2);let e=this.tsParseList(`TypeMembers`,this.tsParseTypeMember.bind(this));return this.expect(4),e}tsIsStartOfMappedType(){return this.next(),this.eat(49)?this.isContextual(118):(this.isContextual(118)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(54)))}tsParseMappedType(){let e=this.startNode();return this.expect(2),this.match(49)?(e.readonly=this.state.value,this.next(),this.expectContextual(118)):this.eatContextual(118)&&(e.readonly=!0),this.expect(0),e.key=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(54),e.nameType=this.eatContextual(89)?this.tsParseType():null,this.expect(1),this.match(49)?(e.optional=this.state.value,this.next(),this.expect(13)):this.eat(13)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(4),this.finishNode(e,`TSMappedType`)}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList(`TupleElementTypes`,this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(e=>{let{type:n}=e;t&&n!==`TSRestType`&&n!==`TSOptionalType`&&!(n===`TSNamedTupleMember`&&e.optional)&&this.raise(X.OptionalTypeBeforeRequired,e),t||(t=n===`TSNamedTupleMember`&&e.optional||n===`TSOptionalType`)}),this.finishNode(e,`TSTupleType`)}tsParseTupleElementType(){let e=this.state.startLoc,t=this.eat(17),{startLoc:n}=this.state,r,i,a,o,s=oi(this.state.type)?this.lookaheadCharCode():null;if(s===58)r=!0,a=!1,i=this.parseIdentifier(!0),this.expect(10),o=this.tsParseType();else if(s===63){a=!0;let e=this.state.value,t=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,i=this.createIdentifier(this.startNodeAt(n),e),this.expect(13),this.expect(10),o=this.tsParseType()):(r=!1,o=t,this.expect(13))}else o=this.tsParseType(),a=this.eat(13),r=this.eat(10);if(r){let e;i?(e=this.startNodeAt(n),e.optional=a,e.label=i,e.elementType=o,this.eat(13)&&(e.optional=!0,this.raise(X.TupleOptionalAfterType,this.state.lastTokStartLoc))):(e=this.startNodeAt(n),e.optional=a,this.raise(X.InvalidTupleMemberLabel,o),e.label=o,e.elementType=this.tsParseType()),o=this.finishNode(e,`TSNamedTupleMember`)}else if(a){let e=this.startNodeAt(n);e.typeAnnotation=o,o=this.finishNode(e,`TSOptionalType`)}if(t){let t=this.startNodeAt(e);t.typeAnnotation=o,o=this.finishNode(t,`TSRestType`)}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(6),e.typeAnnotation=this.tsParseType(),this.expect(7),this.finishNode(e,`TSParenthesizedType`)}tsParseFunctionOrConstructorType(e,t){let n=this.startNode();return e===`TSConstructorType`&&(n.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(15,n)),this.finishNode(n,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 131:case 132:case 130:case 81:case 82:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,`TSLiteralType`)}tsParseTemplateLiteralType(){let e=this.state.startLoc,t=this.parseTemplateElement(!1),n=[t];if(t.tail){let t=this.startNodeAt(e),r=this.startNodeAt(e);return r.expressions=[],r.quasis=n,t.literal=this.finishNode(r,`TemplateLiteral`),this.finishNode(t,`TSLiteralType`)}else{let r=[];for(;!t.tail;)r.push(this.tsParseType()),this.readTemplateContinuation(),n.push(t=this.parseTemplateElement(!1));let i=this.startNodeAt(e);return i.types=r,i.quasis=n,this.finishNode(i,`TSTemplateLiteralType`)}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(112)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 130:case 131:case 132:case 81:case 82:return this.tsParseLiteralTypeNode();case 49:if(this.state.value===`-`){let e=this.startNode(),t=this.lookahead();return t.type!==131&&t.type!==132&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,`TSLiteralType`)}break;case 74:return this.tsParseThisTypeOrThisTypePredicate();case 83:return this.tsParseTypeQuery();case 79:return this.tsParseImportType();case 2:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 6:if(!(this.optionFlags&2048)){let e=this.state.startLoc;this.next();let t=this.tsParseType();return this.expect(7),this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),t}return this.tsParseParenthesizedType();case 21:case 20:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(q(e)||e===84||e===80){let t=e===84?`TSVoidKeyword`:e===80?`TSNullKeyword`:lo(this.state.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,t=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(1)){let n=this.startNodeAt(e);n.elementType=t,this.expect(1),t=this.finishNode(n,`TSArrayType`)}else{let n=this.startNodeAt(e);n.objectType=t,n.indexType=this.tsParseType(),this.expect(1),t=this.finishNode(n,`TSIndexedAccessType`)}return t}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t===`readonly`&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,`TSTypeOperator`)}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case`TSTupleType`:case`TSArrayType`:return;default:this.raise(X.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(111);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,`TSTypeParameter`),this.finishNode(e,`TSInferType`)}tsParseConstraintForInferType(){if(this.eat(77)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(13))return e}}tsParseTypeOperatorOrHigher(){return _i(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(111)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,n){let r=this.startNode(),i=this.eat(n),a=[];do a.push(t());while(this.eat(n));return a.length===1&&!i?a[0]:(r.types=a,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSIntersectionType`,this.tsParseTypeOperatorOrHigher.bind(this),41)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSUnionType`,this.tsParseIntersectionTypeOrHigher.bind(this),39)}tsIsStartOfFunctionType(){return this.match(43)?!0:this.match(6)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(q(this.state.type)||this.match(74))return this.next(),!0;if(this.match(2)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(4,!0),e.length===t}catch(e){return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(1,93,1),e.length===t}catch(e){return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(7)||this.match(17)||this.tsSkipParameterStart()&&(this.match(10)||this.match(8)||this.match(13)||this.match(25)||this.match(7)&&(this.next(),this.match(15))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let n=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(74)){let e=this.tsParseThisTypeOrThisTypePredicate();return e.type===`TSThisType`?(n.parameterName=e,n.asserts=!0,n.typeAnnotation=null,e=this.finishNode(n,`TSTypePredicate`)):(this.resetStartLocationFromNode(e,n),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,`TSTypeAnnotation`)}let i=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!i)return r?(n.parameterName=this.parseIdentifier(),n.asserts=r,n.typeAnnotation=null,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)):this.tsParseTypeAnnotation(!1,t);let a=this.tsParseTypeAnnotation(!1);return n.parameterName=i,n.typeAnnotation=a,n.asserts=r,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(10))return this.tsParseTypeOrTypePredicateAnnotation(10)}tsTryParseTypeAnnotation(){if(this.match(10))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(10)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(112)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==105)return!1;let e=this.state.containsEsc;return this.next(),!q(this.state.type)&&!this.match(74)?!1:(e&&this.raise(H.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:`asserts`}),!0)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(10),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,`TSTypeAnnotation`)}tsParseType(){co(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(77))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(13),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(10),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,`TSConditionalType`)}isAbstractConstructorSignature(){return this.isContextual(120)&&this.isLookaheadContextual(`new`)}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType(`TSFunctionType`):this.match(73)?this.tsParseFunctionOrConstructorType(`TSConstructorType`):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType(`TSConstructorType`,!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(X.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?this.tsParseTypeReference():this.tsParseType())),this.expect(44),e.expression=this.parseMaybeUnary(),this.finishNode(e,`TSTypeAssertion`)}tsParseHeritageClause(e){let t=this.state.startLoc,n=this.tsParseDelimitedList(`HeritageClauseElement`,()=>{let t=(this.state.canStartArrow=!1,super.parseExprSubscripts());po(t)||this.raise(X.InvalidHeritageClauseType,t.start,{token:e});let n=e===`extends`?`TSInterfaceHeritage`:`TSClassImplements`;if(t.type===`TSInstantiationExpression`)return t.type=n,t;let r=this.startNodeAtNode(t);return r.expression=t,(this.match(43)||this.match(47))&&(r.typeArguments=this.tsParseTypeArgumentsInExpression()),this.finishNode(r,n)});return n.length||this.raise(X.EmptyHeritageClauseType,t,{token:e}),n}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(125),t.declare&&(e.declare=!0),q(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(X.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(77)&&(e.extends=this.tsParseHeritageClause(`extends`));let n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,`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(25),this.isContextual(110)&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,`TSIntrinsicKeyword`)}return this.tsParseType()}),this.semicolon(),this.finishNode(e,`TSTypeAliasDeclaration`)}tsInTopLevelContext(e){if(this.curContext()!==J.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}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(130)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(25)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,`TSEnumMember`)}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(122),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),e.body=this.tsParseEnumBody(),this.finishNode(e,`TSEnumDeclaration`)}tsParseEnumBody(){let e=this.startNode();return this.expect(2),e.members=this.tsParseDelimitedList(`EnumMembers`,this.tsParseEnumMember.bind(this)),this.expect(4),this.finishNode(e,`TSEnumBody`)}tsParseModuleBlock(e){let t=this.startNode();return e||this.scope.enter(0),this.expect(2),super.parseBlockOrModuleBlockBody(t.body=[],void 0,!0,4),e||this.scope.exit(),this.finishNode(t,`TSModuleBlock`)}tsParseNamespaceDeclaration(e){return e.id=this.tsParseEntityName(0),e.id.type===`Identifier`&&this.checkIdentifier(e.id,1024),this.scope.enter(2048),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(!1),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`TSModuleDeclaration`)}tsParseAmbientExternalModuleDeclaration(e){let t=this.isContextual(108);return t?(e.kind=`global`,e.id=this.parseIdentifier()):(e.kind=`module`,e.id=super.parseStringLiteral(this.state.value)),this.match(2)?(t||this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(t),this.prodParam.exit(),t||this.scope.exit()):this.semicolon(),this.finishNode(e,`TSModuleDeclaration`)}tsParseImportEqualsDeclaration(e,t){e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(25);let n=this.tsParseModuleReference();return e.importKind===`type`&&n.type!==`TSExternalModuleReference`&&this.raise(X.ImportAliasHasImportType,n),e.moduleReference=n,this.semicolon(),this.finishNode(e,`TSImportEqualsDeclaration`)}tsIsExternalModuleReference(){return this.isContextual(115)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(115),this.expect(6),this.match(130)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(7),this.sawUnambiguousESM=!0,this.finishNode(e,`TSExternalModuleReference`)}tsLookAhead(e){let t=this.state.clone(),n=e();return this.state=t,n}tsTryParseAndCatch(e){let t=this.tryParse(t=>e()||t());if(!(t.aborted||!t.node))return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),n=e();if(n!==void 0&&n!==!1)return n;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type;return this.tsInAmbientContext(()=>{switch(t){case 64:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 76:return e.declare=!0,this.parseClass(e,!0,!1);case 122:return this.tsParseEnumDeclaration(e,{declare:!0});case 108:return this.tsParseAmbientExternalModuleDeclaration(e);case 96:if(this.state.containsEsc)return;case 71:case 70:return!this.match(71)||!this.isLookaheadContextual(`enum`)?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(71),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 103:if(this.isUsing())return this.raise(X.InvalidModifierOnUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.parseVarStatement(e,`using`,!0);break;case 92:if(this.isAwaitUsing())return this.raise(X.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.next(),this.parseVarStatement(e,`await using`,!0);break;case 125:{let t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}default:if(q(t))return this.tsParseDeclaration(e,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(e,t,n,r){switch(t){case 120:if(this.tsCheckLineTerminator(n)&&(this.match(76)||q(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case 123:if(this.tsCheckLineTerminator(n))return this.tsParseAmbientExternalModuleDeclaration(e);break;case 124:if(this.tsCheckLineTerminator(n)&&q(this.state.type))return e.kind=`namespace`,this.tsParseNamespaceDeclaration(e);break;case 126:if(this.tsCheckLineTerminator(n)&&q(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(43))return;let t=this.tsTryParseAndCatch(()=>{let t=this.startNodeAt(e);return t.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(t),t.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(15),t});if(t)return super.parseArrowExpression(t,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===43)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(43),this.tsParseDelimitedList(`TypeParametersOrArguments`,this.tsParseType.bind(this))))),e.params.length===0?this.raise(X.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===J.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TSTypeParameterInstantiation`)}tsIsDeclarationStart(){return vi(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,t){let n=t.length?null:this.state.startLoc,r={};this.tsParseModifiers({allowedModifiers:[`public`,`private`,`protected`,`override`,`readonly`]},r);let i=r.accessibility,a=r.override,o=r.readonly;!(e&4)&&(i||o||a)&&this.raise(X.UnexpectedParameterModifier,n||t[0]);let s=this.state.startLoc,c=this.parseMaybeDefault(s);e&2&&this.parseFunctionParamType(c);let l=this.parseMaybeDefault(s,c);if(i||o||a){let e=n?this.startNodeAt(n):this.startNodeAtNode(t[0]);return t.length?e.decorators=t:this.setLoc(n),i&&(e.accessibility=i),o&&(e.readonly=o),a&&(e.override=a),l.type!==`Identifier`&&l.type!==`AssignmentPattern`&&this.raise(X.UnsupportedParameterPropertyKind,n||t[0]),e.parameter=l,this.finishNode(e,`TSParameterProperty`)}return t.length&&(c.decorators=t),l}isSimpleParameter(e){return e.type===`TSParameterProperty`&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)t.type!==`Identifier`&&t.optional&&!this.state.isAmbientContext&&this.raise(X.PatternIsOptional,t)}setArrowFunctionParameters(e,t,n){super.setArrowFunctionParameters(e,t,n),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,n=!1){this.match(10)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(10));let r=t===`FunctionDeclaration`?`TSDeclareFunction`:t===`ClassMethod`||t===`ClassPrivateMethod`?`TSDeclareMethod`:void 0;if(r&&!this.match(2)&&this.isLineTerminator()){if(r===`TSDeclareMethod`&&e.kind===`constructor`)for(let t of e.params)t.type===`TSParameterProperty`?this.raise(X.UnexpectedParameterModifier,t):t.type===`AssignmentPattern`&&this.raise(X.UnexpectedParameterInitializer,t);else for(let t of e.params)t.type===`AssignmentPattern`&&this.raise(X.UnexpectedParameterInitializer,t);return this.finishNode(e,r)}return r&&this.state.isAmbientContext&&(this.raise(X.DeclareFunctionHasImplementation,this.state.startLoc),r===`TSDeclareFunction`&&e.declare)?super.parseFunctionBodyAndFinish(e,r,n):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,n))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(e=>{(e==null?void 0:e.type)===`TSTypeCastExpression`&&this.raise(X.UnexpectedTypeAnnotation,e.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,t,n,r){if(!this.hasPrecedingLineBreak()&&this.match(31)){this.state.canStartJSXElement=!1,this.next();let n=this.startNodeAt(t);return n.expression=e,this.finishNode(n,`TSNonNullExpression`)}let i=!1;if(this.match(14)&&this.lookaheadCharCode()===60){if(n)return r.stop=!0,e;r.optionalChainMember=i=!0,this.next()}if(this.match(43)||this.match(47)){let a,o=this.tsTryParseAndCatch(()=>{if(!n&&this.atPossibleAsyncArrow(e)){let e=this.tsTryParseGenericAsyncArrowFunction(t);if(e)return r.stop=!0,e}let o=this.tsParseTypeArgumentsInExpression();if(!o)return;if(i&&!this.match(6)){a=this.state.curPosition();return}if(Si(this.state.type)){let n=super.parseTaggedTemplateExpression(e,t,r);return n.typeArguments=o,n}if(!n&&this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(n.arguments),n.typeArguments=o,r.optionalChainMember&&(n.optional=i),this.finishCallExpression(n,r.optionalChainMember)}let s=this.state.type;if(s===44||s===48||s!==6&&s!==89&&s!==116&&li(s)&&!this.hasPrecedingLineBreak())return;let c=this.startNodeAt(t);return c.expression=e,c.typeArguments=o,this.finishNode(c,`TSInstantiationExpression`)});if(a&&this.unexpected(a,6),o)return o.type===`TSInstantiationExpression`&&((this.match(12)||this.match(14)&&this.lookaheadCharCode()!==40)&&this.raise(X.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(12)&&!this.match(14)&&(o.expression=super.stopParseSubscript(e,r))),o}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){var t;super.parseNewCallee(e);let{callee:n}=e;n.type===`TSInstantiationExpression`&&!((t=n.extra)!=null&&t.parenthesized)&&(e.typeArguments=n.typeArguments,e.callee=n.expression)}parseExprOp(e,t,n){let r;if(bi(54)>n&&!this.hasPrecedingLineBreak()&&(this.isContextual(89)||(r=this.isContextual(116)))){let i=this.startNodeAt(t);i.expression=e,i.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?(r&&this.raise(H.UnexpectedKeyword,this.state.startLoc,{keyword:`const`}),this.tsParseTypeReference()):this.tsParseType()));let a=this.finishNode(i,r?`TSSatisfiesExpression`:`TSAsExpression`);return this.reScan_lt_gt(),this.parseExprOp(a,t,n)}return super.parseExprOp(e,t,n)}checkReservedWord(e,t,n,r){this.state.isAmbientContext||super.checkReservedWord(e,t,n,r)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){let t=this.lookaheadCharCode();return e?t===123||t===42:t!==61}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){super.applyImportPhase(e,t,n,r),t?e.exportKind=n===`type`?`type`:`value`:e.importKind=n===`type`||n===`typeof`?n:`value`}parseImport(e){if(this.match(130))return e.importKind=`value`,this.scope.inTSNamespace&&this.raise(X.ImportInTSNamespace,e),super.parseImport(e);let t;if(q(this.state.type)&&this.lookaheadCharCode()===61){e.importKind=`value`;let t=this.tsParseImportEqualsDeclaration(e);return this.scope.inTSNamespace&&t.moduleReference.type===`TSExternalModuleReference`&&this.raise(X.ImportInTSNamespace,e),t}else if(this.isContextual(126)){let n=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.scope.inTSNamespace&&this.raise(X.ImportInTSNamespace,e),this.tsParseImportEqualsDeclaration(e,n);t=super.parseImportSpecifiersAndAfter(e,n)}else t=super.parseImport(e);return t.importKind===`type`&&t.specifiers.length>1&&t.specifiers[0].type===`ImportDefaultSpecifier`?this.raise(X.TypeImportCannotSpecifyDefaultAndNamed,t):this.scope.inTSNamespace&&this.raise(X.ImportInTSNamespace,t),t}parseExport(e,t){if(this.match(79)){let t=this.startNode();this.next();let n=null;this.isContextual(126)&&this.isPotentialImportPhase(!1)?n=this.parseMaybeImportPhase(t,!1):t.importKind=`value`;let r=this.tsParseImportEqualsDeclaration(t,n);return e.attributes=[],e.declaration=r,e.exportKind=`value`,e.source=null,e.specifiers=[],this.finishNode(e,`ExportNamedDeclaration`)}else if(this.eat(25)){let t=e;return t.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.scope.inTSNamespace&&this.raise(X.ExportAssignmentInTSNamespace,t),this.finishNode(t,`TSExportAssignment`)}else if(this.eatContextual(89)){let t=e;return this.expectContextual(124),t.id=this.parseIdentifier(),this.checkIdentifier(t.id,8201),this.semicolon(),this.scope.inTSNamespace&&this.raise(X.NamespaceExportInTSNamespace,t),this.finishNode(t,`TSNamespaceExportDeclaration`)}else{let n=super.parseExport(e,t);return this.scope.inTSNamespace&&(n.type!==`ExportNamedDeclaration`||n.source||!n.declaration&&!this.state.isAmbientContext)&&this.raise(X.ExportInTSNamespace,n),n}}isAbstractClass(){return this.isContextual(120)&&this.isLookaheadContextual(`class`)}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(125)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,n=!1){let{isAmbientContext:r}=this.state,i=super.parseVarStatement(e,t,n||r);if(!r)return i;if(!e.declare&&(t===`using`||t===`await using`))return this.raiseOverwrite(X.UsingDeclarationInAmbientContext,e,t),i;for(let{id:e,init:n}of i.declarations)n&&(t===`var`||t===`let`||e.typeAnnotation?this.raise(X.InitializerNotAllowedInAmbientContext,n):go(n,this.hasPlugin(`estree`))||this.raise(X.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,n));return i}parseStatementContent(e,t){let n=!!(e&2);if(!this.state.containsEsc)switch(this.state.type){case 71:if(this.isLookaheadContextual(`enum`)){let e=this.startNode();return this.next(),this.tsParseEnumDeclaration(e,{const:!0})}break;case 120:case 121:if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let e=this.state.type,n=this.startNode();this.next();let r=e===121?this.tsTryParseDeclare(n):this.tsParseAbstractDeclaration(n,t);return r?(e===121&&(r.declare=!0),r):(n.expression=this.createIdentifier(this.startNodeAtNode(n),e===121?`declare`:`abstract`),this.semicolon(!1),this.finishNode(n,`ExpressionStatement`))}break;case 122:return this.tsParseEnumDeclaration(this.startNode());case 108:if(this.lookaheadCharCode()===123){let e=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(e)}break;case 125:{let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return n||this.raise(X.UnexpectedTypeDeclaration,e,`interface`),e;break}case 123:if(this.nextTokenIsStringLiteralOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,123,!1,t)}else if(this.nextTokenIsIdentifierOnSameLine()){this.raise(X.InlineModuleDeclarationMustUseString,this.state.startLoc);let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 124:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 126:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return n||this.raise(X.UnexpectedTypeDeclaration,e,`type`),this.next(),this.tsParseTypeAliasDeclaration(e)}break}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier([`public`,`protected`,`private`])}tsHasSomeModifiers(e,t){return t.some(t=>uo(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(102)&&this.lookaheadCharCode()===123}parseClassMember(e,t,n){let r=[`declare`,`private`,`public`,`protected`,`override`,`abstract`,`readonly`,`static`];this.tsParseModifiers({allowedModifiers:r,disallowedModifiers:[`in`,`out`],stopOnStartOfClassStaticBlock:!0,errorTemplate:X.InvalidModifierOnTypeParameterPositions},t);let i=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,r)&&this.raise(X.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,n,!!t.static)};t.declare?this.tsInAmbientContext(i):i(),t.decorators&&t.decorators.length>0&&!this.hasPlugin(`decorators-legacy`)&&(t.type===`TSAbstractMethodDefinition`||t.type===`TSDeclareMethod`?this.raise(X.DecoratorAbstractMethod,t,{kind:`abstract method`}):(t.type===`ClassProperty`&&t.abstract||t.type===`ClassProperty`&&t.declare||t.type===`TSAbstractPropertyDefinition`||t.type===`PropertyDefinition`&&t.declare)&&this.raise(X.DecoratorAbstractMethod,t,{kind:t.declare?`declare field`:`abstract field`}))}parseClassMemberWithIsStatic(e,t,n,r){let i=this.tsTryParseIndexSignature(t);if(i){e.body.push(i),t.abstract&&this.raise(X.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(X.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(X.IndexSignatureHasDeclare,t),t.override&&this.raise(X.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(X.NonAbstractClassHasAbstractMethod,t),t.override&&(n.hadSuperClass||this.raise(X.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,n,r)}parsePostMemberNameModifiers(e){this.eat(13)&&(e.optional=!0),e.readonly&&this.match(6)&&this.raise(X.ClassMethodHasReadonly,e),e.declare&&this.match(6)&&this.raise(X.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.next();let r=this.startNodeAt(t);r.test=e;let i=this.state.inConditionalConsequent;return this.state.inConditionalConsequent=!0,r.consequent=this.parseMaybeAssignAllowIn(),this.state.inConditionalConsequent=i,this.expect(10),r.alternate=this.parseMaybeAssign(),this.finishNode(r,`ConditionalExpression`)}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let n=this.startNodeAt(t);return n.expression=e,n.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(n,`TSTypeCastExpression`)}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(121))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.state.startLoc,n=this.eatContextual(121);if(n&&(this.isContextual(121)||!this.shouldParseExportDeclaration()))throw this.raise(X.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let r=q(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return r?((r.type===`TSInterfaceDeclaration`||r.type===`TSTypeAliasDeclaration`||n)&&(e.exportKind=`type`),n&&r.type!==`TSImportEqualsDeclaration`&&(this.resetStartLocation(r,t),r.declare=!0),r):null}parseClassId(e,t,n,r){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n,e.declare?1024:8331);let i=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);i&&(e.typeParameters=i)}parseClassPropertyAnnotation(e){e.optional||(this.eat(31)?e.definite=!0:this.eat(13)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(25)&&this.raise(X.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(25)){let{key:t}=e;this.raise(X.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:t.type===`Identifier`&&!e.computed?t.name:`[${this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(t.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(X.PrivateElementHasAbstract,e),e.accessibility&&this.raise(X.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(X.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,n,r,i,a){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&i&&this.raise(X.ConstructorHasTypeParameters,o);let{declare:s=!1,kind:c}=t;s&&(c===`get`||c===`set`)&&this.raise(X.DeclareAccessor,t,{kind:c}),o&&(t.typeParameters=o),super.pushClassMethod(e,t,n,r,i,a)}pushClassPrivateMethod(e,t,n,r){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(t.typeParameters=i),super.pushClassPrivateMethod(e,t,n,r)}declareClassPrivateMethodInScope(e,t){e.type!==`TSDeclareMethod`&&(e.type===`MethodDefinition`&&e.value.body==null||super.declareClassPrivateMethodInScope(e,t))}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass)if(e.superClass.type===`TSInstantiationExpression`){let t=e.superClass,n=t.expression;this.takeSurroundingComments(n,n.start,n.end);let r=t.typeArguments;this.takeSurroundingComments(r,r.start,r.end),e.superClass=n,e.superTypeArguments=r}else(this.match(43)||this.match(47))&&(e.superTypeArguments=this.tsParseTypeArgumentsInExpression());this.eatContextual(109)&&(e.implements=this.tsParseHeritageClause(`implements`))}parseObjPropValue(e,t,n,r,i,a,o){let s=this.tsTryParseTypeParameters(this.tsParseConstModifier);return s&&(e.typeParameters=s),super.parseObjPropValue(e,t,n,r,i,a,o)}parseFunctionParams(e,t){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(e.typeParameters=n),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),e.id.type===`Identifier`&&!this.hasPrecedingLineBreak()&&this.eat(31)&&(e.definite=!0);let n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(10)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){let n,r,i;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===J.j_oTag||a===J.j_expr)&&i.pop()}if(!(r!=null&&r.error)&&!this.match(43))return super.parseMaybeAssign(e,t);(!n||n===this.state)&&(n=this.state.clone());let a,o=this.tryParse(n=>{var r,i;a=this.tsParseTypeParameters(this.tsParseConstModifier);let o=super.parseMaybeAssign(e,t);if((o.type!==`ArrowFunctionExpression`||(r=o.extra)!=null&&r.parenthesized)&&n(),(a==null?void 0:a.params.length)!==0&&this.resetStartLocationFromNode(o,a),o.typeParameters=a,this.hasPlugin(`jsx`)&&o.typeParameters.params.length===1&&!((i=o.typeParameters.extra)!=null&&i.trailingComma)){let e=o.typeParameters.params[0];e.constraint||this.raise(X.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?jr(e.loc.end,1):e,{typeParameterName:e.name.name})}return o},n);if(!o.error&&!o.aborted)return a&&this.reportReservedArrowTypeParam(a),o.node;if(!r&&(co(!this.hasPlugin(`jsx`)),i=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!i.error))return i.node;if(r!=null&&r.node)return this.state=r.failState,r.node;if(o.node)return this.state=o.failState,a&&this.reportReservedArrowTypeParam(a),o.node;if(i!=null&&i.node)return this.state=i.failState,i.node;throw(r==null?void 0:r.error)||o.error||(i==null?void 0:i.error)}reportReservedArrowTypeParam(e){var t;e.params.length===1&&!e.params[0].constraint&&!((t=e.extra)!=null&&t.trailingComma)&&this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(X.ReservedArrowTypeParam,e)}parseMaybeUnary(e,t){return!this.hasPlugin(`jsx`)&&this.match(43)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(10);return(this.canInsertSemicolon()||!this.match(15))&&e(),t});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(13)&&(e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case`TSTypeCastExpression`:return this.isAssignable(e.expression,t);case`TSParameterProperty`:return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case`ParenthesizedExpression`:this.toAssignableParenthesizedExpression(e,t);break;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:t?this.expressionScope.recordArrowParameterBindingError(X.UnexpectedTypeCastInParameter,e):this.raise(X.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,t);break;case`AssignmentExpression`:!t&&e.left.type===`TSTypeCastExpression`&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:case`ParenthesizedExpression`:this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:case`TSNonNullExpression`:this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,n,r){switch(e){case`TSTypeCastExpression`:return!0;case`TSParameterProperty`:return`parameter`;case`TSNonNullExpression`:return`expression`;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:return(r!==64||!n)&&[`expression`,!0];default:return super.isValidLVal(e,t,n,r)}}parseBindingAtom(){return this.state.type===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,t){if(this.match(43)||this.match(47)){let n=this.tsParseTypeArgumentsInExpression();if(this.match(6)){let r=super.parseMaybeDecoratorArguments(e,t);return r.typeArguments=n,r}this.unexpected(null,6)}return super.parseMaybeDecoratorArguments(e,t)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(8)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(31)||this.match(10)||super.isClassProperty()}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(X.TypeAnnotationAfterAssign,n.typeAnnotation),n}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(44,1);return}if(e===60){this.finishOp(43,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}toAssignableListItem(e,t,n){let r=e[t];r.type===`TSTypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}shouldParseArrow(e){return this.match(10)?e.every(e=>this.isAssignable(e,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(10)?!this.state.inConditionalConsequent:super.shouldParseAsyncArrow()}parseParenAndDistinguishExpression(e){let t=this.state.inConditionalConsequent;this.state.inConditionalConsequent=!1;let n=super.parseParenAndDistinguishExpression(e);return this.state.inConditionalConsequent=t,n}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(43)||this.match(47)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeArguments=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:t,strict:n}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=n}}parseClass(e,t,n){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,n)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,t){if(this.match(76))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(125))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(X.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,76)}parseMethod(e,t,n,r,i,a,o){let s=super.parseMethod(e,t,n,r,i,a,o);if((s.abstract||s.type===`TSAbstractMethodDefinition`)&&(this.hasPlugin(`estree`)?s.value:s).body){let{key:e}=s;this.raise(X.AbstractMethodHasImplementation,s,{methodName:e.type===`Identifier`&&!s.computed?e.name:`[${this.input.slice(this.offsetToSourcePos(e.start),this.offsetToSourcePos(e.end))}]`})}return s}tsParseTypeParameterName(){return this.parseIdentifier()}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,t,n,r){return!t&&r?(this.parseTypeOnlyImportExportSpecifier(e,!1,n),this.finishNode(e,`ExportSpecifier`)):(e.exportKind=`value`,super.parseExportSpecifier(e,t,n,r))}parseImportSpecifier(e,t,n,r,i){return!t&&r?(this.parseTypeOnlyImportExportSpecifier(e,!0,n),this.finishNode(e,`ImportSpecifier`)):(e.importKind=`value`,super.parseImportSpecifier(e,t,n,r,n?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,n){let r=t?`imported`:`local`,i=t?`local`:`exported`,a=e[r],o,s=!1,c=!0,l=a.start;if(this.isContextual(89)){let e=this.parseIdentifier();if(this.isContextual(89)){let n=this.parseIdentifier();oi(this.state.type)?(s=!0,a=e,o=t?this.parseIdentifier():this.parseModuleExportName(),c=!1):(o=n,c=!1)}else oi(this.state.type)?(c=!1,o=t?this.parseIdentifier():this.parseModuleExportName()):(s=!0,a=e)}else oi(this.state.type)&&(s=!0,t?(a=this.parseIdentifier(!0),this.isContextual(89)||this.checkReservedWord(a.name,a.start,!0,!0)):a=this.parseModuleExportName());s&&n&&this.raise(t?X.TypeModifierIsUsedInTypeImports:X.TypeModifierIsUsedInTypeExports,l),e[r]=a,e[i]=o;let u=t?`importKind`:`exportKind`;e[u]=s?`type`:`value`,c&&this.eatContextual(89)&&(e[i]=t?this.parseIdentifier():this.parseModuleExportName()),e[i]||(e[i]=this.cloneIdentifier(e[r])),t&&this.checkIdentifier(e[i],s?4098:4096)}fillOptionalPropertiesForTSESLint(e){switch(e.type){case`ExpressionStatement`:e.directive!=null||(e.directive=void 0);return;case`RestElement`:e.value=void 0;case`Identifier`:case`ArrayPattern`:case`AssignmentPattern`:case`ObjectPattern`:e.decorators!=null||(e.decorators=[]),e.optional!=null||(e.optional=!1),e.typeAnnotation!=null||(e.typeAnnotation=void 0);return;case`TSParameterProperty`:e.accessibility!=null||(e.accessibility=void 0),e.decorators!=null||(e.decorators=[]),e.override!=null||(e.override=!1),e.readonly!=null||(e.readonly=!1),e.static!=null||(e.static=!1);return;case`TSEmptyBodyFunctionExpression`:e.body=null;case`TSDeclareFunction`:case`FunctionDeclaration`:case`FunctionExpression`:case`ClassMethod`:case`ClassPrivateMethod`:e.declare!=null||(e.declare=!1),e.returnType!=null||(e.returnType=void 0),e.typeParameters!=null||(e.typeParameters=void 0);return;case`Property`:e.optional!=null||(e.optional=!1);return;case`TSMethodSignature`:case`TSPropertySignature`:e.optional!=null||(e.optional=!1);case`TSIndexSignature`:e.accessibility!=null||(e.accessibility=void 0),e.readonly!=null||(e.readonly=!1),e.static!=null||(e.static=!1);return;case`TSAbstractPropertyDefinition`:case`PropertyDefinition`:case`TSAbstractAccessorProperty`:case`AccessorProperty`:e.declare!=null||(e.declare=!1),e.definite!=null||(e.definite=!1),e.readonly!=null||(e.readonly=!1),e.typeAnnotation!=null||(e.typeAnnotation=void 0);case`TSAbstractMethodDefinition`:case`MethodDefinition`:e.accessibility!=null||(e.accessibility=void 0),e.decorators!=null||(e.decorators=[]),e.override!=null||(e.override=!1),e.optional!=null||(e.optional=!1);return;case`ClassExpression`:e.id!=null||(e.id=null);case`ClassDeclaration`:e.abstract!=null||(e.abstract=!1),e.declare!=null||(e.declare=!1),e.decorators!=null||(e.decorators=[]),e.implements!=null||(e.implements=[]),e.superTypeArguments!=null||(e.superTypeArguments=void 0),e.typeParameters!=null||(e.typeParameters=void 0);return;case`TSTypeAliasDeclaration`:case`VariableDeclaration`:e.declare!=null||(e.declare=!1);return;case`VariableDeclarator`:e.definite!=null||(e.definite=!1);return;case`TSEnumDeclaration`:e.const!=null||(e.const=!1),e.declare!=null||(e.declare=!1);return;case`TSEnumMember`:e.computed!=null||(e.computed=!1);return;case`TSImportType`:e.qualifier!=null||(e.qualifier=null),e.options!=null||(e.options=null),e.typeArguments!=null||(e.typeArguments=null);return;case`TSInterfaceDeclaration`:e.declare!=null||(e.declare=!1),e.extends!=null||(e.extends=[]);return;case`TSMappedType`:e.optional!=null||(e.optional=!1),e.readonly!=null||(e.readonly=void 0);return;case`TSModuleDeclaration`:e.declare!=null||(e.declare=!1),e.global!=null||(e.global=e.kind===`global`);return;case`TSTypeParameter`:e.const!=null||(e.const=!1),e.in!=null||(e.in=!1),e.out!=null||(e.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(e,t){if(Ai(e)){if(oo.lastIndex=t,oo.test(this.input)){let e=this.codePointAtPos(oo.lastIndex);if(!ji(e)&&e!==92)return!1}return!0}else if(e===92)return!0;else return!1}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifierAndNotRelationalOperator(t,e)}nextTokenIsStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===34||t===39}};function ho(e){if(e.type!==`MemberExpression`)return!1;let{computed:t,property:n}=e;return t&&n.type!==`StringLiteral`&&(n.type!==`TemplateLiteral`||n.expressions.length>0)?!1:yo(e.object)}function go(e,t){var n;let{type:r}=e;if((n=e.extra)!=null&&n.parenthesized)return!1;if(t){if(r===`Literal`){let{value:t}=e;if(typeof t==`string`||typeof t==`boolean`)return!0}}else if(r===`StringLiteral`||r===`BooleanLiteral`)return!0;return!!(_o(e,t)||vo(e,t)||r===`TemplateLiteral`&&e.expressions.length===0||ho(e))}function _o(e,t){return t?e.type===`Literal`&&(typeof e.value==`number`||`bigint`in e):e.type===`NumericLiteral`||e.type===`BigIntLiteral`}function vo(e,t){if(e.type===`UnaryExpression`){let{operator:n,argument:r}=e;if(n===`-`&&_o(r,t))return!0}return!1}function yo(e){return e.type===`Identifier`?!0:e.type!==`MemberExpression`||e.computed?!1:yo(e.object)}const bo=Wr`placeholders`({ClassNameIsRequired:`A class name is required.`,UnexpectedSpace:`Unexpected space in placeholder.`}),xo=e=>class extends e{parsePlaceholder(e){if(this.match(129)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(129),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let n=e;return(!n.expectedNode||!n.type)&&(n=this.finishNode(n,`Placeholder`)),n.expectedNode=t,n}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(129,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder(`Expression`)||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder(`Identifier`)||super.parseIdentifier(e)}checkReservedWord(e,t,n,r){e!==void 0&&super.checkReservedWord(e,t,n,r)}cloneIdentifier(e){let t=super.cloneIdentifier(e);return t.type===`Placeholder`&&(t.expectedNode=e.expectedNode),t}cloneStringLiteral(e){return e.type===`Placeholder`?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder(`Pattern`)||super.parseBindingAtom()}isValidLVal(e,t,n,r){return e===`Placeholder`||super.isValidLVal(e,t,n,r)}toAssignable(e,t){e&&e.type===`Placeholder`&&e.expectedNode===`Expression`?e.expectedNode=`Pattern`:super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){if(super.chStartsBindingIdentifier(e,t))return!0;let n=this.nextTokenStart();return this.input.charCodeAt(n)===37&&this.input.charCodeAt(n+1)===37}verifyBreakContinue(e,t){var n;((n=e.label)==null?void 0:n.type)!==`Placeholder`&&super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){var n;if(t.type!==`Placeholder`||(n=t.extra)!=null&&n.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(10)){let n=e;return n.label=this.finishPlaceholder(t,`Identifier`),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,`LabeledStatement`)}this.semicolon();let r=e;return r.name=t.name,this.finishPlaceholder(r,`Statement`)}parseBlock(e,t,n){return this.parsePlaceholder(`BlockStatement`)||super.parseBlock(e,t,n)}parseFunctionId(e){return this.parsePlaceholder(`Identifier`)||super.parseFunctionId(e)}parseClass(e,t,n){let r=t?`ClassDeclaration`:`ClassExpression`;this.next();let i=this.state.strict,a=this.parsePlaceholder(`Identifier`);if(a)if(this.match(77)||this.match(129)||this.match(2))e.id=a;else if(n||!t)return e.id=null,e.body=this.finishPlaceholder(a,`ClassBody`),this.finishNode(e,r);else throw this.raise(bo.ClassNameIsRequired,this.state.startLoc);else this.parseClassId(e,t,n);return super.parseClassSuper(e),e.body=this.parsePlaceholder(`ClassBody`)||super.parseClassBody(!!e.superClass,i),this.finishNode(e,r)}parseExport(e,t){let n=this.parsePlaceholder(`Identifier`);if(!n)return super.parseExport(e,t);let r=e;if(!this.isContextual(94)&&!this.match(8))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(n,`Declaration`),this.finishNode(r,`ExportNamedDeclaration`);this.expectPlugin(`exportDefaultFrom`);let i=this.startNode();return i.exported=n,r.specifiers=[this.finishNode(i,`ExportDefaultSpecifier`)],super.parseExport(r,t)}isExportDefaultSpecifier(){if(this.match(61)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,`from`)&&this.input.startsWith(yi(129),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){var n;return(n=e.specifiers)!=null&&n.length?!0:super.maybeParseExportDefaultSpecifier(e,t)}checkExport(e){let{specifiers:t}=e;t!=null&&t.length&&(e.specifiers=t.filter(e=>e.exported.type===`Placeholder`)),super.checkExport(e),e.specifiers=t}parseImport(e){let t=this.parsePlaceholder(`Identifier`);if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(94)&&!this.match(8))return e.source=this.finishPlaceholder(t,`StringLiteral`),this.semicolon(),this.finishNode(e,`ImportDeclaration`);let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishNode(n,`ImportDefaultSpecifier`)),this.eat(8)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(94),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.parsePlaceholder(`StringLiteral`)||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(bo.UnexpectedSpace,this.state.lastTokEndLoc)}},So=e=>class extends e{parseV8Intrinsic(){if(this.match(50)){let e=this.state.startLoc,t=this.startNode();if(this.next(),q(this.state.type)){let e=this.parseIdentifierName(),n=this.createIdentifier(t,e);if(this.castNodeTo(n,`V8IntrinsicIdentifier`),this.match(6))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},Co=[`fsharp`,`hack`],wo=[`^^`,`@@`,`^`,`%`,`#`];function To(e){if(e.has(`decorators`)&&e.has(`decorators-legacy`))throw Error(`Cannot use the decorators and decorators-legacy plugin together`);if(e.has(`flow`)&&e.has(`typescript`))throw Error(`Cannot combine flow and typescript plugins.`);if(e.has(`placeholders`)&&e.has(`v8intrinsic`))throw Error(`Cannot combine placeholders and v8intrinsic plugins.`);if(e.has(`pipelineOperator`)){let t=e.get(`pipelineOperator`).proposal;if(!Co.includes(t)){let e=Co.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`)}if(t===`hack`){if(e.has(`placeholders`))throw Error(`Cannot combine placeholders plugin and Hack-style pipes.`);if(e.has(`v8intrinsic`))throw Error(`Cannot combine v8intrinsic plugin and Hack-style pipes.`);let t=e.get(`pipelineOperator`).topicToken;if(!wo.includes(t)){let e=wo.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`)}}}if(e.has(`moduleAttributes`))throw Error("`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.");if(e.has(`importAssertions`))throw Error("`importAssertions` has been removed in Babel 8, please use import attributes instead.");if(e.has(`deprecatedImportAssert`)?console.warn("`deprecatedImportAssert` has been removed in Babel 8, please use import attributes instead."):e.has(`importAttributes`)&&e.get(`importAttributes`).deprecatedAssertSyntax&&console.warn("The 'importAttributes' plugin has been removed in Babel 8. Please migrate any usage of `assert`-style attributes to `with`."),e.has(`recordAndTuple`))throw Error(`The 'recordAndTuple' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`asyncDoExpressions`)&&!e.has(`doExpressions`)){let e=Error(`'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.`);throw e.missingPlugins=`doExpressions`,e}if(e.has(`optionalChainingAssign`)&&e.get(`optionalChainingAssign`).version!==`2023-07`)throw Error(`The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.`);if(e.has(`discardBinding`)&&e.get(`discardBinding`).syntaxType!==`void`)throw Error(`The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.`);if(e.has(`decimal`))throw Error(`The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`importReflection`))throw Error(`The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.`)}const Eo={estree:Jr,jsx:da,flow:ea,typescript:mo,v8intrinsic:So,placeholders:xo},Do=Object.keys(Eo);var Oo=class extends ao{constructor(e,t,n){let r=Kr(e);super(r,t),this.options=r,this.initializeScopes(),this.plugins=n,this.filename=r.sourceFilename,this.startIndex=r.startIndex;let i=0;r.allowAwaitOutsideFunction&&(i|=1),r.allowReturnOutsideFunction&&(i|=2),r.allowImportExportEverywhere&&(i|=8),r.allowSuperOutsideMethod&&(i|=16),r.allowUndeclaredExports&&(i|=64),r.allowNewTargetOutsideFunction&&(i|=4),r.allowYieldOutsideFunction&&(i|=32),r.ranges&&(i|=128),r.locations===!0&&(i|=256),r.tokens&&(i|=512),r.createImportExpressions&&(i|=1024),r.createParenthesizedExpressions&&(i|=2048),r.errorRecovery&&(i|=4096),r.attachComment&&(i|=8192),r.annexB&&(i|=16384),this.optionFlags=i}getScopeHandler(){return Gi}parse(){this.enterInitialScopes();let e=this.startNode(),t=this.startNode();this.nextToken(),e.errors=[];let n=this.parseTopLevel(e,t);return n.errors=this.state.errors,n.comments.length=this.state.commentsLen,n}};function ko(e,t){let n=jo(t,e);return n.options.strictMode&&(n.state.strict=!0),n.getExpression()}function Ao(e){let t={};for(let n of Object.keys(e))t[n]=Ci(e[n]);return t}Ao(ii);function jo(e,t){let n=Oo,r=new Map;if(e!=null&&e.plugins){for(let t of e.plugins){let e,n;typeof t==`string`?e=t:[e,n]=t,r.has(e)||r.set(e,n||{})}To(r),n=No(r)}return new n(e,t,r)}const Mo=new Map;function No(e){let t=[];for(let n of Do)e.has(n)&&t.push(n);let n=t.join(`|`),r=Mo.get(n);if(!r){r=Oo;for(let e of t)r=Eo[e](r);Mo.set(n,r)}return r}let Po=0;function Z(){return Po++}function Fo(e){return{name:e}}function Io(e,t){return{kind:`Expression`,code:e,span:t}}function Lo(e,t){return{kind:`Identifier`,name:e,span:t}}function Ro(e){var t,n;return{id:Z(),kind:`Element`,ref:e.ref,tagName:e.tagName,attrs:(t=e.attrs)==null?[]:t,children:(n=e.children)==null?[]:n,flags:a({isSVG:!1,isVoid:!1,isCustomElement:e.tagName.includes(`-`)},e.flags)}}function zo(e){return{id:Z(),kind:`Text`,value:e}}function Bo(e,t,n=!1){return{id:Z(),kind:`DynamicText`,expr:e,ref:t,once:n}}function Vo(e){return{id:Z(),kind:`Fragment`,children:e}}function Ho(e,t){return{id:Z(),kind:`StaticAttribute`,name:e,value:t}}function Uo(e,t){return{id:Z(),kind:`AttrBinding`,name:e,expr:t}}function Wo(e,t){return{id:Z(),kind:`PropBinding`,name:e,expr:t}}function Go(e,t){return{id:Z(),kind:`EventBinding`,eventName:e,handler:t}}function Ko(e){return{id:Z(),kind:`RefBinding`,expr:e}}function qo(e){return{id:Z(),kind:`Component`,ref:e.ref,callee:e.callee,props:e.props}}function Jo(e){return{id:Z(),kind:`Show`,ref:e.ref,when:e.when,children:e.children,fallback:e.fallback}}function Yo(e){return{id:Z(),kind:`For`,ref:e.ref,each:e.each,by:e.by,item:e.item,index:e.index,body:e.body}}function Xo(e){return{id:Z(),kind:`Host`,attrs:e.attrs,child:e.child,span:e.span}}function Zo(e){var t;return{id:Z(),kind:`Slot`,ref:e.ref,name:e.name,fallback:(t=e.fallback)==null?[]:t,span:e.span}}function Qo(e,t,n){var r,i;(r=t.enter)==null||r.call(t,e,n);for(let n of $o(e))Qo(n,t,e);(i=t.leave)==null||i.call(t,e,n)}function $o(e){switch(e.kind){case`Element`:case`Fragment`:return e.children;case`Component`:return e.props.flatMap(e=>Array.isArray(e.value)?e.value:[]);case`Show`:return[...e.children,...Array.isArray(e.fallback)?e.fallback:[]];case`For`:return e.body;case`Slot`:return e.fallback;case`Host`:return e.child?[e.child]:[];case`Text`:case`DynamicText`:return[]}}function es(e){let t=e.props.find(e=>e.name===`children`);return t&&Array.isArray(t.value)?t.value:[]}function ts(e){if(e.kind!==`Element`)throw Error(`Expected Element IR, received ${e.kind}.`)}function ns(e){throw Error(`Unhandled IR node ${e.kind}.`)}function rs(e){return Io(e.getSource()||e.toString(),as(e.node))}function is(e,t){return Io(e,as(t))}function Q(e){var t;let n=(t=e.span)==null?void 0:t.start,r=typeof(n==null?void 0:n.offset)==`number`?{startLine:n.line,startColumn:n.column,startIndex:n.offset}:{};return ko(e.code,a({sourceType:`module`,plugins:[`typescript`,`jsx`]},r))}function as(e){if(e!=null&&e.loc)return{start:os(e.loc.start.line,e.loc.start.column,e.start),end:os(e.loc.end.line,e.loc.end.column,e.end)}}function os(e,t,n){return typeof n==`number`?{line:e,column:t,offset:n}:{line:e,column:t}}function ss(e,t){let n=[];for(let r of e.attrs)r.kind===`AttrBinding`&&n.push(fs(e,r,t)),r.kind===`EventBinding`&&n.push(ms(e,r,t)),r.kind===`PropBinding`&&n.push(gs(e,r,t)),r.kind===`RefBinding`&&n.push(vs(e,r,t));if(Sr(e.tagName)&&ls(e.children))return n.push(cs(e,t)),n;for(let r of e.children)n.push(...ds(r,t));return n}function cs(e,t){return L(I(t.importRuntime(`bindTextContent`),[R(e.ref.name),B([],us(e.children))]))}function ls(e){return e.some(e=>e.kind===`Text`?!1:e.kind===`Fragment`?ls(e.children):!0)}function us(e){let t=e.flatMap(e=>{switch(e.kind){case`Text`:return[z(e.value)];case`DynamicText`:return[Q(e.expr)];case`Fragment`:return[us(e.children)];default:return[]}});return t.length===0?z(``):t.length===1?t[0]:fn(t)}function ds(e,t){switch(e.kind){case`DynamicText`:return ys(e,t);case`Component`:return bs(e,t);case`Show`:return Ss(e,t,Qs(e,t));case`For`:return Ss(e,t,ec(e,t));case`Slot`:return xs(e,t,oc(e,t));case`Element`:return ss(e,t);case`Fragment`:return e.children.flatMap(e=>ds(e,t));default:return[]}}function fs(e,t,n){let r=ps(t.name);return L(r===`class`?I(n.importRuntime(`bindClass`),[R(e.ref.name),_s(Q(t.expr))]):r===`style`?I(n.importRuntime(`bindStyle`),[R(e.ref.name),_s(Q(t.expr))]):I(n.importRuntime(`bindAttr`),[R(e.ref.name),z(r),_s(Q(t.expr))]))}function ps(e){return e===`className`?`class`:e}function ms(e,t,n){return rr(n.programPath,t.eventName),L(I(n.importRuntime(`bindEvent`),[R(e.ref.name),z(t.eventName),hs(Q(t.handler),n)]))}function hs(e,t){if(Oe(e)||Be(e)){let n=t.uid(`event$`);return B([R(n.name)],On(Mn(e),[R(n.name)],!0))}return e}function gs(e,t,n){return L(I(n.importRuntime(`bindProp`),[R(e.ref.name),z(t.name),_s(Q(t.expr))]))}function _s(e){return Ne(e)||Se(e)?e:B([],e)}function vs(e,t,n){return L(I(n.importRuntime(`bindRef`),[R(e.ref.name),Q(t.expr)]))}function ys(e,t){if(!e.domPath||e.domPath.kind!==`Marker`)return[];let n=t.uid(`text$`),r=Q(e.expr);return e.once?[Sn(`const`,[Cn(n,I(_n(R(`document`),R(`createTextNode`)),[I(R(`String`),[r])]))]),L(I(t.importRuntime(`insert`),[R(e.domPath.parent.name),n,R(e.ref.name)]))]:[Sn(`const`,[Cn(n,I(_n(R(`document`),R(`createTextNode`)),[z(``)]))]),L(I(t.importRuntime(`insert`),[R(e.domPath.parent.name),n,R(e.ref.name)])),L(I(t.importRuntime(`bindText`),[n,B([],r)]))]}function bs(e,t){return xs(e,t,Ks(e,t))}function xs(e,t,n){return!e.domPath||e.domPath.kind!==`Marker`?[]:[L(I(t.importRuntime(`insert`),[R(e.domPath.parent.name),n,R(e.ref.name)]))]}function Ss(e,t,n){return!e.domPath||e.domPath.kind!==`Marker`?[]:[L(n)]}function Cs(e){switch(e.kind){case`Root`:throw Error(`Root path is emitted from template clone directly`);case`FirstChild`:return _n(R(e.parent.name),R(`firstChild`));case`NextSibling`:return _n(R(e.previous.name),R(`nextSibling`));case`ChildNode`:return _n(_n(R(e.parent.name),R(`childNodes`)),mn(e.index),!0)}}function ws(e,t){if(e.kind===`Element`){t.registerTemplate(Es(e),e.flags.isSVG);return}if(e.kind===`Fragment`)for(let n of e.children)n.kind===`Element`&&t.registerTemplate(Es(n),n.flags.isSVG)}function Ts(e){return e===`className`?`class`:e}function Es(e){let t=e.attrs.filter(e=>e.kind===`StaticAttribute`).map(e=>{if(e.kind!==`StaticAttribute`)return``;let t=Ts(e.name);return e.value===!0?` ${t}`:` ${t}="${ks(e.value)}"`}).join(``);return e.flags.isVoid?`<${e.tagName}${t}>`:Sr(e.tagName)&&Ds(e.children)?`<${e.tagName}${t}></${e.tagName}>`:`<${e.tagName}${t}>${e.children.map(Os).join(``)}</${e.tagName}>`}function Ds(e){return e.some(e=>e.kind===`Text`?!1:e.kind===`Fragment`?Ds(e.children):!0)}function Os(e){switch(e.kind){case`Element`:return Es(e);case`Text`:return e.value;case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:return`<!>`;case`Host`:return e.child?Os(e.child):``;case`Fragment`:return e.children.map(Os).join(``)}}function ks(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`)}function As(e,t){let n=Es(e);return _n(I(Mn(t.registerTemplate(n,e.flags.isSVG).id),[]),R(`firstChild`))}function js(e,t){return Hs(e)?I(B([],pn([Sn(`const`,[Cn(R(e.ref.name),As(e,t))]),...Ms(e.children,t),...ss(e,t),xn(R(e.ref.name))])),[]):As(e,t)}function Ms(e,t){let n=[],r=new Set,i=Ns(e);for(let a of e)Fs(a,n,t,i,r);return n}function Ns(e){let t=new Map;for(let n of e)Ps(n,t);return t}function Ps(e,t){switch(e.kind){case`Element`:t.set(e.ref.name,e);for(let n of e.children)Ps(n,t);return;case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:t.set(e.ref.name,e);return;case`Fragment`:for(let n of e.children)Ps(n,t);return;case`Host`:e.child&&Ps(e.child,t);return;default:return}}function Fs(e,t,n,r,i){switch(e.kind){case`Element`:Bs(e)&&Is(e,t,n,r,i);for(let a of e.children)Fs(a,t,n,r,i);return;case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:Is(e,t,n,r,i);return;case`Fragment`:for(let a of e.children)Fs(a,t,n,r,i);return;case`Host`:e.child&&Fs(e.child,t,n,r,i);return;default:return}}function Is(e,t,n,r,i){if(!i.has(e.ref.name)){if(!e.physicalDomPath)throw Error(`${e.kind} physical DOM path is not assigned`);Ls(e.physicalDomPath,t,n,r,i),t.push(zs(e,n)),i.add(e.ref.name)}}function Ls(e,t,n,r,i){switch(e.kind){case`Root`:return;case`FirstChild`:Rs(e.parent,t,n,r,i);return;case`ChildNode`:Rs(e.parent,t,n,r,i);return;case`NextSibling`:Rs(e.previous,t,n,r,i);return}}function Rs(e,t,n,r,i){let a=r.get(e.name);a&&Is(a,t,n,r,i)}function zs(e,t){if(!e.physicalDomPath)throw Error(`${e.kind} physical DOM path is not assigned`);return Sn(`const`,[Cn(R(e.ref.name),Cs(e.physicalDomPath))])}function Bs(e){return e.physicalDomPath?e.attrs.some(e=>e.kind===`AttrBinding`||e.kind===`PropBinding`||e.kind===`EventBinding`||e.kind===`RefBinding`)?!0:e.children.some(e=>{switch(e.kind){case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:return!0;case`Element`:return Bs(e);case`Fragment`:return e.children.some(e=>e.kind===`Element`?Bs(e):e.kind!==`Text`);case`Host`:return e.child?Vs(e.child):!1;default:return!1}}):!1}function Vs(e){switch(e.kind){case`Element`:return Bs(e);case`Text`:return!1;default:return!0}}function Hs(e){return e.attrs.some(e=>e.kind===`AttrBinding`||e.kind===`PropBinding`||e.kind===`EventBinding`||e.kind===`RefBinding`)||e.children.some(Us)}function Us(e){switch(e.kind){case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:return!0;case`Element`:return Hs(e);case`Fragment`:return e.children.some(Us);case`Host`:return e.child?Us(e.child):!1;default:return!1}}function Ws(e,t){return fn(e.children.map(e=>cc(e,t)))}function Gs(e,t){switch(e.kind){case`Text`:return z(e.value);case`DynamicText`:return Q(e.expr);case`Element`:return js(e,t);case`Component`:return Ks(e,t);case`Fragment`:return Ws(e,t);case`Show`:return Zs(e,t);case`For`:return $s(e,t);case`Host`:return tc(e,t);case`Slot`:return oc(e,t);default:return hn()}}function Ks(e,t){let n=vn(e.props.map(e=>qs(e,t)));return I(t.importRuntime(`createComponent`),[Q(e.callee),n])}function qs(e,t){let n=Xs(e.name);if(Array.isArray(e.value))return yn(`get`,n,[],pn([xn(Js(e.value,t))]));let r=Q(e.value);return Ys(r)?bn(n,r):yn(`get`,n,[],pn([xn(r)]))}function Js(e,t){let n=e.map(e=>Gs(e,t));return n.length===1?n[0]:fn(n)}function Ys(e){return we(e)||Te(e)||De(e)||Ee(e)}function Xs(e){return at(e)?R(e):z(e)}function Zs(e,t){let n=[bn(R(`when`),Q(e.when)),bn(R(`children`),B([],Js(e.children,t)))];return e.fallback&&n.push(bn(R(`fallback`),Array.isArray(e.fallback)?B([],Js(e.fallback,t)):Q(e.fallback))),I(t.importRuntime(`createComponent`),[t.importRuntime(`Show`),vn(n)])}function Qs(e,t){let n=e.domPath;if(!n||n.kind!==`Marker`)throw Error(`Show DOM path is not assigned`);return I(t.importRuntime(`mountShow`),[R(n.parent.name),sc(e),B([],Q(e.when)),B([],Js(e.children,t)),e.fallback?Array.isArray(e.fallback)?B([],Js(e.fallback,t)):B([],Q(e.fallback)):R(`undefined`)])}function $s(e,t){let n=[R(e.item.name)];e.index&&n.push(R(e.index.name));let r=[bn(R(`each`),Q(e.each)),bn(R(`children`),B(n,Js(e.body,t)))];return e.by&&r.push(bn(R(`by`),Q(e.by))),I(t.importRuntime(`createComponent`),[t.importRuntime(`For`),vn(r)])}function ec(e,t){let n=[R(e.item.name)];e.index&&n.push(R(e.index.name));let r=e.domPath;if(!r||r.kind!==`Marker`)throw Error(`For DOM path is not assigned`);return I(t.importRuntime(`mountFor`),[R(r.parent.name),sc(e),B([],Q(e.each)),e.by?Q(e.by):R(`undefined`),B(n,Js(e.body,t))])}function tc(e,t){let n=nc(e,t),r=t.importRuntime(`Host`);if(!e.child)return I(r,[vn(n)]);let i=Gs(e.child,t);return I(B([],pn([L(I(r,[vn(n)])),xn(i)])),[])}function nc(e,t){let n=[];for(let t of e.attrs){let e=ac(t.name),r=Q(t.expr);rc(r)||ic(r)?n.push(bn(e,r)):n.push(bn(e,B([],r)))}return n}function rc(e){return we(e)||Te(e)||De(e)||Ee(e)}function ic(e){return Ne(e)||Se(e)}function ac(e){return at(e)?R(e):z(e)}function oc(e,t){return I(t.importRuntime(`createSlot`),[e.name?z(e.name):R(`undefined`),e.fallback.length>0?B([],Js(e.fallback,t)):R(`undefined`)])}function sc(e){return R(e.ref.name)}function cc(e,t){switch(e.kind){case`Element`:return js(e,t);case`Fragment`:return Ws(e,t);case`Component`:return Ks(e,t);case`Show`:return Zs(e,t);case`For`:return $s(e,t);case`Host`:return tc(e,t);case`Slot`:return oc(e,t);case`DynamicText`:return B([],Q(e.expr));default:throw Error(`Unsupported root IR node: ${e.kind}`)}}const $={UNSUPPORTED_SPREAD_ATTRIBUTE:`ZEUS_UNSUPPORTED_SPREAD_ATTRIBUTE`,UNSUPPORTED_SPREAD_CHILD:`ZEUS_UNSUPPORTED_SPREAD_CHILD`,UNSUPPORTED_FRAGMENT:`ZEUS_UNSUPPORTED_FRAGMENT`,UNSUPPORTED_FRAGMENT_CHILD:`ZEUS_UNSUPPORTED_FRAGMENT_CHILD`,UNSUPPORTED_COMPONENT_PROP:`ZEUS_UNSUPPORTED_COMPONENT_PROP`,EMPTY_EXPRESSION:`ZEUS_EMPTY_EXPRESSION`,INVALID_TRANSFORM_RESULT:`ZEUS_INVALID_TRANSFORM_RESULT`,UNSUPPORTED_NODE:`ZEUS_UNSUPPORTED_NODE`,INVALID_BUILTIN_USAGE:`ZEUS_INVALID_BUILTIN_USAGE`,INVALID_REF_USAGE:`ZEUS_INVALID_REF_USAGE`};function lc(e){var t;return a(a(a({code:e.code,severity:(t=e.severity)==null?`error`:t,message:e.message},e.hint===void 0?{}:{hint:e.hint}),e.filename===void 0?{}:{filename:e.filename}),e.span===void 0?{}:{span:e.span})}function uc(e){let t=e.hint?`\nHint: ${e.hint}`:``;return`[${e.code}] ${e.message}${t}`}var dc=class extends Error{constructor(e){let t=lc(a(a({},e),{},{severity:`error`}));super(uc(t)),this.name=`ZeusCompilerError`,this.diagnostic=t,this.code=t.code,this.severity=`error`,this.hint=t.hint,this.filename=t.filename,this.span=t.span,this.loc=t.span?{line:t.span.start.line,column:t.span.start.column}:void 0}};function fc(e,t){var n;let r=e.hub;return new dc(a(a({},t),{},{filename:r==null||(n=r.file)==null||(n=n.opts)==null?void 0:n.filename,span:as(e.node)}))}function pc(e){return We(e)?`${pc(e.object)}.${e.property.name}`:Ue(e)||Ce(e)?e.name:`${e.namespace.name}:${e.name.name}`}function mc(e){return pc(e.openingElement.name)}function hc(e){return Ge(e)?`${e.namespace.name}:${e.name.name}`:e.name}function gc(e){return/^[A-Z]/.test(e)||e.includes(`.`)}function _c(e){return e.slice(2).toLowerCase()}function vc(e,t){if(e.isJSXSpreadAttribute()||Ke(e.node))throw fc(e,{code:$.UNSUPPORTED_SPREAD_ATTRIBUTE,message:`Spread attributes are not supported in Zeus MVP.`,hint:`Use explicit attributes instead, for example <div id={id} />.`});let n=e.node,r=hc(n.name),i=e.get(`value`);if(!i.node){if(r===`ref`)throw fc(e,{code:$.EMPTY_EXPRESSION,message:`ref attribute requires an expression.`,hint:`Use <div ref={target} /> instead.`});return Ho(r,!0)}if(i.isStringLiteral()){if(r===`ref`)throw fc(e,{code:$.INVALID_REF_USAGE,message:`String refs are not supported in Zeus.`,hint:`Use a state holder or callback ref: <div ref={el} />.`});return Ho(r,i.node.value)}if(i.isJSXExpressionContainer()){let t=i.get(`expression`);if(t.isJSXEmptyExpression())throw fc(e,{code:$.EMPTY_EXPRESSION,message:`Attribute "${r}" expression cannot be empty.`});if(!t.isExpression())return null;let n=rs(t);return r===`ref`?Ko(n):r.startsWith(`on`)&&r.length>2?Go(_c(r),n):r.startsWith(`prop:`)?Wo(r.slice(5),n):Uo(r,n)}return null}function yc(e,t){let n=[];for(let r of e){if(r.isJSXText()){let e=br(r.node.value);e&&n.push(zo(yr(e)));continue}if(r.isJSXExpressionContainer()){let e=r.get(`expression`);if(e.isJSXEmptyExpression())continue;e.isExpression()&&n.push(Bo(rs(e),Fo(t.uid(`anchor$`).name)));continue}if(r.isJSXElement()||r.isJSXFragment()){n.push(Vc(r,t));continue}}return n}const bc=new Set([`key`,`__slot`,`__anchor`]);function xc(e){return e===`Show`||e===`For`||e===`Host`||e===`Slot`}function Sc(e,t){let n=e.node.openingElement.name;if(!Ue(n))throw fc(e,{code:$.INVALID_BUILTIN_USAGE,message:`Built-in JSX nodes do not support member expressions.`});switch(n.name){case`Show`:return Cc(e,t);case`For`:return Tc(e,t);case`Host`:return Fc(e,t);case`Slot`:return Ec(e,t);default:throw fc(e,{code:$.INVALID_BUILTIN_USAGE,message:`Unsupported built-in <${n.name}>.`})}}function Cc(e,t){let n=Dc(e,`when`),r=wc(e,t);return Jo({ref:Fo(t.uid(`show$`).name),when:n,fallback:r,children:yc(e.get(`children`),t)})}function wc(e,t){let n=e.get(`openingElement`).get(`attributes`).find(e=>e.isJSXAttribute()?hc(e.node.name)===`fallback`:!1);if(!(n!=null&&n.isJSXAttribute()))return;let r=n.get(`value`);if(!r.node)return is(`true`,n.node);if(r.isStringLiteral())return is(JSON.stringify(r.node.value),r.node);if(!r.isJSXExpressionContainer())return;let i=r.get(`expression`);if(!i.isJSXEmptyExpression()){if(i.isJSXElement()||i.isJSXFragment())return[Vc(i,t)];if(i.isExpression())return rs(i)}}function Tc(e,t){let n=Dc(e,`each`),r=Oc(e,`by`),i=Ac(e),a=jc(i,0,`item`),o=jc(i,1),s=i.get(`body`),c=[];return s.isJSXElement()||s.isJSXFragment()?c.push(Vc(s,t)):s.isExpression()&&c.push(Bo(rs(s),Fo(t.uid(`anchor$`).name))),Yo({ref:Fo(t.uid(`for$`).name),each:n,by:r,item:a,index:o,body:c})}function Ec(e,t){let n=kc(e,`name`);return Zo({ref:Fo(t.uid(`slot$`).name),name:n,fallback:yc(e.get(`children`),t),span:as(e.node)})}function Dc(e,t){let n=Oc(e,t);if(!n)throw fc(e,{code:$.INVALID_BUILTIN_USAGE,message:`<${Mc(e)}> requires "${t}".`});return n}function Oc(e,t){let n=e.get(`openingElement`).get(`attributes`).find(e=>e.isJSXAttribute()?hc(e.node.name)===t:!1);if(!(n!=null&&n.isJSXAttribute()))return;let r=n.get(`value`);if(!r.node)return is(`true`,n.node);if(r.isStringLiteral())return is(JSON.stringify(r.node.value),r.node);if(!r.isJSXExpressionContainer())return;let i=r.get(`expression`);if(i.isExpression())return rs(i)}function kc(e,t){let n=e.get(`openingElement`).get(`attributes`).find(e=>e.isJSXAttribute()?hc(e.node.name)===t:!1);if(!(n!=null&&n.isJSXAttribute()))return;let r=n.node.value;if(!r)return``;if(we(r))return r.value}function Ac(e){let t=e.get(`children`).filter(e=>e.isJSXExpressionContainer()).map(e=>e.get(`expression`)).filter(e=>e.isArrowFunctionExpression()||e.isFunctionExpression());if(t.length!==1)throw fc(e,{code:$.INVALID_BUILTIN_USAGE,message:`<For> requires exactly one render function child.`});return t[0]}function jc(e,t,n){let r=e.node.params[t];if(Ce(r))return Lo(r.name,as(r));if(n)return Lo(n)}function Mc(e){let t=e.node.openingElement.name;return Ue(t)?t.name:`Builtin`}function Nc(e){return/^on[A-Z]/.test(e)||e.startsWith(`on:`)}function Pc(e){switch(e){case`className`:return`class`;case`htmlFor`:return`for`;case`tabIndex`:return`tabindex`;case`readOnly`:return`readonly`;default:return e}}function Fc(e,t){let n=[],r=yc(e.get(`children`),t);for(let t of e.get(`openingElement`).get(`attributes`)){let e=t.node;if(Ke(e))throw fc(t,{code:$.UNSUPPORTED_COMPONENT_PROP,message:`Spread props are not supported on Host in Phase 1.`});if(!t.isJSXAttribute())continue;let r=hc(e.name);if(bc.has(r)||r===`children`)continue;if(r===`ref`){let e=t.get(`value`);if(e.isJSXExpressionContainer()){let t=e.get(`expression`);t.isExpression()&&n.push({id:Z(),kind:`HostAttr`,name:`ref`,expr:rs(t)})}continue}if(Nc(r))continue;let i=t.get(`value`);if(!i.node)n.push({id:Z(),kind:`HostAttr`,name:Pc(r),expr:is(`true`,e)});else if(i.isStringLiteral())n.push({id:Z(),kind:`HostAttr`,name:Pc(r),expr:is(JSON.stringify(i.node.value),i.node)});else if(i.isJSXExpressionContainer()){let e=i.get(`expression`);e.isExpression()&&n.push({id:Z(),kind:`HostAttr`,name:Pc(r),expr:rs(e)})}}return Xo({attrs:n,child:r.length===0?void 0:r.length===1?r[0]:Vo(r),span:as(e.node)})}function Ic(e,t){let n=Lc(e.node.openingElement.name),r=[];for(let t of e.get(`openingElement`).get(`attributes`)){let e=t.node;if(Ke(e))throw fc(t,{code:$.UNSUPPORTED_COMPONENT_PROP,message:`Spread props are not supported in Zeus MVP.`});let n=hc(e.name),i=t.get(`value`);if(!i.node){r.push({name:n,value:is(`true`,e)});continue}if(i.isStringLiteral()){r.push({name:n,value:is(JSON.stringify(i.node.value),i.node)});continue}if(i.isJSXExpressionContainer()){let e=i.get(`expression`);if(e.isJSXEmptyExpression())throw fc(t,{code:$.EMPTY_EXPRESSION,message:`Component prop "${n}" expression cannot be empty.`});e.isExpression()&&r.push({name:n,value:rs(e)})}}let i=yc(e.get(`children`),t);return i.length>0&&r.push({name:`children`,value:i}),qo({ref:Fo(t.uid(`cmp$`).name),callee:n,props:r})}function Lc(e){return is(Rc(e),e)}function Rc(e){if(Ue(e))return e.name===`this`?`this`:at(e.name)?e.name:JSON.stringify(e.name);if(We(e)){let t=Rc(e.object),n=e.property.name;return at(n)?`${t}.${n}`:`${t}[${JSON.stringify(n)}]`}return Ge(e)?JSON.stringify(`${e.namespace.name}:${e.name.name}`):JSON.stringify(``)}function zc(e,t){let n=mc(e.node);if(xc(n))return Sc(e,t);if(gc(n))return Ic(e,t);let r=e.get(`openingElement`).get(`attributes`).map(e=>vc(e,t)).filter(Boolean);return Ro({ref:Fo(t.uid(`el$`).name),tagName:n,attrs:r,children:vr.includes(n)?[]:yc(e.get(`children`),t),flags:{isVoid:vr.includes(n),isCustomElement:n.includes(`-`)}})}function Bc(e,t){return Vo(yc(e.get(`children`),t))}function Vc(e,t){if(e.isJSXElement())return zc(e,t);if(e.isJSXFragment())return Bc(e,t);throw Error(`Unsupported JSX node`)}function Hc(e){return Uc(e),e}function Uc(e){switch(e.kind){case`Element`:case`Fragment`:e.children=e.children.filter(e=>e.kind===`Text`?e.value.length>0:!0);for(let t of e.children)Uc(t);return;case`Host`:e.child&&Uc(e.child);return;case`Component`:for(let t of e.props)if(Array.isArray(t.value)){t.value=t.value.filter(e=>e.kind===`Text`?e.value.length>0:!0);for(let e of t.value)Uc(e)}return;case`Slot`:e.fallback=e.fallback.filter(e=>e.kind===`Text`?e.value.length>0:!0);for(let t of e.fallback)Uc(t);return;case`Show`:for(let t of e.children)Uc(t);if(Array.isArray(e.fallback)){e.fallback=e.fallback.filter(e=>e.kind===`Text`?e.value.length>0:!0);for(let t of e.fallback)Uc(t)}return;case`For`:for(let t of e.body)Uc(t);return;case`Text`:case`DynamicText`:return}}function Wc(e){return Gc(e),e}function Gc(e,t){switch(e.kind){case`Element`:Kc(e,t),qc(e);return;case`Fragment`:for(let n of e.children)Gc(n,t);return;case`Component`:for(let t of e.props)if(Array.isArray(t.value))for(let e of t.value)Gc(e);return;case`Show`:for(let t of e.children)Gc(t);if(Array.isArray(e.fallback))for(let t of e.fallback)Gc(t);return;case`For`:for(let t of e.body)Gc(t);return;case`Host`:e.child&&Gc(e.child,t);return;case`Slot`:for(let t of e.fallback)Gc(t);return;case`Text`:case`DynamicText`:return}}function Kc(e,t){if(!t){e.domPath={kind:`Root`};return}let n=t.children.filter(Yc),r=n.indexOf(e);if(r===-1)return;if(r===0){e.domPath={kind:`FirstChild`,parent:t.ref};return}let i=n[r-1];if(i.kind===`Element`){e.domPath={kind:`NextSibling`,previous:i.ref};return}e.domPath={kind:`Child`,parent:t.ref,index:r}}function qc(e){let t=0;for(let n of e.children){if(Xc(n)){Jc(n,e.ref,t++),Gc(n);continue}Gc(n,e)}}function Jc(e,t,n){e.domPath={kind:`Marker`,parent:t,index:n}}function Yc(e){return e.kind===`Element`||e.kind===`DynamicText`||e.kind===`Component`||e.kind===`Show`||e.kind===`For`||e.kind===`Slot`}function Xc(e){return e.kind===`DynamicText`||e.kind===`Component`||e.kind===`Show`||e.kind===`For`||e.kind===`Slot`}function Zc(e){return Qc(e),e}function Qc(e,t){switch(e.kind){case`Element`:$c(e,t),el(e);return;case`Fragment`:for(let n of e.children)Qc(n,t);return;case`Host`:e.child&&Qc(e.child,t);return;case`Show`:for(let t of e.children)Qc(t);if(Array.isArray(e.fallback))for(let t of e.fallback)Qc(t);return;case`For`:for(let t of e.body)Qc(t);return;case`Slot`:for(let t of e.fallback)Qc(t);return;case`Component`:for(let t of e.props)if(Array.isArray(t.value))for(let e of t.value)Qc(e);return;case`Text`:case`DynamicText`:return}}function $c(e,t){if(!t){e.physicalDomPath={kind:`Root`};return}let n=rl(t.children),r=n.indexOf(e);r<0||(e.physicalDomPath=tl(t.ref,n,r))}function el(e){let t=rl(e.children);for(let n=0;n<t.length;n++){let r=t[n];r.kind!==`TextPlaceholder`&&(r.physicalDomPath=tl(e.ref,t,n))}for(let t of e.children)Qc(t,e)}function tl(e,t,n){if(n===0)return{kind:`FirstChild`,parent:e};let r=nl(t,n);return r?{kind:`NextSibling`,previous:r.ref}:{kind:`ChildNode`,parent:e,index:n}}function nl(e,t){for(let n=t-1;n>=0;n--){let t=e[n];if(t.kind!==`TextPlaceholder`)return t}}function rl(e){let t=[];for(let n of e)il(t,n);return t}function il(e,t){switch(t.kind){case`Text`:t.value.length>0&&e.push({kind:`TextPlaceholder`});return;case`Element`:case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:e.push(t);return;case`Fragment`:for(let n of t.children)il(e,n);return;case`Host`:t.child&&il(e,t.child);return}}function al(e,t){ol(e,{isDefineElementRenderRoot:t.isDefineElementRenderRoot,filename:t.filename,insideHost:!1,root:!0})}function ol(e,t){switch(e.kind){case`Host`:if(!t.isDefineElementRenderRoot||!t.root)throw new dc({code:$.INVALID_BUILTIN_USAGE,message:`<Host> can only be used as a defineElement root boundary.`,filename:t.filename,span:e.span,hint:`Return <Host> directly from the defineElement setup function.`});e.child&&ol(e.child,a(a({},t),{},{insideHost:!0,root:!1}));return;case`Slot`:if(!t.insideHost)throw new dc({code:$.INVALID_BUILTIN_USAGE,message:`<Slot> can only be used inside the defineElement Host boundary.`,filename:t.filename,span:e.span,hint:`Place <Slot> inside the root <Host> returned by defineElement setup.`});for(let n of e.fallback)ol(n,a(a({},t),{},{root:!1}));return;case`Element`:case`Fragment`:for(let n of e.children)ol(n,a(a({},t),{},{root:!1}));return;case`Component`:for(let n of e.props)if(Array.isArray(n.value))for(let e of n.value)ol(e,a(a({},t),{},{root:!1}));return;case`Show`:for(let n of e.children)ol(n,a(a({},t),{},{root:!1}));if(Array.isArray(e.fallback))for(let n of e.fallback)ol(n,a(a({},t),{},{root:!1}));return;case`For`:for(let n of e.body)ol(n,a(a({},t),{},{root:!1}));return;default:return}}function sl(e){let t={dynamicText:0,dynamicAttrs:0,events:0,components:0};return cl(e,t),t}function cl(e,t){switch(e.kind){case`Element`:for(let n of e.attrs)(n.kind===`AttrBinding`||n.kind===`PropBinding`)&&t.dynamicAttrs++,n.kind===`EventBinding`&&t.events++;for(let n of e.children)cl(n,t);return;case`DynamicText`:t.dynamicText++;return;case`Component`:t.components++;for(let n of e.props)if(Array.isArray(n.value))for(let e of n.value)cl(e,t);return;case`Fragment`:for(let n of e.children)cl(n,t);return;case`Host`:e.child&&cl(e.child,t);return;case`Slot`:for(let n of e.fallback)cl(n,t);return;case`Show`:for(let n of e.children)cl(n,t);if(Array.isArray(e.fallback))for(let n of e.fallback)cl(n,t);return;case`For`:for(let n of e.body)cl(n,t);return;case`Text`:return}}function ll(e,t,n){if(t.get(`skip`)||!e.isJSXElement()&&!e.isJSXFragment())return;let r=cr(e,n),i=Vc(e,r);Hc(i),al(i,{isDefineElementRenderRoot:ur(e),filename:t.filename}),Wc(i),Zc(i),sl(i),ws(i,r),e.replaceWith(cc(i,r))}function ul(e){return{JSXElement(t,n){ll(t,n,e)},JSXFragment(t,n){ll(t,n,e)},Program:Er(e)}}function dl(e,t){return e.some(e=>(Array.isArray(e)?e[0]:e)===t)}var fl=s((e,t)=>(e.assertVersion(8),{name:`babel-plugin-zeus-compiler`,manipulateOptions(e,t){t.plugins!=null||(t.plugins=[]),dl(t.plugins,`jsx`)||t.plugins.push(`jsx`)},visitor:ul(or(t))}));export{dc as CompilerError,$ as CompilerErrorCode,ts as assertElementIR,ns as assertNeverIR,Uo as attrBindingIR,qo as componentIR,fl as default,Bo as dynamicTextIR,Ro as elementIR,Go as eventBindingIR,Io as expressionIR,Yo as forIR,uc as formatCompilerDiagnostic,Vo as fragmentIR,es as getComponentChildren,$o as getIRChildren,Xo as hostIR,Z as id,Lo as identifierIR,Wo as propBindingIR,Fo as ref,Ko as refBindingIR,Jo as showIR,Zo as slotIR,Ho as staticAttrIR,zo as textIR,Qo as visitIR};
|
|
10
|
+
`);case 114:return s(`\r`);case 120:{let i;return{code:i,pos:t}=Da(e,t,n,r,2,!1,o,a),s(i===null?null:String.fromCharCode(i))}case 117:{let i;return{code:i,pos:t}=ka(e,t,n,r,o,a),s(i===null?null:String.fromCodePoint(i))}case 116:return s(` `);case 98:return s(`\b`);case 118:return s(`\v`);case 102:return s(`\f`);case 13:e.charCodeAt(t)===10&&++t;case 10:n=t,++r;case 8232:case 8233:return s(``);case 56:case 57:if(i)return s(null);a.strictNumericEscape(t-1,n,r);default:if(c>=48&&c<=55){let o=t-1,c=/^[0-7]+/.exec(e.slice(o,t+2))[0],l=parseInt(c,8);l>255&&(c=c.slice(0,-1),l=parseInt(c,8)),t+=c.length-1;let u=e.charCodeAt(t);if(c!==`0`||u===56||u===57){if(i)return s(null);a.strictNumericEscape(o,n,r)}return s(String.fromCharCode(l))}return s(String.fromCharCode(c))}}function Da(e,t,n,r,i,a,o,s){let c=t,l;return{n:l,pos:t}=Oa(e,t,n,r,16,i,a,!1,s,!o),l===null&&(o?s.invalidEscapeSequence(c,n,r):t=c-1),{code:l,pos:t}}function Oa(e,t,n,r,i,a,o,s,c,l){let u=t,d=i===16?Sa.hex:Sa.decBinOct,f=i===16?Ca.hex:i===10?Ca.dec:i===8?Ca.oct:Ca.bin,p=!1,m=0;for(let u=0,ee=a==null?1/0:a;u<ee;++u){let a=e.charCodeAt(t),u;if(a===95&&s!==`bail`){let i=e.charCodeAt(t-1),a=e.charCodeAt(t+1);if(!s){if(l)return{n:null,pos:t};c.numericSeparatorInEscapeSequence(t,n,r)}else if(Number.isNaN(a)||!f(a)||d.has(i)||d.has(a)){if(l)return{n:null,pos:t};c.unexpectedNumericSeparator(t,n,r)}++t;continue}if(u=a>=97?a-97+10:a>=65?a-65+10:xa(a)?a-48:1/0,u>=i){if(u<=9&&l)return{n:null,pos:t};if(u<=9&&c.invalidDigit(t,n,r,i))u=0;else if(o)u=0,p=!0;else break}++t,m=m*i+u}return t===u||a!=null&&t-u!==a||p?{n:null,pos:t}:{n:m,pos:t}}function ka(e,t,n,r,i,a){let o=e.charCodeAt(t),s;if(o===123){if(++t,{code:s,pos:t}=Da(e,t,n,r,e.indexOf(`}`,t)-t,!0,i,a),++t,s!==null&&s>1114111)if(i)a.invalidCodePoint(t,n,r);else return{code:null,pos:t}}else({code:s,pos:t}=Da(e,t,n,r,4,!1,i,a));return{code:s,pos:t}}function Aa(e,t,n){return new B(n,e-t,e)}const ja=new Set([103,109,115,105,121,117,100,118]);var Ma=class{constructor(e){let t=e.startIndex||0;this.type=e.type,this.value=e.value,this.start=t+e.start,this.end=t+e.end,this.loc=new jr(e.startLoc,e.endLoc)}};let Na;var Pa=class extends ya{constructor(e,t){super(),r(this,`isLookahead`,void 0),r(this,`tokens`,[]),r(this,`errorHandlers_readInt`,{invalidDigit:(e,t,n,r)=>this.optionFlags&4096?(this.raise(H.InvalidDigit,Aa(e,t,n),{radix:r}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(H.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(H.UnexpectedNumericSeparator)}),r(this,`errorHandlers_readCodePoint`,a(a({},this.errorHandlers_readInt),{},{invalidEscapeSequence:this.errorBuilder(H.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(H.InvalidCodePoint)})),r(this,`errorHandlers_readStringContents_string`,a(a({},this.errorHandlers_readCodePoint),{},{strictNumericEscape:(e,t,n)=>{this.recordStrictModeErrors(H.StrictNumericEscape,Aa(e,t,n))},unterminated:(e,t,n)=>{throw this.raise(H.UnterminatedString,Aa(e-1,t,n))}})),r(this,`errorHandlers_readStringContents_template`,a(a({},this.errorHandlers_readCodePoint),{},{strictNumericEscape:this.errorBuilder(H.StrictNumericEscape),unterminated:(e,t,n)=>{throw this.raise(H.UnterminatedTemplate,Aa(e,t,n))}})),this.state=new ba,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1,(!Na||Na.length<(this.length+1)*2)&&(Na=new Uint32Array((this.length+1)*2)),this.locData=Na}setLoc(e){let t=this.offsetToSourcePos(e.index);this.locData[t*2]=e.line,this.locData[t*2+1]=e.column}getLoc(e){let t=this.offsetToSourcePos(e);return new B(this.locData[t*2],this.locData[t*2+1],e)}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&512&&this.pushToken(new Ma(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return this.match(e)?(this.next(),!0):!1}match(e){return this.state.type===e}createLookaheadState(e){return{pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){let e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let t=this.state;return this.state=e,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return aa.lastIndex=e,aa.test(this.input)?aa.lastIndex:e}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(e){return this.input.charCodeAt(this.nextTokenStartSince(e))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return oa.lastIndex=e,oa.test(this.input)?oa.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let t=this.input.charCodeAt(e);if((t&64512)==55296&&++e<this.input.length){let n=this.input.charCodeAt(e);(n&64512)==56320&&(t=65536+((t&1023)<<10)+(n&1023))}return t}setStrict(e){this.state.strict=e,e&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,t)),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(135);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(e){let t;this.isLookahead||(t=this.state.curPosition());let n=this.state.pos,r=this.input.indexOf(e,n+2);if(r===-1)throw this.raise(H.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+e.length,na.lastIndex=n+2;na.test(this.input)&&na.lastIndex<=r;)++this.state.curLine,this.state.lineStart=na.lastIndex;if(this.isLookahead)return;let i={type:`CommentBlock`,value:this.input.slice(n+2,r),start:this.sourceToOffsetPos(n),end:this.sourceToOffsetPos(r+e.length),loc:new jr(t,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(i),i}skipLineComment(e){let t=this.state.pos,n;this.isLookahead||(n=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=e);if(this.state.pos<this.length)for(;!ra(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let i=this.state.pos,a={type:`CommentLine`,value:this.input.slice(t+e,i),start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(i),loc:new jr(n,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(a),a}skipSpace(){let e=this.state.pos,t=this.optionFlags&8192?[]:null;loop:for(;this.state.pos<this.length;){let n=this.input.charCodeAt(this.state.pos);switch(n){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 e=this.skipBlockComment(`*/`);e!==void 0&&(this.addComment(e),t==null||t.push(e));break}case 47:{let e=this.skipLineComment(2);e!==void 0&&(this.addComment(e),t==null||t.push(e));break}default:break loop}break;default:if(sa(n))++this.state.pos;else if(n===45&&!this.inModule&&this.optionFlags&16384){let n=this.state.pos;if(this.input.charCodeAt(n+1)===45&&this.input.charCodeAt(n+2)===62&&(e===0||this.state.lineStart>e)){let e=this.skipLineComment(3);e!==void 0&&(this.addComment(e),t==null||t.push(e))}else break loop}else if(n===60&&!this.inModule&&this.optionFlags&16384){let e=this.state.pos;if(this.input.charCodeAt(e+1)===33&&this.input.charCodeAt(e+2)===45&&this.input.charCodeAt(e+3)===45){let e=this.skipLineComment(4);e!==void 0&&(this.addComment(e),t==null||t.push(e))}else break loop}else break loop}}if((t==null?void 0:t.length)>0){let n=this.state.pos,r={start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(n),comments:t,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let n=this.state.type;this.state.type=e,this.state.value=t,this.isLookahead||this.updateContext(n)}replaceToken(e){this.state.type=e,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let e=this.state.pos+1,t=this.codePointAtPos(e);if(t>=48&&t<=57)throw this.raise(H.UnexpectedDigitAfterHash,this.state.curPosition());Ai(t)?(++this.state.pos,this.finishToken(134,this.readWord1(t))):t===92?(++this.state.pos,this.finishToken(134,this.readWord1())):this.finishOp(23,1)}readToken_dot(){let e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57){this.readNumber(!0);return}e===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(17)):(++this.state.pos,this.finishToken(12))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(27,2):this.finishOp(52,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let e=this.input.charCodeAt(this.state.pos+1);if(e!==33)return!1;let t=this.state.pos;for(this.state.pos+=1;!ra(e)&&++this.state.pos<this.length;)e=this.input.charCodeAt(this.state.pos);let n=this.input.slice(t+2,this.state.pos);return this.finishToken(24,n),!0}readToken_mult_modulo(e){let t=e===42?51:50,n=1,r=this.input.charCodeAt(this.state.pos+1);e===42&&r===42&&(n++,r=this.input.charCodeAt(this.state.pos+2),t=53),r===61&&!this.state.inType&&(n++,t=e===37?29:26),this.finishOp(t,n)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(26,3):this.finishOp(e===124?37:38,2);return}if(e===124&&t===62){this.finishOp(35,2);return}if(t===61){this.finishOp(26,2);return}this.finishOp(e===124?39:41,1)}readToken_caret(){let e=this.input.charCodeAt(this.state.pos+1);e===61&&!this.state.inType?this.finishOp(28,2):e===94&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`^^`}])?(this.finishOp(33,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(40,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`@@`}])?this.finishOp(34,2):this.finishOp(22,1)}readToken_plus_min(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.finishOp(30,2);return}t===61?this.finishOp(26,2):this.finishOp(49,1)}readToken_lt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===60){if(this.input.charCodeAt(e+2)===61){this.finishOp(26,3);return}this.finishOp(47,2);return}if(t===61){this.finishOp(45,2);return}this.finishOp(43,1)}readToken_gt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===62){let t=this.input.charCodeAt(e+2)===62?3:2;if(this.input.charCodeAt(e+t)===61){this.finishOp(26,t+1);return}this.finishOp(48,t);return}if(t===61){this.finishOp(45,2);return}this.finishOp(44,1)}readToken_eq_excl(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===61){this.finishOp(42,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(e===61&&t===62){this.state.pos+=2,this.finishToken(15);return}this.finishOp(e===61?25:31,1)}readToken_question(){let e=this.input.charCodeAt(this.state.pos+1),t=this.input.charCodeAt(this.state.pos+2);e===63?t===61?this.finishOp(26,3):this.finishOp(36,2):e===46&&!(t>=48&&t<=57)?(this.state.pos+=2,this.finishToken(14)):(++this.state.pos,this.finishToken(13))}getTokenFromCode(e){switch(e){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(6);return;case 41:++this.state.pos,this.finishToken(7);return;case 59:++this.state.pos,this.finishToken(9);return;case 44:++this.state.pos,this.finishToken(8);return;case 91:++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(1);return;case 123:++this.state.pos,this.finishToken(2);return;case 125:++this.state.pos,this.finishToken(4);return;case 58:this.hasPlugin(`functionBind`)&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(11,2):(++this.state.pos,this.finishToken(10));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(e);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(e);return;case 124:case 38:this.readToken_pipe_amp(e);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(e);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(e);return;case 126:this.finishOp(32,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(Ai(e)){this.readWord(e);return}}throw this.raise(H.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(e)})}finishOp(e,t){let n=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,n)}readRegexp(){let e=this.state.startLoc,t=this.state.start+1,n,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(H.UnterminatedRegExp,V(e,1));let t=this.input.charCodeAt(i);if(ra(t))throw this.raise(H.UnterminatedRegExp,V(e,1));if(n)n=!1;else{if(t===91)r=!0;else if(t===93&&r)r=!1;else if(t===47&&!r)break;n=t===92}}let a=this.input.slice(t,i);++i;let o=``,s=()=>V(e,i+2-t);for(;i<this.length;){let e=this.codePointAtPos(i),t=String.fromCharCode(e);if(ja.has(e))e===118?o.includes(`u`)&&this.raise(H.IncompatibleRegExpUVFlags,s()):e===117&&o.includes(`v`)&&this.raise(H.IncompatibleRegExpUVFlags,s()),o.includes(t)&&this.raise(H.DuplicateRegExpFlags,s());else if(ji(e)||e===92)this.raise(H.MalformedRegExpFlags,s());else break;++i,o+=t}this.state.pos=i,this.finishToken(133,{pattern:a,flags:o})}readInt(e,t,n=!1,r=!0){let{n:i,pos:a}=Oa(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,t,n,r,this.errorHandlers_readInt,!1);return this.state.pos=a,i}readRadixNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1;this.state.pos+=2;let i=this.readInt(e);if(i==null&&this.raise(H.InvalidDigit,V(n,2),{radix:e}),this.input.charCodeAt(this.state.pos)===110&&(++this.state.pos,r=!0),Ai(this.codePointAtPos(this.state.pos)))throw this.raise(H.NumberIdentifier,this.state.curPosition());if(r){let e=this.input.slice(t,this.state.pos).replace(/[_n]/g,``);this.finishToken(132,e);return}this.finishToken(131,i)}readNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1,i=!1,a=!1;!e&&this.readInt(10)===null&&this.raise(H.InvalidNumber,this.state.curPosition());let o=this.state.pos-t>=2&&this.input.charCodeAt(t)===48;if(o){let e=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(H.StrictOctalLiteral,n),!this.state.strict){let t=e.indexOf(`_`);t>0&&this.raise(H.ZeroDigitNumericSeparator,V(n,t))}a=o&&!/[89]/.test(e)}let s=this.input.charCodeAt(this.state.pos);s===46&&!a&&(++this.state.pos,this.readInt(10),r=!0,s=this.input.charCodeAt(this.state.pos)),(s===69||s===101)&&!a&&(s=this.input.charCodeAt(++this.state.pos),(s===43||s===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(H.InvalidOrMissingExponent,n),r=!0,s=this.input.charCodeAt(this.state.pos));let c=this.input.slice(t,this.state.pos).replaceAll(`_`,``);if(s===110&&((r||o)&&this.raise(H.InvalidBigIntLiteral,n),++this.state.pos,i=!0),Ai(this.codePointAtPos(this.state.pos)))throw this.raise(H.NumberIdentifier,this.state.curPosition());if(i){this.finishToken(132,c);return}let l=a?parseInt(c,8):parseFloat(c);this.finishToken(131,l)}readCodePoint(e){let{code:t,pos:n}=ka(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=n,t}readString(e){let{str:t,pos:n,curLine:r,lineStart:i}=wa(e===34?`double`:`single`,this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=n+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(130,t)}readTemplateContinuation(){this.match(4)||this.unexpected(null,4),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let e=this.input[this.state.pos],{str:t,firstInvalidLoc:n,pos:r,curLine:i,lineStart:a}=wa(`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=a,this.state.curLine=i,n&&(this.state.firstInvalidTemplateEscapePos=new B(n.curLine,n.pos-n.lineStart,this.sourceToOffsetPos(n.pos))),this.input.codePointAt(r)===96?this.finishToken(20,n?null:e+t+"`"):(this.state.pos++,this.finishToken(21,n?null:e+t+"${"))}recordStrictModeErrors(e,t){let n=t.index;this.state.strict&&!this.state.strictErrors.has(n)?this.raise(e,t):this.state.strictErrors.set(n,[e,t])}readWord1(e){this.state.containsEsc=!1;let t=``,n=this.state.pos,r=this.state.pos;for(e!==void 0&&(this.state.pos+=e<=65535?1:2);this.state.pos<this.length;){let e=this.codePointAtPos(this.state.pos);if(ji(e))this.state.pos+=e<=65535?1:2;else if(e===92){this.state.containsEsc=!0,t+=this.input.slice(r,this.state.pos);let e=this.state.curPosition(),i=this.state.pos===n?Ai:ji;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(H.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let a=this.readCodePoint(!0);a!==null&&(i(a)||this.raise(H.EscapedCharNotAnIdentifier,e),t+=String.fromCodePoint(a)),r=this.state.pos}else break}return t+this.input.slice(r,this.state.pos)}readWord(e){let t=this.readWord1(e),n=Xr.get(t);n===void 0?this.finishToken(128,t):this.finishToken(n,yi(n))}checkKeywordEscapes(){let{type:e}=this.state;pi(e)&&this.state.containsEsc&&this.raise(H.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:yi(e)})}raise(e,t,n={}){let r=t instanceof B?t:typeof t==`number`?this.getLoc(t):this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=e(r,t instanceof B?r.index:typeof t==`number`?t:t.start,n);if(!(this.optionFlags&4096))throw i;return this.isLookahead||this.state.errors.push(i),i}raiseOverwrite(e,t,n={}){let r=t instanceof B?t:this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=t instanceof B?r.index:t.start,a=this.state.errors;for(let t=a.length-1;t>=0;t--){let o=a[t];if(o.pos===i)return a[t]=e(r,i,n);if(o.pos<i)break}return this.raise(e,r,n)}updateContext(e){}unexpected(e,t){throw this.raise(H.UnexpectedToken,e==null?this.state.startLoc:e,{expected:t?yi(t):null})}expectPlugin(e,t){if(this.hasPlugin(e))return!0;throw this.raise(H.MissingPlugin,t==null?this.state.startLoc:t,{missingPlugin:[e]})}expectOnePlugin(e){if(!e.some(e=>this.hasPlugin(e)))throw this.raise(H.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:e})}errorBuilder(e){return(t,n,r)=>{this.raise(e,Aa(t,n,r))}}},Fa=class{constructor(){r(this,`privateNames`,new Set),r(this,`loneAccessors`,new Map),r(this,`undefinedPrivateNames`,new Map)}},Ia=class{constructor(e){r(this,`parser`,void 0),r(this,`stack`,[]),this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Fa)}exit(){let e=this.stack.pop(),t=this.current();for(let[n,r]of Array.from(e.undefinedPrivateNames))t?t.undefinedPrivateNames.has(n)||t.undefinedPrivateNames.set(n,r):this.parser.raise(H.InvalidPrivateFieldResolution,r,{identifierName:n})}declarePrivateName(e,t,n){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),o=r.has(e);if(t&3){let n=o&&i.get(e);if(n){let r=n&4,a=t&4;o=(n&3)==(t&3)||r!==a,o||i.delete(e)}else o||i.set(e,t)}o&&this.parser.raise(H.PrivateNameRedeclaration,n,{identifierName:e}),r.add(e),a.delete(e)}usePrivateName(e,t){let n;for(n of this.stack)if(n.privateNames.has(e))return;n?n.undefinedPrivateNames.set(e,t):this.parser.raise(H.InvalidPrivateFieldResolution,t,{identifierName:e})}},La=class{constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Ra=class extends La{constructor(e){super(e),r(this,`declarationErrors`,new Map)}recordDeclarationError(e,t){this.declarationErrors.set(t,e)}clearDeclarationError(e){this.declarationErrors.delete(e)}iterateErrors(e){this.declarationErrors.forEach(e)}},za=class{constructor(e){r(this,`parser`,void 0),r(this,`stack`,[new La]),this.parser=e}enter(e){this.stack.push(e)}exit(){this.stack.pop()}recordParameterInitializerError(e,t){let{stack:n}=this,r=n.length-1,i=n[r];for(;!i.isCertainlyParameterDeclaration();){if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(e,t);else return;i=n[--r]}this.parser.raise(e,t)}recordArrowParameterBindingError(e,t){let{stack:n}=this,r=n[n.length-1],i=t.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(e,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(e,i);else return}recordAsyncArrowParametersError(e){let{stack:t}=this,n=t.length-1,r=t[n];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(H.AwaitBindingIdentifier,e),r=t[--n]}validateAsPattern(){let{stack:e}=this,t=e[e.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors((t,n)=>{this.parser.raise(t,n);let r=e.length-2,i=e[r];for(;i.canBeArrowParameterDeclaration();)i.clearDeclarationError(n),i=e[--r]})}};function Ba(){return new La(3)}function Va(){return new Ra(1)}function Ha(){return new Ra(2)}function Ua(){return new La}var Wa=class{constructor(){r(this,`stacks`,[])}enter(e){this.stacks.push(e)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}get inFSharpPipelineDirectBody(){return(this.currentFlags()&16)==0}};function Ga(e,t){return(e?2:0)|!!t}var Ka=class extends Pa{addExtra(e,t,n,r=!0){if(!e)return;let{extra:i}=e;i==null&&(i={},e.extra=i),r?i[t]=n:Object.defineProperty(i,t,{enumerable:r,value:n})}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,t){if(this.input.startsWith(t,e)){let n=this.input.charCodeAt(e+t.length);return!(ji(n)||(n&64512)==55296)}return!1}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}eatContextual(e){return this.isContextual(e)?(this.next(),!0):!1}expectContextual(e,t){if(!this.eatContextual(e)){if(t!=null)throw this.raise(t,this.state.startLoc);this.unexpected(null,e)}}canInsertSemicolon(){return this.match(135)||this.match(4)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return ia(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return ia(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(9)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(9))||this.raise(H.MissingSemicolon,this.state.lastTokEndLoc)}expect(e,t){this.eat(e)||this.unexpected(t,e)}tryParse(e,t=this.state.clone()){let n={node:null};try{let r=e((e=null)=>{throw n.node=e,n});if(this.state.errors.length>t.errors.length){let e=this.state;return this.state=t,this.state.tokensLength=e.tokensLength,{node:r,error:e.errors[t.errors.length],thrown:!1,aborted:!1,failState:e}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(e){let r=this.state;if(this.state=t,e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:r};if(e===n)return{node:n.node,error:null,thrown:!1,aborted:!0,failState:r};throw e}}checkExpressionErrors(e,t){if(!e)return!1;let{shorthandAssignLoc:n,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a,voidPatternLoc:o}=e,s=!!n||!!r||!!a||!!i||!!o;if(!t)return s;n!=null&&this.raise(H.InvalidCoverInitializedName,n),r!=null&&this.raise(H.DuplicateProto,r),i!=null&&this.raise(H.UnexpectedPrivateField,i),a!=null&&this.unexpected(a),o!=null&&this.raise(H.InvalidCoverDiscardElement,o)}isLiteralPropertyName(){return si(this.state.type)}isPrivateName(e){return e.type===`PrivateName`}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)&&this.isPrivateName(e.property)}isObjectProperty(e){return e.type===`ObjectProperty`}isObjectMethod(e){return e.type===`ObjectMethod`}initializeScopes(e=this.options.sourceType===`module`){let t=this.state.labels;this.state.labels=[];let n=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=e;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,e);let o=this.prodParam;this.prodParam=new Wa;let s=this.classScope;this.classScope=new Ia(this);let c=this.expressionScope;return this.expressionScope=new za(this),()=>{this.state.labels=t,this.exportedIdentifiers=n,this.inModule=r,this.scope=i,this.prodParam=o,this.classScope=s,this.expressionScope=c}}enterInitialScopes(){let e=0;(this.inModule||this.optionFlags&1)&&(e|=2),this.optionFlags&32&&(e|=1);let t=!this.inModule&&this.options.sourceType===`commonjs`;(t||this.optionFlags&2)&&(e|=4),this.prodParam.enter(e);let n=t?514:1;this.optionFlags&4&&(n|=512),this.optionFlags&16&&(n|=48),this.scope.enter(n)}checkDestructuringPrivate(e){let{privateKeyLoc:t}=e;t!==null&&this.expectPlugin(`destructuringPrivate`,t)}},qa=class{constructor(){r(this,`shorthandAssignLoc`,null),r(this,`doubleProtoLoc`,null),r(this,`privateKeyLoc`,null),r(this,`optionalParametersLoc`,null),r(this,`voidPatternLoc`,null)}},Ja=class{constructor(e,t,n,i){r(this,`type`,``),this.start=n,this.end=0,i!==void 0&&(this.loc=new jr(i)),e&128&&(this.range=[n,0]),i!==void 0&&t&&(this.loc.filename=t)}};const Ya=Ja.prototype;var Xa=class extends Ka{createPosition(e){return e}startNode(){let{startLoc:e}=this.state;return this.setLoc(e),this.startNodeAt(e)}startNodeAt(e){let{optionFlags:t,filename:n}=this;return t&256?new Ja(t,n,e.index,this.createPosition(e)):new Ja(t,n,e.index)}startNodeAtNode(e){let{optionFlags:t,filename:n}=this;return t&256?new Ja(t,n,e.start,e.loc.start):new Ja(t,n,e.start)}finishNode(e,t){return this.finishNodeAt(e,t,this.state.lastTokEndLoc)}finishNodeAt(e,t,n){e.type=t,e.end=n.index;let{optionFlags:r}=this;return r&256&&(e.loc.end=this.createPosition(n)),r&128&&(e.range[1]=n.index),r&8192&&this.processComment(e),e}finishNodeAtNode(e,t,n){e.type=t,e.end=n.end;let{optionFlags:r}=this;return r&256&&(e.loc.end=n.loc.end),r&128&&(e.range[1]=e.end),r&8192&&this.processComment(e),e}resetStartLocation(e,t){e.start=t.index;let{optionFlags:n}=this;n&256&&(e.loc.start=this.createPosition(t)),n&128&&(e.range[0]=t.index)}resetEndLocation(e,t=this.state.lastTokEndLoc){e.end=t.index;let{optionFlags:n}=this;n&256&&(e.loc.end=this.createPosition(t)),n&128&&(e.range[1]=t.index)}resetStartLocationFromNode(e,t){e.start=t.start;let{optionFlags:n}=this;n&256&&(e.loc.start=t.loc.start),n&128&&(e.range[0]=t.start)}resetEndLocationFromNode(e,t){e.end=t.end;let{optionFlags:n}=this;n&256&&(e.loc.end=t.loc.end),n&128&&(e.range[1]=t.end)}castNodeTo(e,t){return e.type=t,e}cloneIdentifier(e){let{type:t,start:n,end:r,loc:i,range:a,name:o}=e,s=Object.create(Ya);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.name=o,e.extra&&(s.extra=e.extra),s}cloneStringLiteral(e){let{type:t,start:n,end:r,loc:i,range:a,extra:o}=e,s=Object.create(Ya);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.extra=o,s.value=e.value,s}};const Za=e=>e.type===`ParenthesizedExpression`?Za(e.expression):e;var Qa=class extends Xa{toAssignable(e,t=!1){var n;let r;switch((e.type===`ParenthesizedExpression`||(n=e.extra)!=null&&n.parenthesized)&&(r=Za(e),t?r.type===`Identifier`?this.expressionScope.recordArrowParameterBindingError(H.InvalidParenthesizedAssignment,e):r.type!==`CallExpression`&&r.type!==`MemberExpression`&&!this.isOptionalMemberExpression(r)&&this.raise(H.InvalidParenthesizedAssignment,e):this.raise(H.InvalidParenthesizedAssignment,e)),e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:break;case`ObjectExpression`:this.castNodeTo(e,`ObjectPattern`);for(let n=0,r=e.properties.length,a=r-1;n<r;n++){var i;let r=e.properties[n],o=n===a;this.toAssignableObjectExpressionProp(r,o,t),o&&r.type===`RestElement`&&(i=e.extra)!=null&&i.trailingCommaLoc&&this.raise(H.RestTrailingComma,e.extra.trailingCommaLoc)}break;case`ObjectProperty`:{let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t);break}case`SpreadElement`:throw Error(`Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.`);case`ArrayExpression`:var a;this.castNodeTo(e,`ArrayPattern`),this.toAssignableList(e.elements,(a=e.extra)==null?void 0:a.trailingCommaLoc,t);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(H.MissingEqInAssignment,this.optionFlags&256?e.left.loc.end:e.left),this.castNodeTo(e,`AssignmentPattern`),delete e.operator,e.left.type===`VoidPattern`&&this.raise(H.VoidPatternInitializer,e.left),this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(r,t);break}}toAssignableObjectExpressionProp(e,t,n){if(e.type===`ObjectMethod`)this.raise(e.kind===`get`||e.kind===`set`?H.PatternHasAccessor:H.PatternHasMethod,e.key);else if(e.type===`SpreadElement`){this.castNodeTo(e,`RestElement`);let r=e.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,n),t||this.raise(H.RestTrailingComma,e)}else this.toAssignable(e,n)}toAssignableList(e,t,n){let r=e.length-1;for(let i=0;i<=r;i++){let a=e[i];a&&(this.toAssignableListItem(e,i,n),a.type===`RestElement`&&(i<r?this.raise(H.RestTrailingComma,a):t&&this.raise(H.RestTrailingComma,t)))}}toAssignableListItem(e,t,n){let r=e[t];if(r.type===`SpreadElement`){this.castNodeTo(r,`RestElement`);let e=r.argument;this.checkToRestConversion(e,!0),this.toAssignable(e,n)}else this.toAssignable(r,n)}isAssignable(e,t){switch(e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:return!0;case`ObjectExpression`:{let t=e.properties.length-1;return e.properties.every((e,n)=>e.type!==`ObjectMethod`&&(n===t||e.type!==`SpreadElement`)&&this.isAssignable(e))}case`ObjectProperty`:return this.isAssignable(e.value);case`SpreadElement`:return this.isAssignable(e.argument);case`ArrayExpression`:return e.elements.every(e=>e===null||this.isAssignable(e));case`AssignmentExpression`:return e.operator===`=`;case`ParenthesizedExpression`:return this.isAssignable(e.expression);case`MemberExpression`:case`OptionalMemberExpression`:return!t;default:return!1}}toReferencedList(e,t){return e}parseSpread(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssignAllowIn(e,void 0),this.finishNode(t,`SpreadElement`)}parseRestBinding(){let e=this.startNode();this.next();let t=this.parseBindingAtom();return t.type===`VoidPattern`&&this.raise(H.UnexpectedVoidPattern,t),e.argument=t,this.finishNode(e,`RestElement`)}parseBindingAtom(){switch(this.state.type){case 0:{let e=this.startNode();return this.next(),e.elements=this.parseBindingList(1,93,1),this.finishNode(e,`ArrayPattern`)}case 2:return this.parseObjectLike(4,!0);case 84:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(e,t,n){let r=n&1,i=[],a=!0;for(;!this.eat(e);)if(a?a=!1:this.expect(8),r&&this.match(8))i.push(null);else if(this.eat(e))break;else if(this.match(17)){let r=this.parseRestBinding();if(n&2&&(r=this.parseFunctionParamType(r)),i.push(r),!this.checkCommaAfterRest(t)){this.expect(e);break}}else{let e=[];if(n&2)for(this.match(22)&&this.hasPlugin(`decorators`)&&this.raise(H.UnsupportedParameterDecorator,this.state.startLoc);this.match(22);)e.push(this.parseDecorator());i.push(this.parseBindingElement(n,e))}return i}parseBindingRestProperty(e){return this.next(),this.hasPlugin(`discardBinding`)&&this.match(84)?(e.argument=this.parseVoidPattern(null),this.raise(H.UnexpectedVoidPattern,e.argument)):e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,`RestElement`)}parseBindingProperty(){let{type:e,startLoc:t}=this.state;if(e===17)return this.parseBindingRestProperty(this.startNode());let n=this.startNode();return e===134?(this.expectPlugin(`destructuringPrivate`,t),this.classScope.usePrivateName(this.state.value,t),n.key=this.parsePrivateName()):this.parsePropertyName(n),n.method=!1,this.parseObjPropValue(n,t,!1,!1,!0,!1)}parseBindingElement(e,t){let{startLoc:n}=this.state,r=this.parseMaybeDefault();return e&2&&this.parseFunctionParamType(r),t.length&&(r.decorators=t,this.resetStartLocationFromNode(r,t[0])),this.parseMaybeDefault(n,r)}parseFunctionParamType(e){return e}parseMaybeDefault(e,t){var n;if(e!=null||(e=this.state.startLoc),t=(n=t)==null?this.parseBindingAtom():n,!this.eat(25))return t;let r=this.startNodeAt(e);return t.type===`VoidPattern`&&this.raise(H.VoidPatternInitializer,t),r.left=t,r.right=this.parseMaybeAssignAllowIn(),this.finishNode(r,`AssignmentPattern`)}isValidLVal(e,t,n,r){switch(e){case`AssignmentPattern`:return`left`;case`RestElement`:return`argument`;case`ObjectProperty`:return`value`;case`ParenthesizedExpression`:return`expression`;case`ArrayPattern`:return`elements`;case`ObjectPattern`:return`properties`;case`VoidPattern`:return!0;case`CallExpression`:if(!t&&!this.state.strict&&this.optionFlags&16384)return!0}return!1}isOptionalMemberExpression(e){return e.type===`OptionalMemberExpression`}checkLVal(e,t,n=64,r=!1,i=!1,a=!1,o=!1){var s;let c=e.type;if(this.isObjectMethod(e))return;let l=this.isOptionalMemberExpression(e);if(l||c===`MemberExpression`){l&&(this.expectPlugin(`optionalChainingAssign`,e.start),t.type!==`AssignmentExpression`&&this.raise(H.InvalidLhsOptionalChaining,e,{ancestor:t})),n!==64&&this.raise(H.InvalidPropertyBindingPattern,e);return}if(c===`Identifier`){this.checkIdentifier(e,n,i);let{name:t}=e;r&&(r.has(t)?this.raise(H.ParamDupe,e):r.add(t));return}else c===`VoidPattern`&&t.type===`CatchClause`&&this.raise(H.VoidPatternCatchClauseParam,e);let u=Za(e);o||(o=u.type===`CallExpression`&&(u.callee.type===`Import`||u.callee.type===`Super`));let d=this.isValidLVal(c,o,!(a||(s=e.extra)!=null&&s.parenthesized)&&t.type===`AssignmentExpression`,n);if(d===!0)return;if(d===!1){let r=n===64?H.InvalidLhs:H.InvalidLhsBinding;this.raise(r,e,{ancestor:t});return}let f,p;typeof d==`string`?(f=d,p=c===`ParenthesizedExpression`):[f,p]=d;let m=c===`ArrayPattern`||c===`ObjectPattern`?{type:c}:t,ee=e[f];if(Array.isArray(ee))for(let e of ee)e&&this.checkLVal(e,m,n,r,i,p,!0);else ee&&this.checkLVal(ee,m,n,r,i,p,o)}checkIdentifier(e,t,n=!1){this.state.strict&&(n?zi(e.name,this.inModule):Ri(e.name))&&(t===64?this.raise(H.StrictEvalArguments,e,{referenceName:e.name}):this.raise(H.StrictEvalArgumentsBinding,e,{bindingName:e.name})),t&8192&&e.name===`let`&&this.raise(H.LetInLexicalBinding,e),t&64||this.declareNameFromIdentifier(e,t)}declareNameFromIdentifier(e,t){this.scope.declareName(e.name,t,e.start)}checkToRestConversion(e,t){switch(e.type){case`ParenthesizedExpression`:this.checkToRestConversion(e.expression,t);break;case`Identifier`:case`MemberExpression`:break;case`ArrayExpression`:case`ObjectExpression`:if(t)break;default:this.raise(H.InvalidRestAssignmentPattern,e)}}checkCommaAfterRest(e){return this.match(8)?(this.raise(this.lookaheadCharCode()===e?H.RestTrailingComma:H.ElementAfterRest,this.state.startLoc),!0):!1}},$a=class extends Qa{checkProto(e,t,n){if(e.type===`SpreadElement`||this.isObjectMethod(e)||e.computed||e.shorthand)return t;let r=e.key;return(r.type===`Identifier`?r.name:r.value)===`__proto__`?(t&&(n?n.doubleProtoLoc===null&&(n.doubleProtoLoc=this.getLoc(r.start)):this.raise(H.DuplicateProto,r)),!0):t}shouldExitDescending(e){var t;return e.type===`ArrowFunctionExpression`&&!((t=e.extra)!=null&&t.parenthesized)}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(135))throw this.raise(H.ParseExpressionEmptyInput,this.state.startLoc);let e=this.parseExpression();if(!this.match(135))throw this.raise(H.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),e.comments=this.comments,e.errors=this.state.errors,this.optionFlags&512&&(e.tokens=io(this.tokens)),e}parseExpression(e,t){return e?this.disallowInAnd(()=>this.parseExpressionBase(t)):this.allowInAnd(()=>this.parseExpressionBase(t))}parseExpressionBase(e){let t=this.state.startLoc,n=this.parseMaybeAssign(e);if(this.match(8)){let r=this.startNodeAt(t);for(r.expressions=[n];this.eat(8);)r.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(r.expressions),this.finishNode(r,`SequenceExpression`)}return n}parseMaybeAssignDisallowIn(e,t){return this.disallowInAnd(()=>this.parseMaybeAssign(e,t))}parseMaybeAssignAllowIn(e,t){return this.allowInAnd(()=>this.parseMaybeAssign(e,t))}setOptionalParametersError(e){e.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(e,t){let n=this.state.startLoc,r=this.isContextual(104);if(r&&this.prodParam.hasYield){this.next();let e=this.parseYield(n);return t&&(e=t.call(this,e,n)),e}let i;e?i=!1:(e=new qa,i=!0),this.state.canStartArrow=!0;let a=this.parseMaybeConditional(e);if(t&&(a=t.call(this,a,n)),ui(this.state.type)){let t=this.startNodeAt(n),r=this.state.value;if(t.operator=r,this.match(25)){this.toAssignable(a,!0),t.left=a;let r=n.index;e.doubleProtoLoc!=null&&e.doubleProtoLoc.index>=r&&(e.doubleProtoLoc=null),e.shorthandAssignLoc!=null&&e.shorthandAssignLoc.index>=r&&(e.shorthandAssignLoc=null),e.privateKeyLoc!=null&&e.privateKeyLoc.index>=r&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null),e.voidPatternLoc!=null&&e.voidPatternLoc.index>=r&&(e.voidPatternLoc=null)}else t.left=a;return this.next(),t.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(t,`AssignmentExpression`),void 0,void 0,void 0,void 0,r===`||=`||r===`&&=`||r===`??=`),t}else i&&this.checkExpressionErrors(e,!0);if(r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?li(e):li(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(H.YieldNotInGeneratorFunction,n),this.parseYield(n)}return a}parseMaybeConditional(e){let t=this.state.startLoc,n=this.parseExprOps(e);return this.shouldExitDescending(n)?n:this.parseConditional(n,t,e)}parseConditional(e,t,n){if(this.eat(13)){let n=this.startNodeAt(t);return n.test=e,n.consequent=this.parseMaybeAssignAllowIn(),this.expect(10),n.alternate=this.parseMaybeAssign(),this.finishNode(n,`ConditionalExpression`)}return e}parseMaybeUnaryOrPrivate(e){return this.match(134)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){let t=this.state.startLoc,n=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(n)?n:(this.state.canStartArrow=!1,this.parseExprOp(n,t,-1))}parseExprOp(e,t,n){if(this.isPrivateName(e)){let r=this.getPrivateNameSV(e);(n>=bi(54)||!this.prodParam.hasIn||!this.match(54))&&this.raise(H.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t)}let r=this.state.type;if(mi(r)&&(this.prodParam.hasIn||!this.match(54))){let i=bi(r);if(i>n){if(r===35&&(this.expectPlugin(`pipelineOperator`),this.prodParam.inFSharpPipelineDirectBody))return e;let a=this.startNodeAt(t);a.left=e,a.operator=this.state.value;let o=r===37||r===38,s=r===36;s&&(i=bi(38)),this.next(),a.right=this.parseExprOpRightExpr(r,i);let c=this.finishNode(a,o||s?`LogicalExpression`:`BinaryExpression`),l=this.state.type;if(s&&(l===37||l===38)||o&&l===36)throw this.raise(H.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(c,t,n)}}return e}parseExprOpRightExpr(e,t){switch(e){case 35:switch(this.getPluginOption(`pipelineOperator`,`proposal`)){case`hack`:return this.withTopicBindingContext(()=>this.parseHackPipeBody());case`fsharp`:return this.parseFSharpPipelineBody(t)}default:return this.parseExprOpBaseRightExpr(e,t)}}parseExprOpBaseRightExpr(e,t){let n=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),n,xi(e)?t-1:t)}parseHackPipeBody(){var e;let{startLoc:t}=this.state,n=this.parseMaybeAssign();return zr.has(n.type)&&!((e=n.extra)!=null&&e.parenthesized)&&this.raise(H.PipeUnparenthesizedBody,t,{type:n.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(H.PipeTopicUnused,t),n}checkExponentialAfterUnary(e){this.match(53)&&this.raise(H.UnexpectedTokenUnaryExponentiation,e.argument)}parseMaybeUnary(e,t){let n=this.state.startLoc,r=this.isContextual(92);if(r&&this.recordAwaitIfAllowed()){this.next();let e=this.parseAwait(n);return t||this.checkExponentialAfterUnary(e),e}let i=this.match(30),a=this.startNode();if(gi(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.state.canStartArrow=!1,this.match(68)&&this.expectPlugin(`throwExpressions`);let n=this.match(85);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&n){let e=a.argument;e.type===`Identifier`?this.raise(H.StrictDelete,a):this.hasPropertyAsPrivateName(e)&&this.raise(H.DeletePrivateField,a)}if(!i)return t||this.checkExponentialAfterUnary(a),this.finishNode(a,`UnaryExpression`)}let o=this.parseUpdate(a,i,e);if(r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?li(e):li(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(H.AwaitNotInAsyncContext,n),this.parseAwait(n)}return o}parseUpdate(e,t,n){if(t){let t=this.finishNode(e,`UpdateExpression`);return this.checkLVal(t.argument,t),t}let r=this.state.startLoc,i=this.parseExprSubscripts(n);if(this.checkExpressionErrors(n,!1))return i;for(;hi(this.state.type)&&!this.canInsertSemicolon();){let e=this.startNodeAt(r);e.operator=this.state.value,e.prefix=!1,e.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(e,`UpdateExpression`))}return i}parseExprSubscripts(e){let t=this.state.startLoc;this.setLoc(t);let n=this.parseExprAtom(e);return this.shouldExitDescending(n)?n:this.parseSubscripts(n,t)}parseSubscripts(e,t,n){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do e=this.parseSubscript(e,t,n,r),r.maybeAsyncArrow=!1;while(!r.stop);return e}parseSubscript(e,t,n,r){let{type:i}=this.state;if(!n&&i===11)return this.parseBind(e,t,r);if(Si(i))return this.parseTaggedTemplateExpression(e,t,r);let a=!1;if(i===14){if(n&&(this.raise(H.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(e,r);r.optionalChainMember=a=!0,this.next()}if(!n&&this.match(6))return this.parseCoverCallAndAsyncArrowHead(e,t,r,a);{let n=this.eat(0);return n||a||this.eat(12)?this.parseMember(e,t,r,n,a):this.stopParseSubscript(e,r)}}stopParseSubscript(e,t){return t.stop=!0,e}parseMember(e,t,n,r,i){let a=this.startNodeAt(t);return a.object=e,a.computed=r,r?(a.property=this.parseExpression(),this.expect(1)):this.match(134)?(e.type===`Super`&&this.raise(H.SuperPrivateField,t),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),n.optionalChainMember?(a.optional=i,this.finishNode(a,`OptionalMemberExpression`)):this.finishNode(a,`MemberExpression`)}parseBind(e,t,n){let r=this.startNodeAt(t);r.object=e,this.next();let i=this.match(79),a=this.parseNoCallExpr();if(a.type===`Super`||i&&a.type===`ImportExpression`||a.type===`Import`)throw this.raise(H.UnsupportedBindRHS,a);return r.callee=a,n.stop=!0,this.parseSubscripts(this.finishNode(r,`BindExpression`),t,!1)}parseCoverCallAndAsyncArrowHead(e,t,n,r){let i=null;this.next();let a=this.startNodeAt(t);a.callee=e;let{maybeAsyncArrow:o,optionalChainMember:s}=n;o&&(this.expressionScope.enter(Ha()),i=new qa),s&&(a.optional=r),r?a.arguments=this.parseCallExpressionArguments():a.arguments=this.parseCallExpressionArguments(e.type!==`Super`,a,i);let c=this.finishCallExpression(a,s);return o&&this.shouldParseAsyncArrow()&&!r?(n.stop=!0,this.checkDestructuringPrivate(i),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t),c)):(o&&(this.checkExpressionErrors(i,!0),this.expressionScope.exit()),this.toReferencedList(a.arguments)),c}parseTaggedTemplateExpression(e,t,n){let r=this.startNodeAt(t);return r.tag=e,r.quasi=this.parseTemplate(!0),n.optionalChainMember&&this.raise(H.OptionalChainingNoTemplate,t),this.finishNode(r,`TaggedTemplateExpression`)}atPossibleAsyncArrow(e){return e.type===`Identifier`&&e.name===`async`&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.state.canStartArrow}finishCallExpression(e,t){if(e.callee.type===`Import`)if(e.arguments.length===0||e.arguments.length>2)this.raise(H.ImportCallArity,e);else for(let t of e.arguments)t.type===`SpreadElement`&&this.raise(H.ImportCallSpreadArgument,t);return this.finishNode(e,t?`OptionalCallExpression`:`CallExpression`)}parseCallExpressionArguments(e,t,n){let r=[],i=!0;for(;!this.eat(7);){if(i)i=!1;else if(this.expect(8),this.match(7)){t&&this.addTrailingCommaExtraToNode(t),this.next();break}r.push(this.parseExprListItem(7,!1,n,e))}return r}shouldParseAsyncArrow(){return this.match(15)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){var n;return this.resetPreviousNodeTrailingComments(t),this.expect(15),this.parseArrowExpression(e,t.arguments,!0,(n=t.extra)==null?void 0:n.trailingCommaLoc),t.innerComments&&_a(e,t.innerComments),t.callee.trailingComments&&_a(e,t.callee.trailingComments),e}parseNoCallExpr(){let e=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,!0)}parseExprAtom(e){let t,n=null,{type:r}=this.state;switch(r){case 75:return this.parseSuper();case 79:return t=this.startNode(),this.next(),this.match(12)?this.parseImportMetaPropertyOrPhaseCall(t):this.match(6)?this.optionFlags&1024?this.parseImportCall(t):this.finishNode(t,`Import`):(this.raise(H.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(t,`Import`));case 74:return t=this.startNode(),this.next(),this.finishNode(t,`ThisExpression`);case 86:return this.parseDo(this.startNode(),!1);case 52:case 27:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 131:return this.parseNumericLiteral(this.state.value);case 132:return this.parseBigIntLiteral(this.state.value);case 130:return this.parseStringLiteral(this.state.value);case 80:return this.parseNullLiteral();case 81:return this.parseBooleanLiteral(!0);case 82:return this.parseBooleanLiteral(!1);case 6:return this.parseParenAndDistinguishExpression(this.state.canStartArrow);case 0:return this.parseArrayLike(1,e);case 2:return this.parseObjectLike(4,!1,e);case 64:return this.parseFunctionOrFunctionSent();case 22:n=this.parseDecorators();case 76:return this.parseClass(this.maybeTakeDecorators(n,this.startNode()),!1);case 73:return this.parseNewOrNewTarget();case 21:case 20:return this.parseTemplate(!1);case 11:{t=this.startNode(),this.next(),t.object=null;let e=t.callee=this.parseNoCallExpr();if(e.type===`MemberExpression`)return this.finishNode(t,`BindExpression`);throw this.raise(H.UnsupportedBind,e)}case 134:return this.raise(H.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 29:return this.parseTopicReferenceThenEqualsSign(50,`%`);case 28:return this.parseTopicReferenceThenEqualsSign(40,`^`);case 33:case 34:return this.parseTopicReference(`hack`);case 40:case 50:case 23:{let e=this.getPluginOption(`pipelineOperator`,`proposal`);if(e)return this.parseTopicReference(e);throw this.unexpected()}case 43:{let e=this.input.codePointAt(this.nextTokenStart());throw Ai(e)||e===62?this.expectOnePlugin([`jsx`,`flow`,`typescript`]):this.unexpected()}default:if(q(r)){if(this.isContextual(123)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let{canStartArrow:e,containsEsc:t}=this.state,n=this.parseIdentifier();if(!t&&n.name===`async`&&!this.canInsertSemicolon()){let{type:t}=this.state;if(t===64)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(q(t))return e&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(t===86)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return e&&this.match(15)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(e,t){let n=this.getPluginOption(`pipelineOperator`,`proposal`);if(n)return this.state.type=e,this.state.value=t,this.state.pos--,this.state.end--,this.state.endLoc=V(this.state.endLoc,-1),this.parseTopicReference(n);throw this.unexpected()}parseTopicReference(e){let t=this.startNode(),n=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(t,n,e,r)}finishTopicReference(e,t,n,r){if(this.testTopicReferenceConfiguration(n,t,r))return this.topicReferenceIsAllowedInCurrentContext()||this.raise(H.PipeTopicUnbound,t),this.registerTopicReference(),this.finishNode(e,`TopicReference`);throw this.raise(H.PipeTopicUnconfiguredToken,t,{token:yi(r)})}testTopicReferenceConfiguration(e,t,n){switch(e){case`hack`:return this.hasPlugin([`pipelineOperator`,{topicToken:yi(n)}]);default:throw this.raise(H.PipeTopicRequiresHackPipes,t)}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(Ga(!0,this.prodParam.hasYield));let t=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(H.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(15),this.parseArrowExpression(e,t,!0)}parseDo(e,t){this.expectPlugin(`doExpressions`),t&&this.expectPlugin(`asyncDoExpressions`),e.async=t,this.next();let n=this.state.labels;return this.state.labels=[],t?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=n,this.finishNode(e,`DoExpression`)}parseSuper(){let e=this.startNode();return this.next(),this.match(6)&&!this.scope.allowDirectSuper?this.raise(H.SuperNotAllowed,e):this.scope.allowSuper||this.raise(H.UnexpectedSuper,e),!this.match(6)&&!this.match(0)&&!this.match(12)&&this.raise(H.UnsupportedSuper,e),this.finishNode(e,`Super`)}parsePrivateName(){let e=this.startNode(),t=this.startNodeAt(V(this.state.startLoc,1)),n=this.state.value;return this.next(),e.id=this.createIdentifier(t,n),this.finishNode(e,`PrivateName`)}parseFunctionOrFunctionSent(){let e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`function`);return this.next(),this.match(99)?this.expectPlugin(`functionSent`):this.hasPlugin(`functionSent`)||this.unexpected(),this.parseMetaProperty(e,t,`sent`)}return this.parseFunction(e)}parseMetaProperty(e,t,n){e.meta=t;let r=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==n||r)&&this.raise(H.UnsupportedMetaProperty,e.property,{target:t.name,onlyValidPropertyName:n}),this.finishNode(e,`MetaProperty`)}parseImportMetaPropertyOrPhaseCall(e){if(this.next(),this.isContextual(101)||this.isContextual(93)){let t=this.isContextual(101);return this.expectPlugin(t?`sourcePhaseImports`:`deferredImportEvaluation`),this.next(),e.phase=t?`source`:`defer`,this.parseImportCall(e)}else{let t=this.createIdentifierAt(this.startNodeAtNode(e),`import`,this.state.lastTokStartLoc);return this.isContextual(97)&&(this.inModule||this.raise(H.ImportMetaOutsideModule,t),this.sawUnambiguousESM=!0),this.parseMetaProperty(e,t,`meta`)}}parseLiteralAtNode(e,t,n){return this.addExtra(n,`rawValue`,e),this.addExtra(n,`raw`,this.input.slice(this.offsetToSourcePos(n.start),this.state.end)),n.value=e,this.next(),this.finishNode(n,t)}parseLiteral(e,t){let n=this.startNode();return this.parseLiteralAtNode(e,t,n)}parseStringLiteral(e){return this.parseLiteral(e,`StringLiteral`)}parseNumericLiteral(e){return this.parseLiteral(e,`NumericLiteral`)}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch(e){t=null}return this.parseLiteral(t,`BigIntLiteral`)}parseRegExpLiteral(e){let t=this.startNode();return this.addExtra(t,`raw`,this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.pattern=e.pattern,t.flags=e.flags,this.next(),this.finishNode(t,`RegExpLiteral`)}parseBooleanLiteral(e){let t=this.startNode();return t.value=e,this.next(),this.finishNode(t,`BooleanLiteral`)}parseNullLiteral(){let e=this.startNode();return this.next(),this.finishNode(e,`NullLiteral`)}parseParenAndDistinguishExpression(e){let t=this.state.startLoc,n;this.next(),this.expressionScope.enter(Va());let r=this.state.startLoc,i=[],a=new qa,o=!0,s,c;for(;!this.match(7);){if(o)o=!1;else if(this.expect(8,a.optionalParametersLoc===null?null:a.optionalParametersLoc),this.match(7)){c=this.state.startLoc;break}if(this.match(17)){let e=this.state.startLoc;if(s=this.state.startLoc,i.push(this.parseParenItem(this.parseRestBinding(),e)),!this.checkCommaAfterRest(41))break}else i.push(this.parseMaybeAssignAllowInOrVoidPattern(7,a,this.parseParenItem))}let l=this.state.lastTokEndLoc;this.expect(7);let u=this.startNodeAt(t);return e&&this.shouldParseArrow(i)&&(u=this.parseArrow(u))?(this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(u,i,!1),u):(this.expressionScope.exit(),i.length||this.unexpected(this.state.lastTokStartLoc),c&&this.unexpected(c),s&&this.unexpected(s),this.checkExpressionErrors(a,!0),this.toReferencedList(i,!0),i.length>1?(n=this.startNodeAt(r),n.expressions=i,this.finishNode(n,`SequenceExpression`),this.resetEndLocation(n,l)):n=i[0],this.wrapParenthesis(t,n))}wrapParenthesis(e,t){if(!(this.optionFlags&2048))return this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),this.takeSurroundingComments(t,e.index,this.state.lastTokEndLoc.index),t;let n=this.startNodeAt(e);return n.expression=t,this.finishNode(n,`ParenthesizedExpression`)}shouldParseArrow(e){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(15))return e}parseParenItem(e,t){return e}parseNewOrNewTarget(){let e=this.startNode();if(this.next(),this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`new`);this.next();let n=this.parseMetaProperty(e,t,`target`);return this.scope.allowNewTarget||this.raise(H.UnexpectedNewTarget,n),n}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(6)){let t=this.parseExprList(7);this.toReferencedList(t),e.arguments=t}else e.arguments=[];return this.finishNode(e,`NewExpression`)}parseNewCallee(e){let t=this.match(79),n=this.parseNoCallExpr();e.callee=n,t&&n.type===`ImportExpression`&&this.raise(H.ImportCallNotNewExpression,n,n),n.type===`Import`&&this.raise(H.ImportCallNotNewExpression,n),n.type===`Super`&&this.raise(H.SuperCallNotNewExpression,n)}parseTemplateElement(e){let{start:t,startLoc:n,end:r,value:i}=this.state,a=t+1,o=this.startNodeAt(V(n,1));i===null&&(e||this.raise(H.InvalidEscapeSequenceTemplate,V(this.state.firstInvalidTemplateEscapePos,1)));let s=this.match(20),c=s?-1:-2,l=r+c;o.value={raw:this.input.slice(a,l).replace(/\r\n?/g,`
|
|
11
|
+
`),cooked:i===null?null:i.slice(1,c)},o.tail=s,this.next();let u=this.finishNode(o,`TemplateElement`);return this.resetEndLocation(u,V(this.state.lastTokEndLoc,c)),u}parseTemplate(e){let t=this.startNode(),n=this.parseTemplateElement(e),r=[n],i=[];for(;!n.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(n=this.parseTemplateElement(e));return t.expressions=i,t.quasis=r,this.finishNode(t,`TemplateLiteral`)}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,n){let r=!1,i=!0,a=this.startNode();for(a.properties=[],this.next();!this.match(e);){if(i)i=!1;else if(this.expect(8),this.match(e)){this.addTrailingCommaExtraToNode(a);break}let o;t?o=this.parseBindingProperty():(o=this.parsePropertyDefinition(n),r=this.checkProto(o,r,n)),a.properties.push(o)}this.next();let o=t?`ObjectPattern`:`ObjectExpression`;return this.finishNode(a,o)}addTrailingCommaExtraToNode(e){this.addExtra(e,`trailingComma`,this.state.lastTokStartLoc.index),this.addExtra(e,`trailingCommaLoc`,this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&e.key.type===`Identifier`&&(this.isLiteralPropertyName()||this.match(0)||this.match(51))}parsePropertyDefinition(e){let t=[];if(this.match(22))for(this.hasPlugin(`decorators`)&&this.raise(H.UnsupportedPropertyDecorator,this.state.startLoc);this.match(22);)t.push(this.parseDecorator());let n=this.startNode(),r=!1,i=!1,a;if(this.match(17))return t.length&&this.unexpected(),this.parseSpread();t.length&&(n.decorators=t),n.method=!1,e&&(a=this.state.startLoc);let o=this.eat(51);this.parsePropertyNamePrefixOperator(n);let s=this.state.containsEsc;if(this.parsePropertyName(n,e),!o&&!s&&this.maybeAsyncOrAccessorProp(n)){let{key:e}=n,t=e.name;t===`async`&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(e),o=this.eat(51),this.parsePropertyName(n)),(t===`get`||t===`set`)&&(i=!0,this.resetPreviousNodeTrailingComments(e),n.kind=t,this.match(51)&&(o=!0,this.raise(H.AccessorIsGenerator,this.state.curPosition(),{kind:t}),this.next()),this.parsePropertyName(n))}return this.parseObjPropValue(n,a,o,r,!1,i,e)}getGetterSetterExpectedParamCount(e){return e.kind===`get`?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){var t;let n=this.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e);r.length!==n&&this.raise(e.kind===`get`?H.BadGetterArity:H.BadSetterArity,e),e.kind===`set`&&((t=r[r.length-1])==null?void 0:t.type)===`RestElement`&&this.raise(H.BadSetterRestParameter,e)}parseObjectMethod(e,t,n,r,i){if(i){let n=this.parseMethod(e,t,!1,!1,!1,`ObjectMethod`);return this.checkGetterSetterParams(n),n}if(n||t||this.match(6))return r&&this.unexpected(),e.kind=`method`,e.method=!0,this.parseMethod(e,t,n,!1,!1,`ObjectMethod`)}parseObjectProperty(e,t,n,r){if(e.shorthand=!1,this.eat(10))return e.value=n?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(4,r),this.finishObjectProperty(e);if(!e.computed&&e.key.type===`Identifier`){if(this.checkReservedWord(e.key.name,e.key.start,!0,!1),n)e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key));else if(this.match(25)){let n=this.state.startLoc;r==null?this.raise(H.InvalidCoverInitializedName,n):r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=n),e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key))}else e.value=this.cloneIdentifier(e.key);return e.shorthand=!0,this.finishObjectProperty(e)}}finishObjectProperty(e){return this.finishNode(e,`ObjectProperty`)}parseObjPropValue(e,t,n,r,i,a,o){let s=this.parseObjectMethod(e,n,r,i,a)||this.parseObjectProperty(e,t,i,o);return s||this.unexpected(),s}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(1);else{let{type:n,value:r}=this.state,i;if(oi(n))i=this.parseIdentifier(!0);else switch(n){case 131:i=this.parseNumericLiteral(r);break;case 130:i=this.parseStringLiteral(r);break;case 132:i=this.parseBigIntLiteral(r);break;case 134:{let e=this.state.startLoc;t==null?this.raise(H.UnexpectedPrivateField,e):t.privateKeyLoc===null&&(t.privateKeyLoc=e),i=this.parsePrivateName();break}default:this.unexpected()}e.key=i,n!==134&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,n,r,i,a,o=!1){this.initFunction(e,n),e.generator=t,this.scope.enter(530|(o?576:0)|(i?32:0)),this.prodParam.enter(Ga(n,e.generator)),this.parseFunctionParams(e,r);let s=this.parseFunctionBodyAndFinish(e,a,!0);return this.prodParam.exit(),this.scope.exit(),s}parseArrayLike(e,t){let n=this.startNode();return this.next(),n.elements=this.parseExprList(e,!0,t,n),this.finishNode(n,`ArrayExpression`)}parseArrowExpression(e,t,n,r){this.scope.enter(518);let i=Ga(n,!1);return this.match(2)||(i|=this.prodParam.currentFlags()&24),this.prodParam.enter(i),this.initFunction(e,n),t&&this.setArrowFunctionParameters(e,t,r),this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`ArrowFunctionExpression`)}setArrowFunctionParameters(e,t,n){this.toAssignableList(t,n,!1),e.params=t}parseFunctionBodyAndFinish(e,t,n=!1){return this.parseFunctionBody(e,!1,n),this.finishNode(e,t)}parseFunctionBody(e,t,n=!1){let r=t&&!this.match(2);if(this.expressionScope.enter(Ua()),r)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{let r=this.state.strict,i=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),e.body=this.parseBlock(!0,!1,i=>{let a=!this.isSimpleParamList(e.params);i&&a&&this.raise(H.IllegalLanguageModeDirective,(e.kind===`method`||e.kind===`constructor`)&&e.key?this.optionFlags&256?e.key.loc.end:e.key:e);let o=!r&&this.state.strict;this.checkParams(e,!this.state.strict&&!t&&!n&&!a,t,o),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,o)}),this.prodParam.exit(),this.state.labels=i}this.expressionScope.exit()}isSimpleParameter(e){return e.type===`Identifier`}isSimpleParamList(e){for(let t=0,n=e.length;t<n;t++)if(!this.isSimpleParameter(e[t]))return!1;return!0}checkParams(e,t,n,r=!0){let i=!t&&new Set,a={type:`FormalParameters`};for(let t of e.params)this.checkLVal(t,a,5,i,r)}parseExprList(e,t,n,r){let i=[],a=!0;for(;!this.eat(e);){if(a)a=!1;else if(this.expect(8),this.match(e)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(e,t,n))}return i}parseExprListItem(e,t,n,r){let i;if(this.match(8))t||this.raise(H.UnexpectedToken,this.state.curPosition(),{unexpected:`,`}),i=null;else if(this.match(17)){let e=this.state.startLoc;i=this.parseParenItem(this.parseSpread(n),e)}else if(this.match(13)){this.expectPlugin(`partialApplication`),r||this.raise(H.UnexpectedArgumentPlaceholder,this.state.startLoc);let e=this.startNode();this.next(),i=this.finishNode(e,`ArgumentPlaceholder`)}else i=this.parseMaybeAssignAllowInOrVoidPattern(e,n,this.parseParenItem);return i}parseIdentifier(e){let t=this.startNode(),n=this.parseIdentifierName(e);return this.createIdentifier(t,n)}createIdentifier(e,t){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNode(e,`Identifier`)}createIdentifierAt(e,t,n){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNodeAt(e,`Identifier`,n)}parseIdentifierName(e){let t,{start:n,type:r}=this.state;oi(r)?t=this.state.value:this.unexpected();let i=ai(r);return e?i&&this.replaceToken(128):this.checkReservedWord(t,this.sourceToOffsetPos(n),i,!1),this.next(),t}checkReservedWord(e,t,n,r){if(!(e.length>10)&&Ui(e)){if(n&&Bi(e)){this.raise(H.UnexpectedKeyword,t,{keyword:e});return}if((this.state.strict?r?zi:Li:Ii)(e,this.inModule)){this.raise(H.UnexpectedReservedWord,t,{reservedWord:e});return}else if(e===`yield`){if(this.prodParam.hasYield){this.raise(H.YieldBindingIdentifier,t);return}}else if(e===`await`){if(this.prodParam.hasAwait){this.raise(H.AwaitBindingIdentifier,t);return}if(this.scope.inStaticBlock){this.raise(H.AwaitBindingIdentifierInStaticBlock,t);return}this.expressionScope.recordAsyncArrowParametersError(t)}else if(e===`arguments`&&this.scope.inClassAndNotInNonArrowFunction){this.raise(H.ArgumentsInClass,t);return}}}recordAwaitIfAllowed(){let e=this.prodParam.hasAwait;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e,t){let n=e.index;this.setLoc(e);let r=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(H.AwaitExpressionFormalParameter,n),this.eat(51)&&this.raise(H.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),t||(r.argument=this.parseMaybeUnary(null,!0)),this.finishNode(r,`AwaitExpression`)}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:e}=this.state;return e===49||e===6||e===0||Si(e)||e===98&&!this.state.containsEsc||e===133||e===52||this.hasPlugin(`v8intrinsic`)&&e===50}parseYield(e){this.setLoc(e);let t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(H.YieldInParameter,e.index);let n=!1,r=null;if(!this.hasPrecedingLineBreak())switch(n=this.eat(51),this.state.type){case 9:case 135:case 4:case 7:case 1:case 5:case 10:case 8:if(!n)break;default:r=this.parseMaybeAssign()}return t.delegate=n,t.argument=r,this.finishNode(t,`YieldExpression`)}parseImportCall(e){var t;this.next();let n=this.parseCallExpressionArguments();if(n.length===0||n.length>2)this.raise(H.ImportCallArity,e,e);else for(let t of n)t.type===`SpreadElement`&&this.raise(H.ImportCallSpreadArgument,t,e);return e.source=n[0],e.options=(t=n[1])==null?null:t,this.finishNode(e,`ImportExpression`)}withTopicBindingContext(e){let t=this.state.inHackPipelineBody;this.state.inHackPipelineBody=!0;let n=this.state.seenTopicReference;this.state.seenTopicReference=!1;try{return e()}finally{this.state.inHackPipelineBody=t,this.state.seenTopicReference=n}}allowInAnd(e){let t=this.prodParam.currentFlags();if(24&~t){this.prodParam.enter(t|24);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){let t=this.prodParam.currentFlags(),n=8&t,r=16&~t;if(n||r){this.prodParam.enter(t&-9|16);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.seenTopicReference=!0}topicReferenceIsAllowedInCurrentContext(){return this.state.inHackPipelineBody}topicReferenceWasUsedInCurrentContext(){return this.state.seenTopicReference}parseFSharpPipelineBody(e){let t=this.state.startLoc;this.prodParam.enter(this.prodParam.currentFlags()&-17);let n;if(this.isContextual(92)&&this.recordAwaitIfAllowed()){this.next(),n=this.parseAwait(t,!0);let e=this.state.type;mi(e)&&e!==35&&(this.prodParam.hasIn||e!==54)&&this.raise(H.PipelineUnparenthesized,t)}else this.state.canStartArrow=!0,n=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.prodParam.exit(),n}parseModuleExpression(){this.expectPlugin(`moduleBlocks`);let e=this.startNode();this.next(),this.match(2)||this.unexpected(null,2);let t=this.startNodeAt(this.state.endLoc);this.next();let n=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,4,`module`)}finally{n()}return this.finishNode(e,`ModuleExpression`)}parseVoidPattern(e){this.expectPlugin(`discardBinding`);let t=this.startNode();return e!=null&&(e.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(t,`VoidPattern`)}parseMaybeAssignAllowInOrVoidPattern(e,t,n){if(t!=null&&this.match(84)){let n=this.lookaheadCharCode();if(n===44||n===(e===1?93:e===4?125:41)||n===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(t))}return this.parseMaybeAssignAllowIn(t,n)}parsePropertyNamePrefixOperator(e){}};const eo={kind:1},to={kind:2},no=/[\uD800-\uDFFF]/u,ro=/in(?:stanceof)?/y;function io(e){for(let t=0;t<e.length;t++){let n=e[t],{type:r}=n;typeof r==`number`&&(n.type=Ci(r))}return e}var ao=class extends $a{parseTopLevel(e,t){return e.program=this.parseProgram(t,135,this.options.sourceType===`module`?`module`:`script`),e.comments=this.comments,this.optionFlags&512&&(e.tokens=io(this.tokens)),this.finishNode(e,`File`)}parseProgram(e,t,n){if(e.sourceType=n,e.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(e,!0,!0,t),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[e,t]of Array.from(this.scope.undefinedExports))this.raise(H.ModuleExportUndefined,t,{localName:e});this.addExtra(e,`topLevelAwait`,this.state.hasTopLevelAwait)}let r;return r=t===135?this.finishNode(e,`Program`):this.finishNodeAt(e,`Program`,V(this.state.startLoc,-1)),r}stmtToDirective(e){let t=this.castNodeTo(e,`Directive`),n=this.castNodeTo(e.expression,`DirectiveLiteral`),r=n.value,i=this.input.slice(this.offsetToSourcePos(n.start),this.offsetToSourcePos(n.end)),a=n.value=i.slice(1,-1);return this.addExtra(n,`raw`,i),this.addExtra(n,`rawValue`,a),this.addExtra(n,`expressionValue`,r),t.value=n,delete e.expression,t}parseInterpreterDirective(){if(!this.match(24))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,`InterpreterDirective`)}isLet(){return this.isContextual(96)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(103)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(103))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);if(this.isUnparsedContextual(e,`of`)){let t=this.lookaheadCharCodeSince(e+2);if(t!==61&&t!==58&&t!==59)return!1}return!!(this.chStartsBindingIdentifier(t,e)||this.isUnparsedContextual(e,`void`))}nextTokenIsIdentifierOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifier(t,e)}isAwaitUsing(){if(!this.isContextual(92))return!1;let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,`using`)){e=this.nextTokenInLineStartSince(e+5);let t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))return!0}return!1}chStartsBindingIdentifier(e,t){if(Ai(e)){if(ro.lastIndex=t,ro.test(this.input)){let e=this.codePointAtPos(ro.lastIndex);if(!ji(e)&&e!==92)return!1}return!0}else if(e===92)return!0;else return!1}chStartsBindingPattern(e){return e===91||e===123}hasFollowingBindingAtom(){let e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===123||this.chStartsBindingIdentifier(t,e)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(22)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){let n=this.state.type,r=this.startNode(),i=!!(e&2),a=!!(e&4),o=e&1;switch(n){case 56:return this.parseBreakContinueStatement(r,!0);case 59:return this.parseBreakContinueStatement(r,!1);case 60:return this.parseDebuggerStatement(r);case 86:return this.parseDoWhileStatement(r);case 87:return this.parseForStatement(r);case 64:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?H.StrictFunction:this.options.annexB?H.SloppyFunctionAnnexB:H.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 76:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,r),!0);case 65:return this.parseIfStatement(r);case 66:return this.parseReturnStatement(r);case 67:return this.parseSwitchStatement(r);case 68:return this.parseThrowStatement(r);case 69:return this.parseTryStatement(r);case 92:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(H.AwaitUsingNotInAsyncContext,r):this.raise(H.UnexpectedLexicalDeclaration,r):this.raise(H.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,`await using`);break;case 103:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?i||this.raise(H.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(H.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,`using`);case 96:{if(this.state.containsEsc)break;let e=this.nextTokenStart(),t=this.codePointAtPos(e);if(t!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(t,e)&&t!==123))break}case 71:i||this.raise(H.UnexpectedLexicalDeclaration,this.state.startLoc);case 70:{let e=this.state.value;return this.parseVarStatement(r,e)}case 88:return this.parseWhileStatement(r);case 72:return this.parseWithStatement(r);case 2:return this.parseBlock();case 9:return this.parseEmptyStatement(r);case 79:{let e=this.lookaheadCharCode();if(e===40||e===46)break}case 78:{!(this.optionFlags&8)&&!o&&this.raise(H.UnexpectedImportExport,this.state.startLoc),this.next();let e;return e=n===79?this.parseImport(r):this.parseExport(r,t),this.assertModuleNodeAllowed(e),e}default:if(this.isAsyncFunction())return i||this.raise(H.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let s=this.state.value,c=this.parseExpression();return q(n)&&c.type===`Identifier`&&this.eat(10)?this.parseLabeledStatement(r,s,c,e):this.parseExpressionStatement(r,c,t)}assertModuleNodeAllowed(e){!(this.optionFlags&8)&&!this.inModule&&this.raise(H.ImportOutsideModule,e)}maybeTakeDecorators(e,t,n){if(e){var r;(r=t.decorators)!=null&&r.length?(this.raise(H.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),n&&this.resetStartLocationFromNode(n,t)}return t}canHaveLeadingDecorator(){return this.match(76)}parseDecorators(e){let t=[];do t.push(this.parseDecorator());while(this.match(22));if(this.match(78))e||this.unexpected();else if(!this.canHaveLeadingDecorator())throw this.raise(H.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin([`decorators`,`decorators-legacy`]);let e=this.startNode();if(this.next(),this.hasPlugin(`decorators`)){let t=this.state.startLoc,n;if(this.match(6)){let t=this.state.startLoc;this.next(),n=this.parseExpression(),this.expect(7),n=this.wrapParenthesis(t,n);let r=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(n,t),e.expression!==n&&this.raise(H.DecoratorArgumentsOutsideParentheses,r)}else{for(n=this.parseIdentifier(!1);this.eat(12);){let e=this.startNodeAt(t);e.object=n,this.match(134)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),e.property=this.parsePrivateName()):e.property=this.parseIdentifier(!0),e.computed=!1,n=this.finishNode(e,`MemberExpression`)}e.expression=this.parseMaybeDecoratorArguments(n,t)}}else this.state.canStartArrow=!1,e.expression=this.parseExprSubscripts();return this.finishNode(e,`Decorator`)}parseMaybeDecoratorArguments(e,t){if(this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.toReferencedList(n.arguments),this.finishNode(n,`CallExpression`)}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?`BreakStatement`:`ContinueStatement`)}verifyBreakContinue(e,t){let n;for(n=0;n<this.state.labels.length;++n){let r=this.state.labels[n];if((e.label==null||r.name===e.label.name)&&(r.kind!=null&&(t||r.kind===1)||e.label&&t))break}if(n===this.state.labels.length){let n=t?`BreakStatement`:`ContinueStatement`;this.raise(H.IllegalBreakContinue,e,{type:n})}}parseDebuggerStatement(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)}parseHeaderExpression(){this.expect(6);let e=this.parseExpression();return this.expect(7),e}parseDoWhileStatement(e){return this.next(),this.state.labels.push(eo),e.body=this.parseStatement(),this.state.labels.pop(),this.expect(88),e.test=this.parseHeaderExpression(),this.eat(9),this.finishNode(e,`DoWhileStatement`)}parseForStatement(e){this.next(),this.state.labels.push(eo);let t=null;if(this.isContextual(92)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(6),this.match(9))return t!==null&&this.unexpected(t),this.parseFor(e,null);let n=this.isContextual(96);{let r=this.isAwaitUsing(),i=r||this.isForUsing(),a=n&&this.hasFollowingBindingAtom()||i;if(this.match(70)||this.match(71)||a){let n=this.startNode(),a;r?(a=`await using`,this.recordAwaitIfAllowed()||this.raise(H.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):a=this.state.value,this.next(),this.parseVar(n,!0,a);let o=this.finishNode(n,`VariableDeclaration`),s=this.match(54);return s&&i&&this.raise(H.ForInUsing,o),(s||this.isContextual(98))&&o.declarations.length===1?this.parseForIn(e,o,t):(t!==null&&this.unexpected(t),this.parseFor(e,o))}}let r=this.isContextual(91),i=new qa,a=this.parseExpression(!0,i),o=this.isContextual(98);if(o&&(n&&this.raise(H.ForOfLet,a),t===null&&r&&a.type===`Identifier`&&this.raise(H.ForOfAsync,a)),o||this.match(54)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let n=o?`ForOfStatement`:`ForInStatement`;return this.checkLVal(a,{type:n}),this.parseForIn(e,a,t)}else this.checkExpressionErrors(i,!0);return t!==null&&this.unexpected(t),this.parseFor(e,a)}parseFunctionStatement(e,t,n){return this.next(),this.parseFunction(e,1|(n?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(62)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,`IfStatement`)}parseReturnStatement(e){return this.prodParam.hasReturn||this.raise(H.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let t=e.cases=[];this.expect(2),this.state.labels.push(to),this.scope.enter(256);let n;for(let e;!this.match(4);)if(this.match(57)||this.match(61)){let r=this.match(57);n&&this.finishNode(n,`SwitchCase`),t.push(n=this.startNode()),n.consequent=[],this.next(),r?n.test=this.parseExpression():(e&&this.raise(H.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),e=!0,n.test=null),this.expect(10)}else n?n.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),n&&this.finishNode(n,`SwitchCase`),this.next(),this.state.labels.pop(),this.finishNode(e,`SwitchStatement`)}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(H.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&e.type===`Identifier`?8:0),this.checkLVal(e,{type:`CatchClause`},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(58)){let t=this.startNode();this.next(),this.match(6)?(this.expect(6),t.param=this.parseCatchClauseParam(),this.expect(7)):(t.param=null,this.scope.enter(0)),t.body=this.parseBlock(!1,!1),this.scope.exit(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(63)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(H.NoCatchOrFinally,e),this.finishNode(e,`TryStatement`)}parseVarStatement(e,t,n=!1){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(eo),e.body=this.parseStatement(),this.state.labels.pop(),this.finishNode(e,`WhileStatement`)}parseWithStatement(e){return this.state.strict&&this.raise(H.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.parseStatement(),this.finishNode(e,`WithStatement`)}parseEmptyStatement(e){return this.next(),this.finishNode(e,`EmptyStatement`)}parseLabeledStatement(e,t,n,r){for(let e of this.state.labels)e.name===t&&this.raise(H.LabelRedeclaration,n,{labelName:t});let i=fi(this.state.type)?1:this.match(67)?2:null;for(let t=this.state.labels.length-1;t>=0;t--){let n=this.state.labels[t];if(n.statementStart===e.start)n.statementStart=this.sourceToOffsetPos(this.state.start),n.kind=i;else break}return this.state.labels.push({name:t,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)}parseExpressionStatement(e,t,n){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)}parseBlock(e=!1,t=!0,n){let r=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(2),t&&this.scope.enter(0),this.parseBlockBody(r,e,!1,4,n),t&&this.scope.exit(),this.finishNode(r,`BlockStatement`)}isValidDirective(e){return e.type===`ExpressionStatement`&&e.expression.type===`StringLiteral`&&!e.expression.extra.parenthesized}parseBlockBody(e,t,n,r,i){let a=e.body=[],o=e.directives=[];this.parseBlockOrModuleBlockBody(a,t?o:void 0,n,r,i)}parseBlockOrModuleBlockBody(e,t,n,r,i){let a=this.state.strict,o=!1,s=!1;for(;!this.match(r);){let r=n?this.parseModuleItem():this.parseStatementListItem();if(t&&!s){if(this.isValidDirective(r)){let e=this.stmtToDirective(r);t.push(e),!o&&e.value.value===`use strict`&&(o=!0,this.setStrict(!0));continue}s=!0,this.state.strictErrors.clear()}e.push(r)}i==null||i.call(this,o),a||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(9)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(7)?null:this.parseExpression(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,`ForStatement`)}parseForIn(e,t,n){let r=this.match(54);return this.next(),r?n!==null&&this.unexpected(n):e.await=n!==null,t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(H.ForInOfLoopInitializer,t,{type:r?`ForInStatement`:`ForOfStatement`}),t.type===`AssignmentPattern`&&this.raise(H.InvalidLhs,t,{ancestor:{type:`ForStatement`}}),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,r?`ForInStatement`:`ForOfStatement`)}parseVar(e,t,n,r=!1){let i=e.declarations=[];for(e.kind=n;;){let e=this.startNode();if(this.parseVarId(e,n),e.init=this.eat(25)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,e.init===null&&!r&&(e.id.type!==`Identifier`&&!(t&&(this.match(54)||this.isContextual(98)))?this.raise(H.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:`destructuring`}):(n===`const`||n===`using`||n===`await using`)&&!(this.match(54)||this.isContextual(98))&&this.raise(H.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:n})),i.push(this.finishNode(e,`VariableDeclarator`)),!this.eat(8))break}return e}parseVarId(e,t){let n=this.parseBindingAtom();t===`using`||t===`await using`?(n.type===`ArrayPattern`||n.type===`ObjectPattern`)&&this.raise(H.UsingDeclarationHasBindingPattern,n):n.type===`VoidPattern`&&this.raise(H.UnexpectedVoidPattern,n),this.checkLVal(n,{type:`VariableDeclarator`},t===`var`?5:8201),e.id=n}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){let n=t&2,r=!!(t&1),i=r&&!(t&4),a=!!(t&8);return this.initFunction(e,a),this.match(51)&&(n&&this.raise(H.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),r&&(e.id=this.parseFunctionId(i)),this.scope.enter(514),this.prodParam.enter(Ga(a,e.generator)),r||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.parseFunctionBodyAndFinish(e,r?`FunctionDeclaration`:`FunctionExpression`),this.prodParam.exit(),this.scope.exit(),r&&!n&&this.registerFunctionStatementId(e),e}parseFunctionId(e){return e||q(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(6),this.expressionScope.enter(Ba()),e.params=this.parseBindingList(7,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.start)}parseClass(e,t,n){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,n),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,r),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)}isClassProperty(){return this.match(25)||this.match(9)||this.match(4)}isClassMethod(){return this.match(6)}nameIsConstructor(e){return e.type===`Identifier`&&e.name===`constructor`||e.type===`StringLiteral`&&e.value===`constructor`}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();let n={hadConstructor:!1,hadSuperClass:e},r=[],i=this.startNode();for(i.body=[],this.expect(2);!this.match(4);){if(this.eat(9)){if(r.length>0)throw this.raise(H.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(22)){r.push(this.parseDecorator());continue}let e=this.startNode();r.length&&(e.decorators=r,this.resetStartLocationFromNode(e,r[0]),r=[]),this.parseClassMember(i,e,n)}if(this.state.strict=t,this.next(),r.length)throw this.raise(H.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,`ClassBody`)}parseClassMemberFromModifier(e,t){let n=this.parseIdentifier(!0);if(this.isClassMethod()){let r=t;return r.kind=`method`,r.computed=!1,r.key=n,r.static=!1,this.pushClassMethod(e,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=t;return r.computed=!1,r.key=n,r.static=!1,e.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(n),!1}parseClassMember(e,t,n){let r=this.isContextual(102);if(r){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(2)){this.parseClassStaticBlock(e,t);return}}this.parseClassMemberWithIsStatic(e,t,n,r)}parseClassMemberWithIsStatic(e,t,n,r){let i=t,a=t,o=t,s=t,c=t,l=i,u=i;if(t.static=r,this.parsePropertyNamePrefixOperator(t),this.eat(51)){l.kind=`method`;let t=this.match(134);if(this.parseClassElementName(l),this.parsePostMemberNameModifiers(l),t){this.pushClassPrivateMethod(e,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(H.ConstructorIsGenerator,i.key),this.pushClassMethod(e,i,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&q(this.state.type),f=this.parseClassElementName(t),p=d?f.name:null,m=this.isPrivateName(f),ee=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(l.kind=`method`,m){this.pushClassPrivateMethod(e,a,!1,!1);return}let r=this.isNonstaticConstructor(i),o=!1;r&&(i.kind=`constructor`,i.decorators&&i.decorators.length>0&&this.raise(H.DecoratorConstructor,t),n.hadConstructor&&!this.hasPlugin(`typescript`)&&this.raise(H.DuplicateConstructor,f),r&&this.hasPlugin(`typescript`)&&t.override&&this.raise(H.OverrideOnConstructor,f),n.hadConstructor=!0,o=n.hadSuperClass),this.pushClassMethod(e,i,!1,!1,r,o)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o);else if(p===`async`&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(f);let t=this.eat(51);u.optional&&this.unexpected(ee),l.kind=`method`;let n=this.match(134);this.parseClassElementName(l),this.parsePostMemberNameModifiers(u),n?this.pushClassPrivateMethod(e,a,t,!0):(this.isNonstaticConstructor(i)&&this.raise(H.ConstructorIsAsync,i.key),this.pushClassMethod(e,i,t,!0,!1,!1))}else if((p===`get`||p===`set`)&&!(this.match(51)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(f),l.kind=p;let t=this.match(134);this.parseClassElementName(i),t?this.pushClassPrivateMethod(e,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(H.ConstructorIsAccessor,i.key),this.pushClassMethod(e,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(p===`accessor`&&!this.isLineTerminator()){this.expectPlugin(`decoratorAutoAccessors`),this.resetPreviousNodeTrailingComments(f);let t=this.match(134);this.parseClassElementName(o),this.pushClassAccessorProperty(e,c,t)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o):this.unexpected()}parseClassElementName(e){let{type:t,value:n}=this.state;if((t===128||t===130)&&e.static&&n===`prototype`&&this.raise(H.StaticPrototype,this.state.startLoc),t===134){n===`constructor`&&this.raise(H.ConstructorClassPrivateField,this.state.startLoc);let t=this.parsePrivateName();return e.key=t,t}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){var n;this.scope.enter(720);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let i=t.body=[];this.parseBlockOrModuleBlockBody(i,void 0,!1,4),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,e.body.push(this.finishNode(t,`StaticBlock`)),(n=t.decorators)!=null&&n.length&&this.raise(H.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(H.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){let n=this.parseClassPrivateProperty(t);e.body.push(n),this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),0,n.key.start)}pushClassAccessorProperty(e,t,n){!n&&!t.computed&&this.nameIsConstructor(t.key)&&this.raise(H.ConstructorClassField,t.key);let r=this.parseClassAccessorProperty(t);e.body.push(r),n&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.start)}pushClassMethod(e,t,n,r,i,a){e.body.push(this.parseMethod(t,n,r,i,a,`ClassMethod`,!0))}pushClassPrivateMethod(e,t,n,r){let i=this.parseMethod(t,n,r,!1,!1,`ClassPrivateMethod`,!0);e.body.push(i);let a=i.kind===`get`?i.static?6:2:i.kind===`set`?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassPrivateProperty`)}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassProperty`)}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassAccessorProperty`)}parseInitializer(e){this.scope.enter(592),this.expressionScope.enter(Ua()),this.prodParam.enter(0),e.value=this.eat(25)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,n,r=8331){if(q(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,r);else if(n||!t)e.id=null;else throw this.raise(H.MissingClassName,this.state.startLoc)}parseClassSuper(e){this.eat(77)?(this.state.canStartArrow=!1,e.superClass=this.parseExprSubscripts()):e.superClass=null}parseExport(e,t){let n=this.parseMaybeImportPhase(e,!0),r=this.maybeParseExportDefaultSpecifier(e,n),i=!r||this.eat(8),a=i&&this.eatExportStar(e),o=a&&this.maybeParseExportNamespaceSpecifier(e),s=i&&(!o||this.eat(8)),c=r||a;if(a&&!o){if(r&&this.unexpected(),t)throw this.raise(H.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,`ExportAllDeclaration`)}let l=this.maybeParseExportNamedSpecifiers(e);r&&i&&!a&&!l&&this.unexpected(null,2),o&&s&&this.unexpected(null,94);let u;if(c||l){if(u=!1,t)throw this.raise(H.UnsupportedDecoratorExport,e);this.parseExportFrom(e,c)}else u=this.maybeParseExportDeclaration(e);if(c||l||u){var d;let n=e;if(this.checkExport(n,!0,!1,!!n.source),((d=n.declaration)==null?void 0:d.type)===`ClassDeclaration`)this.maybeTakeDecorators(t,n.declaration,n);else if(t)throw this.raise(H.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(n,`ExportNamedDeclaration`)}if(this.eat(61)){let n=e,r=this.parseExportDefaultExpression();if(n.declaration=r,r.type===`ClassDeclaration`)this.maybeTakeDecorators(t,r,n);else if(t)throw this.raise(H.UnsupportedDecoratorExport,e);return this.checkExport(n,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(n,`ExportDefaultDeclaration`)}throw this.unexpected(null,2)}eatExportStar(e){return this.eat(51)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin(`exportDefaultFrom`,t==null?void 0:t.start);let n=t||this.parseIdentifier(!0),r=this.startNodeAtNode(n);return r.exported=n,e.specifiers=[this.finishNode(r,`ExportDefaultSpecifier`)],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(89)){e.specifiers!=null||(e.specifiers=[]);let t=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),t.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(t,`ExportNamespaceSpecifier`)),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(2)){let t=e;t.specifiers||(t.specifiers=[]);let n=t.exportKind===`type`;return t.specifiers.push(...this.parseExportSpecifiers(n)),t.source=null,t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0):!1}isAsyncFunction(){if(!this.isContextual(91))return!1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,`function`)}parseExportDefaultExpression(){let e=this.startNode();if(this.match(64))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(76))return this.parseClass(e,!0,!0);if(this.match(22))return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(71)||this.match(70)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(H.UnsupportedDefaultExport,this.state.startLoc);let t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){return this.match(76)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(q(e)){if(e===91&&!this.state.containsEsc||e===96)return!1;if((e===126||e===125)&&!this.state.containsEsc){let e=this.nextTokenStart(),t=this.input.charCodeAt(e);if(t===123||this.chStartsBindingIdentifier(t,e)&&!this.input.startsWith(`from`,e))return this.expectOnePlugin([`flow`,`typescript`]),!1}}else if(!this.match(61))return!1;let t=this.nextTokenStart(),n=this.isUnparsedContextual(t,`from`);if(this.input.charCodeAt(t)===44||q(this.state.type)&&n)return!0;if(this.match(61)&&n){let e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return e===34||e===39}return!1}parseExportFrom(e,t){this.eatContextual(94)?(e.source=this.parseImportSource(),this.checkExport(e),this.maybeParseImportAttributes(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:e}=this.state;return e===22&&(this.expectOnePlugin([`decorators`,`decorators-legacy`]),this.hasPlugin(`decorators`))?!0:this.isUsing()||this.isAwaitUsing()?(this.raise(H.UsingDeclarationExport,this.state.startLoc),!0):e===70||e===71||e===64||e===76||this.isLet()||this.isAsyncFunction()}checkExport(e,t,n,r){if(t){var i;if(n){if(this.checkDuplicateExports(e,`default`),this.hasPlugin(`exportDefaultFrom`)){var a;let t=e.declaration;t.type===`Identifier`&&t.name===`from`&&t.end-t.start===4&&!((a=t.extra)!=null&&a.parenthesized)&&this.raise(H.ExportDefaultFromAsIdentifier,t)}}else if((i=e.specifiers)!=null&&i.length)for(let t of e.specifiers){let{exported:e}=t,n=e.type===`Identifier`?e.name:e.value;if(this.checkDuplicateExports(t,n),!r&&t.local){let{local:e}=t;e.type===`Identifier`?(this.checkReservedWord(e.name,e.start,!0,!1),this.scope.checkLocalExport(e)):this.raise(H.ExportBindingIsString,t,{localName:e.value,exportName:n})}}else if(e.declaration){let t=e.declaration;if(t.type===`FunctionDeclaration`||t.type===`ClassDeclaration`){let{id:n}=t;if(!n)throw Error(`Assertion failure`);this.checkDuplicateExports(e,n.name)}else if(t.type===`VariableDeclaration`)for(let e of t.declarations)this.checkDeclaration(e.id)}}}checkDeclaration(e){if(e.type===`Identifier`)this.checkDuplicateExports(e,e.name);else if(e.type===`ObjectPattern`)for(let t of e.properties)this.checkDeclaration(t);else if(e.type===`ArrayPattern`)for(let t of e.elements)t&&this.checkDeclaration(t);else e.type===`ObjectProperty`?this.checkDeclaration(e.value):e.type===`RestElement`?this.checkDeclaration(e.argument):e.type===`AssignmentPattern`&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&(t==="default"?this.raise(H.DuplicateDefaultExport,e):this.raise(H.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){let t=[],n=!0;for(this.expect(2);!this.eat(4);){if(n)n=!1;else if(this.expect(8),this.eat(4))break;let r=this.isContextual(126),i=this.match(130),a=this.startNode();a.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(a,i,e,r))}return t}parseExportSpecifier(e,t,n,r){return this.eatContextual(89)?e.exported=this.parseModuleExportName():t?e.exported=this.cloneStringLiteral(e.local):e.exported||(e.exported=this.cloneIdentifier(e.local)),this.finishNode(e,`ExportSpecifier`)}parseModuleExportName(){if(this.match(130)){let e=this.parseStringLiteral(this.state.value),t=no.exec(e.value);return t&&this.raise(H.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}checkImportPhase(e){let{specifiers:t}=e,n=t.length===1?t[0].type:null;e.phase===`source`?n!==`ImportDefaultSpecifier`&&this.raise(H.SourcePhaseImportRequiresDefault,t[0]):e.phase===`defer`&&n!==`ImportNamespaceSpecifier`&&this.raise(H.DeferImportRequiresNamespace,t[0])}isPotentialImportPhase(e){return e?!1:this.isContextual(101)||this.isContextual(93)}applyImportPhase(e,t,n,r){t||(n===`source`?(this.expectPlugin(`sourcePhaseImports`,r),e.phase=`source`):n===`defer`?(this.expectPlugin(`deferredImportEvaluation`,r),e.phase=`defer`):this.hasPlugin(`sourcePhaseImports`)&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;let n=this.startNode(),r=this.parseIdentifierName(!0),{type:i}=this.state;return(oi(i)?i!==94||this.lookaheadCharCode()===102:i!==8)?(this.applyImportPhase(e,t,r,n.start),null):(this.applyImportPhase(e,t,null),this.createIdentifier(n,r))}isPrecedingIdImportPhase(e){let{type:t}=this.state;return q(t)?t!==94||this.lookaheadCharCode()===102:t!==8}parseImport(e){return this.match(130)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];let n=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(8),r=n&&this.maybeParseStarImportSpecifier(e);return n&&!r&&this.parseNamedImportSpecifiers(e),this.expectContextual(94),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){return e.specifiers!=null||(e.specifiers=[]),e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportPhase(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.match(130)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,n){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}finishImportSpecifier(e,t,n=8201){return this.checkLVal(e.local,{type:t},n),this.finishNode(e,t)}parseImportAttributes(){this.expect(2);let e=[],t=new Set;do{if(this.match(4))break;let n=this.startNode(),r=this.state.value;if(t.has(r)&&this.raise(H.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),t.add(r),this.match(130)?n.key=this.parseStringLiteral(r):n.key=this.parseIdentifier(!0),this.expect(10),!this.match(130))throw this.raise(H.ModuleAttributeInvalidValue,this.state.startLoc);n.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(n,`ImportAttribute`))}while(this.eat(8));return this.expect(4),e}maybeParseImportAttributes(e){let t;if(this.match(72)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),t=this.parseImportAttributes()}else t=[];e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishImportSpecifier(n,`ImportDefaultSpecifier`)),!0}else if(oi(this.state.type))return this.parseImportSpecifierLocal(e,this.startNode(),`ImportDefaultSpecifier`),!0;return!1}maybeParseStarImportSpecifier(e){if(this.match(51)){let t=this.startNode();return this.next(),this.expectContextual(89),this.parseImportSpecifierLocal(e,t,`ImportNamespaceSpecifier`),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(2);!this.eat(4);){if(t)t=!1;else{if(this.eat(10))throw this.raise(H.DestructureNamedImport,this.state.startLoc);if(this.expect(8),this.eat(4))break}let n=this.startNode(),r=this.match(130),i=this.isContextual(126);n.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(n,r,e.importKind===`type`||e.importKind===`typeof`,i,void 0);e.specifiers.push(a)}}parseImportSpecifier(e,t,n,r,i){if(this.eatContextual(89))e.local=this.parseIdentifier();else{let{imported:n}=e;if(t)throw this.raise(H.ImportBindingIsString,e,{importName:n.value});this.checkReservedWord(n.name,e.start,!0,!0),e.local||(e.local=this.cloneIdentifier(n))}return this.finishImportSpecifier(e,`ImportSpecifier`,i)}isThisParam(e){return e.type===`Identifier`&&e.name===`this`}};const oo=/in(?:stanceof)?|as|satisfies/y;function so(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function co(e){if(!e)throw Error(`Assert fail`)}const X=Wr`typescript`({AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:`An 'accessor' property cannot be declared optional.`,AccessorCannotDeclareThisParameter:`'get' and 'set' accessors cannot declare 'this' parameters.`,AccessorCannotHaveTypeParameters:`An accessor cannot have type parameters.`,ClassMethodHasDeclare:`Class methods cannot have the 'declare' modifier.`,ClassMethodHasReadonly:`Class methods cannot have the 'readonly' modifier.`,ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:`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:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:`Initializers are not allowed in ambient contexts.`,DeclareFunctionHasImplementation:`An implementation cannot be declared in ambient contexts.`,DecoratorAbstractMethod:({kind:e})=>`Decorators can't be used with ${e.startsWith(`a`)?`an`:`a`} ${e}.`,DuplicateAccessibilityModifier:({modifier:e})=>`Accessibility modifier already seen: '${e}'.`,DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' 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.`,ExportAssignmentInTSNamespace:`An export assignment cannot be used in a namespace.`,ExportInTSNamespace:`Export declarations are not permitted in a namespace.`,ImportAliasHasImportType:`An import alias can not use 'import type'.`,ImportInTSNamespace:`Import declarations in a namespace cannot reference a module.`,IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:`Index signatures cannot have the 'abstract' modifier.`,IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,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.`,InlineModuleDeclarationMustUseString:"`module ... {}` declarations must have a string name. Use `namespace ... {}` instead.",InvalidHeritageClauseType:({token:e})=>`'${e}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:e=>`'${e}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:e=>`'${e}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[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.`,NamespaceExportInTSNamespace:`Global module exports may only appear at top level.`,NonAbstractClassHasAbstractMethod:`Abstract methods can only appear within an abstract class.`,NonClassMethodPropertyHasAbstractModifier:`'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:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,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.",SetAccessorCannotHaveOptionalParameter:`A 'set' accessor cannot have an optional parameter.`,SetAccessorCannotHaveRestParameter:`A 'set' accessor cannot have rest parameter.`,SetAccessorCannotHaveReturnType:`A 'set' accessor cannot have a return type annotation.`,SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,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.`,UnexpectedParameterInitializer:`A parameter initializer is only allowed in a function or constructor implementation.`,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.`,UnexpectedTypeDeclaration:e=>`'${e}' declarations can only be declared inside a block.`,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:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,UsingDeclarationInAmbientContext:e=>`'${e}' declarations are not allowed in ambient contexts.`});function lo(e){switch(e){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 uo(e){return e===`private`||e===`public`||e===`protected`}function fo(e){return e===`in`||e===`out`}function po(e){var t;if((t=e.extra)!=null&&t.parenthesized)return!1;switch(e.type){case`Identifier`:return!0;case`MemberExpression`:return!e.computed&&po(e.object);case`TSInstantiationExpression`:return po(e.expression);default:return!1}}const mo=e=>class extends e{constructor(...e){super(...e),r(this,`tsParseInOutModifiers`,this.tsParseModifiers.bind(this,{allowedModifiers:[`in`,`out`],disallowedModifiers:[`const`,`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`],errorTemplate:X.InvalidModifierOnTypeParameter})),r(this,`tsParseConstModifier`,this.tsParseModifiers.bind(this,{allowedModifiers:[`const`],disallowedModifiers:[`in`,`out`],errorTemplate:X.InvalidModifierOnTypeParameterPositions})),r(this,`tsParseInOutConstModifiers`,this.tsParseModifiers.bind(this,{allowedModifiers:[`in`,`out`,`const`],disallowedModifiers:[`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`],errorTemplate:X.InvalidModifierOnTypeParameter}))}getScopeHandler(){return pa}tsIsIdentifier(){return q(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(2)||this.match(51)||this.match(17)||this.match(134)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(102)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,t,n){if(!q(this.state.type)&&this.state.type!==54&&this.state.type!==71)return;let r=this.state.value;if(e.includes(r)){if(n&&this.match(102)||t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:n,errorTemplate:r=X.InvalidModifierOnTypeMember},i){let a=(e,t,n,r)=>{t===n&&i[r]&&this.raise(X.InvalidModifiersOrder,e,{orderedModifiers:[n,r]})},o=(e,t,n,r)=>{(i[n]&&t===r||i[r]&&t===n)&&this.raise(X.IncompatibleModifiers,e,{modifiers:[n,r]})};for(;;){let{startLoc:s}=this.state,c=this.tsParseModifier(e.concat(t==null?[]:t),n,i.static);if(!c)break;uo(c)?i.accessibility?this.raise(X.DuplicateAccessibilityModifier,s,{modifier:c}):(a(s,c,c,`override`),a(s,c,c,`static`),a(s,c,c,`readonly`),i.accessibility=c):fo(c)?(i[c]&&this.raise(X.DuplicateModifier,s,{modifier:c}),i[c]=!0,a(s,c,`in`,`out`)):(Object.hasOwn(i,c)?this.raise(X.DuplicateModifier,s,{modifier:c}):(a(s,c,`static`,`readonly`),a(s,c,`static`,`override`),a(s,c,`override`,`readonly`),a(s,c,`abstract`,`override`),o(s,c,`declare`,`override`),o(s,c,`static`,`abstract`)),i[c]=!0),t!=null&&t.includes(c)&&this.raise(r,s,{modifier:c})}}tsIsListTerminator(e){switch(e){case`EnumMembers`:case`TypeMembers`:return this.match(4);case`HeritageClauseElement`:return this.match(2);case`TupleElementTypes`:return this.match(1);case`TypeParametersOrArguments`:return this.match(44)}}tsParseList(e,t){let n=[];for(;!this.tsIsListTerminator(e);)n.push(t());return n}tsParseDelimitedList(e,t,n){return so(this.tsParseDelimitedListWorker(e,t,!0,n))}tsParseDelimitedListWorker(e,t,n,r){let i=[],a=-1;for(;!this.tsIsListTerminator(e);){a=-1;let r=t();if(r==null)return;if(i.push(r),this.eat(8)){a=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(8);return}return r&&(r.value=a),i}tsParseBracketedList(e,t,n,r,i){r||(n?this.expect(0):this.expect(43));let a=this.tsParseDelimitedList(e,t,i);return n?this.expect(1):this.expect(44),a}tsParseImportType(){let e=this.startNode();return this.expect(79),this.expect(6),this.match(130)?e.source=this.parseStringLiteral(this.state.value):(this.raise(X.UnsupportedImportTypeArgument,this.state.startLoc),e.source=this.tsParseNonConditionalType()),this.eat(8)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(7),this.eat(12)&&(e.qualifier=this.tsParseEntityName(3)),this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSImportType`)}tsParseImportTypeOptions(){let e=this.startNode();this.expect(2);let t=this.startNode();return this.isContextual(72)?(t.method=!1,t.key=this.parseIdentifier(!0),t.computed=!1,t.shorthand=!1):this.unexpected(null,72),this.expect(10),t.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(t)],this.eat(8),this.expect(4),this.finishNode(e,`ObjectExpression`)}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),t=[];for(this.expect(2);!this.match(4);){let e=this.state.type;q(e)||e===130?t.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(8)}return e.properties=t,this.next(),this.finishNode(e,`ObjectExpression`)}tsParseEntityName(e){let t;if(e&1&&this.match(74))if(e&2)t=this.parseIdentifier(!0);else{let e=this.startNode();this.next(),t=this.finishNode(e,`ThisExpression`)}else t=this.parseIdentifier(!!(e&1));for(;this.eat(12);){let n=this.startNodeAtNode(t);n.left=t,n.right=this.parseIdentifier(!!(e&1)),t=this.finishNode(n,`TSQualifiedName`)}return t}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeReference`)}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,`TSTypePredicate`)}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,`TSThisType`)}tsParseTypeQuery(){let e=this.startNode();return this.expect(83),this.match(79)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeQuery`)}tsParseTypeParameter(e){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(77),t.default=this.tsEatThenParseType(25),this.finishNode(t,`TSTypeParameter`)}tsTryParseTypeParameters(e){if(this.match(43))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(43)||this.match(138)?this.next():this.unexpected();let n={value:-1};return t.params=this.tsParseBracketedList(`TypeParametersOrArguments`,this.tsParseTypeParameter.bind(this,e),!1,!0,n),t.params.length===0&&this.raise(X.EmptyTypeParameters,t),n.value!==-1&&this.addExtra(t,`trailingComma`,n.value),this.finishNode(t,`TSTypeParameterDeclaration`)}tsFillSignature(e,t){let n=e===15;t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(6),t.params=this.tsParseBindingListForSignature(),(n||this.match(e))&&(t.returnType=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(7,41,2);for(let t of e){let{type:e}=t;(e===`AssignmentPattern`||e===`TSParameterProperty`)&&this.raise(X.UnsupportedSignatureParameterKind,t,{type:e})}return e}tsParseTypeMemberSemicolon(){!this.eat(8)&&!this.isLineTerminator()&&this.expect(9)}tsParseSignatureMember(e,t){return this.tsFillSignature(10,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),q(this.state.type)?(this.next(),this.match(10)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(1),e.parameters=[t];let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,`TSIndexSignature`)}tsParsePropertyOrMethodSignature(e,t){if(this.eat(13)&&(e.optional=!0),this.match(6)||this.match(43)){t&&this.raise(X.ReadonlyForMethodSignature,e);let n=e;if(n.kind&&this.match(43)&&this.raise(X.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(10,n),this.tsParseTypeMemberSemicolon(),n.kind===`get`)n.params.length>0&&(this.raise(H.BadGetterArity,this.state.curPosition()),this.isThisParam(n.params[0])&&this.raise(X.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(n.kind===`set`){if(n.params.length!==1)this.raise(H.BadSetterArity,this.state.curPosition());else{let e=n.params[0];this.isThisParam(e)&&this.raise(X.AccessorCannotDeclareThisParameter,this.state.curPosition()),e.type===`Identifier`&&e.optional&&this.raise(X.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),e.type===`RestElement`&&this.raise(X.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n.returnType&&this.raise(X.SetAccessorCannotHaveReturnType,n.returnType)}else n.kind=`method`;return this.finishNode(n,`TSMethodSignature`)}else{let n=e;t&&(n.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(n.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(n,`TSPropertySignature`)}}tsParseTypeMember(){let e=this.startNode();if(this.match(6)||this.match(43))return this.tsParseSignatureMember(`TSCallSignatureDeclaration`,e);if(this.match(73)){let t=this.startNode();return this.next(),this.match(6)||this.match(43)?this.tsParseSignatureMember(`TSConstructSignatureDeclaration`,e):(e.key=this.createIdentifier(t,`new`),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({allowedModifiers:[`readonly`],disallowedModifiers:[`declare`,`abstract`,`private`,`protected`,`public`,`static`,`override`]},e),this.tsTryParseIndexSignature(e)||(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.match(6)&&!this.match(43)&&this.unexpected(null,6)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,`TSTypeLiteral`)}tsParseObjectTypeMembers(){this.expect(2);let e=this.tsParseList(`TypeMembers`,this.tsParseTypeMember.bind(this));return this.expect(4),e}tsIsStartOfMappedType(){return this.next(),this.eat(49)?this.isContextual(118):(this.isContextual(118)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(54)))}tsParseMappedType(){let e=this.startNode();return this.expect(2),this.match(49)?(e.readonly=this.state.value,this.next(),this.expectContextual(118)):this.eatContextual(118)&&(e.readonly=!0),this.expect(0),e.key=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(54),e.nameType=this.eatContextual(89)?this.tsParseType():null,this.expect(1),this.match(49)?(e.optional=this.state.value,this.next(),this.expect(13)):this.eat(13)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(4),this.finishNode(e,`TSMappedType`)}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList(`TupleElementTypes`,this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(e=>{let{type:n}=e;t&&n!==`TSRestType`&&n!==`TSOptionalType`&&!(n===`TSNamedTupleMember`&&e.optional)&&this.raise(X.OptionalTypeBeforeRequired,e),t||(t=n===`TSNamedTupleMember`&&e.optional||n===`TSOptionalType`)}),this.finishNode(e,`TSTupleType`)}tsParseTupleElementType(){let e=this.state.startLoc,t=this.eat(17),{startLoc:n}=this.state,r,i,a,o,s=oi(this.state.type)?this.lookaheadCharCode():null;if(s===58)r=!0,a=!1,i=this.parseIdentifier(!0),this.expect(10),o=this.tsParseType();else if(s===63){a=!0;let e=this.state.value,t=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,i=this.createIdentifier(this.startNodeAt(n),e),this.expect(13),this.expect(10),o=this.tsParseType()):(r=!1,o=t,this.expect(13))}else o=this.tsParseType(),a=this.eat(13),r=this.eat(10);if(r){let e;i?(e=this.startNodeAt(n),e.optional=a,e.label=i,e.elementType=o,this.eat(13)&&(e.optional=!0,this.raise(X.TupleOptionalAfterType,this.state.lastTokStartLoc))):(e=this.startNodeAt(n),e.optional=a,this.raise(X.InvalidTupleMemberLabel,o),e.label=o,e.elementType=this.tsParseType()),o=this.finishNode(e,`TSNamedTupleMember`)}else if(a){let e=this.startNodeAt(n);e.typeAnnotation=o,o=this.finishNode(e,`TSOptionalType`)}if(t){let t=this.startNodeAt(e);t.typeAnnotation=o,o=this.finishNode(t,`TSRestType`)}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(6),e.typeAnnotation=this.tsParseType(),this.expect(7),this.finishNode(e,`TSParenthesizedType`)}tsParseFunctionOrConstructorType(e,t){let n=this.startNode();return e===`TSConstructorType`&&(n.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(15,n)),this.finishNode(n,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 131:case 132:case 130:case 81:case 82:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,`TSLiteralType`)}tsParseTemplateLiteralType(){let e=this.state.startLoc,t=this.parseTemplateElement(!1),n=[t];if(t.tail){let t=this.startNodeAt(e),r=this.startNodeAt(e);return r.expressions=[],r.quasis=n,t.literal=this.finishNode(r,`TemplateLiteral`),this.finishNode(t,`TSLiteralType`)}else{let r=[];for(;!t.tail;)r.push(this.tsParseType()),this.readTemplateContinuation(),n.push(t=this.parseTemplateElement(!1));let i=this.startNodeAt(e);return i.types=r,i.quasis=n,this.finishNode(i,`TSTemplateLiteralType`)}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(112)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 130:case 131:case 132:case 81:case 82:return this.tsParseLiteralTypeNode();case 49:if(this.state.value===`-`){let e=this.startNode(),t=this.lookahead();return t.type!==131&&t.type!==132&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,`TSLiteralType`)}break;case 74:return this.tsParseThisTypeOrThisTypePredicate();case 83:return this.tsParseTypeQuery();case 79:return this.tsParseImportType();case 2:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 6:if(!(this.optionFlags&2048)){let e=this.state.startLoc;this.next();let t=this.tsParseType();return this.expect(7),this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),t}return this.tsParseParenthesizedType();case 21:case 20:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(q(e)||e===84||e===80){let t=e===84?`TSVoidKeyword`:e===80?`TSNullKeyword`:lo(this.state.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,t=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(1)){let n=this.startNodeAt(e);n.elementType=t,this.expect(1),t=this.finishNode(n,`TSArrayType`)}else{let n=this.startNodeAt(e);n.objectType=t,n.indexType=this.tsParseType(),this.expect(1),t=this.finishNode(n,`TSIndexedAccessType`)}return t}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t===`readonly`&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,`TSTypeOperator`)}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case`TSTupleType`:case`TSArrayType`:return;default:this.raise(X.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(111);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,`TSTypeParameter`),this.finishNode(e,`TSInferType`)}tsParseConstraintForInferType(){if(this.eat(77)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(13))return e}}tsParseTypeOperatorOrHigher(){return _i(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(111)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,n){let r=this.startNode(),i=this.eat(n),a=[];do a.push(t());while(this.eat(n));return a.length===1&&!i?a[0]:(r.types=a,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSIntersectionType`,this.tsParseTypeOperatorOrHigher.bind(this),41)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSUnionType`,this.tsParseIntersectionTypeOrHigher.bind(this),39)}tsIsStartOfFunctionType(){return this.match(43)?!0:this.match(6)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(q(this.state.type)||this.match(74))return this.next(),!0;if(this.match(2)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(4,!0),e.length===t}catch(e){return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(1,93,1),e.length===t}catch(e){return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(7)||this.match(17)||this.tsSkipParameterStart()&&(this.match(10)||this.match(8)||this.match(13)||this.match(25)||this.match(7)&&(this.next(),this.match(15))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let n=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(74)){let e=this.tsParseThisTypeOrThisTypePredicate();return e.type===`TSThisType`?(n.parameterName=e,n.asserts=!0,n.typeAnnotation=null,e=this.finishNode(n,`TSTypePredicate`)):(this.resetStartLocationFromNode(e,n),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,`TSTypeAnnotation`)}let i=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!i)return r?(n.parameterName=this.parseIdentifier(),n.asserts=r,n.typeAnnotation=null,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)):this.tsParseTypeAnnotation(!1,t);let a=this.tsParseTypeAnnotation(!1);return n.parameterName=i,n.typeAnnotation=a,n.asserts=r,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(10))return this.tsParseTypeOrTypePredicateAnnotation(10)}tsTryParseTypeAnnotation(){if(this.match(10))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(10)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(112)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==105)return!1;let e=this.state.containsEsc;return this.next(),!q(this.state.type)&&!this.match(74)?!1:(e&&this.raise(H.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:`asserts`}),!0)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(10),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,`TSTypeAnnotation`)}tsParseType(){co(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(77))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(13),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(10),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,`TSConditionalType`)}isAbstractConstructorSignature(){return this.isContextual(120)&&this.isLookaheadContextual(`new`)}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType(`TSFunctionType`):this.match(73)?this.tsParseFunctionOrConstructorType(`TSConstructorType`):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType(`TSConstructorType`,!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(X.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?this.tsParseTypeReference():this.tsParseType())),this.expect(44),e.expression=this.parseMaybeUnary(),this.finishNode(e,`TSTypeAssertion`)}tsParseHeritageClause(e){let t=this.state.startLoc,n=this.tsParseDelimitedList(`HeritageClauseElement`,()=>{let t=(this.state.canStartArrow=!1,super.parseExprSubscripts());po(t)||this.raise(X.InvalidHeritageClauseType,t.start,{token:e});let n=e===`extends`?`TSInterfaceHeritage`:`TSClassImplements`;if(t.type===`TSInstantiationExpression`)return t.type=n,t;let r=this.startNodeAtNode(t);return r.expression=t,(this.match(43)||this.match(47))&&(r.typeArguments=this.tsParseTypeArgumentsInExpression()),this.finishNode(r,n)});return n.length||this.raise(X.EmptyHeritageClauseType,t,{token:e}),n}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(125),t.declare&&(e.declare=!0),q(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(X.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(77)&&(e.extends=this.tsParseHeritageClause(`extends`));let n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,`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(25),this.isContextual(110)&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,`TSIntrinsicKeyword`)}return this.tsParseType()}),this.semicolon(),this.finishNode(e,`TSTypeAliasDeclaration`)}tsInTopLevelContext(e){if(this.curContext()!==J.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}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(130)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(25)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,`TSEnumMember`)}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(122),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),e.body=this.tsParseEnumBody(),this.finishNode(e,`TSEnumDeclaration`)}tsParseEnumBody(){let e=this.startNode();return this.expect(2),e.members=this.tsParseDelimitedList(`EnumMembers`,this.tsParseEnumMember.bind(this)),this.expect(4),this.finishNode(e,`TSEnumBody`)}tsParseModuleBlock(e){let t=this.startNode();return e||this.scope.enter(0),this.expect(2),super.parseBlockOrModuleBlockBody(t.body=[],void 0,!0,4),e||this.scope.exit(),this.finishNode(t,`TSModuleBlock`)}tsParseNamespaceDeclaration(e){return e.id=this.tsParseEntityName(0),e.id.type===`Identifier`&&this.checkIdentifier(e.id,1024),this.scope.enter(2048),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(!1),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`TSModuleDeclaration`)}tsParseAmbientExternalModuleDeclaration(e){let t=this.isContextual(108);return t?(e.kind=`global`,e.id=this.parseIdentifier()):(e.kind=`module`,e.id=super.parseStringLiteral(this.state.value)),this.match(2)?(t||this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(t),this.prodParam.exit(),t||this.scope.exit()):this.semicolon(),this.finishNode(e,`TSModuleDeclaration`)}tsParseImportEqualsDeclaration(e,t){e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(25);let n=this.tsParseModuleReference();return e.importKind===`type`&&n.type!==`TSExternalModuleReference`&&this.raise(X.ImportAliasHasImportType,n),e.moduleReference=n,this.semicolon(),this.finishNode(e,`TSImportEqualsDeclaration`)}tsIsExternalModuleReference(){return this.isContextual(115)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(115),this.expect(6),this.match(130)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(7),this.sawUnambiguousESM=!0,this.finishNode(e,`TSExternalModuleReference`)}tsLookAhead(e){let t=this.state.clone(),n=e();return this.state=t,n}tsTryParseAndCatch(e){let t=this.tryParse(t=>e()||t());if(!(t.aborted||!t.node))return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),n=e();if(n!==void 0&&n!==!1)return n;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type;return this.tsInAmbientContext(()=>{switch(t){case 64:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 76:return e.declare=!0,this.parseClass(e,!0,!1);case 122:return this.tsParseEnumDeclaration(e,{declare:!0});case 108:return this.tsParseAmbientExternalModuleDeclaration(e);case 96:if(this.state.containsEsc)return;case 71:case 70:return!this.match(71)||!this.isLookaheadContextual(`enum`)?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(71),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 103:if(this.isUsing())return this.raise(X.InvalidModifierOnUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.parseVarStatement(e,`using`,!0);break;case 92:if(this.isAwaitUsing())return this.raise(X.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.next(),this.parseVarStatement(e,`await using`,!0);break;case 125:{let t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}default:if(q(t))return this.tsParseDeclaration(e,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(e,t,n,r){switch(t){case 120:if(this.tsCheckLineTerminator(n)&&(this.match(76)||q(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case 123:if(this.tsCheckLineTerminator(n))return this.tsParseAmbientExternalModuleDeclaration(e);break;case 124:if(this.tsCheckLineTerminator(n)&&q(this.state.type))return e.kind=`namespace`,this.tsParseNamespaceDeclaration(e);break;case 126:if(this.tsCheckLineTerminator(n)&&q(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(43))return;let t=this.tsTryParseAndCatch(()=>{let t=this.startNodeAt(e);return t.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(t),t.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(15),t});if(t)return super.parseArrowExpression(t,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===43)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(43),this.tsParseDelimitedList(`TypeParametersOrArguments`,this.tsParseType.bind(this))))),e.params.length===0?this.raise(X.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===J.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TSTypeParameterInstantiation`)}tsIsDeclarationStart(){return vi(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,t){let n=t.length?null:this.state.startLoc,r={};this.tsParseModifiers({allowedModifiers:[`public`,`private`,`protected`,`override`,`readonly`]},r);let i=r.accessibility,a=r.override,o=r.readonly;!(e&4)&&(i||o||a)&&this.raise(X.UnexpectedParameterModifier,n||t[0]);let s=this.state.startLoc,c=this.parseMaybeDefault(s);e&2&&this.parseFunctionParamType(c);let l=this.parseMaybeDefault(s,c);if(i||o||a){let e=n?this.startNodeAt(n):this.startNodeAtNode(t[0]);return t.length?e.decorators=t:this.setLoc(n),i&&(e.accessibility=i),o&&(e.readonly=o),a&&(e.override=a),l.type!==`Identifier`&&l.type!==`AssignmentPattern`&&this.raise(X.UnsupportedParameterPropertyKind,n||t[0]),e.parameter=l,this.finishNode(e,`TSParameterProperty`)}return t.length&&(c.decorators=t),l}isSimpleParameter(e){return e.type===`TSParameterProperty`&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)t.type!==`Identifier`&&t.optional&&!this.state.isAmbientContext&&this.raise(X.PatternIsOptional,t)}setArrowFunctionParameters(e,t,n){super.setArrowFunctionParameters(e,t,n),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,n=!1){this.match(10)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(10));let r=t===`FunctionDeclaration`?`TSDeclareFunction`:t===`ClassMethod`||t===`ClassPrivateMethod`?`TSDeclareMethod`:void 0;if(r&&!this.match(2)&&this.isLineTerminator()){if(r===`TSDeclareMethod`&&e.kind===`constructor`)for(let t of e.params)t.type===`TSParameterProperty`?this.raise(X.UnexpectedParameterModifier,t):t.type===`AssignmentPattern`&&this.raise(X.UnexpectedParameterInitializer,t);else for(let t of e.params)t.type===`AssignmentPattern`&&this.raise(X.UnexpectedParameterInitializer,t);return this.finishNode(e,r)}return r&&this.state.isAmbientContext&&(this.raise(X.DeclareFunctionHasImplementation,this.state.startLoc),r===`TSDeclareFunction`&&e.declare)?super.parseFunctionBodyAndFinish(e,r,n):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,n))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(e=>{(e==null?void 0:e.type)===`TSTypeCastExpression`&&this.raise(X.UnexpectedTypeAnnotation,e.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,t,n,r){if(!this.hasPrecedingLineBreak()&&this.match(31)){this.state.canStartJSXElement=!1,this.next();let n=this.startNodeAt(t);return n.expression=e,this.finishNode(n,`TSNonNullExpression`)}let i=!1;if(this.match(14)&&this.lookaheadCharCode()===60){if(n)return r.stop=!0,e;r.optionalChainMember=i=!0,this.next()}if(this.match(43)||this.match(47)){let a,o=this.tsTryParseAndCatch(()=>{if(!n&&this.atPossibleAsyncArrow(e)){let e=this.tsTryParseGenericAsyncArrowFunction(t);if(e)return r.stop=!0,e}let o=this.tsParseTypeArgumentsInExpression();if(!o)return;if(i&&!this.match(6)){a=this.state.curPosition();return}if(Si(this.state.type)){let n=super.parseTaggedTemplateExpression(e,t,r);return n.typeArguments=o,n}if(!n&&this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(n.arguments),n.typeArguments=o,r.optionalChainMember&&(n.optional=i),this.finishCallExpression(n,r.optionalChainMember)}let s=this.state.type;if(s===44||s===48||s!==6&&s!==89&&s!==116&&li(s)&&!this.hasPrecedingLineBreak())return;let c=this.startNodeAt(t);return c.expression=e,c.typeArguments=o,this.finishNode(c,`TSInstantiationExpression`)});if(a&&this.unexpected(a,6),o)return o.type===`TSInstantiationExpression`&&((this.match(12)||this.match(14)&&this.lookaheadCharCode()!==40)&&this.raise(X.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(12)&&!this.match(14)&&(o.expression=super.stopParseSubscript(e,r))),o}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){var t;super.parseNewCallee(e);let{callee:n}=e;n.type===`TSInstantiationExpression`&&!((t=n.extra)!=null&&t.parenthesized)&&(e.typeArguments=n.typeArguments,e.callee=n.expression)}parseExprOp(e,t,n){let r;if(bi(54)>n&&!this.hasPrecedingLineBreak()&&(this.isContextual(89)||(r=this.isContextual(116)))){let i=this.startNodeAt(t);i.expression=e,i.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?(r&&this.raise(H.UnexpectedKeyword,this.state.startLoc,{keyword:`const`}),this.tsParseTypeReference()):this.tsParseType()));let a=this.finishNode(i,r?`TSSatisfiesExpression`:`TSAsExpression`);return this.reScan_lt_gt(),this.parseExprOp(a,t,n)}return super.parseExprOp(e,t,n)}checkReservedWord(e,t,n,r){this.state.isAmbientContext||super.checkReservedWord(e,t,n,r)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){let t=this.lookaheadCharCode();return e?t===123||t===42:t!==61}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){super.applyImportPhase(e,t,n,r),t?e.exportKind=n===`type`?`type`:`value`:e.importKind=n===`type`||n===`typeof`?n:`value`}parseImport(e){if(this.match(130))return e.importKind=`value`,this.scope.inTSNamespace&&this.raise(X.ImportInTSNamespace,e),super.parseImport(e);let t;if(q(this.state.type)&&this.lookaheadCharCode()===61){e.importKind=`value`;let t=this.tsParseImportEqualsDeclaration(e);return this.scope.inTSNamespace&&t.moduleReference.type===`TSExternalModuleReference`&&this.raise(X.ImportInTSNamespace,e),t}else if(this.isContextual(126)){let n=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.scope.inTSNamespace&&this.raise(X.ImportInTSNamespace,e),this.tsParseImportEqualsDeclaration(e,n);t=super.parseImportSpecifiersAndAfter(e,n)}else t=super.parseImport(e);return t.importKind===`type`&&t.specifiers.length>1&&t.specifiers[0].type===`ImportDefaultSpecifier`?this.raise(X.TypeImportCannotSpecifyDefaultAndNamed,t):this.scope.inTSNamespace&&this.raise(X.ImportInTSNamespace,t),t}parseExport(e,t){if(this.match(79)){let t=this.startNode();this.next();let n=null;this.isContextual(126)&&this.isPotentialImportPhase(!1)?n=this.parseMaybeImportPhase(t,!1):t.importKind=`value`;let r=this.tsParseImportEqualsDeclaration(t,n);return e.attributes=[],e.declaration=r,e.exportKind=`value`,e.source=null,e.specifiers=[],this.finishNode(e,`ExportNamedDeclaration`)}else if(this.eat(25)){let t=e;return t.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.scope.inTSNamespace&&this.raise(X.ExportAssignmentInTSNamespace,t),this.finishNode(t,`TSExportAssignment`)}else if(this.eatContextual(89)){let t=e;return this.expectContextual(124),t.id=this.parseIdentifier(),this.checkIdentifier(t.id,8201),this.semicolon(),this.scope.inTSNamespace&&this.raise(X.NamespaceExportInTSNamespace,t),this.finishNode(t,`TSNamespaceExportDeclaration`)}else{let n=super.parseExport(e,t);return this.scope.inTSNamespace&&(n.type!==`ExportNamedDeclaration`||n.source||!n.declaration&&!this.state.isAmbientContext)&&this.raise(X.ExportInTSNamespace,n),n}}isAbstractClass(){return this.isContextual(120)&&this.isLookaheadContextual(`class`)}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(125)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,n=!1){let{isAmbientContext:r}=this.state,i=super.parseVarStatement(e,t,n||r);if(!r)return i;if(!e.declare&&(t===`using`||t===`await using`))return this.raiseOverwrite(X.UsingDeclarationInAmbientContext,e,t),i;for(let{id:e,init:n}of i.declarations)n&&(t===`var`||t===`let`||e.typeAnnotation?this.raise(X.InitializerNotAllowedInAmbientContext,n):go(n,this.hasPlugin(`estree`))||this.raise(X.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,n));return i}parseStatementContent(e,t){let n=!!(e&2);if(!this.state.containsEsc)switch(this.state.type){case 71:if(this.isLookaheadContextual(`enum`)){let e=this.startNode();return this.next(),this.tsParseEnumDeclaration(e,{const:!0})}break;case 120:case 121:if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let e=this.state.type,n=this.startNode();this.next();let r=e===121?this.tsTryParseDeclare(n):this.tsParseAbstractDeclaration(n,t);return r?(e===121&&(r.declare=!0),r):(n.expression=this.createIdentifier(this.startNodeAtNode(n),e===121?`declare`:`abstract`),this.semicolon(!1),this.finishNode(n,`ExpressionStatement`))}break;case 122:return this.tsParseEnumDeclaration(this.startNode());case 108:if(this.lookaheadCharCode()===123){let e=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(e)}break;case 125:{let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return n||this.raise(X.UnexpectedTypeDeclaration,e,`interface`),e;break}case 123:if(this.nextTokenIsStringLiteralOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,123,!1,t)}else if(this.nextTokenIsIdentifierOnSameLine()){this.raise(X.InlineModuleDeclarationMustUseString,this.state.startLoc);let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 124:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 126:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return n||this.raise(X.UnexpectedTypeDeclaration,e,`type`),this.next(),this.tsParseTypeAliasDeclaration(e)}break}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier([`public`,`protected`,`private`])}tsHasSomeModifiers(e,t){return t.some(t=>uo(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(102)&&this.lookaheadCharCode()===123}parseClassMember(e,t,n){let r=[`declare`,`private`,`public`,`protected`,`override`,`abstract`,`readonly`,`static`];this.tsParseModifiers({allowedModifiers:r,disallowedModifiers:[`in`,`out`],stopOnStartOfClassStaticBlock:!0,errorTemplate:X.InvalidModifierOnTypeParameterPositions},t);let i=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,r)&&this.raise(X.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,n,!!t.static)};t.declare?this.tsInAmbientContext(i):i(),t.decorators&&t.decorators.length>0&&!this.hasPlugin(`decorators-legacy`)&&(t.type===`TSAbstractMethodDefinition`||t.type===`TSDeclareMethod`?this.raise(X.DecoratorAbstractMethod,t,{kind:`abstract method`}):(t.type===`ClassProperty`&&t.abstract||t.type===`ClassProperty`&&t.declare||t.type===`TSAbstractPropertyDefinition`||t.type===`PropertyDefinition`&&t.declare)&&this.raise(X.DecoratorAbstractMethod,t,{kind:t.declare?`declare field`:`abstract field`}))}parseClassMemberWithIsStatic(e,t,n,r){let i=this.tsTryParseIndexSignature(t);if(i){e.body.push(i),t.abstract&&this.raise(X.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(X.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(X.IndexSignatureHasDeclare,t),t.override&&this.raise(X.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(X.NonAbstractClassHasAbstractMethod,t),t.override&&(n.hadSuperClass||this.raise(X.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,n,r)}parsePostMemberNameModifiers(e){this.eat(13)&&(e.optional=!0),e.readonly&&this.match(6)&&this.raise(X.ClassMethodHasReadonly,e),e.declare&&this.match(6)&&this.raise(X.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.next();let r=this.startNodeAt(t);r.test=e;let i=this.state.inConditionalConsequent;return this.state.inConditionalConsequent=!0,r.consequent=this.parseMaybeAssignAllowIn(),this.state.inConditionalConsequent=i,this.expect(10),r.alternate=this.parseMaybeAssign(),this.finishNode(r,`ConditionalExpression`)}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let n=this.startNodeAt(t);return n.expression=e,n.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(n,`TSTypeCastExpression`)}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(121))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.state.startLoc,n=this.eatContextual(121);if(n&&(this.isContextual(121)||!this.shouldParseExportDeclaration()))throw this.raise(X.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let r=q(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return r?((r.type===`TSInterfaceDeclaration`||r.type===`TSTypeAliasDeclaration`||n)&&(e.exportKind=`type`),n&&r.type!==`TSImportEqualsDeclaration`&&(this.resetStartLocation(r,t),r.declare=!0),r):null}parseClassId(e,t,n,r){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n,e.declare?1024:8331);let i=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);i&&(e.typeParameters=i)}parseClassPropertyAnnotation(e){e.optional||(this.eat(31)?e.definite=!0:this.eat(13)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(25)&&this.raise(X.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(25)){let{key:t}=e;this.raise(X.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:t.type===`Identifier`&&!e.computed?t.name:`[${this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(t.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(X.PrivateElementHasAbstract,e),e.accessibility&&this.raise(X.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(X.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,n,r,i,a){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&i&&this.raise(X.ConstructorHasTypeParameters,o);let{declare:s=!1,kind:c}=t;s&&(c===`get`||c===`set`)&&this.raise(X.DeclareAccessor,t,{kind:c}),o&&(t.typeParameters=o),super.pushClassMethod(e,t,n,r,i,a)}pushClassPrivateMethod(e,t,n,r){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(t.typeParameters=i),super.pushClassPrivateMethod(e,t,n,r)}declareClassPrivateMethodInScope(e,t){e.type!==`TSDeclareMethod`&&(e.type===`MethodDefinition`&&e.value.body==null||super.declareClassPrivateMethodInScope(e,t))}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass)if(e.superClass.type===`TSInstantiationExpression`){let t=e.superClass,n=t.expression;this.takeSurroundingComments(n,n.start,n.end);let r=t.typeArguments;this.takeSurroundingComments(r,r.start,r.end),e.superClass=n,e.superTypeArguments=r}else(this.match(43)||this.match(47))&&(e.superTypeArguments=this.tsParseTypeArgumentsInExpression());this.eatContextual(109)&&(e.implements=this.tsParseHeritageClause(`implements`))}parseObjPropValue(e,t,n,r,i,a,o){let s=this.tsTryParseTypeParameters(this.tsParseConstModifier);return s&&(e.typeParameters=s),super.parseObjPropValue(e,t,n,r,i,a,o)}parseFunctionParams(e,t){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(e.typeParameters=n),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),e.id.type===`Identifier`&&!this.hasPrecedingLineBreak()&&this.eat(31)&&(e.definite=!0);let n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(10)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){let n,r,i;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===J.j_oTag||a===J.j_expr)&&i.pop()}if(!(r!=null&&r.error)&&!this.match(43))return super.parseMaybeAssign(e,t);(!n||n===this.state)&&(n=this.state.clone());let a,o=this.tryParse(n=>{var r,i;a=this.tsParseTypeParameters(this.tsParseConstModifier);let o=super.parseMaybeAssign(e,t);if((o.type!==`ArrowFunctionExpression`||(r=o.extra)!=null&&r.parenthesized)&&n(),(a==null?void 0:a.params.length)!==0&&this.resetStartLocationFromNode(o,a),o.typeParameters=a,this.hasPlugin(`jsx`)&&o.typeParameters.params.length===1&&!((i=o.typeParameters.extra)!=null&&i.trailingComma)){let e=o.typeParameters.params[0];e.constraint||this.raise(X.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?V(e.loc.end,1):e,{typeParameterName:e.name.name})}return o},n);if(!o.error&&!o.aborted)return a&&this.reportReservedArrowTypeParam(a),o.node;if(!r&&(co(!this.hasPlugin(`jsx`)),i=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!i.error))return i.node;if(r!=null&&r.node)return this.state=r.failState,r.node;if(o.node)return this.state=o.failState,a&&this.reportReservedArrowTypeParam(a),o.node;if(i!=null&&i.node)return this.state=i.failState,i.node;throw(r==null?void 0:r.error)||o.error||(i==null?void 0:i.error)}reportReservedArrowTypeParam(e){var t;e.params.length===1&&!e.params[0].constraint&&!((t=e.extra)!=null&&t.trailingComma)&&this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(X.ReservedArrowTypeParam,e)}parseMaybeUnary(e,t){return!this.hasPlugin(`jsx`)&&this.match(43)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(10);return(this.canInsertSemicolon()||!this.match(15))&&e(),t});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(13)&&(e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case`TSTypeCastExpression`:return this.isAssignable(e.expression,t);case`TSParameterProperty`:return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case`ParenthesizedExpression`:this.toAssignableParenthesizedExpression(e,t);break;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:t?this.expressionScope.recordArrowParameterBindingError(X.UnexpectedTypeCastInParameter,e):this.raise(X.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,t);break;case`AssignmentExpression`:!t&&e.left.type===`TSTypeCastExpression`&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:case`ParenthesizedExpression`:this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:case`TSNonNullExpression`:this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,n,r){switch(e){case`TSTypeCastExpression`:return!0;case`TSParameterProperty`:return`parameter`;case`TSNonNullExpression`:return`expression`;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:return(r!==64||!n)&&[`expression`,!0];default:return super.isValidLVal(e,t,n,r)}}parseBindingAtom(){return this.state.type===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,t){if(this.match(43)||this.match(47)){let n=this.tsParseTypeArgumentsInExpression();if(this.match(6)){let r=super.parseMaybeDecoratorArguments(e,t);return r.typeArguments=n,r}this.unexpected(null,6)}return super.parseMaybeDecoratorArguments(e,t)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(8)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(31)||this.match(10)||super.isClassProperty()}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(X.TypeAnnotationAfterAssign,n.typeAnnotation),n}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(44,1);return}if(e===60){this.finishOp(43,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}toAssignableListItem(e,t,n){let r=e[t];r.type===`TSTypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}shouldParseArrow(e){return this.match(10)?e.every(e=>this.isAssignable(e,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(10)?!this.state.inConditionalConsequent:super.shouldParseAsyncArrow()}parseParenAndDistinguishExpression(e){let t=this.state.inConditionalConsequent;this.state.inConditionalConsequent=!1;let n=super.parseParenAndDistinguishExpression(e);return this.state.inConditionalConsequent=t,n}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(43)||this.match(47)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeArguments=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:t,strict:n}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=n}}parseClass(e,t,n){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,n)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,t){if(this.match(76))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(125))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(X.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,76)}parseMethod(e,t,n,r,i,a,o){let s=super.parseMethod(e,t,n,r,i,a,o);if((s.abstract||s.type===`TSAbstractMethodDefinition`)&&(this.hasPlugin(`estree`)?s.value:s).body){let{key:e}=s;this.raise(X.AbstractMethodHasImplementation,s,{methodName:e.type===`Identifier`&&!s.computed?e.name:`[${this.input.slice(this.offsetToSourcePos(e.start),this.offsetToSourcePos(e.end))}]`})}return s}tsParseTypeParameterName(){return this.parseIdentifier()}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,t,n,r){return!t&&r?(this.parseTypeOnlyImportExportSpecifier(e,!1,n),this.finishNode(e,`ExportSpecifier`)):(e.exportKind=`value`,super.parseExportSpecifier(e,t,n,r))}parseImportSpecifier(e,t,n,r,i){return!t&&r?(this.parseTypeOnlyImportExportSpecifier(e,!0,n),this.finishNode(e,`ImportSpecifier`)):(e.importKind=`value`,super.parseImportSpecifier(e,t,n,r,n?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,n){let r=t?`imported`:`local`,i=t?`local`:`exported`,a=e[r],o,s=!1,c=!0,l=a.start;if(this.isContextual(89)){let e=this.parseIdentifier();if(this.isContextual(89)){let n=this.parseIdentifier();oi(this.state.type)?(s=!0,a=e,o=t?this.parseIdentifier():this.parseModuleExportName(),c=!1):(o=n,c=!1)}else oi(this.state.type)?(c=!1,o=t?this.parseIdentifier():this.parseModuleExportName()):(s=!0,a=e)}else oi(this.state.type)&&(s=!0,t?(a=this.parseIdentifier(!0),this.isContextual(89)||this.checkReservedWord(a.name,a.start,!0,!0)):a=this.parseModuleExportName());s&&n&&this.raise(t?X.TypeModifierIsUsedInTypeImports:X.TypeModifierIsUsedInTypeExports,l),e[r]=a,e[i]=o;let u=t?`importKind`:`exportKind`;e[u]=s?`type`:`value`,c&&this.eatContextual(89)&&(e[i]=t?this.parseIdentifier():this.parseModuleExportName()),e[i]||(e[i]=this.cloneIdentifier(e[r])),t&&this.checkIdentifier(e[i],s?4098:4096)}fillOptionalPropertiesForTSESLint(e){switch(e.type){case`ExpressionStatement`:e.directive!=null||(e.directive=void 0);return;case`RestElement`:e.value=void 0;case`Identifier`:case`ArrayPattern`:case`AssignmentPattern`:case`ObjectPattern`:e.decorators!=null||(e.decorators=[]),e.optional!=null||(e.optional=!1),e.typeAnnotation!=null||(e.typeAnnotation=void 0);return;case`TSParameterProperty`:e.accessibility!=null||(e.accessibility=void 0),e.decorators!=null||(e.decorators=[]),e.override!=null||(e.override=!1),e.readonly!=null||(e.readonly=!1),e.static!=null||(e.static=!1);return;case`TSEmptyBodyFunctionExpression`:e.body=null;case`TSDeclareFunction`:case`FunctionDeclaration`:case`FunctionExpression`:case`ClassMethod`:case`ClassPrivateMethod`:e.declare!=null||(e.declare=!1),e.returnType!=null||(e.returnType=void 0),e.typeParameters!=null||(e.typeParameters=void 0);return;case`Property`:e.optional!=null||(e.optional=!1);return;case`TSMethodSignature`:case`TSPropertySignature`:e.optional!=null||(e.optional=!1);case`TSIndexSignature`:e.accessibility!=null||(e.accessibility=void 0),e.readonly!=null||(e.readonly=!1),e.static!=null||(e.static=!1);return;case`TSAbstractPropertyDefinition`:case`PropertyDefinition`:case`TSAbstractAccessorProperty`:case`AccessorProperty`:e.declare!=null||(e.declare=!1),e.definite!=null||(e.definite=!1),e.readonly!=null||(e.readonly=!1),e.typeAnnotation!=null||(e.typeAnnotation=void 0);case`TSAbstractMethodDefinition`:case`MethodDefinition`:e.accessibility!=null||(e.accessibility=void 0),e.decorators!=null||(e.decorators=[]),e.override!=null||(e.override=!1),e.optional!=null||(e.optional=!1);return;case`ClassExpression`:e.id!=null||(e.id=null);case`ClassDeclaration`:e.abstract!=null||(e.abstract=!1),e.declare!=null||(e.declare=!1),e.decorators!=null||(e.decorators=[]),e.implements!=null||(e.implements=[]),e.superTypeArguments!=null||(e.superTypeArguments=void 0),e.typeParameters!=null||(e.typeParameters=void 0);return;case`TSTypeAliasDeclaration`:case`VariableDeclaration`:e.declare!=null||(e.declare=!1);return;case`VariableDeclarator`:e.definite!=null||(e.definite=!1);return;case`TSEnumDeclaration`:e.const!=null||(e.const=!1),e.declare!=null||(e.declare=!1);return;case`TSEnumMember`:e.computed!=null||(e.computed=!1);return;case`TSImportType`:e.qualifier!=null||(e.qualifier=null),e.options!=null||(e.options=null),e.typeArguments!=null||(e.typeArguments=null);return;case`TSInterfaceDeclaration`:e.declare!=null||(e.declare=!1),e.extends!=null||(e.extends=[]);return;case`TSMappedType`:e.optional!=null||(e.optional=!1),e.readonly!=null||(e.readonly=void 0);return;case`TSModuleDeclaration`:e.declare!=null||(e.declare=!1),e.global!=null||(e.global=e.kind===`global`);return;case`TSTypeParameter`:e.const!=null||(e.const=!1),e.in!=null||(e.in=!1),e.out!=null||(e.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(e,t){if(Ai(e)){if(oo.lastIndex=t,oo.test(this.input)){let e=this.codePointAtPos(oo.lastIndex);if(!ji(e)&&e!==92)return!1}return!0}else if(e===92)return!0;else return!1}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifierAndNotRelationalOperator(t,e)}nextTokenIsStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===34||t===39}};function ho(e){if(e.type!==`MemberExpression`)return!1;let{computed:t,property:n}=e;return t&&n.type!==`StringLiteral`&&(n.type!==`TemplateLiteral`||n.expressions.length>0)?!1:yo(e.object)}function go(e,t){var n;let{type:r}=e;if((n=e.extra)!=null&&n.parenthesized)return!1;if(t){if(r===`Literal`){let{value:t}=e;if(typeof t==`string`||typeof t==`boolean`)return!0}}else if(r===`StringLiteral`||r===`BooleanLiteral`)return!0;return!!(_o(e,t)||vo(e,t)||r===`TemplateLiteral`&&e.expressions.length===0||ho(e))}function _o(e,t){return t?e.type===`Literal`&&(typeof e.value==`number`||`bigint`in e):e.type===`NumericLiteral`||e.type===`BigIntLiteral`}function vo(e,t){if(e.type===`UnaryExpression`){let{operator:n,argument:r}=e;if(n===`-`&&_o(r,t))return!0}return!1}function yo(e){return e.type===`Identifier`?!0:e.type!==`MemberExpression`||e.computed?!1:yo(e.object)}const bo=Wr`placeholders`({ClassNameIsRequired:`A class name is required.`,UnexpectedSpace:`Unexpected space in placeholder.`}),xo=e=>class extends e{parsePlaceholder(e){if(this.match(129)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(129),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let n=e;return(!n.expectedNode||!n.type)&&(n=this.finishNode(n,`Placeholder`)),n.expectedNode=t,n}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(129,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder(`Expression`)||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder(`Identifier`)||super.parseIdentifier(e)}checkReservedWord(e,t,n,r){e!==void 0&&super.checkReservedWord(e,t,n,r)}cloneIdentifier(e){let t=super.cloneIdentifier(e);return t.type===`Placeholder`&&(t.expectedNode=e.expectedNode),t}cloneStringLiteral(e){return e.type===`Placeholder`?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder(`Pattern`)||super.parseBindingAtom()}isValidLVal(e,t,n,r){return e===`Placeholder`||super.isValidLVal(e,t,n,r)}toAssignable(e,t){e&&e.type===`Placeholder`&&e.expectedNode===`Expression`?e.expectedNode=`Pattern`:super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){if(super.chStartsBindingIdentifier(e,t))return!0;let n=this.nextTokenStart();return this.input.charCodeAt(n)===37&&this.input.charCodeAt(n+1)===37}verifyBreakContinue(e,t){var n;((n=e.label)==null?void 0:n.type)!==`Placeholder`&&super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){var n;if(t.type!==`Placeholder`||(n=t.extra)!=null&&n.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(10)){let n=e;return n.label=this.finishPlaceholder(t,`Identifier`),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,`LabeledStatement`)}this.semicolon();let r=e;return r.name=t.name,this.finishPlaceholder(r,`Statement`)}parseBlock(e,t,n){return this.parsePlaceholder(`BlockStatement`)||super.parseBlock(e,t,n)}parseFunctionId(e){return this.parsePlaceholder(`Identifier`)||super.parseFunctionId(e)}parseClass(e,t,n){let r=t?`ClassDeclaration`:`ClassExpression`;this.next();let i=this.state.strict,a=this.parsePlaceholder(`Identifier`);if(a)if(this.match(77)||this.match(129)||this.match(2))e.id=a;else if(n||!t)return e.id=null,e.body=this.finishPlaceholder(a,`ClassBody`),this.finishNode(e,r);else throw this.raise(bo.ClassNameIsRequired,this.state.startLoc);else this.parseClassId(e,t,n);return super.parseClassSuper(e),e.body=this.parsePlaceholder(`ClassBody`)||super.parseClassBody(!!e.superClass,i),this.finishNode(e,r)}parseExport(e,t){let n=this.parsePlaceholder(`Identifier`);if(!n)return super.parseExport(e,t);let r=e;if(!this.isContextual(94)&&!this.match(8))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(n,`Declaration`),this.finishNode(r,`ExportNamedDeclaration`);this.expectPlugin(`exportDefaultFrom`);let i=this.startNode();return i.exported=n,r.specifiers=[this.finishNode(i,`ExportDefaultSpecifier`)],super.parseExport(r,t)}isExportDefaultSpecifier(){if(this.match(61)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,`from`)&&this.input.startsWith(yi(129),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){var n;return(n=e.specifiers)!=null&&n.length?!0:super.maybeParseExportDefaultSpecifier(e,t)}checkExport(e){let{specifiers:t}=e;t!=null&&t.length&&(e.specifiers=t.filter(e=>e.exported.type===`Placeholder`)),super.checkExport(e),e.specifiers=t}parseImport(e){let t=this.parsePlaceholder(`Identifier`);if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(94)&&!this.match(8))return e.source=this.finishPlaceholder(t,`StringLiteral`),this.semicolon(),this.finishNode(e,`ImportDeclaration`);let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishNode(n,`ImportDefaultSpecifier`)),this.eat(8)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(94),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.parsePlaceholder(`StringLiteral`)||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(bo.UnexpectedSpace,this.state.lastTokEndLoc)}},So=e=>class extends e{parseV8Intrinsic(){if(this.match(50)){let e=this.state.startLoc,t=this.startNode();if(this.next(),q(this.state.type)){let e=this.parseIdentifierName(),n=this.createIdentifier(t,e);if(this.castNodeTo(n,`V8IntrinsicIdentifier`),this.match(6))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},Co=[`fsharp`,`hack`],wo=[`^^`,`@@`,`^`,`%`,`#`];function To(e){if(e.has(`decorators`)&&e.has(`decorators-legacy`))throw Error(`Cannot use the decorators and decorators-legacy plugin together`);if(e.has(`flow`)&&e.has(`typescript`))throw Error(`Cannot combine flow and typescript plugins.`);if(e.has(`placeholders`)&&e.has(`v8intrinsic`))throw Error(`Cannot combine placeholders and v8intrinsic plugins.`);if(e.has(`pipelineOperator`)){let t=e.get(`pipelineOperator`).proposal;if(!Co.includes(t)){let e=Co.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`)}if(t===`hack`){if(e.has(`placeholders`))throw Error(`Cannot combine placeholders plugin and Hack-style pipes.`);if(e.has(`v8intrinsic`))throw Error(`Cannot combine v8intrinsic plugin and Hack-style pipes.`);let t=e.get(`pipelineOperator`).topicToken;if(!wo.includes(t)){let e=wo.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`)}}}if(e.has(`moduleAttributes`))throw Error("`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.");if(e.has(`importAssertions`))throw Error("`importAssertions` has been removed in Babel 8, please use import attributes instead.");if(e.has(`deprecatedImportAssert`)?console.warn("`deprecatedImportAssert` has been removed in Babel 8, please use import attributes instead."):e.has(`importAttributes`)&&e.get(`importAttributes`).deprecatedAssertSyntax&&console.warn("The 'importAttributes' plugin has been removed in Babel 8. Please migrate any usage of `assert`-style attributes to `with`."),e.has(`recordAndTuple`))throw Error(`The 'recordAndTuple' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`asyncDoExpressions`)&&!e.has(`doExpressions`)){let e=Error(`'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.`);throw e.missingPlugins=`doExpressions`,e}if(e.has(`optionalChainingAssign`)&&e.get(`optionalChainingAssign`).version!==`2023-07`)throw Error(`The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.`);if(e.has(`discardBinding`)&&e.get(`discardBinding`).syntaxType!==`void`)throw Error(`The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.`);if(e.has(`decimal`))throw Error(`The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`importReflection`))throw Error(`The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.`)}const Eo={estree:Jr,jsx:da,flow:ea,typescript:mo,v8intrinsic:So,placeholders:xo},Do=Object.keys(Eo);var Oo=class extends ao{constructor(e,t,n){let r=Kr(e);super(r,t),this.options=r,this.initializeScopes(),this.plugins=n,this.filename=r.sourceFilename,this.startIndex=r.startIndex;let i=0;r.allowAwaitOutsideFunction&&(i|=1),r.allowReturnOutsideFunction&&(i|=2),r.allowImportExportEverywhere&&(i|=8),r.allowSuperOutsideMethod&&(i|=16),r.allowUndeclaredExports&&(i|=64),r.allowNewTargetOutsideFunction&&(i|=4),r.allowYieldOutsideFunction&&(i|=32),r.ranges&&(i|=128),r.locations===!0&&(i|=256),r.tokens&&(i|=512),r.createImportExpressions&&(i|=1024),r.createParenthesizedExpressions&&(i|=2048),r.errorRecovery&&(i|=4096),r.attachComment&&(i|=8192),r.annexB&&(i|=16384),this.optionFlags=i}getScopeHandler(){return Gi}parse(){this.enterInitialScopes();let e=this.startNode(),t=this.startNode();this.nextToken(),e.errors=[];let n=this.parseTopLevel(e,t);return n.errors=this.state.errors,n.comments.length=this.state.commentsLen,n}};function ko(e,t){let n=jo(t,e);return n.options.strictMode&&(n.state.strict=!0),n.getExpression()}function Ao(e){let t={};for(let n of Object.keys(e))t[n]=Ci(e[n]);return t}Ao(ii);function jo(e,t){let n=Oo,r=new Map;if(e!=null&&e.plugins){for(let t of e.plugins){let e,n;typeof t==`string`?e=t:[e,n]=t,r.has(e)||r.set(e,n||{})}To(r),n=No(r)}return new n(e,t,r)}const Mo=new Map;function No(e){let t=[];for(let n of Do)e.has(n)&&t.push(n);let n=t.join(`|`),r=Mo.get(n);if(!r){r=Oo;for(let e of t)r=Eo[e](r);Mo.set(n,r)}return r}let Po=0;function Z(){return Po++}function Fo(e){return{name:e}}function Io(e,t){return{kind:`Expression`,code:e,span:t}}function Lo(e,t){return{kind:`Identifier`,name:e,span:t}}function Ro(e){var t,n;return a(a({id:Z(),kind:`Element`,ref:e.ref,tagName:e.tagName,attrs:(t=e.attrs)==null?[]:t,children:(n=e.children)==null?[]:n},e.span===void 0?{}:{span:e.span}),{},{flags:a({isSVG:!1,isVoid:!1,isCustomElement:e.tagName.includes(`-`)},e.flags)})}function zo(e){return{id:Z(),kind:`Text`,value:e}}function Bo(e,t,n=!1){return{id:Z(),kind:`DynamicText`,expr:e,ref:t,once:n}}function Vo(e){return{id:Z(),kind:`Fragment`,children:e}}function Ho(e,t){return{id:Z(),kind:`StaticAttribute`,name:e,value:t}}function Uo(e,t){return{id:Z(),kind:`AttrBinding`,name:e,expr:t}}function Wo(e,t){return{id:Z(),kind:`PropBinding`,name:e,expr:t}}function Go(e,t){return{id:Z(),kind:`EventBinding`,eventName:e,handler:t}}function Ko(e){return{id:Z(),kind:`RefBinding`,expr:e}}function qo(e){return a({id:Z(),kind:`Component`,ref:e.ref,callee:e.callee,props:e.props},e.span===void 0?{}:{span:e.span})}function Jo(e){return{id:Z(),kind:`Show`,ref:e.ref,when:e.when,children:e.children,fallback:e.fallback}}function Yo(e){return{id:Z(),kind:`For`,ref:e.ref,each:e.each,by:e.by,item:e.item,index:e.index,body:e.body}}function Xo(e){return{id:Z(),kind:`Host`,attrs:e.attrs,child:e.child,span:e.span}}function Zo(e){var t;return{id:Z(),kind:`Slot`,ref:e.ref,name:e.name,fallback:(t=e.fallback)==null?[]:t,span:e.span}}function Qo(e,t,n){var r,i;(r=t.enter)==null||r.call(t,e,n);for(let n of $o(e))Qo(n,t,e);(i=t.leave)==null||i.call(t,e,n)}function $o(e){switch(e.kind){case`Element`:case`Fragment`:return e.children;case`Component`:return e.props.flatMap(e=>Array.isArray(e.value)?e.value:[]);case`Show`:return[...e.children,...Array.isArray(e.fallback)?e.fallback:[]];case`For`:return e.body;case`Slot`:return e.fallback;case`Host`:return e.child?[e.child]:[];case`Text`:case`DynamicText`:return[]}}function es(e){let t=e.props.find(e=>e.name===`children`);return t&&Array.isArray(t.value)?t.value:[]}function ts(e){if(e.kind!==`Element`)throw Error(`Expected Element IR, received ${e.kind}.`)}function ns(e){throw Error(`Unhandled IR node ${e.kind}.`)}function rs(e){return Io(e.getSource()||e.toString(),as(e.node))}function is(e,t){return Io(e,as(t))}function Q(e){var t;let n=(t=e.span)==null?void 0:t.start,r=typeof(n==null?void 0:n.offset)==`number`?{startLine:n.line,startColumn:n.column,startIndex:n.offset}:{};return ko(e.code,a({sourceType:`module`,plugins:[`typescript`,`jsx`]},r))}function as(e){if(e!=null&&e.loc)return{start:os(e.loc.start.line,e.loc.start.column,e.start),end:os(e.loc.end.line,e.loc.end.column,e.end)}}function os(e,t,n){return typeof n==`number`?{line:e,column:t,offset:n}:{line:e,column:t}}function ss(e,t){let n=[];for(let r of e.attrs)r.kind===`AttrBinding`&&n.push(fs(e,r,t)),r.kind===`EventBinding`&&n.push(ms(e,r,t)),r.kind===`PropBinding`&&n.push(gs(e,r,t)),r.kind===`RefBinding`&&n.push(vs(e,r,t));if(Cr(e.tagName)&&ls(e.children))return n.push(cs(e,t)),n;for(let r of e.children)n.push(...ds(r,t));return n}function cs(e,t){return hn(F(t.importRuntime(`bindTextContent`),[I(e.ref.name),R([],us(e.children))]))}function ls(e){return e.some(e=>e.kind===`Text`?!1:e.kind===`Fragment`?ls(e.children):!0)}function us(e){let t=e.flatMap(e=>{switch(e.kind){case`Text`:return[L(e.value)];case`DynamicText`:return[Q(e.expr)];case`Fragment`:return[us(e.children)];default:return[]}});return t.length===0?L(``):t.length===1?t[0]:pn(t)}function ds(e,t){switch(e.kind){case`DynamicText`:return ys(e,t);case`Component`:return bs(e,t);case`Show`:return Ss(e,t,Qs(e,t));case`For`:return Ss(e,t,ec(e,t));case`Slot`:return xs(e,t,oc(e,t));case`Element`:return ss(e,t);case`Fragment`:return e.children.flatMap(e=>ds(e,t));default:return[]}}function fs(e,t,n){let r=ps(t.name);return hn(r===`class`?F(n.importRuntime(`bindClass`),[I(e.ref.name),_s(Q(t.expr))]):r===`style`?F(n.importRuntime(`bindStyle`),[I(e.ref.name),_s(Q(t.expr))]):F(n.importRuntime(`bindAttr`),[I(e.ref.name),L(r),_s(Q(t.expr))]))}function ps(e){return e===`className`?`class`:e}function ms(e,t,n){return ir(n.programPath,t.eventName),hn(F(n.importRuntime(`bindEvent`),[I(e.ref.name),L(t.eventName),hs(Q(t.handler),n)]))}function hs(e,t){if(Oe(e)||Be(e)){let n=t.uid(`event$`);return R([I(n.name)],An(z(e),[I(n.name)],!0))}return e}function gs(e,t,n){return hn(F(n.importRuntime(`bindProp`),[I(e.ref.name),L(t.name),_s(Q(t.expr))]))}function _s(e){return Ne(e)||Se(e)?e:R([],e)}function vs(e,t,n){return hn(F(n.importRuntime(`bindRef`),[I(e.ref.name),Q(t.expr)]))}function ys(e,t){if(!e.domPath||e.domPath.kind!==`Marker`)return[];let n=t.uid(`text$`),r=Q(e.expr);return e.once?[wn(`const`,[Tn(n,F(yn(I(`document`),I(`createTextNode`)),[F(I(`String`),[r])]))]),hn(F(t.importRuntime(`insert`),[I(e.domPath.parent.name),n,I(e.ref.name)]))]:[wn(`const`,[Tn(n,F(yn(I(`document`),I(`createTextNode`)),[L(``)]))]),hn(F(t.importRuntime(`insert`),[I(e.domPath.parent.name),n,I(e.ref.name)])),hn(F(t.importRuntime(`bindText`),[n,R([],r)]))]}function bs(e,t){return xs(e,t,Ks(e,t))}function xs(e,t,n){return!e.domPath||e.domPath.kind!==`Marker`?[]:[hn(F(t.importRuntime(`insert`),[I(e.domPath.parent.name),n,I(e.ref.name)]))]}function Ss(e,t,n){return!e.domPath||e.domPath.kind!==`Marker`?[]:[hn(n)]}function Cs(e){switch(e.kind){case`Root`:throw Error(`Root path is emitted from template clone directly`);case`FirstChild`:return yn(I(e.parent.name),I(`firstChild`));case`NextSibling`:return yn(I(e.previous.name),I(`nextSibling`));case`ChildNode`:return yn(yn(I(e.parent.name),I(`childNodes`)),gn(e.index),!0)}}function ws(e,t){if(e.kind===`Element`){t.registerTemplate(Es(e),e.flags.isSVG);return}if(e.kind===`Fragment`)for(let n of e.children)n.kind===`Element`&&t.registerTemplate(Es(n),n.flags.isSVG)}function Ts(e){return e===`className`?`class`:e}function Es(e){let t=e.attrs.filter(e=>e.kind===`StaticAttribute`).map(e=>{if(e.kind!==`StaticAttribute`)return``;let t=Ts(e.name);return e.value===!0?` ${t}`:` ${t}="${ks(e.value)}"`}).join(``);return e.flags.isVoid?`<${e.tagName}${t}>`:Cr(e.tagName)&&Ds(e.children)?`<${e.tagName}${t}></${e.tagName}>`:`<${e.tagName}${t}>${e.children.map(Os).join(``)}</${e.tagName}>`}function Ds(e){return e.some(e=>e.kind===`Text`?!1:e.kind===`Fragment`?Ds(e.children):!0)}function Os(e){switch(e.kind){case`Element`:return Es(e);case`Text`:return e.value;case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:return`<!>`;case`Host`:return e.child?Os(e.child):``;case`Fragment`:return e.children.map(Os).join(``)}}function ks(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`)}function As(e,t){let n=Es(e);return yn(F(z(t.registerTemplate(n,e.flags.isSVG).id),[]),I(`firstChild`))}function js(e,t){return Hs(e)?F(R([],mn([wn(`const`,[Tn(I(e.ref.name),As(e,t))]),...Ms(e.children,t),...ss(e,t),Cn(I(e.ref.name))])),[]):As(e,t)}function Ms(e,t){let n=[],r=new Set,i=Ns(e);for(let a of e)Fs(a,n,t,i,r);return n}function Ns(e){let t=new Map;for(let n of e)Ps(n,t);return t}function Ps(e,t){switch(e.kind){case`Element`:t.set(e.ref.name,e);for(let n of e.children)Ps(n,t);return;case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:t.set(e.ref.name,e);return;case`Fragment`:for(let n of e.children)Ps(n,t);return;case`Host`:e.child&&Ps(e.child,t);return;default:return}}function Fs(e,t,n,r,i){switch(e.kind){case`Element`:Bs(e)&&Is(e,t,n,r,i);for(let a of e.children)Fs(a,t,n,r,i);return;case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:Is(e,t,n,r,i);return;case`Fragment`:for(let a of e.children)Fs(a,t,n,r,i);return;case`Host`:e.child&&Fs(e.child,t,n,r,i);return;default:return}}function Is(e,t,n,r,i){if(!i.has(e.ref.name)){if(!e.physicalDomPath)throw Error(`${e.kind} physical DOM path is not assigned`);Ls(e.physicalDomPath,t,n,r,i),t.push(zs(e,n)),i.add(e.ref.name)}}function Ls(e,t,n,r,i){switch(e.kind){case`Root`:return;case`FirstChild`:Rs(e.parent,t,n,r,i);return;case`ChildNode`:Rs(e.parent,t,n,r,i);return;case`NextSibling`:Rs(e.previous,t,n,r,i);return}}function Rs(e,t,n,r,i){let a=r.get(e.name);a&&Is(a,t,n,r,i)}function zs(e,t){if(!e.physicalDomPath)throw Error(`${e.kind} physical DOM path is not assigned`);return wn(`const`,[Tn(I(e.ref.name),Cs(e.physicalDomPath))])}function Bs(e){return e.physicalDomPath?e.attrs.some(e=>e.kind===`AttrBinding`||e.kind===`PropBinding`||e.kind===`EventBinding`||e.kind===`RefBinding`)?!0:e.children.some(e=>{switch(e.kind){case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:return!0;case`Element`:return Bs(e);case`Fragment`:return e.children.some(e=>e.kind===`Element`?Bs(e):e.kind!==`Text`);case`Host`:return e.child?Vs(e.child):!1;default:return!1}}):!1}function Vs(e){switch(e.kind){case`Element`:return Bs(e);case`Text`:return!1;default:return!0}}function Hs(e){return e.attrs.some(e=>e.kind===`AttrBinding`||e.kind===`PropBinding`||e.kind===`EventBinding`||e.kind===`RefBinding`)||e.children.some(Us)}function Us(e){switch(e.kind){case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:return!0;case`Element`:return Hs(e);case`Fragment`:return e.children.some(Us);case`Host`:return e.child?Us(e.child):!1;default:return!1}}function Ws(e,t){return pn(e.children.map(e=>cc(e,t)))}function Gs(e,t){switch(e.kind){case`Text`:return L(e.value);case`DynamicText`:return Q(e.expr);case`Element`:return js(e,t);case`Component`:return Ks(e,t);case`Fragment`:return Ws(e,t);case`Show`:return Zs(e,t);case`For`:return $s(e,t);case`Host`:return tc(e,t);case`Slot`:return oc(e,t);default:return _n()}}function Ks(e,t){let n=bn(e.props.map(e=>qs(e,t)));return F(t.importRuntime(`createComponent`),[Q(e.callee),n])}function qs(e,t){let n=Xs(e.name);if(Array.isArray(e.value))return xn(`get`,n,[],mn([Cn(Js(e.value,t))]));let r=Q(e.value);return Ys(r)?Sn(n,r):xn(`get`,n,[],mn([Cn(r)]))}function Js(e,t){let n=e.map(e=>Gs(e,t));return n.length===1?n[0]:pn(n)}function Ys(e){return we(e)||Te(e)||De(e)||Ee(e)}function Xs(e){return at(e)?I(e):L(e)}function Zs(e,t){let n=[Sn(I(`when`),Q(e.when)),Sn(I(`children`),R([],Js(e.children,t)))];return e.fallback&&n.push(Sn(I(`fallback`),Array.isArray(e.fallback)?R([],Js(e.fallback,t)):Q(e.fallback))),F(t.importRuntime(`createComponent`),[t.importRuntime(`Show`),bn(n)])}function Qs(e,t){let n=e.domPath;if(!n||n.kind!==`Marker`)throw Error(`Show DOM path is not assigned`);return F(t.importRuntime(`mountShow`),[I(n.parent.name),sc(e),R([],Q(e.when)),R([],Js(e.children,t)),e.fallback?Array.isArray(e.fallback)?R([],Js(e.fallback,t)):R([],Q(e.fallback)):I(`undefined`)])}function $s(e,t){let n=[I(e.item.name)];e.index&&n.push(I(e.index.name));let r=[Sn(I(`each`),Q(e.each)),Sn(I(`children`),R(n,Js(e.body,t)))];return e.by&&r.push(Sn(I(`by`),Q(e.by))),F(t.importRuntime(`createComponent`),[t.importRuntime(`For`),bn(r)])}function ec(e,t){let n=[I(e.item.name)];e.index&&n.push(I(e.index.name));let r=e.domPath;if(!r||r.kind!==`Marker`)throw Error(`For DOM path is not assigned`);return F(t.importRuntime(`mountFor`),[I(r.parent.name),sc(e),R([],Q(e.each)),e.by?Q(e.by):I(`undefined`),R(n,Js(e.body,t))])}function tc(e,t){let n=nc(e,t),r=t.importRuntime(`Host`);if(!e.child)return F(r,[bn(n)]);let i=Gs(e.child,t);return F(R([],mn([hn(F(r,[bn(n)])),Cn(i)])),[])}function nc(e,t){let n=[];for(let t of e.attrs){let e=ac(t.name),r=Q(t.expr);rc(r)||ic(r)?n.push(Sn(e,r)):n.push(Sn(e,R([],r)))}return n}function rc(e){return we(e)||Te(e)||De(e)||Ee(e)}function ic(e){return Ne(e)||Se(e)}function ac(e){return at(e)?I(e):L(e)}function oc(e,t){return F(t.importRuntime(`createSlot`),[e.name?L(e.name):I(`undefined`),e.fallback.length>0?R([],Js(e.fallback,t)):I(`undefined`)])}function sc(e){return I(e.ref.name)}function cc(e,t){switch(e.kind){case`Element`:return js(e,t);case`Fragment`:return Ws(e,t);case`Component`:return Ks(e,t);case`Show`:return Zs(e,t);case`For`:return $s(e,t);case`Host`:return tc(e,t);case`Slot`:return oc(e,t);case`DynamicText`:return R([],Q(e.expr));default:throw Error(`Unsupported root IR node: ${e.kind}`)}}function lc(e){let t=e.toLowerCase();return t===`script`||t===`style`?t:void 0}const uc={checked:new Set([`input`]),disabled:new Set([`button`,`fieldset`,`input`,`optgroup`,`option`,`select`,`textarea`]),multiple:new Set([`input`,`select`]),readOnly:new Set([`input`,`textarea`]),selected:new Set([`option`])},dc=new Set([`button`,`input`,`option`,`textarea`]);function fc(e,t){var n;let r=e.toLowerCase();return t===`tabIndex`?!0:t===`htmlFor`?r===`label`:t===`value`?dc.has(r):!!((n=uc[t])!=null&&n.has(r))}const $={UNSUPPORTED_SPREAD_ATTRIBUTE:`ZEUS_UNSUPPORTED_SPREAD_ATTRIBUTE`,UNSUPPORTED_SPREAD_CHILD:`ZEUS_UNSUPPORTED_SPREAD_CHILD`,UNSUPPORTED_FRAGMENT:`ZEUS_UNSUPPORTED_FRAGMENT`,UNSUPPORTED_FRAGMENT_CHILD:`ZEUS_UNSUPPORTED_FRAGMENT_CHILD`,UNSUPPORTED_COMPONENT_PROP:`ZEUS_UNSUPPORTED_COMPONENT_PROP`,EMPTY_EXPRESSION:`ZEUS_EMPTY_EXPRESSION`,INVALID_TRANSFORM_RESULT:`ZEUS_INVALID_TRANSFORM_RESULT`,UNSUPPORTED_NODE:`ZEUS_UNSUPPORTED_NODE`,INVALID_BUILTIN_USAGE:`ZEUS_INVALID_BUILTIN_USAGE`,UNSUPPORTED_SSR_BUILTIN:`ZEUS_UNSUPPORTED_SSR_BUILTIN`,UNSUPPORTED_SSR_PROPERTY:`ZEUS_UNSUPPORTED_SSR_PROPERTY`,UNSUPPORTED_SSR_RAW_TEXT_CHILD:`ZEUS_UNSUPPORTED_SSR_RAW_TEXT_CHILD`,INVALID_REF_USAGE:`ZEUS_INVALID_REF_USAGE`};function pc(e){var t;return a(a(a({code:e.code,severity:(t=e.severity)==null?`error`:t,message:e.message},e.hint===void 0?{}:{hint:e.hint}),e.filename===void 0?{}:{filename:e.filename}),e.span===void 0?{}:{span:e.span})}function mc(e){let t=e.hint?`\nHint: ${e.hint}`:``;return`[${e.code}] ${e.message}${t}`}var hc=class extends Error{constructor(e){let t=pc(a(a({},e),{},{severity:`error`}));super(mc(t)),this.name=`ZeusCompilerError`,this.diagnostic=t,this.code=t.code,this.severity=`error`,this.hint=t.hint,this.filename=t.filename,this.span=t.span,this.loc=t.span?{line:t.span.start.line,column:t.span.start.column}:void 0}};function gc(e,t,n){switch(n&&(e.kind===`Element`||e.kind===`Component`)&&_c(e,n,t),e.kind){case`Host`:case`Slot`:yc(e,t);case`Element`:for(let n of e.attrs)n.kind===`PropBinding`&&!fc(e.tagName,n.name)&&vc(e,n,t);let r=lc(e.tagName);for(let n of e.children)gc(n,t,r);return;case`Fragment`:for(let r of e.children)gc(r,t,n);return;case`Component`:for(let n of e.props)if(Array.isArray(n.value))for(let e of n.value)gc(e,t);return;case`Show`:for(let r of e.children)gc(r,t,n);if(Array.isArray(e.fallback))for(let r of e.fallback)gc(r,t,n);return;case`For`:for(let r of e.body)gc(r,t,n);return;case`Text`:case`DynamicText`:return}}function _c(e,t,n){throw new hc({code:$.UNSUPPORTED_SSR_RAW_TEXT_CHILD,message:`${e.kind} children are not supported inside <${t}> SSR raw text.`,hint:`Use text expressions, Fragment, Show, or For directly inside the raw-text element.`,filename:n,span:e.span})}function vc(e,t,n){var r,i;throw new hc({code:$.UNSUPPORTED_SSR_PROPERTY,message:`Property "${t.name}" on <${e.tagName}> cannot be serialized by SSR codegen.`,hint:`Use an equivalent HTML attribute binding or move this DOM-only property update to client code.`,filename:n,span:(r=(i=t.span)==null?t.expr.span:i)==null?e.span:r})}function yc(e,t){throw new hc({code:$.UNSUPPORTED_SSR_BUILTIN,message:`<${e.kind}> is not supported by SSR codegen.`,hint:`Render Web Components on the client; the SSR baseline supports DOM components only.`,filename:t,span:e.span})}function bc(e,t,n){switch(e.kind){case`Element`:return Tc(e,t);case`Fragment`:return Ac(e.children,t,n);case`Text`:return n?L(Mc(e.value)):F(t.importRuntime(`ssrStatic`),[L(e.value)]);case`DynamicText`:return n?Q(e.expr):F(t.importRuntime(`ssrText`),[Q(e.expr)]);case`Component`:return Cc(e,t);case`Show`:return xc(e,t,n);case`For`:return Sc(e,t,n);case`Host`:case`Slot`:return yc(e);default:return Lc(e)}}function xc(e,t,n){let r=[R([],Q(e.when)),R([],jc(e.children,t,n))];if(e.fallback){let i=Array.isArray(e.fallback)?jc(e.fallback,t,n):Q(e.fallback);r.push(R([],i))}return F(t.importRuntime(`ssrShow`),r)}function Sc(e,t,n){let r=[I(e.item.name)];return e.index&&r.push(I(e.index.name)),F(t.importRuntime(`ssrFor`),[R([],Q(e.each)),R(r,jc(e.body,t,n))])}function Cc(e,t){return F(t.importRuntime(`ssrComponent`),[Q(e.callee),bn(e.props.map(e=>wc(e,t)))])}function wc(e,t){let n=Pc(e.name);if(Array.isArray(e.value))return xn(`get`,n,[],mn([Cn(jc(e.value,t))]));let r=Q(e.value);return Nc(r)?Sn(n,r):xn(`get`,n,[],mn([Cn(r)]))}function Tc(e,t){let n=lc(e.tagName),r=[L(e.tagName),pn(e.attrs.flatMap(e=>{switch(e.kind){case`StaticAttribute`:return Ic(e.name)?[]:[kc(e,t)];case`AttrBinding`:return[Ec(e,t)];case`PropBinding`:return[Dc(e,t)];default:return[]}}))];return e.children.length>0&&r.push(Ac(e.children,t,n)),e.flags.isVoid&&(e.children.length===0&&r.push(I(`undefined`)),r.push(vn(!0))),F(t.importRuntime(`ssrElement`),r)}function Ec(e,t){let n=Fc(e.name);return F(t.importRuntime(`ssrAttr`),[L(n),Oc(e.expr)])}function Dc(e,t){return F(t.importRuntime(`ssrProp`),[L(e.name),Oc(e.expr)])}function Oc(e){let t=Q(e);return Ne(t)||Se(t)?F(t,[]):t}function kc(e,t){return F(t.importRuntime(`ssrAttr`),[L(Fc(e.name)),e.value===!0?vn(!0):L(e.value)])}function Ac(e,t,n){return pn(e.map(e=>bc(e,t,n)))}function jc(e,t,n){return e.length===1?bc(e[0],t,n):Ac(e,t,n)}function Mc(e){return e.replace(/</g,`<`).replace(/&/g,`&`)}function Nc(e){return we(e)||Te(e)||De(e)||Ee(e)}function Pc(e){return at(e)?I(e):L(e)}function Fc(e){return e===`className`?`class`:e}function Ic(e){return e.length>2&&e.slice(0,2).toLowerCase()===`on`}function Lc(e){let t=e.kind;throw Error(`Unsupported SSR IR node: ${t}`)}function Rc(e,t){var n;let r=e.hub;return new hc(a(a({},t),{},{filename:r==null||(n=r.file)==null||(n=n.opts)==null?void 0:n.filename,span:as(e.node)}))}function zc(e){return We(e)?`${zc(e.object)}.${e.property.name}`:Ue(e)||Ce(e)?e.name:`${e.namespace.name}:${e.name.name}`}function Bc(e){return zc(e.openingElement.name)}function Vc(e){return Ge(e)?`${e.namespace.name}:${e.name.name}`:e.name}function Hc(e){return/^[A-Z]/.test(e)||e.includes(`.`)}function Uc(e){return e.slice(2).toLowerCase()}function Wc(e,t){if(e.isJSXSpreadAttribute()||Ke(e.node))throw Rc(e,{code:$.UNSUPPORTED_SPREAD_ATTRIBUTE,message:`Spread attributes are not supported in Zeus MVP.`,hint:`Use explicit attributes instead, for example <div id={id} />.`});let n=e.node,r=Vc(n.name),i=e.get(`value`);if(!i.node){if(r===`ref`)throw Rc(e,{code:$.EMPTY_EXPRESSION,message:`ref attribute requires an expression.`,hint:`Use <div ref={target} /> instead.`});return Ho(r,!0)}if(i.isStringLiteral()){if(r===`ref`)throw Rc(e,{code:$.INVALID_REF_USAGE,message:`String refs are not supported in Zeus.`,hint:`Use a state holder or callback ref: <div ref={el} />.`});return Ho(r,i.node.value)}if(i.isJSXExpressionContainer()){let t=i.get(`expression`);if(t.isJSXEmptyExpression())throw Rc(e,{code:$.EMPTY_EXPRESSION,message:`Attribute "${r}" expression cannot be empty.`});if(!t.isExpression())return null;let n=rs(t);return r===`ref`?Ko(n):Gc(r)?Go(Uc(r),n):r.startsWith(`prop:`)?Wo(r.slice(5),n):Uo(r,n)}return null}function Gc(e){return e.length>2&&e.slice(0,2).toLowerCase()===`on`}function Kc(e,t){let n=[];for(let r of e){if(r.isJSXText()){let e=xr(r.node.value);e&&n.push(zo(br(e)));continue}if(r.isJSXExpressionContainer()){let e=r.get(`expression`);if(e.isJSXEmptyExpression())continue;e.isExpression()&&n.push(Bo(rs(e),Fo(t.uid(`anchor$`).name)));continue}if(r.isJSXElement()||r.isJSXFragment()){n.push(ml(r,t));continue}}return n}const qc=new Set([`key`,`__slot`,`__anchor`]);function Jc(e){return e===`Show`||e===`For`||e===`Host`||e===`Slot`}function Yc(e,t){let n=e.node.openingElement.name;if(!Ue(n))throw Rc(e,{code:$.INVALID_BUILTIN_USAGE,message:`Built-in JSX nodes do not support member expressions.`});switch(n.name){case`Show`:return Xc(e,t);case`For`:return Qc(e,t);case`Host`:return cl(e,t);case`Slot`:return $c(e,t);default:throw Rc(e,{code:$.INVALID_BUILTIN_USAGE,message:`Unsupported built-in <${n.name}>.`})}}function Xc(e,t){let n=el(e,`when`),r=Zc(e,t);return Jo({ref:Fo(t.uid(`show$`).name),when:n,fallback:r,children:Kc(e.get(`children`),t)})}function Zc(e,t){let n=e.get(`openingElement`).get(`attributes`).find(e=>e.isJSXAttribute()?Vc(e.node.name)===`fallback`:!1);if(!(n!=null&&n.isJSXAttribute()))return;let r=n.get(`value`);if(!r.node)return is(`true`,n.node);if(r.isStringLiteral())return is(JSON.stringify(r.node.value),r.node);if(!r.isJSXExpressionContainer())return;let i=r.get(`expression`);if(!i.isJSXEmptyExpression()){if(i.isJSXElement()||i.isJSXFragment())return[ml(i,t)];if(i.isExpression())return rs(i)}}function Qc(e,t){let n=el(e,`each`),r=tl(e,`by`),i=rl(e),a=il(i,0,`item`),o=il(i,1),s=i.get(`body`),c=[];return s.isJSXElement()||s.isJSXFragment()?c.push(ml(s,t)):s.isExpression()&&c.push(Bo(rs(s),Fo(t.uid(`anchor$`).name))),Yo({ref:Fo(t.uid(`for$`).name),each:n,by:r,item:a,index:o,body:c})}function $c(e,t){let n=nl(e,`name`);return Zo({ref:Fo(t.uid(`slot$`).name),name:n,fallback:Kc(e.get(`children`),t),span:as(e.node)})}function el(e,t){let n=tl(e,t);if(!n)throw Rc(e,{code:$.INVALID_BUILTIN_USAGE,message:`<${al(e)}> requires "${t}".`});return n}function tl(e,t){let n=e.get(`openingElement`).get(`attributes`).find(e=>e.isJSXAttribute()?Vc(e.node.name)===t:!1);if(!(n!=null&&n.isJSXAttribute()))return;let r=n.get(`value`);if(!r.node)return is(`true`,n.node);if(r.isStringLiteral())return is(JSON.stringify(r.node.value),r.node);if(!r.isJSXExpressionContainer())return;let i=r.get(`expression`);if(i.isExpression())return rs(i)}function nl(e,t){let n=e.get(`openingElement`).get(`attributes`).find(e=>e.isJSXAttribute()?Vc(e.node.name)===t:!1);if(!(n!=null&&n.isJSXAttribute()))return;let r=n.node.value;if(!r)return``;if(we(r))return r.value}function rl(e){let t=e.get(`children`).filter(e=>e.isJSXExpressionContainer()).map(e=>e.get(`expression`)).filter(e=>e.isArrowFunctionExpression()||e.isFunctionExpression());if(t.length!==1)throw Rc(e,{code:$.INVALID_BUILTIN_USAGE,message:`<For> requires exactly one render function child.`});return t[0]}function il(e,t,n){let r=e.node.params[t];if(Ce(r))return Lo(r.name,as(r));if(n)return Lo(n)}function al(e){let t=e.node.openingElement.name;return Ue(t)?t.name:`Builtin`}function ol(e){return/^on[A-Z]/.test(e)||e.startsWith(`on:`)}function sl(e){switch(e){case`className`:return`class`;case`htmlFor`:return`for`;case`tabIndex`:return`tabindex`;case`readOnly`:return`readonly`;default:return e}}function cl(e,t){let n=[],r=Kc(e.get(`children`),t);for(let t of e.get(`openingElement`).get(`attributes`)){let e=t.node;if(Ke(e))throw Rc(t,{code:$.UNSUPPORTED_COMPONENT_PROP,message:`Spread props are not supported on Host in Phase 1.`});if(!t.isJSXAttribute())continue;let r=Vc(e.name);if(qc.has(r)||r===`children`)continue;if(r===`ref`){let e=t.get(`value`);if(e.isJSXExpressionContainer()){let t=e.get(`expression`);t.isExpression()&&n.push({id:Z(),kind:`HostAttr`,name:`ref`,expr:rs(t)})}continue}if(ol(r))continue;let i=t.get(`value`);if(!i.node)n.push({id:Z(),kind:`HostAttr`,name:sl(r),expr:is(`true`,e)});else if(i.isStringLiteral())n.push({id:Z(),kind:`HostAttr`,name:sl(r),expr:is(JSON.stringify(i.node.value),i.node)});else if(i.isJSXExpressionContainer()){let e=i.get(`expression`);e.isExpression()&&n.push({id:Z(),kind:`HostAttr`,name:sl(r),expr:rs(e)})}}return Xo({attrs:n,child:r.length===0?void 0:r.length===1?r[0]:Vo(r),span:as(e.node)})}function ll(e,t){let n=ul(e.node.openingElement.name),r=[];for(let t of e.get(`openingElement`).get(`attributes`)){let e=t.node;if(Ke(e))throw Rc(t,{code:$.UNSUPPORTED_COMPONENT_PROP,message:`Spread props are not supported in Zeus MVP.`});let n=Vc(e.name),i=t.get(`value`);if(!i.node){r.push({name:n,value:is(`true`,e)});continue}if(i.isStringLiteral()){r.push({name:n,value:is(JSON.stringify(i.node.value),i.node)});continue}if(i.isJSXExpressionContainer()){let e=i.get(`expression`);if(e.isJSXEmptyExpression())throw Rc(t,{code:$.EMPTY_EXPRESSION,message:`Component prop "${n}" expression cannot be empty.`});e.isExpression()&&r.push({name:n,value:rs(e)})}}let i=Kc(e.get(`children`),t);return i.length>0&&r.push({name:`children`,value:i}),qo({ref:Fo(t.uid(`cmp$`).name),callee:n,props:r,span:as(e.node)})}function ul(e){return is(dl(e),e)}function dl(e){if(Ue(e))return e.name===`this`?`this`:at(e.name)?e.name:JSON.stringify(e.name);if(We(e)){let t=dl(e.object),n=e.property.name;return at(n)?`${t}.${n}`:`${t}[${JSON.stringify(n)}]`}return Ge(e)?JSON.stringify(`${e.namespace.name}:${e.name.name}`):JSON.stringify(``)}function fl(e,t){let n=Bc(e.node);if(Jc(n))return Yc(e,t);if(Hc(n))return ll(e,t);let r=e.get(`openingElement`).get(`attributes`).map(e=>Wc(e,t)).filter(Boolean);return Ro({ref:Fo(t.uid(`el$`).name),tagName:n,attrs:r,children:yr.includes(n)?[]:Kc(e.get(`children`),t),span:as(e.node),flags:{isVoid:yr.includes(n),isCustomElement:n.includes(`-`)}})}function pl(e,t){return Vo(Kc(e.get(`children`),t))}function ml(e,t){if(e.isJSXElement())return fl(e,t);if(e.isJSXFragment())return pl(e,t);throw Error(`Unsupported JSX node`)}function hl(e){return gl(e),e}function gl(e){switch(e.kind){case`Element`:case`Fragment`:e.children=e.children.filter(e=>e.kind===`Text`?e.value.length>0:!0);for(let t of e.children)gl(t);return;case`Host`:e.child&&gl(e.child);return;case`Component`:for(let t of e.props)if(Array.isArray(t.value)){t.value=t.value.filter(e=>e.kind===`Text`?e.value.length>0:!0);for(let e of t.value)gl(e)}return;case`Slot`:e.fallback=e.fallback.filter(e=>e.kind===`Text`?e.value.length>0:!0);for(let t of e.fallback)gl(t);return;case`Show`:for(let t of e.children)gl(t);if(Array.isArray(e.fallback)){e.fallback=e.fallback.filter(e=>e.kind===`Text`?e.value.length>0:!0);for(let t of e.fallback)gl(t)}return;case`For`:for(let t of e.body)gl(t);return;case`Text`:case`DynamicText`:return}}function _l(e){return vl(e),e}function vl(e,t){switch(e.kind){case`Element`:yl(e,t),bl(e);return;case`Fragment`:for(let n of e.children)vl(n,t);return;case`Component`:for(let t of e.props)if(Array.isArray(t.value))for(let e of t.value)vl(e);return;case`Show`:for(let t of e.children)vl(t);if(Array.isArray(e.fallback))for(let t of e.fallback)vl(t);return;case`For`:for(let t of e.body)vl(t);return;case`Host`:e.child&&vl(e.child,t);return;case`Slot`:for(let t of e.fallback)vl(t);return;case`Text`:case`DynamicText`:return}}function yl(e,t){if(!t){e.domPath={kind:`Root`};return}let n=t.children.filter(Sl),r=n.indexOf(e);if(r===-1)return;if(r===0){e.domPath={kind:`FirstChild`,parent:t.ref};return}let i=n[r-1];if(i.kind===`Element`){e.domPath={kind:`NextSibling`,previous:i.ref};return}e.domPath={kind:`Child`,parent:t.ref,index:r}}function bl(e){let t=0;for(let n of e.children){if(Cl(n)){xl(n,e.ref,t++),vl(n);continue}vl(n,e)}}function xl(e,t,n){e.domPath={kind:`Marker`,parent:t,index:n}}function Sl(e){return e.kind===`Element`||e.kind===`DynamicText`||e.kind===`Component`||e.kind===`Show`||e.kind===`For`||e.kind===`Slot`}function Cl(e){return e.kind===`DynamicText`||e.kind===`Component`||e.kind===`Show`||e.kind===`For`||e.kind===`Slot`}function wl(e){return Tl(e),e}function Tl(e,t){switch(e.kind){case`Element`:El(e,t),Dl(e);return;case`Fragment`:for(let n of e.children)Tl(n,t);return;case`Host`:e.child&&Tl(e.child,t);return;case`Show`:for(let t of e.children)Tl(t);if(Array.isArray(e.fallback))for(let t of e.fallback)Tl(t);return;case`For`:for(let t of e.body)Tl(t);return;case`Slot`:for(let t of e.fallback)Tl(t);return;case`Component`:for(let t of e.props)if(Array.isArray(t.value))for(let e of t.value)Tl(e);return;case`Text`:case`DynamicText`:return}}function El(e,t){if(!t){e.physicalDomPath={kind:`Root`};return}let n=Al(t.children),r=n.indexOf(e);r<0||(e.physicalDomPath=Ol(t.ref,n,r))}function Dl(e){let t=Al(e.children);for(let n=0;n<t.length;n++){let r=t[n];r.kind!==`TextPlaceholder`&&(r.physicalDomPath=Ol(e.ref,t,n))}for(let t of e.children)Tl(t,e)}function Ol(e,t,n){if(n===0)return{kind:`FirstChild`,parent:e};let r=kl(t,n);return r?{kind:`NextSibling`,previous:r.ref}:{kind:`ChildNode`,parent:e,index:n}}function kl(e,t){for(let n=t-1;n>=0;n--){let t=e[n];if(t.kind!==`TextPlaceholder`)return t}}function Al(e){let t=[];for(let n of e)jl(t,n);return t}function jl(e,t){switch(t.kind){case`Text`:t.value.length>0&&e.push({kind:`TextPlaceholder`});return;case`Element`:case`DynamicText`:case`Component`:case`Show`:case`For`:case`Slot`:e.push(t);return;case`Fragment`:for(let n of t.children)jl(e,n);return;case`Host`:t.child&&jl(e,t.child);return}}function Ml(e,t){Nl(e,{isDefineElementRenderRoot:t.isDefineElementRenderRoot,filename:t.filename,insideHost:!1,root:!0})}function Nl(e,t){switch(e.kind){case`Host`:if(!t.isDefineElementRenderRoot||!t.root)throw new hc({code:$.INVALID_BUILTIN_USAGE,message:`<Host> can only be used as a defineElement root boundary.`,filename:t.filename,span:e.span,hint:`Return <Host> directly from the defineElement setup function.`});e.child&&Nl(e.child,a(a({},t),{},{insideHost:!0,root:!1}));return;case`Slot`:if(!t.insideHost)throw new hc({code:$.INVALID_BUILTIN_USAGE,message:`<Slot> can only be used inside the defineElement Host boundary.`,filename:t.filename,span:e.span,hint:`Place <Slot> inside the root <Host> returned by defineElement setup.`});for(let n of e.fallback)Nl(n,a(a({},t),{},{root:!1}));return;case`Element`:case`Fragment`:for(let n of e.children)Nl(n,a(a({},t),{},{root:!1}));return;case`Component`:for(let n of e.props)if(Array.isArray(n.value))for(let e of n.value)Nl(e,a(a({},t),{},{root:!1}));return;case`Show`:for(let n of e.children)Nl(n,a(a({},t),{},{root:!1}));if(Array.isArray(e.fallback))for(let n of e.fallback)Nl(n,a(a({},t),{},{root:!1}));return;case`For`:for(let n of e.body)Nl(n,a(a({},t),{},{root:!1}));return;default:return}}function Pl(e){let t={dynamicText:0,dynamicAttrs:0,events:0,components:0};return Fl(e,t),t}function Fl(e,t){switch(e.kind){case`Element`:for(let n of e.attrs)(n.kind===`AttrBinding`||n.kind===`PropBinding`)&&t.dynamicAttrs++,n.kind===`EventBinding`&&t.events++;for(let n of e.children)Fl(n,t);return;case`DynamicText`:t.dynamicText++;return;case`Component`:t.components++;for(let n of e.props)if(Array.isArray(n.value))for(let e of n.value)Fl(e,t);return;case`Fragment`:for(let n of e.children)Fl(n,t);return;case`Host`:e.child&&Fl(e.child,t);return;case`Slot`:for(let n of e.fallback)Fl(n,t);return;case`Show`:for(let n of e.children)Fl(n,t);if(Array.isArray(e.fallback))for(let n of e.fallback)Fl(n,t);return;case`For`:for(let n of e.body)Fl(n,t);return;case`Text`:return}}function Il(e,t,n){if(t.get(`skip`)||!e.isJSXElement()&&!e.isJSXFragment())return;let r=lr(e,n),i=ml(e,r);if(hl(i),n.generate===`ssr`&&gc(i,t.filename),Ml(i,{isDefineElementRenderRoot:dr(e),filename:t.filename}),Pl(i),n.generate===`ssr`){e.replaceWith(bc(i,r));return}_l(i),wl(i),ws(i,r),e.replaceWith(cc(i,r))}function Ll(e){return{JSXElement(t,n){Il(t,n,e)},JSXFragment(t,n){Il(t,n,e)},Program:Dr(e)}}function Rl(e,t){return e.some(e=>(Array.isArray(e)?e[0]:e)===t)}var zl=s((e,t)=>(e.assertVersion(8),{name:`babel-plugin-zeus-compiler`,manipulateOptions(e,t){t.plugins!=null||(t.plugins=[]),Rl(t.plugins,`jsx`)||t.plugins.push(`jsx`)},visitor:Ll(sr(t))}));export{hc as CompilerError,$ as CompilerErrorCode,ts as assertElementIR,ns as assertNeverIR,Uo as attrBindingIR,qo as componentIR,zl as default,Bo as dynamicTextIR,Ro as elementIR,Go as eventBindingIR,Io as expressionIR,Yo as forIR,mc as formatCompilerDiagnostic,Vo as fragmentIR,es as getComponentChildren,$o as getIRChildren,Xo as hostIR,Z as id,Lo as identifierIR,Wo as propBindingIR,Fo as ref,Ko as refBindingIR,Jo as showIR,Zo as slotIR,Ho as staticAttrIR,zo as textIR,Qo as visitIR};
|